Key-value storage device and operation method

By generating key streams and key matrices, the problems of high computational overhead and unstable validity verification in storage device garbage collection operations are solved, and the processing speed and stability of storage devices are improved.

CN112988615BActive Publication Date: 2025-09-30SAMSUNG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011431455.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-12-13
Filing Date
2020-12-07
Publication Date
2025-09-30
Estimated Expiration
2040-12-07

AI Technical Summary

Technical Problem

Existing storage devices have high computational overhead when performing garbage collection operations, which slows down the overall processing speed and causes prominent instability problems in validity verification operations.

Method used

By generating key stream and key matrix, valid data blocks stored in non-volatile memory are identified, the computational overhead of garbage collection operation is reduced, and validity verification is stabilized by key stream and key matrix.

Benefits of technology

This significantly reduces the computational overhead of garbage collection operations, improves the overall processing speed of storage devices, and stabilizes validity verification operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988615B_ABST
    Figure CN112988615B_ABST
Patent Text Reader

Abstract

A key-value storage device includes: a non-volatile memory (NVM) divided into blocks; a data buffer including a key buffer, a value buffer, and a mapping buffer; and a controller including a key-value manager. The key-value manager receives a command and a key-value pair including a key and a value corresponding to each key, separates the key from the value, stores the key in the key buffer and stores the value in the value buffer, generates a value stream by combining sets of values ​​stored in the value buffer, generates a key stream by combining the key sets and merging indices of values ​​corresponding to the keys in the key sets, and updates a key matrix stored in the mapping buffer and indicating whether an index in the key stream is associated with each of the blocks of the NVM.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of Korean Patent Application No. 10-2019-0167144 filed in the Korean Intellectual Property Office on December 13, 2019, the subject matter of which is incorporated herein by reference. Technical Field

[0003] The present invention relates to a storage device and an operating method for the storage device. More particularly, the present invention relates to a key-value storage device that stores data using a key-value relationship and an operating method for the key-value storage device. Background Art

[0004] Most modern electronic devices include memory components capable of storing and retrieving data. Such electronic devices require methods for storing and retrieving data. To this end, electronic devices may include a storage device or storage system capable of storing and retrieving data while communicating with an external host.

[0005] Many modern storage devices and storage systems use non-volatile memory that is capable of preserving data continuity even when no power is applied. Storage devices can be categorized as block storage, file storage, object storage, and the like. Block storage manages data based on physical location, and file storage manages data based on a logical sequence. In contrast, object storage can manage data based on a unique identifier. Block storage and file storage are useful when the amount of ordinary data to be stored is large, while object storage is an effective alternative when the amount of less ordinary (or atypical or heterogeneous) data to be stored is large. An example of object storage is a key-value store that stores data using key-value relationships. Summary of the Invention

[0006] Embodiments of the inventive concept provide a key-value storage device capable of reducing computational overhead associated with executing garbage collection operations and improving overall processing speed by using a key stream to determine the validity of values ​​stored in each block of a non-volatile memory device. Embodiments of the inventive concept provide a method of operating a key-value storage device capable of reducing computational overhead associated with executing garbage collection operations and improving overall processing speed by using a key stream to determine the validity of values ​​stored in each block of a non-volatile memory device.

[0007] According to one aspect of the present invention, a key-value storage device is provided, which includes a non-volatile memory (NVM) divided into blocks, a data buffer including a key buffer, a value buffer and a mapping buffer, and a controller including a key-value manager, wherein the key-value manager is configured to: receive a command and a key-value pair, the key-value pair including a key and a value corresponding to the key respectively; separate the key from the value; store the key in the key buffer and the value in the value buffer; generate a value stream by combining a set of values ​​stored in the value buffer; generate a key stream by combining the set of keys and merging the indexes of the values ​​corresponding to the keys in the set of keys respectively; and update a key matrix stored in the mapping buffer and indicating whether an index among the indexes of the key stream is related to each of the blocks of the NVM.

[0008] According to one aspect of the present invention, a key-value storage device is provided, comprising: a non-volatile memory (NVM) divided into blocks and configured to store a key stream including keys and a value stream including values ​​respectively corresponding to the keys; a data buffer configured to store a key matrix, the key matrix indicating for each key stream among the key streams whether the value corresponding to the key in the key stream is stored in each of the blocks; and a controller configured to select a target block from the blocks based on the key matrix and perform garbage collection on the target block.

[0009] According to one aspect of the present invention, a method for operating a key-value storage device is provided, the key-value storage device including a non-volatile memory (NVM) divided into blocks. The method includes generating and storing a key stream including keys and addresses of values ​​corresponding to the keys; for each key stream, updating a key matrix indicating whether addresses associated with each of the blocks are included; selecting a target block from the blocks based on the key matrix; and performing a garbage collection operation on the target block. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Embodiments of the present inventive concept will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:

[0011] Figure 1 is a block diagram illustrating a storage system according to an embodiment of the inventive concept;

[0012] Figure 2 It is further shown in an example Figure 1 A block diagram of a key-value storage device;

[0013] Figure 3 is shown in an example Figure 1 and Figure 2 A conceptual diagram of the operation of a key-value storage device;

[0014] Figure 4Aand Figure 4B It further shows Figure 3 A conceptual diagram of an example of the operation of a key-value manager;

[0015] Figure 5 is a flowchart outlining an operating method of a key-value storage device according to an embodiment of the inventive concept;

[0016] Figure 6 、 Figure 7A and Figure 7B is a conceptual diagram further illustrating the operation of a key-value storage device according to an embodiment of the inventive concept;

[0017] Figure 8A 、 Figure 8B 、 Figure 8C and Figure 8D is a related conceptual diagram further illustrating the operation of a key-value storage device according to an embodiment of the inventive concept;

[0018] Figure 9 and Figure 10 are flowcharts respectively outlining various aspects of an operating method for a key-value storage device according to an embodiment of the inventive concept;

[0019] Figure 11 is a block diagram illustrating a storage device according to an embodiment of the inventive concept; and

[0020] Figure 12 is a block diagram illustrating an electronic device according to an embodiment of the inventive concept. DETAILED DESCRIPTION

[0021] Figure 1 is a block diagram illustrating a storage system 10 according to an embodiment.

