Data management method and solid state hard disk in storage system

CN113608701BActive Publication Date: 2024-09-20HEFEI DATANG STORAGE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110949637.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-18
Publication Date
2024-09-20
Estimated Expiration
2041-08-18

AI Technical Summary

Technical Problem

由于KV存储技术是将对象数据转换为具有结构化数据块大小的数据片段,当某些数据发生变化时,会将整个结构化数据块删除并且重新编程,这样的做法会大大加快现有存储介质的磨损,并且影响了小容量KV存储设备的存储性能

Benefits of technology

[0014] When the storage system stores structured data, the value value corresponding to the key value of the data to be written is set to the i address data of the i data block to achieve independent management of each data block in the data, which is consistent with the existing Compared with the entire structured data contained in the value pointed to by the key, the management granularity in the technology is further refined, providing a basis for partial updates of structured data, achieving the purpose of improving the storage performance of the KV storage system, and effectively avoiding writes. Amplify the problem of excessive WA.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113608701B
    Figure CN113608701B
Patent Text Reader

Abstract

The embodiment of the present application discloses a data management method and a solid-state hard disk in a storage system. The storage system is used to store structured data, and the method includes: splitting the first data to be written into i data blocks of the same size, where i is an integer greater than or equal to 1; recording the physical address used for the write operation for each data block to obtain i address data; generating a first address data set of the first data according to the i address data; recording the mapping relationship between the first key value of the first data and the first address data set in a preset mapping table; and managing the data in the storage system using the mapping table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of information processing, and in particular to a data management method and a solid-state hard disk in a storage system. Background Art

[0002] KV (key-value) storage transfers the storage workload of today's CPU to the storage controller, greatly improving the efficiency of software and hardware, paving the way for a new generation of high-performance and scalable storage architecture. Since KV storage technology converts object data into data fragments with structured data block size, when some data changes, the entire structured data block will be deleted and reprogrammed. This practice will greatly accelerate the wear of existing storage media and affect the storage performance of small-capacity KV storage devices. Summary of the invention

[0003] In order to solve any of the above technical problems, an embodiment of the present application provides a data management method and a solid state drive in a storage system.

[0004] In order to achieve the purpose of the embodiment of the present application, the embodiment of the present application provides a data management method in a storage system, wherein the storage system is used to store structured data, and the method includes:

[0005] Splitting the first data to be written into i data blocks of the same size, where i is an integer greater than or equal to 1;

[0006] Record the physical address used for the write operation for each data block, and obtain i pieces of address data;

[0007] generating a first address data set of the first data according to the i pieces of address data;

[0008] Recording a mapping relationship between a first key value of the first data and a first address data set in a preset mapping table;

[0009] The mapping table is used to manage data in the storage system.

[0010] A storage medium stores a computer program, wherein the computer program is configured to execute the method described above when running.

[0011] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the method described above.

[0012] A solid state hard disk comprises the electronic device mentioned above.

[0013] One of the above technical solutions has the following advantages or beneficial effects:

[0014] When the storage system stores structured data, by setting the value corresponding to the key value of the data to be written to the i-th address data of the i-th data block, independent management of each data block in the data is achieved. Compared with the entire structured data contained in the value pointed to by the key in the prior art, the management granularity is further refined, which provides a basis for realizing local updates of structured data, achieves the purpose of improving the storage performance of the KV storage system, and effectively avoids the occurrence of excessive write amplification WA problems.

[0015] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by implementing the embodiments of the present application. The purpose and other advantages of the embodiments of the present application can be achieved and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are used to provide further understanding of the technical solutions of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the embodiments of the present application, they are used to explain the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0017] Figure 1 A flowchart of a data management method in a storage system provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of a method for creating a mapping table provided in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of a storage method of a mapping table provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of a method for restoring a mapping table provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of a method for updating a mapping table provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application more clear, the embodiments of the present application will be described in detail in conjunction with the accompanying drawings. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily.

[0023] In order to solve the problem of low storage performance of KV storage and large write amplification (WA) caused by the prior art to NAND flash, an embodiment of the present application provides a new key array mapping table, which is used to manage data in the storage system.

[0024] Figure 1 Flow chart of a data management method in a storage system provided in an embodiment of the present application. Figure 1 As shown, the storage system is used to store structured data, and the method includes:

[0025] Step 101: split the first data to be written into i data blocks of the same size, where i is an integer greater than or equal to 1;

