# US 2021/0286730 A1 · Method, electronic device and computer program product for managing cache

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0286730 A1
- Document ID: US20210286730A1
- Status: Published application
- Kind: A1
- Application number: 17/079,925
- Filed: 2020-10-26
- Published: 2021-09-16
- Earliest claimed: 2020-03-12
- Assignees: EMC IP Holding Company LLC
- Applicants: EMC IP Holding Company LLC
- Inventors: Shuo Lv; Ming Zhang
- Web page: https://patentgrep.com/patent/US20210286730A1

## CPC

- G06F 12/0877: Cache access modes
- G06F 12/127: using additional replacement algorithms
- G06F 2212/502: using adaptive policy
- G06F 2212/60: Details of cache memory
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for cache management involve accessing, when a first data block to be accessed is missing in a first cache, the first data block from a storage device storing the first data block; selecting, when the first cache is full and based on a plurality of parameters associated with a plurality of eviction policies, an eviction policy for evicting a data block in the first cache from the plurality of eviction policies, the plurality of parameters indicating corresponding possibilities that the plurality of eviction policies are selected; evicting a second data block in the first cache to a second cache based on the selected eviction policy, the second cache being configured to record the data block evicted from the first cache; and caching the accessed first data block in the first cache. Such techniques can improve the cache hit rate, thereby improving the access performance of a system.

## Claims

### Claim 1

A method for cache management, comprising:
accessing, according to a determination that a first data block to be accessed is missing in a first cache, the first data block from a storage device storing the first data block;
selecting, according to a determination that the first cache is full and based on a plurality of parameters associated with a plurality of eviction policies, an eviction policy for evicting a data block in the first cache from the plurality of eviction policies, the plurality of parameters indicating corresponding possibilities that the plurality of eviction policies are selected;
evicting a second data block in the first cache to a second cache based on the selected eviction policy, the second cache being configured to record the data block evicted from the first cache; and
caching the accessed first data block in the first cache.

### Claim 2 (depends on 1)

The method of claim 1, wherein accessing the first data block from the storage device storing the first data block comprises:
accessing, according to a determination that the first data block exists in the second cache, the first data block from the second cache; and
accessing, according to a determination that the first data block is missing in the second cache, the first data block from the storage device storing the first data block.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
deleting the first data block from the second cache according to a determination that the first data block exists in the second cache; and
updating the plurality of parameters according to an eviction policy for evicting the first data block to the second cache.

### Claim 4 (depends on 3)

The method of claim 3, wherein the second cache comprises a plurality of lists, each of the plurality of lists comprising data blocks evicted from the first cache based on a corresponding eviction policy in the plurality of eviction policies, and deleting the first data block from the second cache comprises:
determining, from the plurality of lists, a list in which the first data block is located; and
deleting the first data block from the determined list.

### Claim 5 (depends on 3)

The method of claim 3, wherein the plurality of eviction policies comprise a first eviction policy and a second eviction policy, and the plurality of parameters comprise a first parameter associated with the first eviction policy and a second parameter associated with the second eviction policy, and updating the plurality of parameters comprises:
updating the first parameter and the second parameter according to a determination that the first data block is evicted to the second cache based on the first eviction policy, to increase the possibility that the second eviction policy is selected; and
updating the first parameter and the second parameter according to a determination that the first data block is evicted to the second cache based on the second eviction policy, to increase the possibility that the first eviction policy is selected.

### Claim 6 (depends on 1)

The method of claim 1, wherein selecting the eviction policy from the plurality of eviction policies comprises:
determining a maximum parameter in the plurality of parameters; and
selecting an eviction policy corresponding to the maximum parameter in the plurality of eviction policies as the eviction policy for evicting the second data block.

### Claim 7 (depends on 1)

The method of claim 1, wherein the plurality of eviction policies comprise:
a first eviction policy based on the least recently used (LRU) algorithm; and
a second eviction policy based on the least frequently used (LFU) algorithm.

### Claim 8 (depends on 7)

The method of claim 7, wherein the second cache comprises a first list for caching data blocks evicted from the first cache based on the first eviction policy, and evicting the second data block from the first cache to the second cache comprises:
determining, according to a determination that the first eviction policy is selected, a least recently accessed data block from the first cache as the second data block; and
evicting the second data block from the first cache to the first list.

### Claim 9 (depends on 7)

The method of claim 7, wherein the second cache comprises a second list for caching data blocks evicted from the first cache based on the second eviction policy, and evicting the second data block from the first cache to the second cache comprises:
determining, according to a determination that the second eviction policy is selected, a least frequently accessed data block from the first cache as the second data block; and
evicting the second data block from the first cache to the second list.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
accessing the first data block from the first cache according to a determination that the first data block to be accessed exists in the first cache.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
caching the first data block in the first cache according to a determination that the first data block is accessed from the storage device and the first cache is not full.