[0022] refer to Figure 1 , the storage system 10 may generally include a storage device 100 and a host 200. The storage device 100 may include a controller 110, a data buffer 130, and a non-volatile memory (NVM) 150. The host 200 may communicate with the storage device 100 via one or more interfaces. Here, for example, the host 200 may be implemented as an application processor (AP) or a system on chip (SoC).

[0023] The controller 110 of the storage device 100 may include a key-value storage device or "key-value storage" (e.g., a key-value solid state drive (SSD)). In this regard, a key-value storage is a device that uses key-value pairs to efficiently process data. Here, a "key-value pair" may include a unique key and a value corresponding to the key. A key-value pair may be referred to as a "tuple" or a "key-value tuple". In a key-value pair, a "key" may be represented as any data string (e.g., a file name, a uniform resource identifier (URI), a hash, etc.), and a "value" may be represented as any type of data (e.g., an image, a user-preferred file, a document, etc.). The size of the key may vary and / or the size of the value may vary. For example, the size of the value may vary depending on the data type of the value.

[0024] Hereinafter, an embodiment in which the storage device 100 is assumed to be a key-value storage will be described. Figure 1 , for example, the storage device 100 can be considered as a key-value store. However, the storage device 100 is not limited to only a key-value store and can be applied to any object cache system or any object storage system that manages data according to object units. Therefore, Figure 1 The storage device 100 may manage data according to object units using a method other than the key-value pair method.

[0025] The host 200 may transmit (e.g., generate and send) at least one command (CMD), at least one key (KEY), and at least one value (VALUE) to the storage device 100. The command may be, for example, a read (or get) request for retrieving data stored in the storage device 100, or a write (or put) request for writing data (e.g., a key-value pair) to the storage device 100. As an example, the host 200 may send a get command including a key to the storage device 100, and the storage device 100 may read the value corresponding to the key from the NVM 150 in response to the get command.

[0026] The controller 110 may write a value to the NVM 150 in response to a write request from the host 200, or read a stored value from the NVM 150 in response to a read request from the host 200. Figure 1 In the illustrated example of , the controller 110 includes a key-value manager 120 .

[0027] The key-value manager 120 may receive a key-value pair included in (or transmitted together with) a command CMD and “separate” a plurality of keys (hereinafter referred to as “keys”) from a plurality of values ​​(hereinafter referred to as “values”) included in the key-value pair. In this regard, the key-value manager 120 may extract the key included in the key-value pair and store the key in the data buffer 130. In addition, the key-value manager 120 may extract the value included in the key-value pair and store the value in the data buffer 130.

[0028] When a certain number of values ​​(eg, a certain amount of data) has been stored in the data buffer 130 , the key-value manager 120 may generate a “value stream” from the stored values.

[0029] When a certain number of keys (e.g., a certain amount of data) have been stored in the data buffer 130, the key value manager 120 can generate a "key stream" by combining the keys with "indexes" corresponding to the values ​​respectively corresponding to the keys. Thereafter, the key value manager 120 can store the generated value stream and / or the generated key stream in different areas of the NVM 150. In this regard, the "index" corresponding to the value may be location information identifying the area of ​​the NVM 150 where the value is stored.

[0030] The key value manager 120 may also update the key matrix 140 stored in the data buffer 130 based on the generated key stream. That is, for each key stream, the key matrix 140 may include information indicating whether values ​​corresponding to keys included in one key stream are stored in one or more blocks of the NVM 150.

[0031] In other words, for each key stream, the key matrix 140 may include "matching information" between the blocks storing the key stream and the values ​​corresponding to the key stream. For example, the key matrix 140 provides matching information indicating whether an index associated with one or more blocks is included for each key stream. For example, assuming that the NVM 150 includes three (3) blocks (e.g., a first block, a second block, and a third block), for each key stream, the key matrix 140 may include a value indicating whether an index associated with the first block is included, whether an index associated with the second block is included, and whether an index associated with the third block is included. This will be referred to below. Figure 4A and Figure 4B A more detailed description of the update functionality performed by the key matrix 140 and the key value manager 120 is presented.

[0032] The key value manager 120 may also use the key matrix 140 to perform (or control the execution of) a garbage collection operation within the storage device 100. In this regard, the key value manager 120 may use the key matrix 140 to select a “target block” from among the blocks of the NVM 150 and perform a garbage collection operation on the target block.

[0033] For example, the key value manager 120 may use the key matrix 140 to identify the number of key streams including indexes associated with each block among the blocks of the NVM 150, and may select a block having the least number of identified key streams as a target block. In other words, the key value manager 120 may be operable to select (or target) a block that should have stored (or is expected to have stored) the least number of valid values ​​by referencing the key matrix 140. Thereafter, the key value manager 120 may at least partially control the execution of garbage collection operations on the target blocks. Figures 8A to 8D Provides a description of one possible garbage collection operation with some additional detail.

[0034] Data buffer 130 may include at least one memory device configured to store keys, values, and key matrix 140. For example, data buffer 130 may include volatile memory devices such as dynamic random access memory (RAM) (DRAM) and static RAM (SRAM).

[0035] The NVM 150 may include a memory cell array (MCA), wherein the memory cell array is divided into a plurality of memory blocks (hereinafter referred to as “blocks”) (e.g., Figure 1 1 to BLKz in ). In this case, NVM 150 can be divided differently (e.g., physically divided and / or logically divided) into differentiated (e.g., addressable) blocks. Each block can be further divided into (e.g.,) multiple pages (e.g., PG1 to PGk). Here, "z" and "k" are positive integers and can vary depending on the embodiment. For example, a block can be a unit of erase, and a page can be a unit of write and read. In some embodiments, the memory cell array can include multiple planes, multiple dies, and / or multiple chips. As an example, NVM 150 can include a flash memory device (e.g., a NAND flash memory device). However, the present inventive concept is not limited thereto, and NVM 150 can include a resistive memory device such as resistive RAM (rRAM), phase change RAM (PRAM), magnetic RAM (MRAM), etc.

[0036] The storage system 10 may be implemented as, for example, a personal computer (PC), a data server, a network coupled storage, an Internet of Things (IoT) device, or a portable electronic device. The portable electronic device may include a laptop computer, a mobile phone, a smartphone, a tablet PC, a personal digital assistant (PDA), an enterprise digital assistant (EDA), a digital camera, a digital video camera, an audio device, a portable multimedia player (PMP), a personal navigation device (PND), an MP3 player, a handheld game console, an e-book, a wearable device, etc.

