Cache Eviction Using Dynamic Weight Queues for Timely Removal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing cache management systems suffer from low efficiency and untimely eviction of cached data, particularly when cache space is depleted, leading to inefficiencies in data processing and resource management.
Innovation Solution
A method and apparatus for evicting cached data that involves dynamically updating cached metadata items based on access frequency and time, assigning them to weight queues, and sequentially evicting data items based on weight levels, using real-time weight queues and cached weight queues to optimize cache eviction.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional cache eviction methods are used, then cache space is managed, but eviction efficiency is low and timing is delayed
Solution Approach 1:
The patent implements dynamic weight values for cached metadata items that are continuously updated based on access frequency and access time. This dynamic adjustment allows the system to adaptively prioritize which data to evict, improving eviction efficiency by selecting the most appropriate candidates based on real-time usage patterns rather than static rules.
Solution Approach 2:
The patent performs preliminary classification of cached metadata items into different weight queues based on their weight values before eviction is needed. By pre-organizing data into priority queues (first weight queue for high priority, second weight queue for low priority), the system eliminates the need for real-time detection and sorting during eviction, thereby reducing eviction timing delay.
2Measurement precision
If real-time detection of cached data is performed, then accurate eviction decisions are made, but system performance overhead increases
Solution Approach 1:
The patent calculates and updates weight values for cached metadata items in advance, based on access frequency and access time metrics. This preliminary calculation stores the prioritization information in weight queues, eliminating the need for complex real-time analysis during eviction operations. The system maintains accurate eviction decisions by relying on pre-computed weight values rather than performing intensive real-time detection.
Solution Approach 2:
The patent creates metadata items that contain weight value information as a copy or representation of the actual cached data's usage characteristics. This metadata copy allows the system to make eviction decisions based on the lightweight metadata structure rather than analyzing the full cached data, reducing performance overhead while maintaining decision accuracy.
3Speed
If cached data is retained longer in cache, then data access speed is improved, but cache space depletion occurs
Solution Approach 1:
The patent applies different retention policies to different cached metadata items based on their local characteristics (access frequency and access time). High-weight items (frequently accessed or recently accessed) are retained in the cache longer, while low-weight items are evicted sooner. This localized quality approach ensures that cache space is allocated proportionally to actual usage needs, maintaining fast access speeds for important data while freeing space for new data.
Solution Approach 2:
The patent dynamically changes the retention parameter (weight value) for each cached metadata item based on observed access patterns. As access frequency decreases or access time elapses, the weight value changes, triggering eviction. This parameter-based control allows flexible management of cache space, retaining data long enough to provide speed benefits but evicting timely to prevent space depletion.
Data Source
AI summary
The disclosed embodiments provide a method and an apparatus for evicting cached data, an electronic device, and a storage medium. The method comprises: acquiring a cached metadata item in a real-time weight queue, wherein the cached metadata item comprise a cached weight value; assigning the cached metadata item to a cached weight queue with a corresponding weight level based on the cached weight value in the cached metadata item; and in response to a cache eviction instruction, determining at least one target cached weight queue based on the weight levels, and evicting sequentially cached data items corresponding to target cached metadata items in the at least one target cached weight queue.


