Cache prefetching method, controller and system based on space-time association
By combining spatial and temporal association prefetching strategies in the cloud block storage system, setting association weights for data blocks, and dynamically adjusting the learning rate and cache hit rate, the problems of low cache hit rate and high access latency are solved, achieving more efficient cache management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAZHONG UNIV OF SCI & TECH
- Filing Date
- 2026-01-26
- Publication Date
- 2026-04-28
AI Technical Summary
Existing cache prefetching strategies are difficult to effectively adapt to the diversity of access patterns and the variability of workloads in cloud block storage systems, resulting in low cache hit rates and high access latency.
A spatiotemporal correlation-based cache prefetching method is adopted, which combines spatial correlation prefetching strategy and temporal correlation prefetching strategy. Correlation weight is set for each data block, and the prefetching strategy is optimized by dynamically adjusting the learning rate and cache hit rate.
It improves cache hit rate, reduces access latency, dynamically adapts to changes in access patterns and workload, and reduces the hardware overhead of prefetching strategies.
Smart Images

Figure CN121935178A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of cache prefetching technology, and more specifically, relates to a cache prefetching method, controller and system based on spatiotemporal correlation. Background Technology
[0002] With the rapid development of cloud computing technology, cloud block storage systems have become a key underlying storage facility supporting various cloud services such as virtual machines, containers, databases, and big data analytics. Their performance, especially I / O latency and throughput, directly determines the response speed and quality of service (QoS) of upper-layer applications. To bridge the performance gap between compute nodes and remote storage, deploying efficient caches at the storage front end or within compute nodes and employing intelligent cache prefetching technology has become a core approach to improving system performance.
[0003] The effectiveness of cache prefetching technology fundamentally depends on the accurate prediction of data access patterns. Traditional prefetching strategies mainly follow the principle of locality of reference in program access and can be divided into two main categories:
[0004] Spatial associative prefetching: This assumes that the address to be accessed in the future is physically adjacent to the current address or has a fixed stride relationship. It is simple to implement and has low overhead, but it performs very poorly on non-contiguous, pointer-chasing (such as linked lists and graph traversal) or random access modes, and is prone to generating a large number of invalid prefetches, causing cache pollution and bandwidth waste.
[0005] Temporal association prefetching: This method learns the sequential access relationships between data blocks by analyzing historical access sequences. When block A is accessed again, it prefetches the block B that was subsequently accessed in its history. This type of method can capture more complex sequence patterns, but its effectiveness is highly dependent on the stability and repeatability of the access sequences. The prefetch table needs to record a large number of historical associations, resulting in high hardware overhead, and it is very sensitive to the outdatedness of historical information.
[0006] However, cloud block storage systems have diverse access patterns, variable workloads, and localized access data, making it difficult for a single spatial or temporal associative prefetch strategy to adapt effectively. This results in a low cache hit rate and high access latency for the entire system. Summary of the Invention
[0007] In response to the shortcomings and improvement needs of existing technologies, this invention provides a cache prefetching method, controller and system based on spatiotemporal correlation, with the aim of effectively improving the cache hit rate of the system and reducing access latency.
[0008] To achieve the above objectives, according to one aspect of the present invention, a cache prefetching method based on spatiotemporal correlation is provided, comprising: Maintain a trigger policy flag (TriggerFlag) and a trigger block address (TriggerAddr) for each cached data block, and maintain a time-related prefetch weight for each data block. Spatial association prefetch weights The trigger policy flag (TriggerFlag) identifies the prefetch policy used when a cached data block is prefetched into the cache, and the trigger block address (TriggerAddr) records the address of the data block that triggers the prefetching of the cached data block; time-related prefetch weights. Spatial association prefetch weights These represent the probabilities of using a time-based prefetch strategy and a space-based prefetch weight when the corresponding data block triggers cache prefetching, respectively. When the request arrives, perform the following steps: S1: If the requested data block exists in the cache, then determine the prefetching strategy to trigger the data block to be cached based on the triggering policy flag TriggerFlag and the triggering block address TriggerAddr of the data block. and data blocks Increase the size of the data block With prefetching strategy The corresponding weight is assigned and the process is moved to S4; otherwise, the process is moved to S2. S2: Determine if the cache is full. If so, select a cached data block as the data block to be evicted (evict). Determine the prefetching strategy for triggering the data block evict to be cached based on the triggering policy flag (TriggerFlag) and the triggering block address (TriggerAddr) of the data block evict. and data blocks Reduce data blocks With prefetching strategy The corresponding weight is used to evict the data block from the cache and transfer it to S3; otherwise, it is transferred to S3. S3: Copy the data block from the persistent storage layer to the cache, then proceed to S4; S4: Determine the cached data block that triggered the data block based on the trigger block address TriggerAddr. Each in data block Time-related prefetch weights Spatial association prefetch weights The time-related prefetching strategy and the space-related prefetching strategy are triggered by probability, and the cache prefetching operation is performed.
[0009] Furthermore, the expression for increasing the weight is as follows:
[0010]
[0011] in, and These represent the spatial association prefetch weights before and after the update, respectively. and These represent the time-related prefetch weights before and after the update, respectively. The preset maximum weight; For the learning rate, and .
[0012] Furthermore, the expression for calculating the weight reduction is as follows:
[0013]
[0014] in, This indicates the preset minimum weight.
[0015] Furthermore, the spatiotemporal correlation-based cache prefetching method provided by the present invention further includes: periodically adjusting the learning rate according to a preset adjustment period. The values can be adjusted in the following ways: If the difference in learning rate between the previous cycle and the previous cycle is 0, or the difference in cache hit rate is 0, then the learning rate in the next cycle... Remain unchanged; If the difference between the learning rate and the cache hit rate in the current period and the previous period are both non-zero, and the trend of the cache hit rate is consistent with the trend of the learning rate, then the learning rate should be increased in the next period. ; If the difference between the learning rate and the cache hit rate in the current period and the previous period are both non-zero, and the trend of cache hit rate changes is inconsistent with the trend of learning rate changes, then the learning rate should be reduced in the next period. .
[0016] Furthermore, with Indicates the current period, with and These represent the previous cycle and the next cycle, respectively. and Let represent the difference in learning rate and cache hit rate between the current period and the previous period, respectively. Then, the learning rate for the next period... The expression is as follows:
[0017] in, , ; This represents the learning rate for the current period. This represents the learning rate from the previous period. This indicates the cache hit rate for the current period. This indicates the cache hit rate in the previous cycle; This indicates the preset maximum learning rate. This represents the preset minimum learning rate.
[0018] Furthermore, the cache prefetching method based on spatiotemporal correlation provided by the present invention further includes: if in continuous During the adjustment period, the learning rate remains unchanged, while the cache hit rate continues to decline. Randomly select a value within the range as the learning rate for the next cycle. ; in, It is an integer greater than 1.
[0019] Furthermore, , .
[0020] Furthermore, the spatiotemporal correlation-based cache prefetching method provided by the present invention further includes: if the temporal correlation prefetching weights of multiple data blocks with consecutive addresses are... Spatial association prefetch weights If all data blocks are identical, they are aggregated into one data block, and the aggregated data block shares the same time-related prefetch weight. Spatial association prefetch weights .
[0021] According to another aspect of the present invention, a cache prefetch controller based on spatiotemporal correlation 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 spatiotemporal correlation-based cache prefetching method provided by the present invention.
[0022] According to another aspect of the present invention, a cloud block storage system is provided, comprising: a persistent storage layer, a cache, and a spatiotemporal correlation-based cache prefetch controller provided by the present invention.
[0023] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects: (1) This invention integrates spatial association prefetching strategy and temporal association prefetching strategy, and sets association weights for each prefetching strategy. When a cached data block is hit in the cache, the weight of the prefetching strategy corresponding to the triggering data block will be increased. When a cached data block is evicted from the cache, the weight of the prefetching strategy corresponding to the triggering data block will be decreased. Therefore, it can dynamically adapt to different access modes, effectively improve the cache hit rate and reduce access latency.
[0024] (2) In this invention, the specific value of the learning rate is closely related to the associated weight of the prefetching strategy. This invention will periodically adjust the learning rate according to the changes in the learning rate and cache hit rate, thereby adapting to the dynamic changes in workload and adjusting the associated weight of the prefetching strategy to further improve the cache hit rate and reduce access latency. Specifically, when the difference between the learning rate of the current period and the previous period is 0, or the difference between the cache hit rate and the previous period is 0, the learning rate of the next period remains unchanged; when the trend of the cache hit rate is consistent with the trend of the learning rate, the learning rate is increased, thereby preventing the cache hit rate from continuing to decrease when both the learning rate and the cache hit rate decrease, and further improving the cache hit rate when both the learning rate and the cache hit rate increase; when the trend of the cache hit rate is opposite to the trend of the learning rate, the learning rate is decreased, thereby preventing the cache hit rate from decreasing further when the learning rate increases but the cache hit rate decreases, and further improving the cache hit rate when the learning rate decreases but the cache hit rate increases.
[0025] (3) The present invention aggregates multiple data blocks with the same time-related prefetch weight and spatial-related prefetch weight and consecutive addresses into a large data block. The aggregated data block shares a time-related prefetch weight and spatial-related prefetch weight, thereby making full use of the locality of accessed data and reducing the space overhead of time-related prefetch weight and spatial-related prefetch weight without reducing the cache hit rate. Attached Figure Description
[0026] Figure 1 The flowchart illustrates the spatiotemporal correlation-based cache prefetching method provided in this embodiment of the invention.
[0027] Figure 2 This is a schematic diagram illustrating the operation of the spatiotemporal correlation-based cache prefetching system provided in an embodiment of the present invention within a cloud block storage system. Detailed Implementation
[0028] 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.
[0029] 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.
[0030] To effectively address the technical problem of low cache hit rate and high access latency caused by the inability of existing prediction strategies to adapt to the characteristics of cloud block storage systems, this invention provides a cache prefetching method, controller, and system based on spatiotemporal correlation. To cope with the diversity of access patterns, this invention integrates spatial correlation prefetching strategy and temporal correlation prefetching strategy, and sets correlation weights for them respectively. To cope with the variability of workload, the correlation weights are adjusted online based on the performance feedback of the cache system. To cope with the locality of accessed data, corresponding correlation weights are maintained for each data block, and space overhead is reduced by aggregating the correlation weights of adjacent data blocks.
[0031] The following is an example.
[0032] Example 1: A cache prefetching method based on spatiotemporal correlation includes: For each cached data block, maintain the trigger policy identifier (TriggerFlag) and the trigger block address (TriggerAddr) in its metadata, and maintain the time-related prefetch weight for each data block. Spatial association prefetch weights The trigger policy flag (TriggerFlag) identifies the prefetch policy used when a cached data block is prefetched into the cache, and the trigger block address (TriggerAddr) records the address of the data block that triggers the prefetching of the cached data block; time-related prefetch weights. Spatial association prefetch weights These represent the probabilities of using a time-based prefetch strategy and a space-based prefetch weight when the corresponding data block triggers cache prefetching, respectively. When the request is received, such as Figure 1 As shown, perform the following steps: S1: If the requested data block exists in the cache, it indicates that the prefetching of the data block is valid. Then, the prefetching strategy for triggering the data block to be cached is determined based on the triggering policy flag TriggerFlag and the trigger address TriggerAddr of the data block. and data blocks Increase the size of the data block With prefetching strategy The corresponding weight is assigned and the process is moved to S4; otherwise, the process is moved to S2. S2: Determine if the cache is full. If so, select a cached data block as the data block to be evicted (evict). Determine the prefetching strategy for triggering the data block evict to be cached based on the triggering policy flag (TriggerFlag) and the triggering block address (TriggerAddr) of the data block evict. and data blocks Reduce data blocks With prefetching strategy The corresponding weight is used to evict the data block from the cache and transfer it to S3; otherwise, it is transferred to S3. S3: Copy the data block from the persistent storage layer to the cache, then proceed to S4; S4: Determine the cached data block that triggered the data block based on the trigger block address TriggerAddr. Each in data block Time-related prefetch weights Spatial association prefetch weights The time-related prefetching strategy and the space-related prefetching strategy are triggered by probability, and the cache prefetching operation is performed.
[0033] This embodiment integrates spatial association prefetching strategy and temporal association prefetching strategy, and sets association weights for each prefetching strategy. When a cached data block is hit in the cache, the weight of the prefetching strategy corresponding to the triggering data block will be increased. When a cached data block is evicted from the cache, the weight of the prefetching strategy corresponding to the triggering data block will be decreased. This can dynamically adapt to different access patterns, effectively improve the cache hit rate, and reduce access latency.
[0034] Optionally, in this embodiment, for each cached data block, the triggering policy identifier TriggerFlag and the triggering block address TriggerAddr are recorded in its metadata. When the data block enters the cache instance due to the triggering of the spatially associated prefetching policy, the value of its metadata TriggerFlag is set to S; when the data block enters the cache instance due to the triggering of the time-associated prefetching policy, the value of its metadata TriggerFlag is set to T; when the data block enters the cache instance due to the triggering of a user request, the value of its metadata TriggerFlag is set to NULL. In this case, its triggering block address TriggerAddr is set to the address of the data block requested by the corresponding user request.
[0035] In this embodiment, when the weight is increased, the original weight will be expanded. Meanwhile, its upper limit is controlled, and accordingly, the calculation expression for increasing the weight is as follows:
[0036]
[0037] in, and These represent the spatial association prefetch weights before and after the update, respectively. and These represent the time-related prefetch weights before and after the update, respectively. The preset maximum weight; For the learning rate, and Its value is located at the preset minimum weight. and maximum weight Optionally, in this embodiment, , .
[0038] In this embodiment, when reducing the weight, the original weight will be reduced. Meanwhile, its lower limit is controlled, and accordingly, the calculation expression for reducing the weight is as follows:
[0039]
[0040] in, This indicates the preset minimum weight.
[0041] To address the variability of workloads in cloud block storage systems, this embodiment also includes: periodically adjusting the learning rate according to a preset adjustment cycle. The values can be adjusted in the following ways: If the difference in learning rate between the previous cycle and the previous cycle is 0, or the difference in cache hit rate is 0, then the learning rate in the next cycle... Remain unchanged; If the difference between the learning rate and the cache hit rate in the current period and the previous period are both non-zero, and the trend of the cache hit rate is consistent with the trend of the learning rate, then the learning rate should be increased in the next period. ; If the difference between the learning rate and the cache hit rate in the current period and the previous period are both non-zero, and the trend of cache hit rate changes is inconsistent with the trend of learning rate changes, then the learning rate should be reduced in the next period. .
[0042] Furthermore, with Indicates the current period, with and These represent the previous cycle and the next cycle, respectively. and These represent the difference in learning rate and cache hit rate between the current period and the previous period, respectively, and the difference in cache hit rate between the current period and the previous period, respectively. for:
[0043] in, This indicates the cache hit rate for the current period. This indicates the cache hit rate in the previous cycle; The difference in learning rate between the current period and the previous period is:
[0044] in, This represents the learning rate for the current period. This represents the learning rate for the previous period; The learning rate for the next cycle will be updated using the following formula:
[0045] Based on the above update formula, if the difference in learning rate between the current period and the previous period is 0, or the difference in cache hit rate is 0, then the learning rate for the next period remains unchanged; when the trend of cache hit rate changes is consistent with the trend of learning rate change, i.e. If the learning rate has increased in the past and the cache hit rate has also increased, then further increasing the learning rate may further improve the cache hit rate; conversely, if the learning rate has decreased in the past and the cache hit rate has also decreased, increasing the learning rate may prevent the cache hit rate from continuing to decrease. If the trend of cache hit rate changes is opposite to the trend of learning rate change, i.e. If the learning rate is high but the cache hit rate is low, then lowering the learning rate may prevent a further decrease in the cache hit rate; conversely, if the learning rate is low but the cache hit rate is high, further lowering the learning rate may further improve the cache hit rate. During this process, the magnitude of the learning rate change is... This refers to the change in cache hit rate caused by a change in the unit learning rate.
[0046] To avoid a situation where the learning rate remains constant while the hit rate performance continues to decline, this embodiment further includes: if in continuous During the adjustment period, the learning rate remains unchanged, while the cache hit rate continues to decline. A value is randomly selected from the range of 0.001 to 0.1 as the learning rate for the next cycle. ; in, It is an integer greater than 1.
[0047] By periodically adjusting the learning rate based on the system's cache hit rate performance through the above operations, the associated weights can be adjusted online, which can effectively cope with the variability of workload, further improve the cache hit rate, and reduce access latency.
[0048] To address the locality of data blocks, this embodiment further includes: a time-associative prefetch weighting for multiple data blocks with contiguous addresses. Spatial association prefetch weights If all data blocks are identical, they are aggregated into one data block, and the aggregated data block shares the same time-related prefetch weight. Spatial association prefetch weights .
[0049] By aggregating multiple data blocks with the same time-related prefetch weight and spatial-related prefetch weight and contiguous addresses into a large data block, the aggregated data block shares the same time-related prefetch weight and spatial-related prefetch weight. This can fully utilize the locality of accessed data and reduce the space overhead of time-related prefetch weight and spatial-related prefetch weight without reducing the cache hit rate.
[0050] Overall, this embodiment can fully adapt to the diversity of access patterns, the variability of workloads, and the locality of data blocks in cloud block storage systems, effectively improving cache hit rate and reducing access latency.
[0051] Example 2: A cache prefetch controller based on spatiotemporal correlation 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 spatiotemporal correlation-based cache prefetching method provided in Embodiment 1 above.
[0052] The cache prefetch controller provided in this embodiment, after being deployed in a cloud block storage system, operates as follows: Figure 2 As shown.
[0053] Example 3: A cloud block storage system includes: a persistent storage layer, a cache, and a cache prefetch controller based on spatiotemporal correlation provided by the present invention.
[0054] 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. A cache prefetching method based on spatiotemporal correlation, characterized in that, include: Maintain a trigger policy flag (TriggerFlag) and a trigger block address (TriggerAddr) for each cached data block, and maintain a time-related prefetch weight for each data block. Spatial association prefetch weights The trigger policy flag (TriggerFlag) identifies the prefetch policy used when a cached data block is prefetched into the cache, and the trigger block address (TriggerAddr) records the address of the data block that triggers the prefetching of the cached data block; time-related prefetch weights. Spatial association prefetch weights These represent the probabilities of using a time-based prefetch strategy and a space-based prefetch weight when the corresponding data block triggers cache prefetching, respectively. When the request arrives, perform the following steps: S1: If the requested data block exists in the cache, then determine the prefetching strategy to trigger the data block to be cached based on the triggering policy flag TriggerFlag and the triggering block address TriggerAddr of the data block. and data blocks Increase the size of the data block With prefetching strategy The corresponding weight is assigned and the process is moved to S4; otherwise, the process is moved to S2. S2: Determine if the cache is full. If so, select a cached data block as the data block to be evicted (evict). Determine the prefetching strategy for triggering the data block evict to be cached based on the triggering policy flag (TriggerFlag) and the triggering block address (TriggerAddr) of the data block evict. and data blocks Reduce data blocks With prefetching strategy The corresponding weights are used to evict the data blocks from the cache and transfer them to S3; Otherwise, proceed to S3; S3: Copy the data block from the persistent storage layer to the cache, then proceed to S4; S4: Determine the cached data block that triggered the data block based on the trigger block address TriggerAddr. Each in data block Time-related prefetch weights Spatial association prefetch weights The time-related prefetching strategy and the space-related prefetching strategy are triggered by probability, and the cache prefetching operation is performed.
2. The cache prefetching method based on spatiotemporal correlation as described in claim 1, characterized in that, The formula for calculating the increased weight is as follows: in, and These represent the spatial association prefetch weights before and after the update, respectively. and These represent the time-related prefetch weights before and after the update, respectively. The preset maximum weight; For the learning rate, and .
3. The cache prefetching method based on spatiotemporal correlation as described in claim 2, characterized in that, The expression for calculating the weight reduction is as follows: in, This indicates the preset minimum weight.
4. The cache prefetching method based on spatiotemporal correlation as described in claim 3, characterized in that, Also includes: Adjust the learning rate periodically according to the preset adjustment cycle. The values can be adjusted in the following ways: If the difference in learning rate between the previous cycle and the previous cycle is 0, or the difference in cache hit rate is 0, then the learning rate in the next cycle... Remain unchanged; If the difference between the learning rate and the cache hit rate in the current period and the previous period are both non-zero, and the trend of the cache hit rate is consistent with the trend of the learning rate, then the learning rate should be increased in the next period. ; If the difference between the learning rate and the cache hit rate in the current period and the previous period are both non-zero, and the trend of cache hit rate changes is inconsistent with the trend of learning rate changes, then the learning rate should be reduced in the next period. .
5. The cache prefetching method based on spatiotemporal correlation as described in claim 4, characterized in that, by Indicates the current period, with and These represent the previous cycle and the next cycle, respectively. and Let represent the difference in learning rate and cache hit rate between the current period and the previous period, respectively. Then, the learning rate for the next period... The expression is as follows: in, , ; This represents the learning rate for the current period. This represents the learning rate from the previous period. This indicates the cache hit rate for the current period. This indicates the cache hit rate in the previous cycle; This indicates the preset maximum learning rate. This represents the preset minimum learning rate.
6. The cache prefetching method based on spatiotemporal correlation as described in claim 5, characterized in that, Also includes: If in continuous During the adjustment period, the learning rate remains unchanged, while the cache hit rate continues to decline. Randomly select a value within the range as the learning rate for the next cycle. ; in, It is an integer greater than 1.
7. The cache prefetching method based on spatiotemporal correlation as described in claim 5, characterized in that, , 。 8. The cache prefetching method based on spatiotemporal correlation as described in any one of claims 1 to 7, characterized in that, Also includes: If the time-related prefetch weights of multiple data blocks with consecutive addresses Spatial association prefetch weights If all data blocks are identical, they are aggregated into one data block, and the aggregated data block shares the same time-related prefetch weight. Spatial association prefetch weights .
9. A cache prefetch controller based on spatiotemporal correlation, characterized in that, include: 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 spatiotemporal correlation-based cache prefetching method as described in any one of claims 1 to 8.
10. A cloud block storage system, characterized in that, include: A persistent storage layer, a cache, and a spatiotemporal correlation-based cache prefetch controller as described in claim 9.