[0037] In some embodiments, the storage device 100 may include an internal memory embedded in an electronic device. For example, the storage device 100 may include an embedded universal flash storage (UFS) memory device or an embedded multimedia card (eMMC). In some embodiments, the storage device 100 may include an external memory that is removable from the electronic device. For example, the storage device 100 may include a UFS memory card, a compact flash (CF) memory card, a secure digital (SD) card, a micro SD card, a mini SD card, an extreme digital (xD) card, or a memory stick.

[0038] Compared to the key-value storage of certain embodiments consistent with the present invention, the comparison storage device can individually store keys and values ​​separated from key-value pairs, and use the validity information included in the value to perform garbage collection. Therefore, when the comparison storage device performs garbage collection on the target block, the key-value storage reads all values ​​stored in the target block, verifies whether each value is valid by using the validity information included in the read value, and then stores only valid values ​​in the new area. Because this method does not selectively read only valid values ​​from the target block, a relatively high computational overhead is required to perform the garbage collection operation. This slows down the overall processing power of the storage device.

[0039] Additionally or alternatively, the comparison storage device can use a multi-map table to identify the validity of each value with respect to validity information. Therefore, the multi-map table is a table that, for values ​​stored by continuous merging, includes a valid bit indicating the validity of each of the continuous values ​​and the address storing the first value. When performing garbage collection, the comparison storage device must identify the address information and sequence information included in the validity information associated with the value read from the target block, and determine whether the corresponding value is a valid value by identifying the address verified in the multi-map table and the valid bit corresponding to the sequence identified. In addition, the number of continuously merged values ​​defined in the multi-map table will vary according to the size of the value. In other words, when the size of the value decreases, because the number of continuously merged values ​​increases, the size of the multi-map table also increases. Moreover, when the size of the value increases, the number of continuously merged values ​​decreases, and therefore, the size of the multi-map table also decreases. As a result, the comparison storage device suffers from the problem of instability of the validity verification operation caused by the size of the information required for validity verification, which depends on the size of the value.

[0040] In contrast, the key-value storage device according to an embodiment of the present invention can generate a key stream by merging indexes including matching information, and can generate a key matrix including information about the index of each key stream, wherein the matching information identifies the area (e.g., blocks BLK1 to BLKz) in the NVM 150 that stores the value corresponding to the key. Therefore, when garbage collection is performed, the key-value storage device according to an embodiment of the present invention can use the key matrix to read the key stream including the index related to the target block undergoing garbage collection, and obtain only the address of the value related to the target block from the read key stream. Therefore, the key-value storage device according to an embodiment of the present invention can greatly reduce the computational overhead associated with the garbage collection operation and improve the overall processing speed.

[0041] In addition, the key-value storage device according to an embodiment of the present invention can use a key matrix having a size corresponding to the number of blocks and the number of key streams. Therefore, the key-value storage device according to an embodiment of the present invention can prevent instability of the validity verification operation depending on the change in the size of the value because the information required to determine the validity has a constant size regardless of the size of the value.

[0042] Figure 2 It is further shown in an example Figure 1 A block diagram of a storage device 100 is shown. Figure 1 and Figure 2 , the storage device 100 again includes a key-value manager 120 , a data buffer 130 , and an NVM 150 .

[0043] The key-value manager 120 may include a key-value extractor 121 , a compression module 122 , and a garbage collection (GC) module 123 .

[0044] The key value extractor 121 can extract a key (KEY) and a value (VALUE) included in a command (CMD) received from the host 200, for example. The key value extractor 121 can then store the extracted key in the key buffer 131 of the data buffer 130 and store the extracted value in the value buffer 132 of the data buffer 130. In this regard, the key buffer 131 and the value buffer 132 can be configured as separate memory elements. Alternatively, the key buffer 131 and the value buffer 132 can be configured as different areas of the data buffer 130.

[0045] When the number (or volume) of values ​​stored in the value buffer 132 (hereinafter referred to as a "value set") becomes equal to or greater than a predetermined number of values ​​or a predetermined volume of data associated with the values ​​(hereinafter referred to as a "value set limit"), the key value extractor 121 may generate a value stream (ST_VAL) based on the value set. For example, the key value extractor 121 may generate the value stream by sequentially arranging the value set. The key value extractor 121 may store the generated value stream in the second area AR2 of the NVM 150.

[0046] When keys are repeatedly extracted and stored in the key buffer 131, a set of keys having a sufficient amount of data to generate a key stream (ST_KEY) may be stored in the key buffer 131. When the set of keys stored in the key buffer 131 reaches or exceeds a predetermined key set limit, the key value extractor 121 may also generate a key stream (ST_KEY) based on a plurality of keys (hereinafter referred to as a "set of keys"). For example, the key value extractor 121 may generate a key stream by sequentially arranging the set of keys and merging the indexes of the values ​​corresponding to the keys included in the set of keys with the set of keys. Here, the index of the value may identify the area of ​​the NVM 150 where the value is stored. For example, the index of the value may include the physical address where the value is stored in the second area AR2 of the NVM 150.

[0047] In some embodiments, the key value extractor 121 may use a key table to manage physical addresses stored in the first area AR1 of the NVM 150. For example, the key table may be generated as a hash table that stores a hash key corresponding to a key as a mapping index of the key together with the key.

[0048] The key value extractor 121 may also update the key matrix 140, which indicates whether an index related to each of the blocks of the NVM 150 is included for each key stream, based on the generated key stream, and may store the updated key matrix 140 in the map buffer 133. For example, when the index of a value is a physical address of a region of the NVM 150 where the value is stored, the key value extractor 121 may update the key matrix 140 by identifying a block related to the physical address included in the key stream among the blocks of the NVM 150, and by changing the key stream generated in the key matrix 140 and the value corresponding to the identified block.

[0049] The compression module 122 may perform a compression operation on at least one key stream stored in the first area AR1 of the NVM 150. In this context, the compression operation may generate a "new key stream" by deleting at least one key corresponding to an invalid value stored in the NVM 150. For example, the compression operation may compress data in a data structure based on a long structured merge (LSM) tree.

