Cache Eviction Using Preweighted Queues for Fast Data Removal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing cache technologies suffer from low efficiency and untimely eviction of cached data, particularly when cache queues are long, leading to time-consuming real-time analysis and poor eviction performance.
Innovation Solution
Implement a real-time weight queue with dynamically updated cached metadata items based on access frequency and time, assigning them to weight levels for sequential eviction based on cache eviction instructions, allowing for efficient and targeted data removal without real-time detection.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If real-time analysis is performed on cached data items in a cache queue, then eviction decisions can be made based on current usage patterns, but the eviction process becomes time-consuming and inefficient when the cache queue is long
Solution Approach 1:
The patent pre-calculates weight values for cached data items based on access frequency and recency before eviction is needed. These weight values are stored and updated continuously, so when eviction is required, the system can immediately identify candidates without performing real-time analysis of the entire cache queue, thus resolving the contradiction between accurate eviction decisions and fast processing
Solution Approach 2:
The patent segments the cache queue into multiple sub-queues based on weight levels (e.g., high, medium, low). Each sub-queue contains data items with similar weight characteristics. During eviction, the system only needs to examine relevant sub-queues rather than the entire cache queue, significantly reducing processing time while maintaining eviction accuracy through the pre-computed weight values
2Quantity of substance
If the cache queue is maintained to store a large amount of cached data, then cache capacity and data retention are improved, but the efficiency of analyzing and evicting data decreases
Solution Approach 1:
The patent divides the large cache queue into multiple smaller sub-queues based on weight levels. This segmentation allows the system to maintain a large overall cache capacity while enabling efficient processing during eviction by only examining relevant sub-queues. The segmentation strategy resolves the contradiction by organizing data structure to facilitate both large-scale storage and efficient selective processing
Solution Approach 2:
The patent introduces weight values as an additional parameter for cached data items, calculated based on access frequency and recency. This parameter enables the system to prioritize eviction candidates without examining all data items, thus maintaining large cache capacity while improving eviction efficiency through parameter-based filtering
3Reliability
If traditional cache eviction methods analyze all cached data items to identify least frequently used data, then comprehensive eviction decisions are made, but resource overhead and processing complexity increase
Solution Approach 1:
The patent introduces a weight value parameter for each cached data item, computed from access frequency and recency metrics. This single parameter encapsulates the information needed for eviction decisions, replacing complex multi-criteria analysis. The weight parameter maintains reliable eviction decisions while significantly simplifying the eviction system's complexity by providing a straightforward comparison metric
Solution Approach 2:
The patent uses weight values as an intermediary between raw access patterns and eviction decisions. Instead of directly analyzing access frequency, recency, and other factors during eviction, the system relies on pre-computed weight values that mediate these factors into a single sortable metric. This intermediary approach maintains decision reliability while reducing system complexity
Data Source
Figure 1~2
Figure 3~5
Figure 6~7
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 (S101) a cached metadata item in a real-time weight queue, wherein the cached metadata item comprise a cached weight value; assigning (SI02) 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 (S103) 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. By pre-assigning the cached metadata item to the cached weight queues with different weight levels, the cached data items corresponding to the cached metadata items can be directly evicted based on the weight level.