### Claim 12

An electronic device, comprising:
a processor;
a memory coupled to the processor and storing instructions for execution by the processor, wherein when executed by the processor, the instructions cause the device to perform actions comprising:
accessing, according to a determination that a first data block to be accessed is missing in a first cache, the first data block from a storage device storing the first data block;
selecting, according to a determination that the first cache is full and based on a plurality of parameters associated with a plurality of eviction policies, an eviction policy for evicting a data block in the first cache from the plurality of eviction policies, the plurality of parameters indicating corresponding possibilities that the plurality of eviction policies are selected;
evicting a second data block in the first cache to a second cache based on the selected eviction policy, the second cache being configured to record the data block evicted from the first cache; and
caching the accessed first data block in the first cache.

### Claim 13 (depends on 12)

The device of claim 12, wherein accessing the first data block from the storage device storing the first data block comprises:
accessing, according to a determination that the first data block exists in the second cache, the first data block from the second cache; and
accessing, according to a determination that the first data block is missing in the second cache, the first data block from the storage device storing the first data block.

### Claim 14 (depends on 12)

The device of claim 12, wherein the actions further comprise:
deleting the first data block from the second cache according to a determination that the first data block exists in the second cache; and
updating the plurality of parameters according to an eviction policy for evicting the first data block to the second cache.

### Claim 15 (depends on 14)

The device of claim 14, wherein the second cache comprises a plurality of lists, each of the plurality of lists comprising data blocks evicted from the first cache based on a corresponding eviction policy in the plurality of eviction policies, and deleting the first data block from the second cache comprises:
determining, from the plurality of lists, a list in which the first data block is located; and
deleting the first data block from the determined list.

### Claim 16 (depends on 14)

The device of claim 14, wherein the plurality of eviction policies comprise a first eviction policy and a second eviction policy, and the plurality of parameters comprise a first parameter associated with the first eviction policy and a second parameter associated with the second eviction policy, and updating the plurality of parameters comprises:
updating the first parameter and the second parameter according to a determination that the first data block is evicted to the second cache based on the first eviction policy, to increase the possibility that the second eviction policy is selected; and
updating the first parameter and the second parameter according to a determination that the first data block is evicted to the second cache based on the second eviction policy, to increase the possibility that the first eviction policy is selected.

### Claim 17 (depends on 12)

The device of claim 12, wherein selecting the eviction policy from the plurality of eviction policies comprises:
determining a maximum parameter in the plurality of parameters; and
selecting an eviction policy corresponding to the maximum parameter in the plurality of eviction policies as the eviction policy for evicting the second data block.

### Claim 18 (depends on 12)

The device of claim 12, wherein the plurality of eviction policies comprise:
a first eviction policy based on the least recently used (LRU) algorithm; and
a second eviction policy based on the least frequently used (LFU) algorithm.

### Claim 19 (depends on 18)

The device of claim 18, wherein the second cache comprises a first list for caching data blocks evicted from the first cache based on the first eviction policy, and evicting the second data block from the first cache to the second cache comprises:
determining, according to a determination that the first eviction policy is selected, a least recently accessed data block from the first cache as the second data block; and
evicting the second data block from the first cache to the first list.

### Claim 20 (depends on 18)

The device of claim 18, wherein the second cache comprises a second list for caching data blocks evicted from the first cache based on the second eviction policy, and evicting the second data block from the first cache to the second cache comprises:
determining, according to a determination that the second eviction policy is selected, a least frequently accessed data block from the first cache as the second data block; and
evicting the second data block from the first cache to the second list.

### Claim 21 (depends on 12)

The device of claim 12, wherein the actions further comprise:
accessing the first data block from the first cache according to a determination that the first data block to be accessed exists in the first cache.

### Claim 22 (depends on 12)

The device of claim 12, wherein the actions further comprise:
caching the first data block in the first cache according to a determination that the first data block is accessed from the storage device and the first cache is not full.

### Claim 23

A computer program product having a non-transitory computer readable medium which stores a set of instructions to perform cache management; the set of instructions, when carried out by computerized circuitry, causing the computerized circuitry to perform a method of:
accessing, according to a determination that a first data block to be accessed is missing in a first cache, the first data block from a storage device storing the first data block;
selecting, according to a determination that the first cache is full and based on a plurality of parameters associated with a plurality of eviction policies, an eviction policy for evicting a data block in the first cache from the plurality of eviction policies, the plurality of parameters indicating corresponding possibilities that the plurality of eviction policies are selected;
evicting a second data block in the first cache to a second cache based on the selected eviction policy, the second cache being configured to record the data block evicted from the first cache; and
caching the accessed first data block in the first cache.