[0050] The compression module 122 may read at least one keystream stored in the first area AR1 of the NVM 150 and identify an invalid key. Here, an "invalid key" may be a key corresponding to a value that has received a delete command CMD received from the host 200 (or has been the subject of the delete command). The compression module 122 may generate a new keystream using only valid keys included in the at least one keystream. The compression module 122 may write the generated new keystream to the first area AR1 of the NVM 150.

[0051] When generating a new key stream, the compression module 122 may change or delete a value corresponding to at least one key stream including at least one invalid key in the key matrix 140. In addition, the compression module 122 may update the key matrix 140 based on the newly generated key stream.

[0052] The GC module 123 may perform garbage collection on one or more blocks of the NVM 150. For example, the GC module 123 may identify the number of key streams including indexes associated with each block of the NVM 150 based on the key matrix 140, select a block having the least number of identified key streams ST_KEY as a target block, and perform a GC operation on the target block. Figures 8A to 8D One possible method of doing this is described in some additional detail.

[0053] Figure 3 : is a conceptual diagram illustrating the operation of a key-value storage device according to an embodiment of the present invention in one example. Figure 3 is a conceptual diagram illustrating a storage operation for a key-value pair and a generation operation of a key matrix for a key-value storage device.

[0054] refer to Figure 1 、 Figure 2 and Figure 3 The key value manager 120 may receive a key-value pair (KVP) and separate the key (KEY) from the value (VAL) included in the key-value pair. The key value manager 120 may then generate a value stream by merging a set of values ​​and store the generated value stream in the second area AR2 of the NVM 150.

[0055] The key value manager 120 may combine the index (Idx) associated with the value with the key and store the combination of (index+key) in the data buffer 130. Here, the index may identify a physical address where the value associated with the index is stored in the second area AR2 of the NVM 150. However, the present inventive concept is not limited thereto, and the index may include block information identifying a block storing the value.

[0056] In addition, the key value manager 120 may generate a key stream by merging a set of keys, wherein each key in the set of keys is combined with an index, and the key value manager 120 may store the generated key stream in the first area AR1 of the NVM 150. The key value manager 120 may generate a key table (KT) using the physical address of the stored key stream stored in the first area AR1 of the NVM 150. In other words, the key table may be used to store the physical address of the NVM 150 in which the key stream and the value stream are stored.

[0057] Thereafter, the key value manager 120 may identify which block of the NVM 150 stores the key stream by using the index included in the key stream, and may update the key matrix (KM) using the block identification result.

[0058] Figure 4A and Figure 4B is a conceptual diagram illustrating the operation of a key value manager according to an embodiment of the present invention in one example. That is, Figure 4A and Figure 4B 1 is a conceptual diagram illustrating an operation in which a key value manager updates a key matrix. An operation method for a key value manager according to an embodiment of the present invention may be performed by Figure 1 、 Figure 2 and Figure 3 The key value manager 120 is used to execute.

[0059] refer to Figure 1 、 Figure 2 、 Figure 3 and Figure 4A , the key value manager 120 may generate a fourth key stream (ST_KEY4) by combining keys (e.g., Key1, Key2, and Key3) with physical addresses (e.g., Value1PPN, Value2PPN, and Value3PPN) that are indexes of values ​​(e.g., Value1, Value2, and Value3) that respectively correspond to the keys.

[0060] The key value manager 120 can identify at least one block in which values ​​(Value1, Value2, and Value3) corresponding to keys (Key1, Key2, and Key3) are stored by referring to physical addresses (Value1PPN, Value2PPN, and Value3PPN) included in the key stream ST_KEY. Figure 4AIt can be seen that the key value manager 120 can recognize that the first value (Value1) is stored in the first block BLK1 according to the first physical address (Value1PPN); the second value (Value2) is stored in the third block BLK3 according to the second physical address (Value2PPN); and the third value (Value3) is stored in the fifth block BLK5 according to the third physical address (Value3PPN).

[0061] refer to Figure 4B , the key value manager 120 may also be used to update a key matrix (KM) using the identified block information. Here, the key matrix may be implemented as a two-dimensional matrix, where one axis is a block number corresponding to a plurality of blocks in the NVM 150, and the other axis is a key stream number corresponding to a plurality of key streams. Figure 4B In the example shown in , the key matrix uses a flag value (i.e., "0" or "1") to indicate whether a particular block is associated with a particular key stream. For example, a flag value of "0" may be used to indicate that a particular key stream is not associated with a particular block, and a flag value of "1" indicates the opposite.

[0062] In this regard, the key value manager 120 may identify a row of a key stream number corresponding to a newly generated key stream among key stream numbers of the key matrix, identify a column associated with a block number corresponding to the identified block among block numbers of the key matrix, and change values ​​corresponding to the identified row and the identified column. For example, referring to Figure 2 、 Figure 4A and Figure 4B , the key value manager 120 may identify the fourth row in the key matrix as corresponding to Figure 4A The generated fourth key stream ST_KEY4 is generated, and the first column, the third column, and the fifth column corresponding to the identified at least one block (BLK1, BLK3, or BLK5) are identified. In addition, the key value manager 120 can use, for example, the form of identifying (row, column) (for example, ((4, 1), (4, 3), (4, 5))) and the values ​​'0' and '1' to change the values ​​corresponding to the identified row and the identified column.

[0063] exist Figure 4A In the example shown in , three (3) keys and three (3) indexes are combined into the fourth key stream ST_KEY4, but this is merely a teaching example and the inventive concept is not limited thereto. More or fewer keys and / or indexes may be implicated in various key stream formats.

[0064] Figure 5 is a flowchart outlining an operating method for a key-value storage device according to an embodiment of the present inventive concept in one example. Figure 5The described method can be used in conjunction with a storage operation for key-value pairs and a generation operation for a key matrix in a key-value storage device, such as Figure 1 、 Figure 2 and Figure 3 As described in .

[0065] refer to Figure 1 、 Figure 2 、 Figure 3 and Figure 5 , the storage device 100 may receive data including a key and a value from the host 200 (S110). For example, the storage device 100 may receive a command CMD including a key and a value from the host 200. Next, the storage device 100 may separate the key and the value from the received data (S120). For example, the storage device 100 may separate the key from the value and store the separated key and the separated value in the data buffer 130, respectively.