[0026] Step 102: Record the physical address used for the write operation for each data block to obtain i pieces of address data;

[0027] The address data may record the physical address in an array form;

[0028] Step 103: Generate a first address data set of the first data according to the i pieces of address data;

[0029] Step 104: Record the mapping relationship between the first key value of the first data and the first address data set in a preset mapping table;

[0030] Step 105: Use the mapping table to manage data in the storage system.

[0031] The method provided in the embodiment of the present application realizes independent management of each data block in the data by setting the value corresponding to the key value of the data to be written to i address data of i data blocks when the storage system stores structured data. Compared with the entire structured data contained in the value pointed to by the key in the prior art, the management granularity is further refined, which provides a basis for realizing local updates of structured data, achieves the purpose of improving the storage performance of the KV storage system, and effectively avoids the occurrence of the problem of WA being too large.

[0032] Figure 2 A schematic diagram of a method for creating a mapping table provided in an embodiment of the present application. Figure 2As shown in the figure, taking the standard value size of 4K as an example, the creation of the key array mapping table is first generated by the hash engine. The structured data blocks written by the host are split into 4K data domains, and the physical addresses corresponding to all 4K data are associated into an array. Finally, the key value is associated with the array array to form a key-array mapping relationship. All keyarray pairs constitute the key array mapping table.

[0033] The following is a detailed description of the above process using a certain structured data to be written as an example, including:

[0034] Step A: Determine the key value of the structured data to be written:

[0035] The key in the access command sent by the host is hashed to obtain the hash value, that is, the key in the mapping table, and the unique hash value of the structured data can be obtained as the key value of the structured data. The key value is used to record and represent the logical address of the structured data accessed by the host this time.

[0036] Step B: Determine the array set of structured data to be written as the value of the structured data in the KV storage system:

[0037] Step B01, split the structured data written by the host into data blocks of 4k data domain size;

[0038] If the space is less than 4K, you can add dummy data to fill up the space.

[0039] For example, the data blocks obtained by splitting are D0, D1, D2, ..., Di, ...; wherein i is an integer greater than or equal to 0.

[0040] Step B02: When writing each data block obtained by splitting in sequence, record the physical address of each data block obtained by splitting, and construct the physical address of each 4k data into an array.

[0041] Among them, each array record corresponds to the full physical address of 4k data;

[0042] For example, the array of data blocks can be array[0], array[1], array[2], ..., array[i], ...

[0043] Step B03, generating an array set of structured data according to the writing order of the data blocks;

[0044] The arrangement order of the arrays in the data set is consistent with the writing order of the corresponding database.

[0045] Step C: Associate the key value with the array to form a key-array pair.

[0046] The number of array members corresponding to a key shall not exceed 128; if the size of the structured data loaded by the host exceeds the size specified by the number of array members, the excess part will be divided into the next key-arraypair.

[0047] The above process provides a process for establishing a mapping relationship table for structured data to be written. Different from the key-value correspondence of structured data in the prior art, the value in the above process is an array set of physical addresses of data blocks of the same size, which can provide operational support for local update operations.

[0048] In the storage system, Nand Flash is used to store data, and DRAM is used to cache user data and store the correspondence between logical addresses and physical addresses when the solid-state disk (SSD) is working. Once the SSD loses power, the RAM data will be lost. If there is no mapping table reconstruction mechanism, serious errors will occur. In addition, because the cache needs to frequently update the key array mapping table, in order to speed up access, the cache can be used for local caching. If a sudden power outage occurs, the data in the cache will be lost, so a software mechanism is needed to recover this loss.

[0049] In order to solve the above problem, in the physical block where the first data is written, a timestamp and mapping information are recorded for each data block, wherein the timestamp of the i-th data block represents the writing order of the i-th data block, and the mapping information of the i-th data block includes the first key value and the i-th address data.

[0050] The mapping information includes a mapping pair formed by the first key value and each address data, and the relationship is expressed as key-array[i].

[0051] By recording the writing time and mapping information of the written data in the physical block, the purpose of recording the mapping relationship of the data in the physical block of the storage system can be achieved, and the storage of the mapping relationship can be completed.

[0052] Preferably, the write time and mapping information are recorded in metadata of each data block.

[0053] The metadata is used to store the above information, making it easier to find and locate the information.

[0054] The mapping table is divided into N mapping sub-tables, wherein each mapping sub-table records a mapping relationship of data stored in a physical block;

