Method for key-value persistent storage and key-value persistent storage
By combining hash tables and recursive index storage devices in a key-value storage device, and constructing a recursive model index using a linear regression model, the problem of hash tables accommodating large key-value pairs is solved, improving data retrieval efficiency and storage performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2026-03-20
AI Technical Summary
Existing key-value stores cannot accommodate large key-value pairs in their hash tables, leading to the need to limit the maximum key size, which negatively impacts user experience and results in low data retrieval efficiency.
By combining hash tables and recursive index storage devices, a recursive model index is constructed by training a linear regression model. The linear regression model is then used to map keys to storage locations, reducing the size of the hash table and improving search efficiency.
It enables efficient management of large key-value pairs, reduces the size limitation of hash tables, and improves the efficiency of data retrieval and the performance of storage devices.
Smart Images

Figure CN116225309B_ABST
Abstract
Description
[0001] This application claims priority to and the benefit of U.S. Provisional Application No. 63 / 285,802, entitled “TWO LEVEL MEMORY EFFICIENT INDEXING FOR KV SSD USING LINEAR REGRESSION,” filed December 3, 2021, which is incorporated by reference herein in its entirety. TECHNICAL FIELD
[0002] One or more aspects of embodiments in accordance with the present disclosure relate to persistent storage devices, and more specifically, to a two-level indexing system for key-value persistent storage devices. BACKGROUND
[0003] Key-value storage devices have various uses for data storage in, for example, server systems. In such storage devices, data can be stored as values, each value identified by a corresponding key, and a host using the key-value storage device can, for example, send a read request (or “Get command”) including a key that identifies a value to be read from the storage device.
[0004] Aspects of the present disclosure are with respect to this general technical environment. SUMMARY
[0005] In some embodiments, a key-value persistent storage device includes two indexing systems for mapping keys to values: (i) a hash table and (ii) a recursive index storage device. When new key-value pairs are written to the key-value persistent storage device, the hash table can be employed, and some of the key-value pairs (e.g., key-value pairs determined to be longer-lived than other key-value pairs) can be periodically moved (e.g., when wear leveling or garbage collection is performed) to the recursive index storage device. The recursive index storage device can employ a tree structure (e.g., a tree of linear models) to map keys to value storage locations, where higher levels in the tree (including internal nodes) direct any queries related to a key to lower levels (external nodes), including a linear mapping from the key to an address in the persistent storage device.
[0006] According to one embodiment of the present disclosure, a method is provided that includes ordering two or more key-value pairs to form a set of ordered key-value pairs, determining an address of a first key-value pair of the key-value pairs, the first key-value pair including a first key and a first value, determining an address of a second key-value pair of the key-value pairs, the second key-value pair including a second key and a second value, and constructing a model based on the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair.
[0007] In some embodiments, the method further comprises performing a data movement operation in a block of the key-value persistent storage, the step of performing the data movement operation comprising identifying the two or more key-value pairs.
[0008] In some embodiments, the data movement operation is a wear leveling operation.
[0009] In some embodiments, the method further comprises storing the sorted set of key-value pairs in a storage area, wherein the step of determining the address of the first key-value pair comprises determining a first address at which the first key-value pair is stored.
[0010] In some embodiments, the step of constructing the model comprises training a first linear regression model to generate a first line corresponding to the key-value pairs, the step of training comprising training the first linear regression model with the key-value pairs and corresponding addresses, the key-value pairs and corresponding addresses comprising the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair; and the method further comprises receiving a command to access a third key-value pair of the two or more key-value pairs, and determining an approximate address of the third key-value pair based on the first line.
[0011] In some embodiments, the step of determining the approximate address comprises multiplying a key of the key-value pair by a factor and adding an offset to the factor, the factor and the offset based on a slope and an offset of the first line.
[0012] In some embodiments, the step of constructing the model comprises training a first linear regression model to generate a first line corresponding to the key-value pairs, the step of training comprising training the first linear regression model with the key-value pairs and corresponding addresses, the key-value pairs and corresponding addresses comprising the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair; and the method further comprises determining that a difference between an approximate address of the first key-value pair based on the first line and the address of the first key-value pair exceeds a threshold, and training a second linear regression model to generate a second line corresponding to a first subset of the key-value pairs, the step of training comprising training the second linear regression model with the first subset of the key-value pairs.
[0013] In some embodiments, the threshold is a difference between the address of the first key-value pair and a page boundary.
[0014] In some embodiments, the method further comprises receiving a command to access a key-value pair of the two or more key-value pairs, and determining that the key-value pair is in the first subset.
[0015] In some embodiments, the method further comprises determining an approximate address of the key-value pair based on the second line.
[0016] In some embodiments, the method further comprises reading a page from the persistent storage device, the approximate address being within the page.
[0017] According to one embodiment of the disclosure, a key-value persistent storage device is provided, comprising: a persistent storage device; a buffer; and processing circuitry configured to: order two or more key-value pairs to form an ordered set of key-value pairs; determine an address of a first key-value pair of the key-value pairs, the first key-value pair comprising a first key and a first value; determine an address of a second key-value pair of the key-value pairs, the second key-value pair comprising a second key and a second value; and construct a model based on the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair.
[0018] In some embodiments, the processing circuitry is further configured to perform a data movement operation in a block of the key-value persistent storage device, the processing of performing the data movement operation including identifying the two or more key-value pairs.
[0019] In some embodiments, the data movement operation is a wear leveling operation.
[0020] In some embodiments, the processing circuitry is further configured to store the ordered set of key-value pairs in a storage area, wherein the processing of determining the address of the first key-value pair includes determining a first address at which the first key-value pair is stored.
[0021] In some embodiments, the processing of constructing the model includes training a first linear regression model to generate a first line corresponding to the key-value pairs, the processing of training including training the first linear regression model with the key-value pairs and corresponding addresses, the key-value pairs and corresponding addresses including the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair; and the processing circuitry is further configured to receive a command to access a third key-value pair of the two or more key-value pairs, and determine an approximate address of the third key-value pair based on the first line.
[0022] In some embodiments, the processing of determining the approximate address includes multiplying a key of the key-value pairs by a factor and adding an offset to the key, the factor and the offset being based on a slope and an offset of the first line.
[0023] In some embodiments, the processing of constructing the model includes training a first linear regression model to generate a first line corresponding to the key-value pairs, the processing of training includes training the first linear regression model with the key-value pairs and corresponding addresses, the key-value pairs and corresponding addresses include the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair; and the processing circuit is further configured to: determine that a difference between the approximate address of the first key-value pair based on the first line and the address of the first key-value pair exceeds a threshold; and train a second linear regression model to generate a second line corresponding to a first subset of the key-value pairs, the processing of training includes training the second linear regression model with the first subset of the key-value pairs.
[0024] In some embodiments, the threshold is a difference between the address of the first key-value pair and a page boundary; and the processing circuit is further configured to: receive a command to access a key-value pair of the two or more key-value pairs, and determine that the key-value pair is in the first subset.
[0025] In some embodiments, the processing circuit is further configured to: determine the approximate address of the key-value pair based on the second line.
[0026] According to embodiments of the present disclosure, there is provided a key-value persistent storage apparatus, comprising: a persistent storage device; a buffer; and means for processing configured to: sort two or more key-value pairs to form a sorted set of key-value pairs; determine an address of a first key-value pair of the key-value pairs, the first key-value pair comprising a first key and a first value; determine an address of a second key-value pair of the key-value pairs, the second key-value pair comprising a second key and a second value; and construct a model based on the first key-value pair, the address of the first key-value pair, the second key-value pair, and the address of the second key-value pair. BRIEF DESCRIPTION OF DRAWINGS
[0027] These and other features and advantages of the present disclosure will be appreciated and understood by reference to the following specification, claims, and drawings.
[0028] Figure 1 is a hybrid block diagram and flow chart of a host and a key-value persistent storage apparatus according to embodiments of the present disclosure;
[0029] Figure 2 is a data flow diagram illustrating various key-value operations according to embodiments of the present disclosure;
[0030] Figure 3 is a hybrid block diagram and flow chart illustrating operations of a key-value persistent storage apparatus according to embodiments of the present disclosure;
[0031] Figure 4 is a block diagram of a recursive model index according to embodiments of the present disclosure;
[0032] Figure 5A is a flowchart of a method for constructing a recursive model index according to embodiments of the present disclosure;
[0033] Figure 5B is a flowchart of a method for performing a Put operation according to embodiments of the present disclosure;
[0034] Figure 5C is a flowchart of a method for performing a Get operation according to embodiments of the present disclosure;
[0035] Figure 5D is a flowchart of a method for performing an Update operation according to embodiments of the present disclosure;
[0036] Figure 5E is a flowchart of a method for performing a Delete operation according to embodiments of the present disclosure;
[0037] Figure 6 is a table of factors for determining whether to move data to a recursive index’s storage device according to embodiments of the present disclosure;
[0038] Figure 7 is a block diagram of a host and a key-value persistent storage device according to embodiments of the present disclosure; and
[0039] Figure 8 is a flowchart of a method for constructing a recursive model index according to embodiments of the present disclosure, including a portion of the method that trains a recursive model index to generate a fitted line corresponding to a set of key-value pairs. DETAILED DESCRIPTION
[0040] The detailed description set forth below, in connection with the appended drawings, is intended as a description of exemplary embodiments of a two-level index system for key-value persistent storage devices provided in accordance with the present disclosure and is not intended to represent the only forms in which the present disclosure can be constructed or utilized. The description sets forth the features of the present disclosure in connection with the illustrated embodiments. It is to be understood, however, that the same or equivalent features can be incorporated in different embodiments which are also intended to be encompassed within the scope of the disclosure. Where the same or similar reference numerals are used throughout the drawings and specification, it is intended to refer to the same or like parts throughout the description of the drawings and the specification.
[0041] Key-value persistent storage devices, such as key-value solid state drives (SSDs), have various uses for data storage in, for example, server systems. In such storage devices, data can be stored as values, each value identified by a respective key, and a host using the key-value persistent storage device can, for example, send a read request (or "Get command") that includes a key, the key identifying a value to be read from the storage. Key-value persistent storage devices can include persistent storage (e.g., flash memory organized into blocks (the smallest unit that can be erased) and pages (the smallest unit that can be read or written)) and a buffer (e.g., dynamic random access memory (DRAM)). In operation, a hash table can be stored in the buffer for faster operations. The hash table can include each key and a pointer to the location of the corresponding value in the persistent storage. If the keys are large (e.g., greater than 255 bytes), the hash table can not fit in the buffer, forcing the buffer to exchange expensively with the data stored in the persistent storage. Accordingly, some key-value persistent storage devices limit the maximum key size that can be allowed, which can be an inconvenient constraint for some users or applications.
[0042] As such, in some embodiments, the size of the hash table of a key-value persistent storage device can be reduced by moving some key-value pairs to one or more separately maintained pools of storage, referred to herein as "recursive index storage." Referring to Figure 1 When a new key-value pair is to be written to the key-value persistent storage device, the host 105 can make a request to the request handler 110, which can forward the key 115 to the key-value persistent storage device. In the key-value persistent storage device, the key and the corresponding value can first be indexed using the hash table 120, and the key and value can be saved in the persistent storage 125 (e.g., flash memory).
[0043] During a data movement operation (such as a wear leveling operation, a garbage collection operation, or a data movement operation to avoid unrecoverable read disturb errors) (for blocks storing key-value pairs indexed using a hash table), long-lived key-value pairs can be identified as, for example, key-value pairs that remain unchanged for a long time or key-value pairs that remain valid in a block for which garbage collection is being performed. This identification can be performed, for example, by a data movement circuit or method (e.g., a garbage collector or a wear leveling circuit or method) that is aware of the availability of the recursive index storage (in the case of a garbage collector, which can be referred to as an "RMI-aware garbage collector" 130). As discussed in further detail below, such key-value pairs can be moved to the recursive index storage by a recursive model indexing circuit (RMI circuit) 135.
[0044] Figure 2 It is shown that a key-value persistent storage device can include a hash table 120, a persistent storage 125, a buffer 140, a request handler 110, a recursive index storage 150, and a recursive model indexing circuit (RMI circuit) 135.Figure 1 The operations performed by the system of FIG. 1 are summarized in FIG. 2. When a Put operation is performed by the host 105 at 205, the hash table 120 can be used to store keys and pointers to associated values. As described above, the RMI-aware garbage collector 130 can identify some of the key-value pairs (as candidates for moving) when performing garbage collection and move them to the recursive index storage 210. In some embodiments, the set of key-value pairs can alternatively be identified and moved by the RMI-aware circuitry for wear leveling or by the RMI-aware circuitry for performing data movement operations to avoid unrecoverable read disturb errors. When a GET operation is performed at 215, the key can be looked up in the hash table 120; if the key exists (i.e., a hash table hit occurs, at 220), the value can be returned based on the pointer to the value stored in the hash table 120. If the key does not exist (i.e., a hash table miss occurs, at 225), the key can alternatively be looked up in the recursive index storage 210 (as discussed in further detail below).
[0045] The recursive model index can be generated as follows. Referring to Figure 3 , the garbage collection 305 (performed by the RMI-aware garbage collector 130) can identify a set of key-value pairs to be stored in the recursive index storage 210. As described above, in some embodiments, the set of key-value pairs can alternatively be identified by the RMI-aware circuitry for wear leveling or by the RMI-aware circuitry for performing data movement operations to avoid unrecoverable read disturb errors. At 310, the key-value pairs can be sorted in order of their keys to form a sorted set of key-value pairs, and the sorted set of key-value pairs can be stored in the persistent storage 125 in that order. Once all key-value pairs have been stored, a storage location (or address) can be associated with each key, the address specifying where the key-value pair was stored in the persistent storage 125 (e.g., a first address at which a first key-value pair was stored (which can be a plurality of addresses spanning a storage region occupied by the key-value pair)). In this way, the keys and corresponding storage locations form a set of ordered pairs, which can be referred to as a “storage map.” Then, at 315, the recursive model index (RMI) can be constructed, e.g., a linear regression (LR) model can be trained with the key-value pairs and corresponding addresses; as shown, this can involve training a linear regression (LR) model with the keys as input and the storage locations (or addresses) as output. In some embodiments, the model is expected to only predict the location of a key that was part of the model fitting process, or the absence of a key (e.g., if the page corresponding to the key is identified by the model as not containing the key). However, it should be understood that step 310 is not necessary. For example, step 315 can be performed without performing step 310.
[0046] For example, an RMI can be constructed based on a memory mapping as follows. The recursive model index can be a multi-stage or "multi-level" model tree that can be traversed for any key in the memory mapping to find an approximate address of that key. As used herein, an "approximate address" of a key is the address that identifies the page containing the key-value pair (e.g., the address in the same page as the key-value pair, or the address that differs from the key-value pair's address by less than a threshold (e.g., the difference between the key-value pair's address and the page boundary), where the page boundary represents the range boundary of addresses within a page). Thus, the approximate address is sufficient to read the first portion of the key-value pair from persistent storage 125 (without having to perform additional read operations from persistent storage 125 to find the key-value pair); once the page containing the key-value pair has been read into the buffer of the persistent key-value storage device, the first portion of the key-value pair can be found by searching the memory buffer. In some embodiments, a delimiter (a reserved sequence of bits that may be long enough (e.g., at least 80 bits, or at least 128 bits, or at least 256 bits) to make its occurrence by random chance acceptable) is used to mark the beginning of each key-value pair in the storage device.
[0047] An RMI may include one or more internal nodes and one or more external nodes. In operation, each internal node may receive a key and map each key to another node in the next level of the tree (e.g., if the internal node is in the second level, it may map each key to a corresponding node in the third level). In operation, each external node may receive a key and map each key to a corresponding approximate address. Each external node may include a linear regression model (e.g., a function of a straight line of the form y = ax + b), which returns an approximate address as the value of y given a key (as the value of x) (e.g., the approximate address can be computed by multiplying the key by a factor (e.g., by factor a) and adding it to an offset (e.g., by offset b) (where a and b are based on the slope and offset of a first line)). The linear regression model can be trained by fitting a function to a subset of the memory map. The RMI can be constructed by: (i) fitting a first straight line to the entire memory map and then computeing a measure of how well the resulting line fits the memory map. If the fit is good enough (e.g., if it successfully computes an approximate address for each key in the storage map), the construction of the RMI can terminate, and the RMI can consist of a single external node. The first line (in this example, the RMI) can then be used to find an approximate address for any key in the storage map.
[0048] Figure 4 The diagram illustrates a two-level RMI for memory mapping. Typically, if the first straight line is insufficient to fit the memory mapping well (e.g., ...), ... Figure 4As with the case of a storage mapping, if the difference between the approximate address of the key determined based on the first straight line and the address of the key exceeds a threshold, then the first node 405 (the root node of the tree) can become an internal node. The storage mapping is divided into contiguous subsets 410 of keys (e.g., uniformly divided such that each subset contains almost the same number of keys), and a corresponding linear regression model can be trained for each subset 410. This process in Figure 4 The diagram shows a graph of the storage mapping at the root node 405 of the tree, where the keys are on the horizontal axis and the addresses are on the vertical axis. This graph shows that it cannot be well fitted to a straight line and has therefore been divided into multiple (in...) Figure 4 In the example, storage mapping for eight subsets. As shown, each subset is assigned to a node in the second level of the tree. In each second-level node 415, a corresponding linear regression model is trained and tested to evaluate whether it is good enough (e.g., whether it successfully computes an approximate address for each key in subset 410). As shown, each second-level node 415 with a sufficiently good linear regression model becomes an external node and is used in operation to map keys to approximate addresses (e.g., to page 420). In one embodiment, the approximate address of a key-value pair (e.g., the key-value pair included in the subset) can be determined based on a trained linear regression model (e.g., a linear regression model trained with a subset of key-value pairs). Figure 4 In the example, all second-level nodes are external nodes. In other examples, some or all of the second-level nodes may be internal nodes (because a linear fit to their respective subsets of storage maps cannot produce an acceptable approximate address), and a third level (and possibly one or more additional levels beyond the third level) may exist.
[0049] When persistent storage device 125 is flash memory, the recursive index storage device can occupy multiple blocks within persistent storage device 125, and a separate RMI can be constructed for each block. When a key is to be looked up in the recursive index storage device, a coarse lookup table can be used to determine which block the key and value are stored in, and then the RMI of that block can be used to identify the page in which the key and value (or a first part of the key and value) are stored. The structure of the recursive model index allows it to avoid holding a large number of keys in the buffer of the key-value persistent storage device; instead, the recursive model index can use only a set of key boundaries (key values at the boundaries between subsets of keys) for each internal node, and a factor (a) and offset (b) that define the line of the linear regression model for each external node. In this way, the keys can be relatively large; for example, the size of each key can be as high as a value between 100 bytes and 1 MB (e.g., up to 100 kB).
[0050] Figure 5AA flowchart for constructing an RMI is shown. At 502, if it is determined that the buffer of the key-value persistent storage device is full, persistent storage device 125 is full, or a scheduled garbage collection is about to run, then at 504, the RMI-aware garbage collector 130 runs, identifying a set of key-value pairs for storage in the recursive indexed storage device. As described above, in some embodiments, the set of key-value pairs may alternatively be identified by RMI-aware circuitry for wear leveling or by RMI-aware circuitry for performing data movement operations to avoid unrecoverable read interference errors. At 506, the key-value pairs are sorted to form a sorted set of key-value pairs, and at 508, the sorted set of key-value pairs is stored in persistent storage device 125. At 510, an RMI model is then constructed (e.g., based on...). Figure 4 The method shown in the diagram and described in the accompanying text, at 512, deletes the hash table entries of the key-value pairs stored in the recursive index storage device. However, it should be understood that steps 506 and 508 are not mandatory. For example, step 510 can be performed directly without performing step 506, and / or step 510 can be performed directly without performing step 508 (e.g., the persistent storage device 125 already stores the set of key-value pairs).
[0051] Figure 5B Methods for performing a placement operation are shown in some embodiments. At 516, input (i / p) is received from host 105 (e.g., placement commands and key-value pairs ("..."). <k:v>)) and at 518, the input (i / p) is initially accepted and queued by the request handler 110 for execution. The request handler 110 identifies the operation to be performed from the command header 520 and stores the key in the hash table 120 along with a pointer to the value and at 524, the value is stored in the persistent storage 125.
[0052] Figure 5C A method for performing a get operation in some embodiments is shown. At 516, input (i / p) from a host (e.g., a get command and a key ("K")) is received and at 518, the input (i / p) is initially accepted and queued by the request handler 110 for execution. The request handler 110 identifies the operation to be performed from the command header 520 and checks for the existence of the key in the hash table 120. If the key exists in the hash table 120, as determined at 526, then at 528, the value is read from the persistent storage 125 and returned to the host 105. If the key does not exist in the hash table 120, then at 530, the storage address is looked up in the recursive index storage and at 532, the value is read from the persistent storage 125 and returned to the host 105.
[0053] Figure 5D A method for performing an update operation in some embodiments is shown. At 516, input (i / p) from a host 105 (e.g., an update command and a key value pair ("K", "V")) is received and at 518, the input (i / p) is initially accepted and queued by the request handler 110 for execution. The request handler 110 identifies the operation to be performed from the command header 520 and checks for the existence of the key in the hash table 120. If the key exists in the hash table 120, as determined at 526, then at 528, the value is read from the persistent storage 125 and returned to the host 105. If the key does not exist in the hash table 120, then at 530, the storage address is looked up in the recursive index storage and at 532, the value is read from the persistent storage 125 and returned to the host 105. <k:v>At 518, the request handler 110 initially accepts and queues the input (I / P) application for execution. The request handler 110 identifies the operation to be performed from the command header 520 and checks for the existence of the key in hash table 120. As determined at 526, if the key exists in hash table 120, then at 534, hash table 120 is updated with the new address of the value, and at 536, the updated value is saved to persistent storage device 125. If the key does not exist in hash table 120, then at 538, a place operation is performed. The absence of the key in hash table 120 may mean that the key-value pair is stored in a recursive indexed storage device. In some embodiments, the old value may remain in the recursive indexed storage device after the place operation; the presence of the old value in the recursive indexed storage device may be harmless because a subsequent retrieval operation will cause hash table 120 to be checked first, and the key will be found there, so that the old value will not be retrieved from recursive indexed storage device 210.
[0054] Figure 5E Methods for performing a deletion operation are shown in some embodiments. At 516, input (i / p) (e.g., a delete command and a key ("K")) is received from the host, and at 518, the input (i / p) is initially accepted and queued by the request handler 110 for execution. The request handler 110 identifies the operation to be performed from the command header 520 and checks for the existence of the key in the hash table 120. As determined at 526, if the key exists in the hash table 120, then at 540, the value is invalidated in the hash table and from the persistent storage device 125. If the key does not exist in the hash table 120, then at 530, the storage address is looked up in the recursive index storage device, and at 542, the value is invalidated in the persistent storage device 125.
[0055] In some embodiments, the RMI-aware garbage collector 130 may employ various factors to identify blocks in which garbage collection will be performed (e.g., blocks that will be erased after any valid data has been moved). Similarly, in some embodiments, RMI-aware circuitry for wear leveling or for performing data movement operations to avoid unrecoverable read interference errors may employ the same or similar factors to identify blocks from which data will be moved. These factors may include, for example, the number of invalid keys in the block, average key size, and device memory pressure (e.g., the fraction of the currently used storage device buffer). Another factor may be an "access frequency factor," the value of which may be based on... Figure 6 The table is used to set the key-value pairs. For example, key-value pairs can be: (i) "hot" or "cold" for read operations (e.g., they may be read frequently or infrequently), (ii) "hot" or "cold" for update or delete operations (e.g., they may be updated or deleted frequently or infrequently), and (iii) "hot" or "cold" for write operations (e.g., they may be written frequently or infrequently). Figure 6 The representation suggests that key-value pairs that are "hot" for updates and deletions may be better candidates for storage in recursive indexed storage. This preference may be part of the motivation to use garbage collection as an opportunity to move key-value pairs to recursive indexed storage because key-value pairs that remain valid in a block when garbage collection is performed tend to be longer-lived than other key-value pairs written to the same block. This preference, as an opportunity to move long-lived key-value pairs to recursive indexed storage, similarly promotes the operation of RMI-aware circuitry for wear leveling or for performing data movement operations to avoid unrecoverable read interference errors because such circuitry can sense long-lived key-value pairs as part of its normal function.
[0056] Figure 7 This is a block diagram of a host 705 and a storage device 710 (which may be a key-value persistent storage device). The storage device 710 may have a form factor as any of a plurality of form factors suitable for persistent storage devices, including but not limited to 2.5”, 1.8”, MO-297, MO-300, M.2, and Enterprise and Data Center SSD form factor (EDSFF). The storage device 710 may have an electrical interface through which it can be connected to the host 705, which is any of a plurality of interfaces suitable for persistent storage devices, including Peripheral Component Interconnect (PCI), PCIe, Ethernet, Small Computer System Interface (SCSI), Serial AT Attachment (SATA), and Serial Attached SCSI (SAS). Each of the host 705 and the storage device 710 may include processing circuitry 715 (discussed in further detail below). The storage device 710 may also include persistent storage medium 720 (e.g., NAND flash memory). The processing circuitry 715 of the storage device 710 may perform (and the storage device 710 may perform using the processing circuitry 715 contained in the storage device 710) some or all of the methods described herein. Figure 8 is a flowchart of a method that includes: at 805, sorting two or more key-value pairs to form a sorted set of key-value pairs; at 810, determining an address of a first key-value pair of the key-value pairs, the first key-value pair including a first key and a first value; at 815, determining an address of a second key-value pair of the key-value pairs, the second key-value pair including a second key and a second value; and at 820, training a first linear regression model to generate a first line corresponding to the key-value pairs, the training including training the first linear regression model with the key-value pairs including the first key-value pair and the second key-value pair. However, it is understood that step 805 is not necessarily required. For example, step 820 can be performed directly without performing step 805.
[0057] As used herein, a "portion" of something means "at least some" of that thing, and as such can mean less than all of the thing or all of the thing. As such, as a special case, a "portion" of a thing includes the entire thing (i.e., the entire thing is an example of a portion of the thing). As used herein, a "subset" of a set is the set or a proper subset of the set. As used herein, when a second quantity is "Y within" a first quantity X, it means that the second quantity is at least X-Y, and the second quantity is at most X+Y. As used herein, when a second quantity is "Y% within" a first quantity, it means that the second quantity is at least (1-Y / 100) times the first quantity, and the second quantity is at most (1+Y / 100) times the first quantity. As used herein, the term "or" should be interpreted as "and / or," such that, for example, "A or B" means "A" or "B" or "A and B."
[0058] The background provided in the Background section of this disclosure is included solely for setting context and the content of this section is not to be acknowledged as prior art. Any component or any combination of components (e.g., in any system diagram included herein) can be used to perform one or more of the operations of any flowchart included herein. Moreover, (i) the operations are example operations and can involve various additional steps not explicitly covered, and (ii) the temporal ordering of the operations can be changed.
[0059] The methods disclosed herein can be performed by one or more processing circuits; for example, the RMI circuit 135 can be a processing circuit, or a part of, or include, a processing circuit. The term "processing circuit" is used herein to refer to any combination of hardware, firmware, and software that is employed to process data or digital signals. The processing circuit hardware can include, for example, an application specific integrated circuit (ASIC), a general purpose or special purpose central processing unit (CPU), a digital signal processor (DSP), a graphics processing unit (GPU), and programmable logic devices such as field programmable gate arrays (FPGAs). In a processing circuit, as used herein, each function is performed by hardware configured (i.e., hardwired) to perform that function, or by general purpose hardware (e.g., a CPU) configured to execute instructions stored in a non-transitory storage medium. The processing circuit can be fabricated on a single printed circuit board (PCB) or distributed among several interconnected PCBs. The processing circuit can contain other processing circuits; for example, the processing circuit can include two processing circuits interconnected on a PCB, such as an FPGA and a CPU.
[0060] As used herein, when a method (e.g., adjusting) or a first quantity (e.g., a first variable) is referred to as being "based on" a second quantity (e.g., a second variable), it is meant that the second quantity is an input to the method or influences the first quantity, e.g., the second quantity can be an input (e.g., the only input or one of several inputs) to a function from which the first quantity is calculated, or the first quantity can be equal to the second quantity, or the first quantity can be the same as the second quantity (e.g., stored in the same location or locations in memory) as the second quantity.
[0061] It will be understood that, although the terms "first", "second", "third", etc. can be used herein to describe various elements, components, regions, layers and / or sections, these elements, components, regions, layers and / or sections should not be limited by these terms. These terms are only used to distinguish one element, component, region, layer or section from another element, component, region, layer or section. Thus, a first element, a first component, a first region, a first layer or a first section discussed herein could be termed a second element, a second component, a second region, a second layer or a second section without departing from the spirit and scope of the inventive concept.
[0062] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the inventive concept. As used herein, the terms "substantially", "approximately" and similar terms are used as terms of approximation and not as terms of degree, and are intended to account for the inherent deviations in measured or calculated values that would be recognized by those of ordinary skill in the art.
[0063] As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising", when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. Expressions such as "at least one of," when preceding a list of two or more items, cover all of the individual items in the list, as well as any carbinations of the individual items. Furthermore, the use of the term "about" in describing the embodiments of the inventive concept is intended to mean that quantities, dimensions, values, and other parameters are not to be taken exactly, but are to be taken approximately. Moreover, the term "exemplary" is intended to mean an example or illustration. As used herein, the terms "use", "using", and "used" can be taken in their broadest possible context as being synonymous with the terms "utilizing", "utilizing", and "utilized", respectively.
[0064] It will be understood that when an element or layer is referred to as being "on", "connected to", "coupled to", "adjacent to", another element or layer, it can be directly on, directly connected to, directly coupled to, adjacent to, or intervening elements or layers can be present. In contrast, when an element or layer is referred to as being "directly on", "directly connected to", "directly coupled to", "adjacent to" another element or layer, there are no intervening elements or layers present.
[0065] Any numerical range recited herein is intended to include all sub-ranges of the same numerical precision subsumed within the recited range. For example, a range of "1.0 to 10.0" or "1.0 to 10.0" is intended to include all sub-ranges, e.g., 2.4 to 7.6, between and including the recited minimum and maximum values, and, in this example, is intended to cover "1.0 to 3.0", "3.0 to 4.0", "4.0 to 5.0", "5.0 to 6.0", "6.0 to 7.0", "7.0 to 8.0", "8.0 to 9.0", "9.0 to 10.0", "1.0 to 2.4", "2.4 to 3.0", "3.0 to 4.0", "4.0 to 5.0", "5.0 to 6.0", "6.0 to 7.0", "7.0 to 8.0", "8.0 to 9.0", "9.0 to 10.0", "1.0 to 2.0", "2.0 to 3.0", "3.0 to 4.0", "4.0 to 5.0", "5.0 to 6.0", "6.0 to 7.0", "7.0 to 8.0", "8.0 to 9.0", "9.0 to 10.0", "1.0 to 3.0", "3.0 to 5.0", "5.0 to 7.0", "7.0 to 9.0", and "1.0 to 10.0". Any maximum numerical limitation recited herein is intended to include all lower numerical limitations subsumed therein. Any minimum numerical limitation recited herein is intended to include all higher numerical limitations subsumed therein.
[0066] While example embodiments of a two-level index system for a key-value persistent storage device have been particularly described and shown herein, many modifications and variations will be apparent to those skilled in the art. Accordingly, it is to be understood that a two-level index system for a key-value persistent storage device constructed in accordance with the principles of the present disclosure can be embodied in a form other than that specifically described herein. The application is also defined in the following claims, and equivalents thereof.< / k:v> < / k:v>
Claims
1. A method for a key-value persistent storage device, comprising: Move two or more key-value pairs from the hash table index stored in the buffer of the key-value persistent storage device to the recursive index storage device; Sort the two or more key-value pairs to form a sorted set of key-value pairs; Determine the first address of the first key-value pair in the sorted key-value pair set, where the first key-value pair includes the first key and the first value; Determine the second address of the second key-value pair in the sorted set of key-value pairs, where the second key-value pair includes the second key and the second value; The machine learning model is trained using the first key-value pair, the first address of the first key-value pair, the second key-value pair, and the second address of the second key-value pair. Delete the hash table entries for key-value pairs stored in the recursive index storage device; Provide the input keys to the trained machine learning model; The third address is determined based on the input key using a trained machine learning model; Store the third key-value pair in the third address.
2. The method according to claim 1, further comprising: Performing a data movement operation within a block of a key-value persistent storage device, the steps of which include identifying the two or more key-value pairs.
3. The method according to claim 2, wherein, Data movement is a loss leveling operation.
4. The method according to claim 1, further comprising: The sorted set of key-value pairs is stored in a storage area, wherein the step of determining the first address of the first key-value pair includes determining the first address where the first key-value pair is stored.
5. The method according to claim 1, wherein, The steps of training a machine learning model using a first key-value pair, a first address of the first key-value pair, a second key-value pair, and a second address of the second key-value pair include: training a first linear regression model to generate a first line based on the first key-value pair, the first address of the first key-value pair, the second key-value pair, and the second address of the second key-value pair.
6. The method according to claim 5, wherein, The step of determining the third address of the third key-value pair includes multiplying the input key by a factor and adding it to an offset, the factor and the offset being based on the slope and offset of the first line.
7. The method according to claim 1, wherein, The steps of training a machine learning model using a first key-value pair, a first address of the first key-value pair, a second key-value pair, and a second address of the second key-value pair include: training a first linear regression model to generate a first line based on the first key-value pair, the first address of the first key-value pair, the second key-value pair, and the second address of the second key-value pair, wherein the third address of a third key-value pair is determined based on the first line, the method further includes: The difference between the third address of the third key-value pair determined by the machine learning model and the actual address of the third key-value pair exceeds a threshold. In response to determining that the difference exceeds a threshold, a second linear regression model is trained to generate a second line based on a first subset of the sorted set of key-value pairs.
8. The method according to claim 7, wherein, The threshold is the difference between the actual address of the third key-value pair and the page boundary.
9. The method according to claim 8, further comprising: Receive commands for accessing the fourth key-value pair, and The fourth key-value pair is determined to be in the first subset.
10. The method of claim 9, further comprising: The fourth address of the fourth key-value pair is determined based on the second line.
11. The method of claim 10, further comprising: A page is read from persistent storage, and the fourth address of the fourth key-value pair is located within that page.
12. A key-value persistent storage device, comprising: Persistent storage devices; A buffer used to store hash tables; as well as The processing circuit is configured as follows: Move two or more key-value pairs that use a hash table index to the recursive index storage device; Sort the two or more key-value pairs to form a sorted set of key-value pairs; Determine the first address of the first key-value pair in the sorted key-value pair set, where the first key-value pair includes the first key and the first value; Determine the second address of the second key-value pair in the sorted set of key-value pairs, where the second key-value pair includes the second key and the second value; The machine learning model is trained using the first key-value pair, the first address of the first key-value pair, the second key-value pair, and the second address of the second key-value pair. Delete the hash table entries for key-value pairs stored in the recursive index storage device; Provide the input keys to the trained machine learning model; The third address is determined based on the input key using a trained machine learning model; Store the third key-value pair in the third address.
13. The key-value persistent storage device according to claim 12, wherein, The processing circuitry is also configured to perform a data movement operation within a block of the key-value persistent storage device, wherein the process of performing the data movement operation includes identifying the two or more key-value pairs.
14. The key-value persistent storage device according to claim 13, wherein, Data movement is a loss leveling operation.
15. The key-value persistent storage device according to claim 12, wherein, The processing circuit is also configured to store the sorted set of key-value pairs in a storage area, wherein the process of determining the first address of the first key-value pair includes determining the first address where the first key-value pair is stored.
16. The key-value persistent storage device according to claim 12, wherein, The processing circuitry is configured to train a machine learning model, including: the processing circuitry is configured to construct a first linear regression model to generate a first line based on a first key-value pair, a first address of the first key-value pair, a second key-value pair, and a second address of the second key-value pair.
17. The key-value persistent storage device according to claim 16, wherein, The processing circuitry is configured to determine the third address of the third key-value pair, which includes multiplying the input key by a factor and adding an offset, the factor and the offset being based on the slope and offset of the first line.
18. The key-value persistent storage device according to claim 12, wherein, The processing circuitry is configured to train a machine learning model using a first key-value pair, a first address of the first key-value pair, a second key-value pair, and a second address of the second key-value pair. This processing includes: the processing circuitry is configured to train a first linear regression model to generate a first line based on the first key-value pair, the first address of the first key-value pair, the second key-value pair, and the second address of the second key-value pair; wherein the processing circuitry is configured to determine a third address of a third key-value pair, the processing circuitry is configured to determine the third address of the third key-value pair based on the first line. The processing circuit is also configured as follows: The difference between the third address of the third key-value pair determined by the machine learning model and the actual address of the third key-value pair exceeds a threshold. In response to the processing circuit being configured to determine that the difference exceeds a threshold, a second linear regression model is trained to generate a second line based on a first subset of the key-value pair set.
19. The key-value persistent storage device according to claim 18, wherein, The threshold is the difference between the actual address of the third key-value pair and the page boundary. The processing circuit is also configured as follows: Receive commands for accessing the fourth key-value pair, and The fourth key-value pair is determined to be in the first subset.
20. A key-value persistent storage device, comprising: Persistent storage devices; A buffer used to store hash tables; as well as The device for processing is configured as follows: Move two or more key-value pairs that use a hash table index to the recursive index storage device; Sort the two or more key-value pairs to form a sorted set of key-value pairs; Determine the first address of the first key-value pair in the sorted key-value pair set, where the first key-value pair includes the first key and the first value; Determine the second address of the second key-value pair in the sorted set of key-value pairs, where the second key-value pair includes the second key and the second value; The machine learning model is trained using the first key-value pair, the first address of the first key-value pair, the second key-value pair, and the second address of the second key-value pair. Delete the hash table entries for key-value pairs stored in the recursive index storage device; Provide the input keys to the trained machine learning model; The third address is determined based on the input key using a trained machine learning model; Store the third key-value pair in the third address.
Citation Information
Patent Citations
Data storage method based on learning index
CN113722319A