[0066] Next, the storage device 100 may generate and store a value stream (S130). This may be achieved, for example, by combining (or merging) the "first values" among the separated values ​​to generate a value stream. That is, when a set of values ​​is accumulated in the data buffer 130, the storage device 100 may generate a value stream by sequentially arranging the first values. Here, the storage device 100 may store the generated value stream in a designated portion of the NVM 150.

[0067] Next, the storage device 100 may generate a key stream by merging the "first key" among the separated keys with the index of the value corresponding to the first key (S140). For example, when a set of keys is accumulated in the data buffer 130, the storage device 100 may generate a key stream by combining (or merging) the keys and the indexes associated with the value corresponding to the first key. In this case, each of the indexes may be a physical address corresponding to an area in the NVM 150 storing the corresponding value.

[0068] Next, the storage device 100 may update the key matrix based on the key stream (S150). Here, the key matrix may include matching information indicating whether the index is "associated" with one or more blocks of the NVM 150 for the key stream. For example, the storage device 100 may identify which block of the NVM 150 the index Idx included in the key stream is associated with, and may update the key matrix by changing the value corresponding to the key stream and the block associated with the key stream tracked by the key matrix.

[0069] Next, the storage device 100 may store the keystream ( S160 ). For example, the storage device 100 may store the generated keystream in a designated portion of the NVM 150 .

[0070] Figure 61 is a conceptual diagram further illustrating the operation of a key-value storage device according to an embodiment of the present invention in an example. Specifically, Figure 6 It is further shown that Figure 1 、 Figure 2 and Figure 3 A conceptual diagram of a compression operation performed by the key-value storage device 100.

[0071] refer to Figure 1 、 Figure 2 、 Figure 3 and Figure 6 , the key value manager 120 may (1) read two or more invalid key streams (ST_IK) from the first area AR1 of the NVM 150. And the key value manager 120 may update the validity information indicating whether the keys included in the key stream are valid, as indicated by the hash table (HT), in response to various commands (CMD) received from the host 200. The key value manager 120 may also determine whether the key stream is an invalid key stream based on the hash table HT. For example, when an erase command CMD pointing to (or identifying) a first value is received from the host 200, the key value manager 120 may identify a first key corresponding to the first value in the hash table HT based on the combined index, and update the hash table HT to indicate the invalidity of the first key.

[0072] The key manager 120 may then (2) generate a merged key stream (ST_MK) by merging the invalid key streams previously read. For example, as described above, the key manager 120 may generate a merged key stream by deleting one or more invalid keys in order to generate a valid key stream. Thus, Figure 6 The merged key stream includes only valid keys.

[0073] The key value manager 120 may now (3) write the merged key stream in the first area AR1 of the NVM 150. In addition, the key value manager 120 may update the physical address of the merged key stream in the key table KT, delete the invalid key stream, and update the validity information corresponding to the invalid key stream in the hash table.

[0074] The key value manager 120 may update the key matrix with respect to the invalid key stream and the merged key stream ST_MK. For example, the key value manager 120 may delete the value corresponding to the invalid key stream from the key matrix, or change the tag values ​​of the plurality of blocks associated with the index included in the merged key stream.

[0075] Thereafter, the key value manager 120 may perform GC on invalid values ​​by referring to the key matrix KM. When GC is performed based on the key matrix KM, invalid values ​​may be deleted from the second area AR2 of the NVM 150.

[0076] Figure 7A and Figure 7Bis a conceptual diagram illustrating, in one example, the operation of a key-value manager according to an embodiment of the inventive concept. Figure 7A and Figure 7B is a conceptual diagram illustrating compression operations that can be performed by a key-value manager.

[0077] refer to Figure 1 、 Figure 2 、 Figure 3 and Figure 7A , the key value manager 120 may read the second key stream (ST_KEY2) and the third key stream (ST_KEY3) from the stored key stream as corresponding invalid key streams (ST_IK).

[0078] In addition, the key value manager 120 can extract a valid key and an index merged with the valid key from each of the second key stream ST_KEY2 and the third key stream ST_KEY3. That is, the key value manager 120 can extract a first physical address (Value1PPN) associated with a first key (Key1) and a first value (Value1) corresponding to a valid key, and a second physical address (Value2PPN) associated with a second key (Key2) and a second value (Value2) from the second key stream ST_KEY2. Furthermore, the key value manager 120 can extract a sixth physical address (Value6PPN) associated with a sixth key (Key6) and a sixth value (Value6) corresponding to a valid key from the third key stream ST_KEY3.

[0079] The key value manager 120 can now generate a new key stream (ST_MK) by merging the extracted valid keys and the indexes extracted from the valid keys. Figure 7A , the key value manager 120 may generate a fifth key stream (ST_KEY5) by merging the first physical address of the extracted first key with the first value, merging the second physical address of the second key with the second value, and merging the sixth physical address of the sixth key with the sixth value.

[0080] In addition, the key value manager 120 may update the key matrix with respect to the new key stream and the invalid key stream. For example, first, based on the address included in the new key stream, the key value manager 120 may identify at least one block in which a value associated with the key of the new key stream is stored. Figure 7A , the key value manager 120 may identify each of the values ​​corresponding to the keys included in the fifth key stream stored in the sixth block BLK6 or the second block BLK2 of the NVM 150 .

[0081] The key value manager 120 may then identify a row in the key matrix corresponding to the merged key stream and a column corresponding to the identified block, and may change values ​​corresponding to the identified row and the identified column in the key matrix.

[0082] refer to Figure 7B , the key value manager 120 may identify the row corresponding to the fifth key stream as the fifth row, identify the columns corresponding to the identified blocks (BLK6 and BLK2) as the second column and the sixth column, respectively, and change the tag values ​​corresponding to the identified row and the identified column from “0” to “1”.

[0083] In addition, the key value manager 120 may identify a row in the key matrix corresponding to an invalid key stream and change a value corresponding to the identified row. Figure 7B , the key value manager 120 can identify the second row and the third row as rows in the key matrix corresponding to the second key stream and the third key stream including the portion of the invalid key stream, and can change all tag values ​​"1" on the identified second row and the third row to "0".