[0055] When writing the i-th data block into the n-th physical block, the timestamp and mapping information of the i-th data block are written into the metadata of the i-th data block;

[0056] Where n and N are both integers, and n≤N, where N is the total number of physical blocks in the storage system.

[0057] Divide the entire key array mapping table into N equal parts. If one of the parts is flushed in sequence after each physical block is written, the Sn timestamp is recorded for each physical block, where the Sn (timestamp) is recorded in the metadata area of ​​each piece of data. In addition, the key-array[x] of the data is also recorded, where x is the offset of the array in the key-array mapping table.

[0058] By adopting the above method, every time a physical block is written, the mapping table information corresponding to the user data carried in this physical block will be flushed to the meta data area. That is, after completing the writing of a physical block, 1 / N of the mapping table can be written in the metadata area. Therefore, if the writing of N blocks is completed, a complete key array mapping table will be refreshed, but the above mapping table is not the latest one.

[0059] Among them, the latest key array mapping table is the key array mapping sub-table stored in the block indicated by the current latest Sn number, and the key array mapping sub-table of N-1 blocks before the timestamp of this block.

[0060] Figure 3 A schematic diagram of a storage method of a mapping table provided in an embodiment of the present application. Figure 3 As shown in the figure, the storage method of the mapping table is designed for the purpose of restoration. In the process of storing the key array mapping table, since each mapping sub-table will obtain the latest value of its own write time by subsequent write operations, the latest key array mapping relationship must exist in the head block and in N-1 blocks traced forward from the head block, where the head block is the block with the latest write timestamp Sn among all blocks.

[0061] In an exemplary embodiment, after a mapping table loss occurs in a storage system, the target physical block last written before the loss is determined based on the timestamps in the N physical blocks;

[0062] Obtaining a mapping subtable of the target physical block and N-1 physical blocks before the target physical block;

[0063] Generate the latest mapping table using the acquired mapping sub-table.

[0064] The block being written before power failure is called the head block. Based on the time-sharing flashing strategy of the key array mapping table, when the writing of N blocks is completed, a complete key array mapping table can be written, and the key array mapping table information in the meta data of the last N blocks written is the latest. According to the timestamp of writing, the N blocks counting down from the headblock are used to complete the construction of the latest table using the sub-tables corresponding to the N blocks.

[0065] Figure 4 A schematic diagram of a method for restoring a mapping table provided in an embodiment of the present application. Figure 4 As shown, after the storage system loses power, the meta data area of ​​each block is obtained, and N blocks can be obtained by iterating from the latest write timestamp to the most recent timestamp. The latest key array mapping table before the power failure can be rebuilt using the timestamps of the N physical blocks.

[0066] In an exemplary embodiment, managing data in a storage system by using the mapping table includes:

[0067] If the request information is to read the second data, obtain the second key value of the second data;

[0068] Determine a second address data set corresponding to the second key from the mapping table;

[0069] Read data in all storage addresses in the second address data set.

[0070] When an access request is received, the key value of the structured data required for the access request is found by accessing all the key-array pairs recorded in the mapping table in the storage controller DDR, and then all the data in the physical address indicated by each array member associated with this key value is read out and sent to the front end, which decides which data to transmit is required by the host.

[0071] It can be seen from the data access process in the above process that the embodiment of the present application provides a data access process based on a new key-array pair, which is compatible with the data access mechanism of the KV storage system in the prior art and has good versatility.

[0072] In an exemplary embodiment, managing data in a storage system by using the mapping table includes:

[0073] If the request information is to update the stored third data, the number of m data blocks is p data blocks, determining the address data of the m data blocks, and recording the physical addresses where the p data blocks are written;

[0074] In the third address data set corresponding to the third data, the physical addresses in the address data corresponding to the m data blocks are replaced with the physical addresses written by the p data blocks to obtain an updated mapping table;

[0075] Wherein, 1≤m≤M, p≥1, wherein m, M and p are all positive numbers, and M is the total number of data blocks into which the third data is divided.

[0076] In the above method flow, if a rewrite instruction is received, first determine whether the second key value carried by the rewrite instruction is in the mapping relationship table. If the second key value is not in the mapping relationship table, it means that the rewrite instruction is a write operation. Figure 1 The process shown completes the creation operation of the mapping relationship when writing structured data.

