# US 2009/0024795 A1 · Method and apparatus for caching data

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

- Number: US 2009/0024795 A1
- Document ID: US20090024795A1
- Status: Published application
- Kind: A1
- Application number: 12/174,817
- Filed: 2008-07-17
- Published: 2009-01-22
- Earliest claimed: 2007-07-20
- Inventors: Makoto KOBARA
- Web page: https://patentgrep.com/patent/US20090024795A1

## CPC

- G06F 12/0864: using pseudo-associative means, e.g. set-associative or hashing
- G06F 2212/1044: Space efficiency improvement
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A relay unit inputs data and an index. A cache management unit determines whether or not a space area to cache data exists. In the case where there is a space area, the cache management unit caches data. An identifier generating unit generates an identifier corresponding to contents of the cached data. The identifier is registered in a cache data table in association with the data. The identifier is registered in a cache index table in association with the index. In the case where there is no space area, the cache management unit secures a space area. The cache management unit unregisters an identifier associated with the data which was cached in the secured area.

## Claims

### Claim 1

A method of caching performed by a cache apparatus comprising a cache database used to cache data in a storage device, a cache data table and a cache index table, comprising:
inputting data stored in the storage device and an index indicating the data;
generating an identifier corresponding to contents of the input data;
determining whether or not a space area to cache the input data exits in the cache database;
caching the input data in the cache database when it is determined that the space area exists in the cache database;
registering the generated identifier in association with the cached data in the cache data table;
registering the generated identifier in association with the input index in the cache index table;
securing a space area in the cache database when it is determined that no space area exists in the cache database,;
caching the input data in the secured space area; and
unregistering the identifier registered in the cache data table which is in association with the input data which is cached in the secured space area.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising:
inputting a read request to request reading data from the storage device, the request including an index indicating the data which is to be requested to be read from the storage device;
identifying an identifier which is registered in the cache index table in association with the index included in the input read request;
determining whether or not data associated with the identified identifier in the cache data table exists in the cache database; and
outputting the data to the read requester in the case where it is determined that the data exists.

### Claim 3 (depends on 1)

The method according to claim 1, further comprising:
determining whether or not the generated identifier is registered in the cache data table; wherein
in the step of determining whether or not the space area exits, in the case where the generated identifier is determined as unregistered in the cache data table, determining whether or not the space area exists in the cache database.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising:
in the case where the input data is write data to be written on the storage device, obtaining an identifier which is registered in the cache index table in association with an index indicating the data;
in reference to the cache data table, determining whether or not data associated with the obtained identifier exists; and
in the case where it is determined that the data exists, updating the data stored in the cache database to the write data.

### Claim 5 (depends on 4)

The method according to claim 4, further comprising:
in the step of determining whether or not the data exists, in the case where the data is determined as nonexistent, nullifying the identifier which is registered in the cache index table in association with the index indicating the data.

### Claim 6 (depends on 1)

The method according to claim 1, wherein
in the step of generating the identifier, generating a hash value as an identifier which corresponds to contents of the data, using a predetermined hash function.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
determining whether or not the generated hash value is registered in the cache data table;
in the case where it is determined that the hash value is registered in the cache data table, determining whether or not data associated with the generated hash value and the input data are identical; and
in the case where the foregoing is determined as nonidentical, detecting a hash clash, wherein
in the step of caching, in the case where the hash clash is detected, not caching the input data in the cache database.

### Claim 8 (depends on 7)

The method according to claim 7, further comprising:
in the case where the hash clash is detected, generating a hash value using another hash function.

### Claim 9 (depends on 7)

The method according to claim 7, further comprising:
in the case where the hash clash is detected, generating an identifier which is different from the hash value.

### Claim 10 (depends on 1)

The method according to claim 1, wherein
the input data is transfer data which is transferred from the storage device to a client device, which are provided separately from the cache apparatus.

### Claim 11 (depends on 10)

The method according to claim 10, wherein
the input data is a block volume stored in a disk volume provided in the storage device, and
the index includes an identification number which identifies the disk volume, and a logical block address in which the block volume is stored.

### Claim 12

A cache apparatus comprising:
a cache database used for caching data;
an input unit configured to input data and an index indicating the data;
an identifier generating unit configured to generate an identifier corresponding to contents of the input data;
a determination unit configured to determine whether or not a space area to cache the input data exists in the cache database;
a cache database in which the input data is cached in the case where it is determined that the space area exists;
a cache data table in which the generated identifier is registered in association with the data cached in the cache database;
a cache index table in which the generated identifier is registered in association with the input index;
a securing unit configured to secure a space area in the cache database in the case where it is determined that the space area does not exist in the cache database;
a cache management unit configured to cache the input data in the secured space area; and
an unregister unit configured to unregister an identifier which is registered in the cache data table in association with data that was cached in the secured area.