[0084] about Figure 7B Although the method of updating the key matrix with respect to an invalid key stream has been described as including a step of changing the mark value corresponding to the invalid key stream in the key matrix to "0", the method may alternatively be implemented as a method in which the rows corresponding to the invalid key stream are simply erased from the key matrix.

[0085] Figure 8A 、 Figure 8B 、 Figure 8C and Figure 8D (Thereafter, including Figures 8A to 8D ) is a related conceptual diagram illustrating the operation of a key-value storage device according to an embodiment of the present invention in an example. That is, Figures 8A to 8D Conceptually shown Figures 1 to 3 Garbage collection (GC) operation of the storage device 100.

[0086] Here, the key manager 120 may select a target block on which GC is to be performed with reference to the key matrix (KM). For example, the key manager 120 may identify the number of key streams including indexes related to each block of the NVM 150 using the key matrix, and may select a target block from among the blocks using the identified result. Hereinafter, for ease of description, it is assumed that Figure 8A As shown, the key matrix has 64 values ​​corresponding to eight (8) key streams (e.g., ST_KEY1 to ST_KEY8) and eight blocks (e.g., BLK1 to BLK8). However, the present disclosure is not limited thereto, and the key matrix may include values ​​corresponding to any reasonable number of key streams and / or blocks. In addition, hereinafter, for ease of description, it is assumed that the index corresponding to a value is a physical address that identifies the area where the value is stored.

[0087] For example, the key value manager 120 can use the key matrix KM (①) to identify the number of tag values ​​"1" for each block number. Here, the tag value "1" in the key matrix KM means that the key stream includes the address associated with the corresponding block. Therefore, the key value manager 120 can identify the number of key streams including the address associated with each block by counting the number of tag values ​​"1" in the row corresponding to each block.

[0088] For example, reference Figure 8A , the key value manager 120 can recognize that in the column corresponding to the first block (BLK1), the tag value of the row corresponding to the key stream number (4, 6 and 7) is "1". In other words, the key value manager 120 can recognize that the addresses related to the first block BLK1 are included in the fourth key stream (ST_KEY4), the sixth key stream (ST_KEY6) and the seventh key stream (ST_KEY7), respectively. Therefore, the key value manager 120 can recognize that the number of key streams including the addresses related to the first block BLK1 is three (3). On the other hand, by using the key matrix, the storage device 100 according to an embodiment of the present invention may include a separate counter (not shown) that counts the number of "1" tag values ​​in the column corresponding to each block.

[0089] Next, the key value manager 120 may select a block having the least number of key streams including addresses associated with the block as a target block (②). Figure 8A , the key manager 120 may select the second block (BLK2) as the target block because it has the least number of "1" tag values. Next, the key manager 120 may identify at least one key stream (③) including an address associated with the target block from the key matrix. For example, referring to Figure 8A , the key manager 120 may identify the row corresponding to the tag value '1' as the third row in the second column corresponding to the second block BLK2 as the target block. Next, the key manager 120 may identify the key stream corresponding to the third row as a third key stream (ST_KEY3).

[0090] Next, refer to Figure 8B , the key value manager 120 may read the identified third key stream ST_KEY3 (④) from the NVM 150 and identify an address associated with the target block (⑤). For example, the key value manager 120 may read the third key stream and identify the fifth physical address Value5PPN of the fifth value Value5 and the sixth physical address Value6PPN of the sixth value Value6 from the read third key stream as addresses associated with the second block.

[0091] Next, the key value manager 120 may generate a GC read list (GC Read List) from the identified address (⑥). Next, the key value manager 120 may read a value from the target block using the GC read list (⑦). For example, the key value manager 120 may generate a GC read list using the fifth physical address Value5PPN of the fifth value Value5 and the sixth physical address Value6PPN of the sixth value Value6, and may read the fifth value Value5 and the sixth value Value6 from the second block BLK2 by using the GC read list.

[0092] Next, refer to Figure 8C , the key value manager 120 can generate a new value stream using the read values ​​(⑧), and store the generated new value stream in the new area (⑨). For example, the key value manager 120 can generate a new value stream using the fifth value Value5 and the sixth value Value6, and store the new value stream in the third block (BLK3).

[0093] Next, the key value manager 120 may update the key stream and the key matrix (⑩). Here, the key value manager 120 may update the key stream by changing the address of the read value to a new address in the key stream including the key corresponding to the value read from the target block. In addition, the key value manager 120 may update the key matrix based on the updated key stream.

[0094] refer to Figure 8D In another embodiment, the key manager 120 may use a different method to select a target block to perform a GC operation. First, the key manager 120 may select a candidate block for each block using a valid data table (Valid Data Table), which includes information indicating a ratio of valid data to all data in the block. The key manager 120 may then use the valid data table to select blocks having a ratio of valid data that is equal to or less than a reference ratio of the candidate blocks. For example, when the reference ratio is set to approximately 60, the key manager 120 may select the second block BLK2 (i.e., a block with block number "2") and the eighth block BLK8 (i.e., a block with block number "8") whose ratios of valid data to all data are approximately 45 and approximately 55 (based on an assumed scale of 100) as candidate blocks.

[0095] In addition, the key value manager 120 can use the key matrix to identify the number of "1" tag values ​​corresponding to the columns of the candidate blocks (②). For example, the key value manager 120 can identify the number of "1" tag values ​​in the second column corresponding to the second block BLK2 and in the eighth column corresponding to the eighth block BLK8.

[0096] In addition, the key value manager 120 may select a block with the least number of "1" mark values ​​among the candidate blocks as the target block (③). Figure 8D Since the number of “1”s in the second column corresponding to the second block BLK2 is less than the number of “1”s in the eighth column, the key value manager 120 may select the second block BLK2 as the target block.

[0097] Alternatively, regarding the embodiments and Figure 8D , it has been shown that a candidate block is selected using a valid data table, and a target block is selected from the candidate blocks using a key matrix. However, other methods can be implemented in which a candidate block is selected using a key matrix and a target block is selected using a valid data table. As an example, the key value manager 120 can use the key matrix to select a block having a number of key streams including relevant addresses less than a predetermined number as a candidate block, and can select a block having a minimum valid data ratio among the candidate blocks as a target block.

[0098] Figure 9 is a flowchart outlining an operating method for a key-value storage device according to an embodiment of the present invention in one example. That is, Figure 9 It shows that it can be Figure 1 、 Figure 2 and Figure 3 A conceptual diagram of a GC operation performed by the storage device 100.