[0077] If the second key value is in the mapping relationship table, it means that the rewrite instruction is to modify the original data into new data, and write the new data specified by the host into a new flash memory address, wherein the original data corresponding to the new data may be data stored in some or all members of the array associated with one or more keys, and the physical address indicated by the array member of the original data hit by the rewrite command in the key-array is updated. The generated new mapping relationship may contain one or more key-array pairs, or may only change the physical addresses indicated by some members of the original key-array pair.

[0078] Figure 5 A schematic diagram of a method for updating a mapping table provided in an embodiment of the present application. Figure 5 As shown, the update of the key array mapping table can be divided into local update and overall update. The update situation depends on the needs of the host side. It only needs to convert the access command of the host side into the access to the data contained in the key value, and then update the address of the user data stored in the array member hit in the key array mapping table to obtain the latest key array mapping table.

[0079] In summary, the method provided in the embodiment of the present application is to realize local update of the mapping relationship, and only needs to update the data specified by the host side, without updating the data of the entire structured data block contained in the value pointed to by the key, and provides a set of mapping table management strategies (creation / update / storage / restore of mapping tables), which can be applied to KV storage technology to improve the pressure of mapping table processing on performance and improve the management efficiency of SSD for user data; the storage table strategy is designed based on the idea of ​​restoration, avoiding the trouble of traditional table flushing strategy GC, and reducing the performance pressure brought by table flushing from the perspective of table flushing; different from the overall programming method in the KV storage technology solution, it reduces write amplification to a certain extent and extends the service life of Nand flash.

[0080] An embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute any of the methods described above when running.

[0081] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the methods described above.

[0082] An embodiment of the present application provides a solid state drive (SSD), comprising the device described above.

[0083] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A data management method in a storage system, characterized in that: The storage system is used to store structured data, and the method includes: Splitting the first data to be written into i data blocks of the same size, where i is an integer greater than or equal to 1; In the process of writing the data block of the first data, the physical address used for the write operation is recorded for each data block, i pieces of address data are obtained, and the write time of each data block in the physical block is recorded; generating a first address data set of the first data according to the i pieces of address data; A mapping table recording a first key value of the first data and a first address data set in a preset mapping table, wherein the mapping table is divided into mapping sub-tables corresponding to N physical blocks one by one, wherein each mapping sub-table records a mapping relationship of data stored in a physical block, and mapping information of each data block includes a mapping pair formed by the first key value and each address data, and each physical block has a corresponding timestamp, wherein the timestamp is used to record the latest time when the data block is written into the physical block, and N represents the total number of physical blocks in the storage system, wherein N is a positive integer; Iterate the timestamps of N physical blocks toward the most recent timestamp to obtain the order of the timestamps of the N physical blocks, and generate a mapping table using the order of the timestamps of the N physical blocks, where the current mapping table consists of a mapping sub-table corresponding to the target physical block indicated by the most recent timestamp and a mapping sub-table counting N-1 blocks forward from the timestamp of the target physical block; The mapping table is used to manage data in the storage system.

2. The method according to claim 1, characterized in that The method further comprises: In the physical block where the first data is written, a timestamp and mapping information are recorded for each data block, wherein the timestamp of the i-th data block represents the writing order of the i-th data block, and the mapping information of the i-th data block includes the first key value and the i-th address data.

3. The method according to claim 2, characterized in that The timestamp and mapping information are recorded in the metadata of each data block.

4. The method according to claim 3, characterized in that: When writing the i-th data block into the n-th physical block, the timestamp and mapping information of the i-th data block are written into the metadata of the i-th data block; Wherein n is a positive integer and n≤N.

5. The method according to claim 1, characterized in that The using the mapping table to manage the data in the storage system includes: If the request information is to read the second data, obtain the second key value of the second data; Determine a second address data set corresponding to the second key value from the mapping table; Read data in all storage addresses in the second address data set.

6. The method according to claim 1, characterized in that The using the mapping table to manage the data in the storage system includes: If the request information is to update the stored third data, the number of m data blocks is p data blocks, determining the address data of the m data blocks, and recording the physical addresses where the p data blocks are written; In the third address data set corresponding to the third data, the physical addresses in the address data corresponding to the m data blocks are replaced with the physical addresses written by the p data blocks to obtain an updated mapping table; Wherein, 1≤m≤M, p≥1, wherein m, M and p are all positive numbers, and M is the total number of data blocks into which the third data is divided.

7. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.

8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

9. A solid state drive (SSD), comprising the device as claimed in claim 8.