Address conversion method and system for KV storage device
Through the combination of multi-layer hash table and conflict table, the problem of hash key conflict and length matching recognition in KV storage devices is solved, efficient key-value mapping and conflict processing are achieved, and the reading and writing of KV storage devices is improved. Operational efficiency.
Patent Information
- Application Number
- CN201711392529.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-12-21
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2037-12-21
AI Technical Summary
The existing KV storage devices have problems such as hash key conflict and length matching recognition during address conversion, resulting in inefficient read and write operations.
Using a combination scheme of multi-layer hash table and conflict table, the multi-part index query of hash keys can be used to efficiently map and conflict processing of key values, reduce the chance of hash key conflict, and optimize matching recognition through length comparison.
It improves the read and write operation efficiency of KV storage devices, reduces hash key conflicts and length matching errors, and improves the accuracy and efficiency of data access.
Smart Images

Figure CN109947669B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a KV storage device, and in particular, to an address conversion method and system for a KV storage device. Background Art
[0002] Figure 1A The block diagram of the solid-state storage device is shown. The solid-state storage device 102 is coupled to the host to provide storage capacity for the host. The host and the solid-state storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the solid-state storage device 102 through, for example, SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIE (Peripheral Component Interconnect Express, PCIe), NVMe (NVM Express), Ethernet, Fiber Channel, wireless communication network, etc. The host can be an information processing device that can communicate with the storage device in the above manner, such as a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103 , a control component 104 , one or more NVM chips 105 , and a DRAM (Dynamic Random Access Memory) 110 .
[0003] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory) and the like are common NVMs.
[0004] The interface 103 may be adapted to exchange data with the host via, for example, SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, Fibre Channel, etc.
[0005] The control component 104 is used to control data transmission between the interface 103, the NVM chip 105 and the DRAM 110, and is also used for storage management, mapping of host logical addresses to flash physical addresses, erase leveling, bad block management, etc. The control component 104 can be implemented in a variety of ways, such as software, hardware, firmware, or a combination thereof. For example, the control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof. The control component 104 can also include a processor or a controller, in which software is executed to manipulate the hardware of the control component 104 to process IO (Input / Output) commands. The control component 104 can also be coupled to the DRAM 110 and can access the data of the DRAM 110. The FTL table and / or the data of the cached IO commands can be stored in the DRAM.
[0006] The control component 104 includes a flash memory interface controller (or medium interface controller, flash memory channel controller), which is coupled to the NVM chip 105 and issues commands to the NVM chip 105 in a manner that complies with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives command execution results output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI" and the like.
[0007] A memory target is one or more logic units (LUNs) within a NAND flash package that share a CE (Chip Enable) signal. A NAND flash package may include one or more dies. Typically, a logic unit corresponds to a single die. A logic unit may include multiple planes. Multiple planes within a logic unit can be accessed in parallel, and multiple logic units within a NAND flash chip can execute commands and report status independently of each other.
[0008] Data is usually stored and read on a storage medium in pages. Data is erased in blocks. A block (also called a physical block) contains multiple pages. A block contains multiple pages. A page on a storage medium (called a physical page) has a fixed size, such as 17664 bytes. A physical page can also have other sizes.
[0009] In a solid-state storage device, the FTL (Flash Translation Layer) is used to maintain the mapping information from the logical address to the physical address. The logical address constitutes the storage space of the solid-state storage device perceived by the upper-layer software such as the operating system. The physical address is the address used to access the physical storage unit of the solid-state storage device. In the related art, the address mapping can also be implemented using the intermediate address form. For example, the logical address is mapped to the intermediate address, and then the intermediate address is further mapped to the physical address.
[0010] The table structure that stores the mapping information from logical addresses to physical addresses is called an FTL table. The FTL table is an important metadata in a solid-state storage device. Usually, the data items of the FTL table record the address mapping relationship in units of data pages in the solid-state storage device.
[0011] The FTL table includes multiple FTL table entries (or table items). In one case, each FTL table entry records the correspondence between a logical page address and a physical page. In another case, each FTL table entry records the correspondence between multiple consecutive logical page addresses and multiple consecutive physical pages. In another case, each FTL table entry records the correspondence between a logical block address and a physical block address. In still another case, the FTL table records the mapping relationship between the logical block address and the physical block address, and / or the mapping relationship between the logical page address and the physical page address.
[0012] An improved FTL table method and its application in a solid-state storage device are disclosed in “DFTL: A Flash Translation Layer Employing Demand-based Selective Caching of Page-level Address Mappings”, the full text of which can be obtained from http: / / www.cse.psu.edu / ~buu1 / papers / ps / dftl-asplos09.pdf.
[0013] A storage device that supports the Key-Value (key-data, also referred to as "KV") storage model provides key-based read operations (Get(Key)) and write operations (Put(Key,Value)). To perform a write operation, the host provides the key (Key) and data (Value) to the storage device to write the data to the storage device, and uses the key as the index of the written data. To perform a read operation, the host provides the key to the storage device, the storage device finds the data based on the key, and provides the data to the host. Therefore, in a KV storage system, the key is an index used to access data, and the data (Value) is the data being accessed. Generally, the length of the key and the data is not fixed. And optionally, in order to reduce complexity, the length of the key and / or the data may have a specified range.
[0014] Figure 1B A schematic diagram of an address translation system of a solid-state storage device of the prior art is shown. The address translation system (also referred to as an FTL table) of a solid-state storage device supporting a KV storage model provides a mapping from a hash value obtained from a key (recorded as a hash key) to a physical address (e.g., PPA, Physical Page Address). Optionally, in addition to the physical page address, the physical address recorded in the FTL table may be the starting address of a data frame within a physical page. A data frame is a data unit of a fixed size, and a physical page includes one or more data frames.
[0015] The length of the key provided by the host is indefinite, and the length of the data is also indefinite. The indefinite-length key is hashed to obtain a fixed-length hash key (for example, 4 bytes / 8 bytes) as the index of the FTL table. The hash key is used as the index to query the FTL table and obtain the corresponding physical address. The FTL table can be implemented by various data structures such as arrays, linked lists, and trees. Summary of the invention
[0016] The purpose of this application includes providing a data access method based on a KV model and a solid-state storage device thereof.
[0017] According to the first aspect of the present application, a first method for KV read operation according to the first aspect of the present application is provided, including: obtaining a key (K) accessed by the read operation; performing a hash calculation on the key to obtain a hash key (HK); querying a first hash table according to the first part (HK1) of the hash key; if the entry corresponding to the first part (HK1) of the hash key in the first hash table records the physical address of the value (V) to be accessed by the storage read operation, reading first data from a storage medium according to the physical address.
[0018] According to the first method for KV read operation according to the first aspect of the present application, a second method for KV read operation according to the first aspect of the present application is provided, further comprising: if the entry corresponding to the first part (HK1) of the hash key in the first hash table records the address of the second hash table, querying the second hash table according to the second part (HK2) of the hash key.
[0019] According to the first or second method for KV read operation of the first aspect of the present application, a third method for KV read operation according to the first aspect of the present application is provided, further comprising: if the first part (HK1) of the hash key has no corresponding entry in the first hash table, indicating that the key accessed by the read operation does not exist.
[0020] According to one of the first to third methods for KV read operations according to the first aspect of the present application, a fourth method for KV read operations according to the first aspect of the present application is provided, wherein the length of the first part (HK1) of the hash key is smaller than the hash key (HK); and the length of the second part (HK1) of the hash key is smaller than the hash key (HK).
[0021] According to one of the first to fourth methods for KV read operations according to the first aspect of the present application, a fifth method for KV read operations according to the first aspect of the present application is provided, which also includes: obtaining a first key (Kp) from the first data, and if the first key (Kp) matches the key (K), responding to the read operation with a value (V) obtained from the first data.
[0022] According to the fifth method for KV read operation of the first aspect of the present application, a sixth method for KV read operation according to the first aspect of the present application is provided, which also includes: if the first key (Kp) does not match the key (K), indicating that the key accessed by the read operation does not exist.
[0023] According to the second method for KV read operation according to the first aspect of the present application, a seventh method for KV read operation according to the first aspect of the present application is provided, which also includes: if the second part (HK2) of the hash key has no corresponding entry in the second hash table, indicating that the key accessed by the read operation does not exist.
[0024] According to the second or seventh method for KV read operation of the first aspect of the present application, there is provided an eighth method for KV read operation according to the first aspect of the present application, further comprising: if the second part (HK2) of the hash key corresponds to an entry in the second hash table that records the physical address of the value (V) to be accessed by the storage read operation, reading second data from the storage medium according to the physical address.
[0025] According to the eighth method for KV read operation according to the first aspect of the present application, a ninth method for KV read operation according to the first aspect of the present application is provided, further comprising: if the address of the conflict table is recorded in the entry corresponding to the second part (HK2) of the hash key in the second hash table, querying the conflict table according to the key (K).
[0026] According to the eighth or ninth method for KV read operation of the first aspect of the present application, there is provided a tenth method for KV read operation according to the first aspect of the present application, which also includes: obtaining a second key (Kp) from the second data, and if the second key (Kp) matches the key (K), responding to the read operation with the value (V) obtained from the second data.
[0027] According to the tenth method for KV read operation of the first aspect of the present application, there is provided an eleventh method for KV read operation according to the first aspect of the present application, further comprising: if the second key (Kp) does not match the key (K), indicating that the key accessed by the read operation does not exist.
[0028] According to the second or seventh method for KV read operation according to the first aspect of the present application, a twelfth method for KV read operation according to the first aspect of the present application is provided, wherein, if the second part (HK2) of the hash key corresponds to an entry in the second hash table that records the physical address of the value (V) to be accessed by the storage read operation, the length of the second key recorded in the entry is compared with the length of the key to identify whether the second key (Kp) matches the key (K).
[0029] According to one of the first to fourth methods for KV read operations according to the first aspect of the present application, a thirteenth method for KV read operations according to the first aspect of the present application is provided, which also includes: obtaining the length of the first key (Kp) from the entry corresponding to the first part (HK1) of the hash key in the first hash table, and comparing the length of the first (Kp) key with the length of the key (K) to identify whether the first key (Kp) matches the key (K).
[0030] According to the ninth method for KV read operation of the first aspect of the present application, there is provided the fourteenth method for KV read operation according to the first aspect of the present application, further comprising: if a third entry indexed by the key (K) exists in the conflict table, the third entry records the physical address of the value (V) to be accessed by the storage read operation, and data is read from the storage medium according to the physical address recorded in the third entry.
[0031] According to the ninth or fourteenth method for KV read operation of the first aspect of the present application, there is provided a fifteenth method for KV read operation according to the first aspect of the present application, further comprising: if the third entry indexed by the key (K) does not exist in the conflict table, indicating that the key accessed by the read operation does not exist.
[0032] According to the first method for KV read operation of the first aspect of the present application, a sixteenth method for KV read operation according to the first aspect of the present application is provided, which also includes: if the address of the conflict table is recorded in the entry corresponding to the first part (HK1) of the hash key in the first hash table, querying the conflict table according to the key (K).
[0033] According to the sixteenth method for KV read operation of the first aspect of the present application, there is provided a seventeenth method for KV read operation according to the first aspect of the present application, further comprising: if a third entry indexed by the key (K) exists in the conflict table, the third entry records the physical address of the value (V) to be accessed by the storage read operation, and data is read from the storage medium according to the physical address recorded in the third entry.
[0034] According to the sixteenth or seventeenth method for KV read operation of the first aspect of the present application, there is provided an eighteenth method for KV read operation according to the first aspect of the present application, further comprising: if the third entry indexed by the key (K) does not exist in the conflict table, indicating that the key accessed by the read operation does not exist.
[0035] According to the second method for KV read operation according to the first aspect of the present application, a nineteenth method for KV read operation according to the first aspect of the present application is provided, further comprising: loading a second hash table from a storage medium.
[0036] According to the second aspect of the present application, a first method for KV write operation according to the second aspect of the present application is provided, comprising: obtaining a key (K) accessed by the write operation and a physical address assigned to the write operation; performing a hash calculation on the key to obtain a hash key (HK); querying a first hash table according to the first part (HK1) of the hash key; if the first part (HK1) of the hash key has no corresponding entry in the first hash table, adding an entry in the first hash table with the first part (HK1) of the hash key as the index and recording the assigned physical address.
[0037] According to the first method for KV write operation according to the second aspect of the present application, a second method for KV write operation according to the second aspect of the present application is provided, which also includes: if the first part (HK1) of the hash key corresponds to the first entry in the first hash table that records the physical address of the value (V) to be accessed by the storage read operation, the physical address recorded in the first entry is updated to the allocated physical address.
[0038] According to the first method for KV write operation according to the second aspect of the present application, a third method for KV write operation according to the second aspect of the present application is provided, which also includes: if the first part of the hash key (HK1) corresponds to the first entry in the first hash table that records the physical address of the value (V) to be accessed by the storage read operation, reading the first data from the storage medium according to the physical address; obtaining the first key (Kp) from the first data, and if the first key (Kp) matches the key (K), updating the physical address recorded in the first entry to the assigned physical address.
[0039] According to the third method for KV write operation according to the second aspect of the present application, a fourth method for KV write operation according to the second aspect of the present application is provided, which also includes: if the first key (Kp) does not match the key (K), creating a second hash table, creating a second entry and a third entry in the second hash table, wherein the second entry is indexed by the second part of the hash key corresponding to the first key (Kp), and records the physical address recorded in the first entry; the third entry is indexed by the second part (HK2) of the hash key corresponding to the key (K), and records the assigned physical address; and updating the physical address recorded in the first entry to the address of the second hash table.
[0040] According to the first method for KV write operation according to the second aspect of the present application, a fifth method for KV write operation according to the second aspect of the present application is provided, which also includes: if the first part of the hash key (HK1) corresponds to the first entry in the first hash table that records the physical address of the value (V) to be accessed by the storage read operation, compare the length of the first key (Kp) recorded in the first entry with the length of the key (K) to identify whether the first key (Kp) matches the key (K).
[0041] According to the fifth method for KV write operation according to the second aspect of the present application, a sixth method for KV write operation according to the second aspect of the present application is provided, which also includes: if the first key (Kp) matches the key (K), updating the physical address recorded in the first entry to the allocated physical address.
[0042] According to the fifth or sixth method for KV write operation according to the second aspect of the present application, a seventh method for KV write operation according to the second aspect of the present application is provided, which also includes: if the first key (Kp) does not match the key (K), creating a second hash table, creating a second entry and a third entry in the second hash table, wherein the second entry is indexed by the second part of the hash key corresponding to the first key (Kp), and records the physical address recorded in the first entry; the third entry is indexed by the second part (HK2) of the hash key corresponding to the key (K), and records the assigned physical address; and updating the physical address recorded in the first entry to the address of the second hash table.
[0043] According to one of the first to seventh methods for KV write operations according to the second aspect of the present application, an eighth method for KV write operations according to the second aspect of the present application is provided, further comprising: if the first part (HK1) of the hash key corresponds to the first entry in the first hash table and records the address of the second hash table, querying the second hash table according to the second part (HK2) of the hash key.
[0044] According to the eighth method for KV write operation of the second aspect of the present application, a ninth method for KV write operation according to the second aspect of the present application is provided, further comprising: if the second part (HK2) of the hash key has no corresponding entry in the second hash table, adding an entry indexed by the second part (HK2) of the hash key to the second hash table, recording the assigned physical address.
[0045] According to the eighth or ninth method for KV write operation of the second aspect of the present application, there is provided a tenth method for KV write operation according to the second aspect of the present application, further comprising: if the fourth entry corresponding to the second part (HK2) of the hash key in the second hash table records the physical address of the value (V) to be accessed by the storage read operation, the physical address recorded in the fourth entry is updated to the allocated physical address.
[0046] According to one of the eighth to tenth methods for KV write operations of the second aspect of the present application, an eleventh method for KV write operations according to the second aspect of the present application is provided, further comprising: if the fourth entry corresponding to the second part (HK2) of the hash key in the second hash table records the physical address of the value (V) to be accessed by the storage read operation, reading second data from the storage medium according to the physical address; obtaining a second key (Kp) from the second data, and if the second key (Kp) matches the key (K), updating the physical address recorded in the fourth entry to the assigned physical address.
[0047] According to the eleventh method for KV write operation of the second aspect of the present application, a twelfth method for KV write operation of the second aspect of the present application is provided, which also includes: if the second key (Kp) does not match the key (K), creating a conflict table, creating a fifth entry and a sixth entry in the conflict table, wherein the fifth entry is indexed by the second key (Kp) and records the physical address recorded in the fourth entry; the sixth entry is indexed by the key (K) and records the assigned physical address; and updating the physical address recorded in the fourth entry to the address of the conflict table.
[0048] According to the eighth method for KV write operation of the second aspect of the present application, a thirteenth method for KV write operation according to the second aspect of the present application is provided, which also includes: if the fourth entry corresponding to the second part (HK2) of the hash key in the second hash table records the physical address of the value (V) to be accessed by the storage read operation, compare the length of the second key (Kp) recorded in the fourth entry with the length of the key (K) to identify whether the second key (Kp) matches the key (K).
[0049] According to the thirteenth method for KV write operation of the second aspect of the present application, a fourteenth method for KV write operation of the second aspect of the present application is provided, which also includes: if the second key (Kp) matches the key (K), updating the physical address recorded in the fourth entry to the allocated physical address.
[0050] According to the thirteenth or fourteenth method for KV write operation of the second aspect of the present application, there is provided a fifteenth method for KV write operation according to the second aspect of the present application, which also includes: if the second key (Kp) does not match the key (K), creating a conflict table, creating a fifth entry and a sixth entry in the conflict table, wherein the fifth entry is indexed by the second key (Kp) and records the physical address recorded in the fourth entry; the sixth entry is indexed by the key (K) and records the assigned physical address; and updating the physical address recorded in the fourth entry to the address of the conflict table.
[0051] According to one of the first to fifteenth methods for KV write operations according to the second aspect of the present application, a sixteenth method for KV write operations according to the second aspect of the present application is provided, wherein the length of the first part (HK1) of the hash key is smaller than the hash key (HK).
[0052] According to the fourth or seventh method for KV write operation according to the second aspect of the present application, a seventeenth method for KV write operation according to the second aspect of the present application is provided, further comprising: loading a second hash table from a storage medium.
[0053] According to the third aspect of the present application, a first KV storage device according to the third aspect of the present application is provided, comprising a control component, an NVM storage medium and a memory, wherein the NVM storage medium records a key (K) and a value (V) written to the storage device; a first hash table is recorded in the memory, wherein entries of the first hash table are indexed by the first part (HK1) of the hash key (HK), and record the physical address of the value (V) written to the storage device or the address of the second hash table; a second hash table is also recorded in the memory, wherein entries of the second hash table are indexed by the second part (HK2) of the hash key (HK), and record the physical address of the value (V) written to the storage device or the address of the conflict table; entries of the conflict table are indexed by the key (K) and record the physical address of the value (V) written to the storage device.
[0054] According to the first KV storage device of the third aspect of the present application, a second KV storage device according to the third aspect of the present application is provided, wherein the entry of the first hash table also records the length of the key (K) corresponding to the first part (HK1) of the hash key (HK) as its index.
[0055] According to the first or second KV storage device of the third aspect of the present application, a third KV storage device according to the third aspect of the present application is provided, wherein the entry of the first hash table also records the length of the key (K) corresponding to the second part (HK2) of the hash key (HK) which is its index.
[0056] According to one of the first to third KV storage devices according to the third aspect of the present application, a fourth KV storage device according to the third aspect of the present application is provided, wherein the control component executes one of the methods provided according to the first aspect or the second aspect of the present application.
[0057] According to the fourth aspect of the present application, a first KV storage device according to the fourth aspect of the present application is provided, comprising a control component, an NVM storage medium and a memory, the NVM storage medium recording a key (K) and a value (V) written to the storage device; the memory records a first hash table and conflicts, the entries of the first hash table are indexed by the first part (HK1) of the hash key (HK), and record the physical address of the value (V) written to the storage device or the address of the conflict table; the entries of the conflict table are indexed by the key (K), and record the physical address of the value (V) written to the storage device.
[0058] According to the first or second KV storage device of the fourth aspect of the present application, the control component executes one of the methods provided according to the first or second aspect of the present application.
[0059] According to the fifth aspect of the present application, a first KV storage device according to the fifth aspect of the present application is provided, comprising a control component and a non-volatile memory chip, wherein the control component executes one of the methods provided according to the first aspect or the second aspect of the present application.
[0060] According to the sixth aspect of the present application, a first program comprising program code according to the sixth aspect of the present application is provided. When loaded into the CPU and executed in the CPU, the program causes the CPU to execute one of the methods provided according to the first aspect or the second aspect of the present application.
[0061] According to the seventh aspect of the present application, a first system for KV read operations according to the seventh aspect of the present application is provided, comprising: a key acquisition module, used to acquire a key (K) accessed by a read operation; a hash key module, used to perform a hash calculation on the key to obtain a hash key (HK); a first hash table query module, used to query a first hash table according to a first part (HK 1) of the hash key; and a value acquisition module, used to read first data from a storage medium according to the physical address if the entry corresponding to the first part (HK1) of the hash key in the first hash table records the physical address of a value (V) to be accessed by a storage read operation.
[0062] According to the eighth aspect of the present application, a first system for KV write operations according to the eighth aspect of the present application is provided, comprising: a key acquisition module, used to acquire a key (K) accessed by a write operation and a physical address allocated for the write operation; a hash key module, used to perform hash calculation on the key to obtain a hash key (HK); a first hash table query module, used to query a first hash table according to a first part (HK1) of the hash key; and a value address recording module, used to add an entry in the first hash table with the first part (HK1) of the hash key as an index and recording the allocated physical address if there is no corresponding entry in the first hash table for the first part (HK1) of the hash key. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0064] Figure 1A is a block diagram of a solid-state storage device in the related art;
[0065] Figure 1B A schematic diagram showing an address translation system of a solid-state storage device of the prior art is shown;
[0066] Figure 2 is a schematic diagram of an address conversion system of a solid-state storage device according to an embodiment of the present application;
[0067] Figure 3 is a detailed schematic diagram of an address conversion system of a solid-state storage device according to an embodiment of the present application;
[0068] Figure 4A is based on Figure 3 A flowchart of address conversion in response to a read operation (Get(K)) of a solid-state storage device of an embodiment;
[0069] Figure 4Bis based on Figure 3 A flowchart of address conversion in response to a write operation (Put(K,V)) of a solid-state storage device of an embodiment; and
[0070] Figure 5 is a schematic diagram of an address conversion system of a solid-state storage device according to another embodiment of the present application. DETAILED DESCRIPTION
[0071] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0072] Figure 2 1 is a schematic diagram of an address conversion system of a solid-state storage device according to an embodiment of the present application. The NVM chip of the solid-state storage device (also see FIG. 1 , NVM chip 105) provides a plurality of physical blocks. The physical blocks are used as data blocks. The data blocks include physical pages or data frames for recording data written to the solid-state storage device.
[0073] Taking the physical page as an example, Figure 2 The data block shown includes 5 physical pages. Each physical page includes a header field (respectively recorded as "header 1", "header 2" ... and "header 5"). Each physical page has a physical address (recorded as PPA), and the corresponding physical page can be accessed by using PPA. The physical page records the key (K) and the value (Value). The key (Key) and the value (Value) are the key (Key) and the value (Value) provided by the host when writing data. The physical page also records the header field, which is used to indicate the starting address and / or length of the key (Key) and / or value (Value).
[0074] For example Figure 2The physical page indicated by "Header 1" in the PPA includes a header field (Header 1), a key 1, and a value 1. The header field records the length of the key (Key) and the length of the value (Value) (while the length of the header field is a fixed value). The starting address of the key (Key) and the starting address of the value (Value) can be calculated based on the physical address indicated by the PPA and the length of the header field. In one example, the header field records the length of the key (Key). The starting address of the value (Value) can be calculated based on the physical address indicated by the PPA and the length of the header field, as well as the length of the key (Key). And in another example, the starting address of the key (Key) is fixed, and the header field records the starting address of the value (Value). In another example, the key (Key) and the value (Value) are of variable length.
[0075] Optionally, multiple <key, value> pairs are recorded in the physical page. Take the physical page indicated by "header 2" as an example, where "key 2" and "value 2" are recorded as a pair, and "key 3" and "value 3" are recorded as another pair. And each pair of <key 2, value 2> and <key 3, value 3> is addressed according to "header 2".
[0076] Still optionally, a physical page (eg Figure 2 If the sum of the lengths of the header field, key (Key) and value (Value) is not enough to fill the physical page (the physical page indicated by "header 3" in the table), the physical page is filled with dummy data.
[0077] The physical page indicated by "Header 4" and "Header 5" is a physical page with continuous physical addresses, and Key 5 and "Value 5" are the key (Key) and value (Value) provided by the host when writing data. Since the size of "Value 5" exceeds the size that the physical page can accommodate, Key 5 and a part of Value 5 provided by the host are recorded in the physical page indicated by "Header 4", and the rest of "Value 5" is recorded in the physical page indicated by "Header 5". The header fields "Header 4" and "Header 5" are used to indicate the starting address and / or length of "Key 5" and "Value 5" in the physical page. Optionally, the number of occupied physical pages (the number is 2) is also recorded in the header field.
[0078] Alternatively, see Figure 2 The physical pages indicated by "header 4" and "header 5" are not large enough to fill two physical pages, so the physical page indicated by "header 5" is filled with dummy data.
[0079] Continue to refer Figure 2, the key (Key) provided by the host or user is hashed to obtain a hash key (denoted as HK). Optionally, the key (Key) is of indefinite length, and the hash key (HK) has a specified length. The hash key (HK) is divided into multiple parts. For example, the hash key (HK) is divided into 3 parts, denoted as HK1, HK2 and HK3. For example, for a hash key with a length of 128 bits, HK1 is the first 16 bits of the hash key (HK), HK2 is the next 32 bits of the hash key (HK), and HK3 is the remaining bits of the hash key (HK). It can be understood that there are many other ways to divide the hash key (HK) into multiple parts without limiting the method, order and / or length of selecting the bits of the hash key (HK).
[0080] Still see Figure 2 , a plurality of data tables are recorded in the memory of the solid-state storage device (also see FIG. 1 , such as DRAM 110 ), including an L1 hash table, optionally an L2 hash table, and a conflict linked list.
[0081] The L1 hash table is indexed by the portion HK1 of the hash key (HK). For example, HK1 is used as an offset value within the L1 hash table to obtain an entry of the L1 hash table. The entry of the L1 hash table records the physical page (or data unit) address of the data block or the address of the L2 hash table.
[0082] One or more L2 hash tables are provided. The entries of the L1 hash table optionally record the addresses of the L2 hash tables, so that the L2 hash tables can be addressed according to the entries of the L1 hash table. (Each) L2 hash table is indexed by a portion HK2 of a hash key (HK). For example, HK2 is used as an offset value within the L2 hash table to obtain the entries of the L2 hash table. The entries of the L2 hash table record the physical page (or data unit) address of the data block or the address of the conflict table.
[0083] One or more conflict tables are provided. The entries of the L2 hash table record the addresses of the conflict tables, so that the conflict tables can be addressed according to the entries of the L2 hash table. (Each) conflict table is indexed by a key (K). The entries of the conflict table record the physical page (or data unit) address of the data block.
[0084] In an optional implementation, the L2 hash table is omitted, and the entries of the L1 hash table record the physical page (or data unit) address of the data block or the address of the conflict table.
[0085] Figure 3 It is a detailed schematic diagram of an address conversion system of a solid-state storage device according to an embodiment of the present application.
[0086] Each entry of the L1 hash table is indexed by a portion (HK1) of the hash key (HK), and the value of the entry is the physical page (or data unit) address of the data block or the address of the L2 hash table. As an example, the entry of the L1 hash table is accessed with HK1 as the address. If the entry of the L1 hash table records the physical page (or data unit) address of the data block, the address indicates the storage location of the <key (K), value (V)> pair in the NVM storage medium.
[0087] It can be understood that the index HK1 of the L1 hash table is different from the key (K) of the <key (K), value (V)> pair. And HK 1 and key (K) are not in a one-to-one correspondence, but multiple keys (K) may correspond to the same HK1. Therefore, there is a certain probability that the <key (K), value (V)> accessed from the physical page (or data unit) address of the data block indexed from the L1 hash table by HK1 does not correspond to the key accessed by the host / user and is used to generate the hash key HK1, so an error occurs. In some cases, the occurrence of this error is extremely unlikely and can be accepted by the user or the technical standards followed by the solid-state storage device. In other cases, this error cannot be accepted, and it is necessary to compare whether the key (K) accessed from the physical page (or data unit) address of the data block indexed from the L1 hash table is the same as the key (Key) that the user wants to access to identify whether an error has occurred.
[0088] If an entry of the L1 hash table records an L2 hash table address, the address indicates the location of one of the L2 hash tables associated with the entry in the memory, so that the L2 hash table entry is also associated with HK1.
[0089] For example, see Figure 3 In the L1 hash table, the entry indexed by HK1-1 records the physical address PPA, the entry indexed by HK1-2 records the address of the L2 hash table 320, and the entry indexed by HK1-4 records the address of the L2 hash table 322.
[0090] Each entry of the L2 hash table is indexed by a portion (HK2) of the hash key (HK), and the value of the entry is the physical page (or data unit) address of the data block or the address of the conflict table. There are one or more L2 hash tables. Figure 3L2 hash table 320 and L2 hash table 322 are shown. As an example, an entry of a specified L2 hash table is accessed with HK2 as the address. The specified L2 hash table is associated with HK1. If the entry of the L2 hash table records the physical page (or data unit) address of the data block, the address indicates the storage location of the <key (K), value (V)> pair in the NVM storage medium. It can be understood that the index HK2 of the L2 hash table is different from the key (K) of the <key (K), value (V)> pair. And HK2 and key (K) are not in a one-to-one correspondence, but multiple HK2s may correspond to the same key (K). And the combination of HK1 and HK2 and key (K) is not in a one-to-one correspondence, but multiple keys (K) may correspond to the same combination of HK1 and HK2.
[0091] If an entry of the L2 hash table records a conflict table address, the address indicates the location of one of the conflict tables associated with the entry in the memory, so that the conflict table entry is also associated with the combination of HK1 and HK2.
[0092] For example, see Figure 3 In the L2 hash table 320, the entry indexed by HK2-1 records the physical address PPA, and the entry indexed by HK2-2 records the conflict table address.
[0093] Each entry of the conflict table is indexed by a key (K), and the value of the entry is the physical page (or data unit) address of the data block. Figure 3 Conflict tables 340, 342, and 344 are shown. The conflict table is, for example, an array, a linked list, a linear list, or a tree. Optionally, the conflict table is sorted, for example, by the numerical order of the key (K), to support fast search of entries indexed by the key (K) in the conflict table by the key (K).
[0094] according to Figure 3 In the illustrated embodiment, each entry of the L2 hash table is associated with HK1 and HK2. Multiple keys (denoted as K1 and K2) may correspond to the same combination of HK1 and HK2. For example, both key (K1) and key (K2) correspond to the same combination of HK1_2 and HK2_2, so that HK1_2 and HK2_2 obtained according to key (K1) are associated with the entry of the L2 hash table indicated by HK2_2, and HK1_2 and HK2_2 also obtained according to key (K2) are associated with the entry of the L2 hash table indicated by HK2_2. In this case, the entry of the L2 hash table indicated by HK2_2 conflicts. To resolve the conflict, a conflict table 340 is created to record the association between the key (K1) and its physical address PPA, and also record the association between the key (K2) and its physical address PPA. And the address of the conflict table 340 is recorded in the entry of the L2 hash table indicated by HK2_2.
[0095] Optionally, the L1 hash table and the L2 hash table have a specified size (e.g., 1KB-4MB), while the number of entries in the conflict table is unlimited. Still optionally, the sizes of the L1 hash table and the L2 hash table are selected to be easily accessed by an operating system or a memory management unit (MMU) and / or easily stored in an NVM storage medium.
[0096] In an optional embodiment, the L2 hash table is omitted. The physical page (or data unit) address of the data block or the address of the conflict table is recorded in the entry of the L1 hash table. When the length of the hash key HK is small, it is advantageous to omit the L2 hash table. This reduces the overhead of queries in the address conversion system. In this embodiment, the L1 hash table is indexed with the part HK1 of the hash key (HK). If the L1 hash table conflicts, the conflict table is indexed with the key (K) to obtain the physical address PPA corresponding to the key (K). If there is no conflict in the L1 hash table, the physical address PPA is obtained from the L1 hash table entry indexed by HK1.
[0097] In still an optional embodiment, the solid-state storage device includes multiple Figure 3 The address translation system shown in FIG. Each namespace of the solid-state storage device corresponds to Figure 3 One of the address translation systems shown.
[0098] Figure 4A is based on Figure 3 A flowchart of address conversion in response to a read operation (Get(K)) of a solid-state storage device of an embodiment.
[0099] The read operation (Get(K)) indicates obtaining the corresponding value (Value) according to the key (K).
[0100] In one example, in response to receiving a read operation, a key (K) to be accessed by the read operation is obtained (410). A specified hash operation is performed on the key (K) to obtain a hash key (HK) (415). And various parts of the hash key (e.g., HK1, HK2, and HK3) are obtained according to a specified rule. The L1 hash table is queried using the hash key part HK1 (420).
[0101] The hash key part HK1 queries the L1 hash table to determine whether HK1 conflicts in the L1 hash table (425). If there is no conflict, the NVM storage medium is accessed according to the physical address PPA obtained from the L1 hash table entry indexed by HK1 (435). Since HK1 does not correspond one-to-one to the key (K), the key (Kp) is also read from the NVM storage medium according to the physical address PPA, and the key (Kp) is compared with the key (K) to see if they are the same. If the key (Kp) is the same as the key (K), the value stored in the NVM storage medium in association with the key (Kp) is the value corresponding to the key (K), and the value is used as the result of the read operation. If the key (Kp) is different from the key (K), the value stored in the NVM storage medium in association with the key (Kp) is not the value corresponding to the key (K), indicating that the value corresponding to the key (K) does not exist in the solid-state storage device.
[0102] Optionally, the length of the key (KL1) is also recorded in the entry of the L1 hash table. After obtaining the entry of the L1 hash table according to HK1, the length of the key (KL1) recorded in the entry is compared with the length of the key (K) to see if they are the same, so as to identify earlier that the key (KL1) is different from the key (K), and indicate that the value corresponding to the same key (K) does not exist in the solid-state storage device. It can be understood that if the length of the key (KL1) is the same as the length of the key (K), it cannot be determined that the length of the key (KL1) is the same as the length of the key (K), and it is necessary to read the key (Kp) from the physical address PPA and compare it with the key (K).
[0103] Still optionally, in some cases, the probability of different keys (K) obtaining the same HK1 is extremely small and can be accepted by the technical standards followed by the user or the solid-state storage device. In this case, the NVM storage medium is accessed according to the physical address PPA obtained from the L1 hash table, and the value corresponding to HK1 is read as the result of the read operation, without checking whether the key (Kp) is the same as the key (K). For example, the probability of different keys (K) obtaining the same HK1 is reduced by increasing the length of HK1 (or the ratio of the length of HK1 to the length of key (K)), and / or the probability of different keys (K) obtaining the same HK1 is reduced by selecting an algorithm for the hash operation.
[0104] Return to view Figure 4A , if the hash key part HK1 conflicts in the L1 hash table ( 425 ), the L2 hash table is accessed according to the L2 hash table address obtained from the L1 hash table entry indexed by HK1, and the L2 hash table is queried according to the hash key part HK2 index ( 430 ).
[0105] If HK2 does not conflict in the L2 hash table (440), the NVM storage medium is accessed according to the physical address PPA obtained from the L2 hash table entry indexed by HK2 (448). Since HK1 does not correspond to the key (K) one-to-one, the key (Kp) is also read from the NVM storage medium according to the physical address PPA to identify whether the value stored at the physical address PPA is the value corresponding to the key (K).
[0106] Optionally, similar to the method applied in the L1 hash table, the length of the key (KL2) is recorded in the L2 hash table, and the difference between the key (KL2) and the key (K) can be identified earlier through the length of the key (KL2).
[0107] Still optionally, in some cases, the probability of different keys (K) obtaining the same NK1 and HK2 is extremely small and can be accepted by the technical standards followed by the user or the solid-state storage device. In this case, the NVM storage medium is accessed according to the physical address PPA obtained from the L2 hash table, and the value corresponding to HK2 is read as the result of the read operation, without checking whether the value stored at the physical address PPA is the value corresponding to the same key (K).
[0108] Return to view Figure 4A , if HK2 has a conflict in the L2 hash table (440), the conflict table is accessed according to the conflict table address obtained from the L2 hash table entry indexed by HK2, and the conflict table is queried according to the key (K) (445). If an entry matching the same key (K) is found in the conflict table, the NVM storage medium is accessed according to the physical address PPA obtained from the entry, and the value corresponding to the same key (K) is read out as a result of the read operation. If no entry matching the same key (K) is found in the conflict table, it is indicated that the value corresponding to the same key (K) does not exist in the solid-state storage device as a response to the read operation.
[0109] In an optional embodiment, if there is no conflict (425) in the L1 hash table for the hash key portion HK1, it may also be that no entry is found in the L1 hash table according to HK1, then it is indicated that the value corresponding to the same key (K) does not exist in the solid-state storage device as a response to the read operation. Similarly, if no entry is found in the L2 hash table according to HK2, it is also indicated that the value corresponding to the same key (K) does not exist in the solid-state storage device as a response to the read operation.
[0110] In an optional implementation, the L2 hash table is omitted. Instead, the physical page (or data unit) address of the data block or the address of the conflict table is recorded in the entry of the L1 hash table. Figure 4ASteps 430, 440 and 448 in FIG. 4. In this embodiment, the L1 hash table is indexed with the portion HK1 of the hash key (HK). If the L1 hash table conflicts (425), the conflict table is indexed with the key (K) to obtain the physical address PPA corresponding to the key (K).
[0111] Figure 4B is based on Figure 3 A flowchart of address conversion in response to a write operation (Put(K,V)) of a solid-state storage device of an embodiment.
[0112] A write operation indicates that the value corresponding to the key (K) is set or updated to the value (V).
[0113] according to Figure 4B In an embodiment, in response to receiving a write operation, a key (K) to be accessed by the write operation is obtained (450), a physical address is allocated for the write operation, and a value (V) of the write operation is written to the allocated physical address PPA.
[0114] Perform a specified hash operation on the key (K) to obtain a hash key (HK) (455). And obtain the various parts of the hash key (e.g., HK1, HK2, and HK3) according to the specified rules. Use the hash key part HK1 to query the L1 hash table (458).
[0115] If HK1 does not exist in the L1 hash table, or there is no entry indexed by HK1 in the L1 hash table (460), the L1 hash table is updated (462), an entry is added to the L1 hash table, the added entry is indexed by HK1, and the allocated physical address PPA is recorded in the entry. The write operation is completed.
[0116] If HK1 exists in the L1 hash table (460), further identify whether HK1 has a conflict in the L1 hash table (464). If there is no conflict, obtain the physical address PPA in the L1 hash table entry indexed by HK1 to access the NVM storage medium, read the key (Kp) from the NVM storage medium, and compare whether the key (Kp) is the same as the key (K) (466). If the key (Kp) is the same as the key (K) (466), update the physical address recorded in the L1 hash table entry indexed by HK1 to the physical address PPA (468), and the write operation is completed. If the key (Kp) is different from the key (K) (466), a conflict is marked in the index HK1 in the L1 hash table, and a new L2 hash table is generated. An entry with the hash key HK2_Kp obtained according to the key (Kp) as the index and the physical address PPA as the value, as well as an entry with the hash key part HK2 of the key (K) corresponding to the write operation as the index and the allocated physical address as the value is recorded in the new L2 hash table (469).
[0117] Optionally, the length of the key (KL1) is also recorded in the entry of the L1 hash table. After obtaining the entry of the L1 hash table according to HK1, the length of the key (KL1) recorded in the entry is compared with the length of the key (K) to see if they are the same, so as to identify earlier that the key (KL1) does not match the key (K) (466). It can be understood that if the length of the key (KL1) is the same as the length of the key (K), it cannot be determined that the key (KL1) matches the key (K), and it is necessary to read the key (Kp) from the physical address PPA and compare it with the key (K).
[0118] Optionally, the length of the key (KL2) is also recorded in the entry of the L2 hash table. After obtaining the entry of the L2 hash table according to HK2, the length of the key (KL2) recorded in the entry is compared with the length of the key (K) to see if they are the same, so as to identify earlier that the key (KL1) does not match the key (K) (476). It can be understood that if the length of the key (KL2) is the same as the length of the key (K), it cannot be determined that the key (KL2) matches the key (K), and it is necessary to read the key (Kp) from the physical address PPA and compare it with the key (K).
[0119] Still optionally, in some cases, the probability of different keys (K) obtaining the same HK1 is extremely small and can be accepted by the technical standards followed by the user or the solid-state storage device. In this case, if HK1 does not conflict in the L1 hash table (464), skip step 466 and update the physical address recorded in the L1 hash table entry indexed by HK1 to the physical address PPA (468).
[0120] Still optionally, in some cases, the probability of different keys (K) obtaining the same combination of HK1 and HK2 is extremely small and can be accepted by the technical standards followed by the user or the solid-state storage device. In this case, if HK2 does not conflict in the L2 hash table (472), steps 474 and 476 are skipped, and the physical address recorded in the L2 hash table entry indexed by HK2 is updated to the physical address PPA (479).
[0121] Back to Figure 4B , if HK1 conflicts in the L1 hash table ( 464 ), the address of the L2 hash table is obtained based on the L1 hash table entry indexed by HK1 , and the L2 hash table is queried using the hash key portion HK2 ( 470 ).
[0122] If HK2 does not exist in the L2 hash table (not shown), or there is no entry indexed by HK2 in the L2 hash table, the L2 hash table is updated, an entry is added to the L2 hash table, the added entry is indexed by HK2, and the allocated physical address PPA is recorded in the entry. The write operation is completed.
[0123] If HK2 exists in the L2 hash table, further identify whether HK2 has a conflict in the L2 hash table (472). If there is no conflict, obtain the physical address PPA in the L2 hash table entry indexed by HK2 to access the NVM storage medium (474), read the key (Kp) from the NVM storage medium, and compare whether the key (Kp) is the same as the key (K) (476). If the key (Kp) is the same as the key (K) (476), the physical address recorded in the L2 hash table entry indexed by HK2 is updated to the physical address PPA (479), and the write operation is completed. If the key (Kp) is different from the key (K) (476), the index HK2 is marked in the L2 hash table as conflicting, a new conflict table is generated, and an entry indexed by the key (Kp) and with the physical address PPA as the value is recorded in the new conflict table, as well as an entry indexed by the key (K) corresponding to the write operation and with the allocated physical address as the value (478).
[0124] If HK2 conflicts in the L2 hash table (472), the address of the conflict table is obtained according to the L2 hash table entry indexed by HK2, and the conflict table is queried with the key (K) (480). If an entry indexed by the key (K) is found in the conflict table (482), the entry is updated with the allocated physical address PPA (486). If the entry indexed by the key (K) does not exist in the conflict table (482), an entry indexed by the key (K) and with the allocated physical address PPA as the value is added to the conflict table (484).
[0125] In an optional embodiment, the L2 hash table is omitted. Instead, the physical page (or data unit) address of the data block or the address of the conflict table is recorded in the entry of the L1 hash table. Step 469 is modified to mark the index HK1 as conflicting in the L1 hash table, generate a new conflict table, and record the entry with the key (Kp) as index and the physical address PPA as value, and the entry with the key (K) corresponding to the write operation as index and the allocated physical address as value in the new conflict table. And omit Figure 4B Step 470 and step 472 in . Step 480 is modified to obtain the address of the conflict table from the L1 hash table entry indexed by HK1, and query the conflict table with the key (K) (480).
[0126] Figure 5 1 is a schematic diagram of an address conversion system of a solid-state storage device according to another embodiment of the present application. The NVM chip of the solid-state storage device (also see FIG. 1 , NVM chip 105) provides a plurality of physical blocks. The physical blocks are used as data blocks. The data blocks include physical pages or data frames for recording data written to the solid-state storage device.
[0127] Continue to refer Figure 5, the key (Key) provided by the host or user is hashed to obtain a hash key (denoted as HK). Optionally, the key (Key) is of indefinite length, while the hash key (HK) has a specified length. The hash key (HK) is divided into multiple parts. According to Figure 5 In the embodiment shown, the hash key (HK) is divided into 4 parts, which are respectively recorded as HK1, HK2, HK3 and HK4. It can be understood that the hash key can be divided into other numbers of parts, and there are many other ways to divide the hash key (HK) into multiple parts without limiting the way, order and / or length of selecting the bits of the hash key (HK).
[0128] Still see Figure 5 , a plurality of data tables are recorded in the memory of the solid-state storage device (also see FIG. 1 , such as DRAM 110 ), including an L1 hash table, optionally an L2 hash table, an L3 hash table and a conflict table.
[0129] The L1 hash table is indexed by the portion HK1 of the hash key (HK). For example, HK1 is used as an offset value within the L1 hash table to obtain an entry of the L1 hash table. The entry of the L1 hash table records the physical page (or data unit) address of the data block or the address of the L2 hash table.
[0130] One or more L2 hash tables are provided. The entries of the L1 hash table optionally record the addresses of the L2 hash tables, so that the L2 hash tables can be addressed according to the entries of the L1 hash table. (Each) L2 hash table is indexed by a portion HK2 of a hash key (HK). For example, HK2 is used as an offset value within the L2 hash table to obtain the entries of the L2 hash table. The entries of the L2 hash table record the physical page (or data unit) address of the data block or the address of the conflict table.
[0131] One or more L3 hash tables are provided. The entries of the L2 hash table optionally record the addresses of the L3 hash tables, so that the L3 hash tables can be addressed according to the entries of the L2 hash tables. (Each) L3 hash table is indexed by a portion HK 3 of a hash key (HK). For example, HK3 is used as an offset value in the L1 hash table to obtain the entries of the L3 hash table. The entries of the L3 hash table record the physical page (or data unit) address of the data block or the address of the conflict table.
[0132] One or more conflict tables are provided. The entries of the L3 hash table record the addresses of the conflict tables, so that the conflict tables can be addressed according to the entries of the L3 hash table. (Each) conflict table is indexed by a key (K). The entries of the conflict table record the physical page (or data unit) address of the data block.
[0133] By providing more levels of hash tables, it is easier to support larger address spaces in the address translation system.
[0134] Optionally, the L1 hash table, L2 hash table, L3 hash table and / or conflict table have a specified size, such as 1KB-4MB. The size is selected so that it is easy to be accessed by an operating system or a memory management unit (MMU, Memory Management Unit), and / or easy to store in an NVM storage medium. For example, when the address space is large, the combined capacity of the L1 hash table, L2 hash table, L3 hash table and conflict table also increases accordingly, and it is difficult to accommodate in the memory. Part or all of the L2 hash table, L3 hash table and / or conflict table are exchanged between the memory and the large-capacity NVM storage medium. The accessed L2 hash table, L3 hash table and / or conflict table are loaded into the memory, and the unaccessed L2 hash table, L3 hash table and / or conflict table are stored in the NVM storage medium.
[0135] Still optionally, according to the address translation system of the embodiment of the present application, the L1 hash table, L2 hash table, L3 hash table and / or conflict table are accessed with the virtual address or physical address for the memory. For the implementation method using the physical address for the memory, the physical address for the memory of the next level table is recorded in the entries of the L1 hash table, the L2 hash table and the L3 hash table.
[0136] For the implementation method using the virtual address for the memory, the virtual address for the memory of the next level table is recorded in the entries of the L1 hash table, the L2 hash table and the L3 hash table. An address management system for converting the virtual address of the memory to the physical address is also provided in the storage device. For example, a memory (memory) management system provided by an operating system of the prior art or a memory management unit of a processor is used to provide conversion from the virtual address of the memory to the physical address.
[0137] according to Figure 5 The processing flow of address conversion in response to a read operation (Get(K)) of a solid-state storage device of an embodiment of the present invention is similar to Figure 4A According to the method shown. Figure 5 The processing flow of address conversion in response to a write operation (Put(K,V)) of a solid-state storage device of an embodiment is similar to Figure 4B implemented by the method of display.
[0138] According to an embodiment of the present application, a solid-state storage device is also provided, which includes a controller and a non-volatile memory chip, wherein the controller executes any one of the processing methods provided in the embodiments of the present application.
[0139] According to an embodiment of the present application, there is also provided a program stored on a readable medium, which, when executed by a controller of a solid-state storage device, enables the solid-state storage device to execute any one of the processing methods provided according to the embodiments of the present application.
[0140] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for a KV read operation, comprising: Get the key K for read operation access; Performing hash calculation on the key to obtain a hash key HK; Query a first hash table according to the first part HK1 of the hash key; If the entry corresponding to the first part HK1 of the hash key in the first hash table records the physical address of the value V to be accessed by the storage read operation, read the first data from the storage medium according to the physical address; if the entry corresponding to the first part HK1 of the hash key in the first hash table records the address of the conflict table, query the conflict table according to the key K; Also includes: If the entry corresponding to the first part HK1 of the hash key in the first hash table records the address of the second hash table, query the second hash table according to the second part HK2 of the hash key; If the entry corresponding to the second part HK2 of the hash key in the second hash table records the physical address of the value V to be accessed by the storage read operation, the second data is read from the storage medium according to the physical address; if the entry corresponding to the second part HK2 of the hash key in the second hash table records the address of the conflict table, the conflict table is queried according to the key K; if a third entry indexed by the key K exists in the conflict table, the third entry records the physical address of the value V to be accessed by the storage read operation, and data is read from the storage medium according to the physical address recorded in the third entry.
2. The method according to claim 1, further comprising: If the first part HK1 of the hash key has no corresponding entry in the first hash table, it indicates that the key accessed by the read operation does not exist.
3. The method according to claim 1 or 2, wherein The length of the first part HK1 of the hash key is smaller than the hash key HK; and The length of the second part HK1 of the hash key is smaller than the hash key HK.
4. The method according to claim 1 or 2, further comprising: A first key Kp is obtained from the first data, and if the first key Kp matches the key K, the read operation is responded to with a value V obtained from the first data.
5. The method according to claim 1 or 2, further comprising: The length of the first key Kp is obtained from the entry corresponding to the first part HK1 of the hash key in the first hash table, and the length of the first key Kp is compared with the length of the key K to identify whether the first key Kp matches the key K.
6. A method for a KV write operation, comprising: Get the key K for write operation access and the physical address assigned for the write operation; Performing hash calculation on the key to obtain a hash key HK; Query a first hash table according to the first part HK1 of the hash key; If the first part HK1 of the hash key has no corresponding entry in the first hash table, adding an entry in the first hash table that uses the first part HK1 of the hash key as an index and records the allocated physical address; If the first part HK1 of the hash key exists in the first hash table, obtain a physical address from a first entry corresponding to the first part HK1 of the hash key in the first hash table, read first data from a storage medium according to the physical address, obtain a first key Kp from the first data, and if the first key Kp matches the key K, update the physical address recorded in the first entry to the allocated physical address; If the first key Kp does not match the key K, create a second hash table; create a second entry and a third entry in the second hash table, wherein the second entry is indexed by the second part of the hash key corresponding to the first key Kp, and records the physical address recorded in the first entry; the third entry is indexed by the second part HK2 of the hash key corresponding to the key K, and records the allocated physical address; and update the physical address recorded in the first entry to the address of the second hash table; If the first entry corresponding to the first part HK1 of the hash key in the first hash table records the address of the second hash table, query the second hash table according to the second part HK2 of the hash key; Alternatively, if the first key Kp does not match the key K, a conflict table is created; Creating a fifth entry and a sixth entry in the conflict table, wherein the fifth entry is indexed by the first key Kp and records the physical address recorded in the first entry; the sixth entry is indexed by the key K and records the allocated physical address; and updating the physical address recorded in the first entry to the address of the conflict table; If the first entry corresponding to the first part HK1 of the hash key in the first hash table records the address of the conflict table, the conflict table is queried according to the key K.
7. The method according to claim 6, further comprising: If the first entry corresponding to the first part HK1 of the hash key in the first hash table records the physical address of the value V to be accessed by the storage read operation, the physical address recorded in the first entry is updated to the allocated physical address.
8. A KV storage device, comprising a control component, an NVM storage medium and a memory, wherein the NVM storage medium records a key K and a value V written into the storage device; The memory records a first hash table and a conflict table, wherein entries of the first hash table are indexed by the first part HK1 of the hash key HK and record the physical address of the value V written into the storage device or the address of the conflict table; The entries in the conflict table are indexed by key K and record the physical address of the value V written to the storage device; The control component executes the method according to any one of claims 1 to 7.
Citation Information
Cited By
Updating and querying by distributed KV storage system
CN111581451A
Updating and querying for distributed KV storage systems
CN113535851A
Updating and querying of distributed KV storage systems
CN113535851B
Accelerator for clustering computation
CN114461861A