[0099] refer to Figure 2 、 Figure 3 and Figure 9 , the storage device 100 may select a target block among the plurality of blocks of the NVM 150 using the key matrix (S210). For example, the storage device 100 may select a block having the least number of key streams including the relevant address from among the blocks of the NVM 150 as the target block. For another example, the storage device 100 may select candidate blocks by using information about the ratio of valid data, and select a block having the least number of key streams including the relevant address from among the candidate blocks as the target block. For another example, the storage device 100 may select blocks having a certain number of key streams including the relevant address that is equal to or less than a certain number as candidate blocks, and may select a block having the smallest ratio of valid data from among the candidate blocks as the target block.

[0100] Next, the storage device 100 may identify a key stream including an address associated with the target block (S220). The storage device 100 may identify a value indicating that the address associated with the target block is included in the key matrix among the values ​​corresponding to the target block, and identify a key stream corresponding to the identified value.

[0101] Next, the storage device 100 may identify an address associated with the target block from the identified keystream (S230).The storage device 100 may read the identified keystream from the NVM 150 and identify an address associated with the target block among addresses included in the read keystream.

[0102] Next, the storage device 100 can read the value corresponding to the identified address from the target block (S240). Next, the storage device 100 can store the read value in the new area (S250). When the read value is essentially multiple, the storage device 100 can generate a new value stream (ST_VALUE) by merging these values ​​and store the generated value stream in the new area. In this case, the new area can be an area different from the area that previously stored the read value, and can be an area of ​​a block different from the target block.

[0103] Next, the storage device 100 may update the key stream and key matrix (S260). The storage device 100 may update the key stream by changing the address of the previously read value to a new address. In addition, the storage device 100 may update the key matrix based on the updated key stream.

[0104] According to certain embodiments of the inventive concept, the storage device 100 may reduce computational overhead and improve processing speed by determining the validity of a value stored in a target block using a key stream.

[0105] Figure 10 Further summarizes the embodiments according to the present invention Figure 9 Flowchart of operations S220 to S240 in an operating method for a key-value storage device.

[0106] refer to Figure 9 and Figure 10 , the storage device 100 may read a key stream including an address associated with a target block (S310). For example, the storage device 100 may identify a first key stream as a key stream including an address associated with a target block by using a key matrix, and may read the first key stream from an area corresponding to the address of the first key stream.

[0107] Next, the storage device 100 may identify the addresses included in the read keystream and register the addresses associated with the target block in a GC Read List (S320). The storage device 100 may sequentially identify the addresses in the first keystream and register at least one address associated with the target block in the GC Read List.

[0108] Next, the storage device 100 may determine whether all addresses included in the keystream have been identified with respect to the target block (S330). In the process of sequentially identifying addresses in the first keystream, the storage device 100 may determine whether the relationship with the target block has been identified up to the last address. When all addresses in the keystream have not been identified (S330=No), the storage device 100 may repeat operation S320. In other words, the storage device 100 may identify the relationship between the target block and the next sequential address in the first keystream.

[0109] On the other hand, when all addresses in the key stream have been identified (S330=Yes), the storage device 100 can identify whether there is a separate key stream including addresses related to the target block (S340). The storage device 100 can identify whether there is a second key stream including addresses related to the target block in addition to the first key stream by using the key matrix. When there is a separate key stream including addresses related to the target block (S340=Yes), the storage device 100 can repeat operation S320 for the corresponding key stream. On the other hand, when there is no separate key stream including addresses related to the target block (S340=No), the storage device 100 can read a valid value from the target block by using the GC read list (S350).

[0110] Figure 11 is a block diagram illustrating a storage device 100 a according to an embodiment of the inventive concept.

[0111] refer to Figure 11 , the storage device 100a may include a controller 110a, a volatile memory (VM) 130a, and an NVM. In addition, the controller 110a may include a processor 111, a memory 112, a host interface (IF) 113, an NVM IF 114, a hardware (HW) accelerator 115, and a VM IF 116, which can communicate with each other via a bus 117.

[0112] The processor 111 may include a central processing unit (CPU), a microprocessor, etc., and may control the overall operation of the controller 110a. The memory 112 may operate under the control of the processor 111 and may be used as an operating memory, a buffer memory, a cache memory, etc. For example, the memory 112 may be implemented as a VM such as a DRAM and an SRAM, or an NVM such as a PRAM and a flash memory.

[0113] The key value manager 120a may be implemented in firmware or software and may be loaded into the memory 112. For example, the key value manager 120a may be implemented in a flash translation layer (FTL) and may be loaded into the memory 112. However, the present invention is not limited thereto, and the key value manager 120a may be implemented in hardware. Figures 1 to 10 The described operations may be performed by the processor 111 using the key-value manager 120 a .

[0114] The host interface 113 may provide an IF between the host 200 and the controller 110 a according to, for example, universal serial bus (USB), multimedia card (MMC), peripheral component interconnect (PCI) express (PCI-E), advanced technology attachment (ATA), serial ATA (SATA), parallel ATA (PATA), small computer system interface (SCSI), serial attached SCSI (SAS), enhanced minidisk interface (ESDI), and integrated drive electronics (IDE). The NVM IF 114 may provide an IF between the controller 110 a and the NVM 150. For example, a key stream ST_KEY or a value stream ST_VAL may be transmitted and / or received (hereinafter, “transferred”) between the controller 110 a and the NVM 150 via the NVM IF 114.

[0115] The VM IF 116 may provide an IF between the controller 110a and the VM 130a. For example, keys, values, mapping tables, and key matrices may be transferred between the controller 110a and the VM 130a.

[0116] VM 130a may store a mapping table and a key matrix 140a. For example, VM 130a may further store the keys and values ​​in Figure 2 The data buffer 130 in the memory is stored in memory. To this end, the VM 130a can be implemented as a DRAM. The mapping table may include the above reference Figures 1 to 10 Any of the hash tables and key tables described.

[0117] The HW accelerator 115 may include various types of accelerators, such as a field programmable gate array (FPGA), a massively parallel processor array (MPPA), a graphics processing unit (GPU), an application specific integrated circuit (ASIC), a neural processing unit (NPU), a tensor processing unit (TPU), and a multi-processor system on a chip (MPSoC). The HW accelerator 115 may be used for at least a portion of the GC operation, such as by selecting a target block using the key matrix 140a. Figure 11 , the controller 110 a is illustrated as including the HW accelerator 115 , but the present disclosure is not limited thereto, and the HW accelerator 115 may be omitted.

[0118] Figure 12 is a block diagram illustrating an electronic device 3000 according to an embodiment of the inventive concept.

[0119] refer to Figure 12, the electronic device 3000 may include a processor 3100, a memory device 3200, a storage device 3300, a modem 3400, an input / output (I / O) device 3500, and a power supply 3600. For example, the storage device 3300 may be configured by using the above reference Figures 1 to 11 The described embodiments are implemented.

[0120] For example, the storage device 3300 may receive a key-value pair including a key and values ​​respectively corresponding to the key from the host, and may separate the key KEY and the value from the key-value pair.

[0121] For example, the storage device 3300 may generate a value stream by merging values ​​and store the generated value stream in the non-volatile memory device. In addition, the storage device 3300 may combine an index corresponding to a value with each of the keys, generate a key stream by adding the keys that are combined with the index, and store the generated key stream in the non-volatile memory device.

[0122] For example, the storage device 3300 can update a key matrix based on the generated key stream, the key matrix indicating whether an index related to each of the blocks of the non-volatile memory device is included for each key stream. In addition, the storage device 3300 can use the key matrix to select a target block to perform a garbage collection operation, read the key stream related to the target block using the key matrix, identify the storage location of the valid value related to the target block from the read key stream, and read the valid value and store it in the new area. Therefore, after reading all the values ​​included in the target block, the storage device 3300 can use the key stream to determine the validity of the value stored on the target block without having to determine the validity of each of the read values, and can reduce the computational overhead associated with the garbage collection operation and improve the overall processing speed.

[0123] For example, without receiving the command CMD from the processor 3100 , the storage device 3300 may perform the above operations by itself.

[0124] While the inventive concept has been particularly shown and described with reference to embodiments thereof, it will be understood that various changes in form and details may be made therein without departing from the spirit and scope of the appended claims.

Claims

1. A storage device comprising: a non-volatile memory NVM divided into blocks; and The controller is configured as: receiving a command and a key-value pair, wherein the key-value pair includes a key and a value corresponding to each key, Separate keys from values, Produces a stream of values ​​by combining sets of values, generating a key stream by merging the indices of the values ​​in the set of keys and the set of values ​​that respectively correspond to the keys in the set of keys, and updating a key matrix including information indicating whether an index among indexes of the key stream is associated with each of the blocks of the NVM, identifying, for each of the blocks of the NVM based on the key matrix, the number of key streams including indexes respectively associated with the blocks among the key streams, selecting a target block having the least number of key streams among the blocks, and Performs a garbage collection operation on the target block.

2. The storage device according to claim 1, wherein The index comprises a physical address of the value among a set of values ​​stored in the NVM.

3. The storage device according to claim 2, wherein: The controller is configured to identify at least one block among the blocks that stores a value corresponding to the key stream based on an index in the key stream among the key streams, and change a tag value corresponding to the key stream and the identified at least one block in the key matrix. The storage device according to claim 3 , wherein: The controller is configured to generate a third key stream by merging a pre-stored second key stream with the key stream, delete information corresponding to the key stream and the pre-stored second key stream in a key matrix, and update the key matrix based on at least one index in the third key stream.

5. A storage device comprising: a non-volatile memory NVM divided into blocks and configured to store a key stream including keys and a value stream including values ​​respectively corresponding to the keys; a data buffer configured to store a key matrix including, for each of the key streams, information indicating whether values ​​respectively corresponding to keys included in the key streams are stored in each of the blocks; as well as a controller configured to select a target block from the blocks based on the key matrix and perform garbage collection on the target block, wherein the controller is configured to use a key matrix to identify the number of key streams including keys corresponding to values ​​stored in each of the blocks, and select a target block as a block among the blocks having the least number of key streams identified using the key matrix. The storage device according to claim 5 , wherein: The controller is configured to identify at least one key stream among the key streams using a key matrix, the at least one key stream including a key corresponding to a value stored in a target block, and read the at least one key stream from the NVM.

7. The storage device according to claim 6, wherein: The key stream includes the addresses of the values ​​corresponding to the keys, and The controller is further configured to identify an address associated with a target block from the at least one keystream and read a value corresponding to the address from the target block using the address. The storage device according to claim 7 , wherein: The controller stores the read value in an area of ​​the nonvolatile memory that is different from an area in which the read value was previously stored.

9. The storage device according to claim 8, wherein: The controller is configured to change an address of the read value to a new address of the read value in a key stream including a key corresponding to the read value among the key streams.

10. An operating method for a storage device, the storage device including a non-volatile memory (NVM) divided into blocks, the operating method comprising: generating and storing a key stream, the key stream including keys and addresses of values ​​respectively corresponding to the keys; updating a key matrix for each of the key streams, the key matrix including information indicating whether addresses associated with each of the blocks among the addresses are included; selecting a target block from among the blocks based on the key matrix; as well as Perform garbage collection on the target block, Among them, performing garbage collection operations includes: identifying, using a key matrix, at least one key stream among the key streams that includes an address associated with a target block, identifying at least one address associated with a target block using the at least one keystream, reading at least one value from a target block using the at least one address, storing the at least one value in a new area of ​​the NVM, and In a key stream including a key corresponding to the at least one value, an address of the at least one value is changed to a new address to provide a changed key stream.

11. The operating method according to claim 10, wherein: Selecting the target block using a key matrix includes: A block among the blocks having a smallest number of keystreams including addresses associated with the block is selected.

12. The operating method according to claim 10, wherein: Selecting the target block includes: selecting a candidate block from among the blocks based on ratio information of valid data of each of the blocks; as well as Using the key matrix, a block having a minimum number of key streams including addresses associated with the candidate blocks among the blocks is selected as a target block.

13. The operating method according to claim 10, wherein: Performing garbage collection operations also includes: Based on the changed key stream, the key matrix is ​​updated.

Citation Information

Patent Citations

  • Flash memory cache including for use with persistent key-value store

    US20110276744A1

  • KVS tree

    US20180225315A1