Garbage recycling method, device and equipment for solid state disk and medium
By dividing and marking data in a distributed storage system in a solid-state drive and writing it in a data stream, the problem of performance degradation in solid-state drives during garbage collection operations is solved, and more efficient storage and response speed is achieved.
Patent Information
- Application Number
- CN202412000405.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-31
AI Technical Summary
When performing garbage collection operations, solid-state drives need to pause or slow down the input/output operations of the host, resulting in poor working performance.
The data in the distributed storage system is divided into different types (cold data, hot data, metadata, system data), and a data label is set for each type, and the data is written to the solid-state drive in a data stream according to the data label. When a garbage collection operation instruction is received, the solid-state drive is controlled to perform garbage collection operations according to the data flow.
By writing data with the same or similar life cycle to the solid-state drive, the workload of garbage collection is reduced, storage efficiency is improved, and the host can process multiple data streams in parallel during the garbage collection process, reducing the impact on host operational performance and improving response speed.
Smart Images

Figure CN119739341A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a garbage collection method, device, equipment and medium for a solid state hard disk. Background Art
[0002] Solid State Drive (SSD) is becoming the new generation of mainstream storage media due to its advantages of low power consumption, low noise, small size, light weight and fast read and write speed. Because SSD stores different types of data in a mixed manner, there are both cold data and hot data in the same storage unit of SSD. Since hot data is updated more frequently, when SSD performs garbage collection (GC), it needs to copy the cold data that is not frequently updated to other empty storage units, and then erase the storage unit that originally stored the cold data. This causes SSD to pause or slow down the input / output (I / O) operation of the host when performing garbage collection, which results in poor performance of SSD. At present, there is no more effective solution to this technical problem. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a garbage collection method, device, equipment and medium for a solid state drive to solve the problem of poor working performance of the solid state drive when performing garbage collection operations in the related art.
[0004] In order to solve the above technical problems, the present invention provides a garbage collection method for a solid state hard disk, comprising:
[0005] Divide the data in the distributed storage system into different types of data and set corresponding data labels for each type of data;
[0006] Writing the data in the distributed storage system to the solid state drive in a data stream manner according to different data tags;
[0007] When the solid state hard disk receives a garbage collection operation instruction, the solid state hard disk is controlled to perform a garbage collection operation on the stored data in the solid state hard disk according to different data streams.
[0008] In a specific implementation of the present application, dividing the data in the distributed storage system into different types of data and setting corresponding data labels for each type of data includes:
[0009] The data in the distributed storage system is divided into cold data, hot data, metadata and system data, and a first tag, a second tag, a third tag and a fourth tag are respectively set for the cold data, the hot data, the metadata and the system data.
[0010] In a specific implementation of the present application, dividing the data in the distributed storage system into cold data, hot data, metadata, and system data, and setting a first tag, a second tag, a third tag, and a fourth tag for the cold data, the hot data, the metadata, and the system data, respectively, includes:
[0011] Real-time detection of whether the storage pool of the distributed storage system has received the target data sent by the user end;
[0012] If not, continue to execute the step of detecting in real time whether the storage pool of the distributed storage system has received the target data sent by the user end;
[0013] If yes, the target data is differentiated by heat to obtain the cold data and the hot data;
[0014] storing the cold data and the hot data in a slow storage pool and a fast storage pool respectively;
[0015] Setting the first label and the second label for the cold data and the hot data respectively;
[0016] Sending the cold data with the first label and the hot data with the second label to an object storage device of the distributed storage system;
[0017] Using the object storage device to acquire data used to describe the cold data and the hot data, obtain the metadata, and set the third tag for the metadata;
[0018] Sending the cold data with the first tag, the hot data with the second tag, and the metadata with the third tag to a storage device engine of the distributed storage system;
[0019] The storage device engine is used to determine the data generated by the distributed storage system as the system data, and the fourth tag is set for the system data.
[0020] In a specific implementation of the present application, the step of performing heat differentiation on the target data to obtain the cold data and the hot data includes:
[0021] The target data is differentiated by heat according to a plurality of data dimensions to obtain the cold data and the hot data; wherein the data dimensions include: data access frequency, user name, and data storage path.
[0022] In a specific implementation of the present application, it also includes:
[0023] Storing configuration information related to the hot data and the cold data in an object storage device mapping table;
[0024] The object storage device mapping table is sent to the object storage device through a monitor in the distributed storage system.
[0025] In a specific implementation of the present application, writing the data in the distributed storage system to the solid state drive in a data stream manner according to different data tags includes:
[0026] specifying, by the storage device engine, a first data stream, a second data stream, a third data stream, and a fourth data stream for the cold data, the hot data, the metadata, and the system data;
[0027] The first data stream, the second data stream, the third data stream and the fourth data stream are encapsulated by using the driver layer of the distributed storage system, and the first data stream, the second data stream, the third data stream and the fourth data stream are written to the solid state drive.
[0028] In a specific implementation of the present application, the encapsulating the first data stream, the second data stream, the third data stream, and the fourth data stream by using the driver layer of the distributed storage system includes:
[0029] Based on the non-volatile memory host controller interface specification and using a storage system development kit, the first data stream, the second data stream, the third data stream and the fourth data stream are encapsulated.
[0030] In order to solve the above technical problems, the present invention further provides a garbage collection device for a solid state hard disk, comprising:
[0031] The data partitioning module is used to partition the data in the distributed storage system into different types of data and set corresponding data labels for each type of data;
[0032] A data writing module, used for writing the data in the distributed storage system to the solid state drive in a data stream according to different data tags;
[0033] The garbage collection module is used to control the solid-state hard disk to perform a garbage collection operation on the stored data in the solid-state hard disk according to different data streams when the solid-state hard disk receives a garbage collection operation instruction.
[0034] In order to solve the above technical problems, the present invention also provides a garbage collection device for a solid state hard disk, comprising:
[0035] Memory for storing computer programs;
[0036] The processor is used to implement the steps of a garbage collection method for a solid state hard disk as disclosed above when executing the computer program.
[0037] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a garbage collection method for a solid state hard disk as disclosed above are implemented.
[0038] In the garbage collection method of the solid-state hard disk provided by the present invention, first, the data in the distributed storage system is divided into different types of data, and corresponding data tags are set for each type of data; then, the data in the distributed storage system is written to the solid-state hard disk in the form of a data stream according to the different data tags; when the solid-state hard disk receives a garbage collection operation instruction, the solid-state hard disk is controlled to perform a garbage collection operation on the stored data in the solid-state hard disk according to the different data streams.
[0039] The beneficial effect of the present invention is that the method provided by the present invention is equivalent to writing data with the same or similar life cycle in a distributed storage system into a solid-state hard disk, so that when the solid-state hard disk performs a garbage collection operation, the workload of garbage collection can be reduced and storage efficiency can be improved. Moreover, under this setting mode, the host of the solid-state hard disk can also process multiple data streams in parallel, so that the impact of the solid-state hard disk on the host operating performance when performing a garbage collection operation can be reduced, so that the host can respond to user requests and applications more quickly. Therefore, the working performance of the solid-state hard disk when performing a garbage collection operation can be significantly improved by this method.
[0040] Correspondingly, a garbage collection device, equipment and storage medium for a solid state hard disk provided by the present invention also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flowchart of a garbage collection method for a solid state hard disk provided by an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of the performance consumption of a solid-state drive when performing a garbage collection operation in the related art;
[0044] Figure 3 A schematic diagram of classifying data in a distributed storage system provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of writing data in a distributed storage system to a solid state drive in the form of a data stream provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of data interaction among management software, a monitor and an object storage device provided by an embodiment of the present invention;
[0047] Figure 6 A structural diagram of a garbage collection device for a solid state hard disk provided by an embodiment of the present invention;
[0048] Figure 7 A structural diagram of a garbage collection device for a solid state hard disk provided by an embodiment of the present invention;
[0049] Figure 8 A schematic diagram of the specific structure of a garbage collection device for a solid state drive provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0052] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0053] See also Figure 1 , Figure 1 A flowchart of a garbage collection method for a solid state drive provided by an embodiment of the present invention, the method comprising:
[0054] Step S11: Divide the data in the distributed storage system into different types of data, and set corresponding data labels for each type of data;
[0055] Step S12: writing the data in the distributed storage system to the solid state drive in a data stream manner according to different data tags;
[0056] Step S13: when the solid state hard disk receives the garbage collection operation instruction, the solid state hard disk is controlled to perform a garbage collection operation on the stored data in the solid state hard disk according to different data streams.
[0057] In order to enable those skilled in the art to more clearly understand the implementation principle of the present invention, a brief description of the existing garbage collection operation of the solid-state drive is first given here. From the principle of garbage collection, different types of data will be mixed and stored in the solid-state drive, which means that cold data and hot data may be stored in the same storage unit of the solid-state drive at the same time. Since the update frequency of hot data is relatively frequent, when the solid-state drive triggers the garbage collection operation, it is necessary to copy the cold data that is not frequently updated to other empty storage units, and then erase the storage unit that originally stored the cold data, which will reduce the working performance of the solid-state drive. Please refer to Figure 2 , Figure 2 Schematic diagram of the performance consumption of a solid state drive when performing a garbage collection operation in the related art. Figure 2 In the figure, the red line represents the external output performance of the SSD, the blue line represents the performance consumption of the SSD when performing garbage collection operations, and the green line represents the total bandwidth of the SSD.
[0058] In order to improve the working performance of the solid state drive, in this embodiment, it is first necessary to divide the data in the distributed storage system into different types of data, and set corresponding data tags for each type of data. The data in the distributed storage system includes both the data sent by the user end to the distributed storage system and the data generated by the distributed storage system itself.
[0059] Specifically, the data in the distributed storage system is divided into different types of data, and corresponding data labels are set for each type of data, including:
[0060] The data in the distributed storage system is divided into different types according to the creation time, IO size, and source of the data, and corresponding data labels are set for each type of data.
[0061] In practical applications, when dividing data in a distributed storage system into different types of data, the data in the distributed storage system can be divided into different types of data according to the creation time of the data, the IO size of the data, or the source of the data, and a corresponding data label can be set for each type of data. Under this setting, the same type of data can be stored centrally, which can not only optimize the storage performance of the distributed storage system, but also improve the speed at which users access the same type of data.
[0062] Of course, in practical applications, the data in the distributed storage system can also be classified according to other attribute characteristics of the data, and corresponding data labels can be set for each type of data, which will not be described in detail here.
[0063] After dividing the data in the distributed storage system into different types of data and setting corresponding data tags for each type of data, the data in the distributed storage system also needs to be written to the solid-state drive in the form of a data stream according to the different data tags. This is equivalent to writing data with the same or similar life cycle in the distributed storage system into the solid-state drive.
[0064] When the SSD receives a garbage collection operation instruction, it controls the SSD to perform garbage collection operations on the stored data in the SSD according to different data streams. It can be imagined that when data with the same or similar life cycle in a distributed storage system is written to the SSD, the write amplification phenomenon can be reduced (that is, the ratio between the amount of data actually written to the SSD and the amount of data requested to be written by the host is reduced). Due to the reduction in write amplification, the service life of the SSD can be extended and the IOPS (Input / Output Operations PerSecond) of the SSD can be significantly improved.
[0065] When the SSD performs garbage collection operations in a multi-stream manner, it can process multiple data streams at the same time and efficiently handle concurrent operations. In this setting, the SSD can provide I / O responses for other data streams of the host while performing garbage collection operations on one data stream, thus reducing the impact of the SSD on the host I / O operation performance when performing garbage collection operations, thereby improving the performance of the entire distributed storage system. The specific advantages of this operation mode are as follows:
[0066] First, improve the performance of SSDs. SSDs can efficiently perform garbage collection operations in the background, and multi-stream SSDs can reduce performance flickering when performing garbage collection operations, providing more stable and consistent IO performance;
[0067] Second, it improves the host's response speed to requests. Since the SSD reduces interference with the host's IO operations when performing garbage collection operations, the host can respond to user requests and applications at a faster speed;
[0068] Third, enhance the multi-tasking capability of SSDs. Multi-stream technology allows SSDs to perform garbage collection operations while processing multiple concurrent IO requests, which is very beneficial for environments that need to process a large number of concurrent tasks. In addition, SSDs process multiple data streams in parallel and can more efficiently handle concurrent I / O requests from different applications.
[0069] Fourth, improve the QoS (Quality of Service) of distributed storage systems. Multi-stream technology can improve the service level between different applications or virtual machines and ensure that key applications get enough I / O resources;
[0070] Fifth, enhance the resource utilization of solid-state drives. Multi-stream technology can more efficiently utilize the resources in solid-state drives, thereby improving the throughput and system response time of the entire distributed storage system.
[0071] The method provided by this embodiment is equivalent to writing data with the same or similar life cycle in a distributed storage system into a solid-state hard disk, so that when the solid-state hard disk performs a garbage collection operation, the workload of garbage collection can be reduced and storage efficiency can be improved. Moreover, under this setting mode, the host of the solid-state hard disk can also process multiple data streams in parallel, so that the impact of the solid-state hard disk on the host operating performance when performing a garbage collection operation can be reduced, so that the host can respond to user requests and applications more quickly. Therefore, this method can significantly improve the working performance of the solid-state hard disk when performing a garbage collection operation.
[0072] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation, the above steps of dividing the data in the distributed storage system into different types of data and setting corresponding data labels for each type of data include:
[0073] The data in the distributed storage system is divided into cold data, hot data, metadata and system data, and a first tag, a second tag, a third tag and a fourth tag are set for the cold data, the hot data, the metadata and the system data respectively.
[0074] In this embodiment, when the data in the distributed storage system is divided into different types of data, the data in the distributed storage system can be divided into cold data, hot data, metadata and system data according to the heat of the data. Among them, the heat of metadata is the highest, the heat of system data is second, the heat of hot data is lower than that of system data, and the heat of cold data is the lowest.
[0075] After the data in the distributed storage system is divided into cold data, hot data, metadata, and system data, the first label, second label, third label, and fourth label need to be set for the cold data, hot data, metadata, and system data, respectively. Specifically, the first label, second label, third label, and fourth label can be set to hot, cold, meta, and WAL (Write Ahead Logging), respectively.
[0076] After the data in the distributed storage system is classified according to data heat, the data with the same or similar life cycle can be written to the same erase unit of the solid-state drive. In addition, data with different heats have different access modes. Therefore, when data with different heats are classified and stored in the solid-state drive, not only can unnecessary data movement and copying be reduced, but also the performance loss of data during migration can be reduced.
[0077] Obviously, the technical solution provided in this embodiment can further improve the efficiency of the solid state drive when performing garbage collection operations.
[0078] As a preferred implementation, the above step of dividing the data in the distributed storage system into cold data, hot data, metadata and system data, and setting a first tag, a second tag, a third tag and a fourth tag for the cold data, the hot data, the metadata and the system data, respectively, includes:
[0079] Real-time detection of whether the storage pool of the distributed storage system has received the target data sent by the user end;
[0080] If not, continue to execute the step of real-time detecting whether the storage pool of the distributed storage system has received the target data sent by the user end;
[0081] If so, the target data is differentiated by heat to obtain cold data and hot data;
[0082] Store cold data and hot data in slow storage pools and fast storage pools respectively;
[0083] Set a first label and a second label for cold data and hot data respectively;
[0084] Sending the cold data with the first label and the hot data with the second label to an object storage device of the distributed storage system;
[0085] Using the object storage device to obtain data describing the cold data and the hot data, obtain metadata, and set a third tag for the metadata;
[0086] Sending the cold data with the first label, the hot data with the second label, and the metadata with the third label to a storage device engine of the distributed storage system;
[0087] The storage device engine is used to determine the data generated by the distributed storage system as system data, and a fourth tag is set for the system data.
[0088] In this embodiment, the data classification process in the distributed storage system is specifically introduced. Figure 3 , Figure 3 A schematic diagram of classifying data in a distributed storage system provided by an embodiment of the present invention. When classifying data in a distributed storage system, firstly, it is detected in real time whether the storage pool of the distributed storage system has received the target data sent by the user end, and if it is not detected that the storage pool has received the target data sent by the user end, then the step of detecting in real time whether the storage pool of the distributed storage system has received the target data sent by the user end is continued.
[0089] If it is detected that the storage pool of the distributed storage system receives the target data sent by the user end, the heat of the target data is distinguished to obtain cold data and hot data, and the cold data and hot data are stored in the slow storage pool and the fast storage pool respectively, and the cold data and the hot data are marked with a first label and a second label respectively.
[0090] Among them, the slow storage pool refers to the storage medium with low setup cost and low usage frequency in the distributed storage system, while the fast storage pool refers to the storage medium with high setup cost and faster access speed in the distributed storage system. Generally speaking, the slow storage pool is suitable for storing infrequently accessed data, while the fast storage pool is suitable for storing frequently accessed data.
[0091] Then, the cold data with the first label and the hot data with the second label are sent to the object storage device (OSD) of the distributed storage system. After the object storage device receives the cold data with the first label and the hot data with the second label, it obtains the data used to describe the cold data and the hot data, obtains the metadata, and sets a third label for the metadata. The data used to describe the cold data and the hot data include: the creation information of the cold data and the hot data, the data storage location, the data format, the file name, the access permission information, etc.
[0092] Afterwards, the object storage device will send the cold data with the first tag, the hot data with the second tag, and the metadata with the third tag to the storage device engine (BlueStore) of the distributed storage system. After receiving the cold data with the first tag, the hot data with the second tag, and the metadata with the third tag, the storage device engine will determine that the data generated by the distributed storage system is system data and set a fourth tag for the system data.
[0093] Among them, system data refers to the data generated by the distributed storage system during operation, including: operating system information, application information and system configuration information, etc. System data is an important part of the distributed storage system and is the key to ensuring the safe and stable operation of the distributed storage system.
[0094] Obviously, through the technical solution provided by this embodiment, the data in the distributed storage system can be accurately classified.
[0095] As a preferred implementation, the above step of writing the data in the distributed storage system to the solid state drive in a data stream manner according to different data tags includes:
[0096] Specifying, by a storage device engine, a first data stream, a second data stream, a third data stream, and a fourth data stream for cold data, hot data, metadata, and system data;
[0097] The first data stream, the second data stream, the third data stream and the fourth data stream are encapsulated by using the driver layer of the distributed storage system, and the first data stream, the second data stream, the third data stream and the fourth data stream are written to the solid state drive.
[0098] Please continue to see Figure 3 When the storage device engine writes cold data, hot data, metadata and system data to the solid-state drive, the storage device engine specifies the first data stream, the second data stream, the third data stream and the fourth data stream for the cold data, the hot data, the metadata and the system data, and uses the driver layer of the distributed storage system to encapsulate the first data stream, the second data stream, the third data stream and the fourth data stream.
[0099] After the driver layer of the distributed storage system encapsulates the first data stream, the second data stream, the third data stream and the fourth data stream, the first data stream, the second data stream, the third data stream and the fourth data stream are written to the solid state drive.
[0100] It should be noted that before writing the first data stream, the second data stream, the third data stream and the fourth data stream to the solid-state drive, the driver layer of the distributed storage system will also detect whether the solid-state drive supports the directive feature, the on / off status of the multi-stream, and query the multi-stream information. The multi-stream information query includes: the streams supported by the solid-state drive, the number of available streams, whether they are shared, the granularity of stream writing, the granularity of stream allocation, and the number of exclusive streams, etc.
[0101] Obviously, through the technical solution provided in this embodiment, cold data, hot data, metadata and system data can be accurately classified and written into the solid state drive.
[0102] As a preferred implementation, the above step of encapsulating the first data stream, the second data stream, the third data stream and the fourth data stream by using the driver layer of the distributed storage system includes:
[0103] Based on the non-volatile memory host controller interface specification and using a storage system development kit, the first data stream, the second data stream, the third data stream and the fourth data stream are encapsulated.
[0104] In this embodiment, when the driver layer of the distributed storage system encapsulates the first data stream, the second data stream, the third data stream and the fourth data stream, it is based on the non-volatile memory host controller interface specification (Non-Volatile Memory Express, NVMe), and uses the storage system development kit (Storage Performance Development Kit, SPDK) to encapsulate the first data stream, the second data stream, the third data stream and the fourth data stream.
[0105] Because SPDK provides a user-space NVMe driver that allows zero-copy and highly parallel access directly from user-space applications to SSDs, and the NVMe protocol also supports multiple queues and parallel operations, it can greatly improve the concurrent performance of distributed storage systems.
[0106] In addition, SPDK can save the frequent and bloated operations of copying data between the user space and kernel space of the host memory through a custom user-mode NVMe driver and other tool sets that replace the kernel protocol stack, which can greatly reduce the latency generated during data transmission and reception.
[0107] Combination Figure 3 It can be seen that when classifying data in a distributed storage system, the storage pool and object storage device mainly divert the target data through the pool strategy and the archiving strategy, and the storage device engine mainly organizes the target data and the data generated by the distributed storage system, and sends it to the driver layer in the form of a data stream. When the driver layer receives the data sent by the storage device engine, it will use SPDK to encapsulate each data stream and write each data stream to the solid-state drive so that the solid-state drive can perform garbage collection operations using multi-stream technology.
[0108] See also Figure 4 , Figure 4 A schematic diagram of an embodiment of the present invention for writing data in a distributed storage system to a solid-state drive in the form of a data stream. When the distributed storage system receives data sent by a user terminal, it will send instructions to the storage pool / object storage device in the distributed storage system. The storage pool, object storage device and storage device engine will divide the data sent by the user terminal and the data generated by the distributed storage system into metadata, system data, cold data and hot data. In this process, the metadata and system data will be stored in the corresponding databases respectively, and the cold data and hot data will be stored on the storage device engine. Afterwards, the driver layer in the distributed storage system will encapsulate the metadata, system data, cold data and hot data with labels in the form of a data stream, and write them to the solid-state drive respectively.
[0109] Obviously, through the technical solution provided in this embodiment, the first data stream, the second data stream, the third data stream and the fourth data stream can be encapsulated more quickly and efficiently.
[0110] As a preferred implementation, the above step of distinguishing the heat of the target data to obtain cold data and hot data includes:
[0111] The target data is differentiated by heat according to multiple data dimensions to obtain cold data and hot data; wherein the data dimensions include: data access frequency, user name, and data storage path.
[0112] In this embodiment, when the target data is differentiated by heat to obtain cold data and hot data, the target data may be differentiated by heat based on data dimensions such as data access frequency, user name, and data storage path.
[0113] When using data access frequency to distinguish the popularity of target data, frequently accessed data and infrequently accessed data can be classified and stored on different types of storage media, which can not only reduce storage costs, but also relatively improve data access efficiency. When using user names and data storage paths to distinguish the popularity of target data, it can help users better understand and control data access rights and improve data security.
[0114] Obviously, the technical solution provided by this embodiment can ensure the accuracy and reliability when classifying cold data and hot data.
[0115] As a preferred implementation, the garbage collection method for the solid state drive further includes:
[0116] Storing configuration information related to hot data and cold data in an object storage device mapping table;
[0117] The object storage device mapping table is sent to the object storage device through a monitor in the distributed storage system.
[0118] In this embodiment, in order to enable the object storage device to better classify the attributes of cold data and hot data, the configuration information related to hot data and cold data is stored in the object storage device mapping table (OSDMap), and the object storage device mapping table is sent to the object storage device through the monitor (Monitor) in the distributed storage system.
[0119] See also Figure 5 , Figure 5A schematic diagram of data interaction among a management software, a monitor and an object storage device provided in an embodiment of the present invention. When creating a storage pool, the management software in the distributed storage system will classify the target data sent by the user terminal according to the heat of the data, and send the classification result to the monitor. When the monitor receives the data sent by the management software, it will add a heat tag to the storage pool and store the heat tag of the storage pool in the object storage device mapping table (OSDMap). At the same time, the monitor will also send the OSDMap to the object storage device. When the object storage device receives the OSDMap, it will assign different heat information to the data in the distributed storage system according to the data content stored in the OSDMap to facilitate the smooth execution of subsequent processes.
[0120] Obviously, through the technical solution provided by this embodiment, the object storage device in the distributed storage system can be fully aware of the configuration information related to hot data and cold data.
[0121] See also Figure 6 , Figure 6 A structural diagram of a garbage collection device for a solid state hard disk provided by an embodiment of the present invention, the device includes:
[0122] The data partitioning module 21 is used to partition the data in the distributed storage system into different types of data and set corresponding data labels for each type of data;
[0123] A data writing module 22, used for writing the data in the distributed storage system to the solid state drive in a data stream according to different data tags;
[0124] The garbage collection module 23 is used to control the solid state hard disk to perform a garbage collection operation on the stored data in the solid state hard disk according to different data streams when the solid state hard disk receives a garbage collection operation instruction.
[0125] In a specific implementation of the present application, the data partitioning module 21 includes:
[0126] The data partitioning submodule is used to partition the data in the distributed storage system into cold data, hot data, metadata and system data, and to set a first label, a second label, a third label and a fourth label for the cold data, the hot data, the metadata and the system data respectively.
[0127] In a specific implementation of the present application, the data partitioning submodule includes:
[0128] A real-time detection unit, used for detecting in real time whether the storage pool of the distributed storage system has received the target data sent by the user end;
[0129] A step jump unit, used for continuing to execute the step of real-time detecting whether the storage pool of the distributed storage system receives the target data sent by the user end when the determination result of the real-time detecting unit is no;
[0130] A data partitioning unit, configured to, when the determination result of the real-time detection unit is yes, perform heat classification on the target data to obtain the hot data and the cold data;
[0131] A data storage unit, used for storing the cold data and the hot data in a slow storage pool and a fast storage pool respectively;
[0132] a label setting unit, configured to set the first label and the second label for the cold data and the hot data respectively;
[0133] A data sending unit, configured to send the cold data with the first label and the hot data with the second label to an object storage device of the distributed storage system;
[0134] a data reading unit, configured to use the object storage device to acquire data used to describe the cold data and the hot data, obtain the metadata, and set the third tag for the metadata;
[0135] a label sending unit, configured to send the cold data with the first label, the hot data with the second label, and the metadata with the third label to a storage device engine of the distributed storage system;
[0136] The engine division unit is used to use the storage device engine to determine the data generated by the distributed storage system as the system data, and set the fourth tag for the system data.
[0137] In a specific implementation of the present application, the data partitioning unit includes:
[0138] The data partitioning subunit is used to differentiate the heat of the target data according to multiple data dimensions to obtain the cold data and the hot data; wherein the data dimensions include: data access frequency, user name, and data storage path.
[0139] In a specific implementation of the present application, it also includes:
[0140] An information storage unit, used for storing configuration information related to the hot data and the cold data in an object storage device mapping table;
[0141] A mapping table sending unit is used to send the object storage device mapping table to the object storage device through a monitor in the distributed storage system.
[0142] In a specific implementation of the present application, the data writing module 22 includes:
[0143] a data stream designation unit, configured to designate a first data stream, a second data stream, a third data stream, and a fourth data stream for the cold data, the hot data, the metadata, and the system data through the storage device engine;
[0144] A data writing unit is used to encapsulate the first data stream, the second data stream, the third data stream and the fourth data stream by using the driver layer of the distributed storage system, and write the first data stream, the second data stream, the third data stream and the fourth data stream to the solid state drive.
[0145] In a specific implementation of the present application, the data writing unit includes:
[0146] The data writing subunit is used to encapsulate the first data stream, the second data stream, the third data stream and the fourth data stream using a storage system development kit based on a non-volatile memory host controller interface specification.
[0147] A garbage collection device for a solid state hard disk provided in an embodiment of the present invention has the beneficial effects of the garbage collection method for a solid state hard disk disclosed above.
[0148] Corresponding to the above method embodiment, see Figure 7 , Figure 7 A structural diagram of a garbage collection device for a solid state hard disk provided in an embodiment of the present invention, the device may include:
[0149] A memory 332, for storing computer programs;
[0150] The processor 322 is used to implement the steps of the garbage collection method for the solid state drive of the above method embodiment when executing a computer program.
[0151] For details, please refer to Figure 8 , Figure 8A schematic diagram of the specific structure of a garbage collection device for a solid state drive provided in an embodiment of the present invention. The garbage collection device for the solid state drive may have relatively large differences due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the garbage collection device 301 of the solid state drive.
[0152] The garbage collection device 301 of the solid state drive may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .
[0153] The steps in the garbage collection method of the solid state drive described above can be implemented by the structure of the garbage collection device of the solid state drive.
[0154] Corresponding to the above method embodiment, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:
[0155] The data in the distributed storage system is divided into different types of data, and corresponding data labels are set for each type of data; the data in the distributed storage system is written to the solid-state hard disk in the form of data streams according to the different data labels; when the solid-state hard disk receives a garbage collection operation instruction, the solid-state hard disk is controlled to perform garbage collection operations on the stored data in the solid-state hard disk according to the different data streams.
[0156] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0157] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0158] Corresponding to the above method embodiment, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of a garbage collection method for a solid state hard disk as disclosed above.
[0159] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the devices, equipment and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0160] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the technical solution and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A garbage collection method for a solid state hard disk, characterized in that: include: Divide the data in the distributed storage system into different types of data and set corresponding data labels for each type of data; Writing the data in the distributed storage system to the solid state drive in a data stream manner according to different data tags; When the solid state hard disk receives a garbage collection operation instruction, the solid state hard disk is controlled to perform a garbage collection operation on the stored data in the solid state hard disk according to different data streams.
2. The garbage collection method for a solid state hard disk according to claim 1, characterized in that: The method of dividing the data in the distributed storage system into different types of data and setting corresponding data labels for each type of data includes: The data in the distributed storage system is divided into cold data, hot data, metadata and system data, and a first tag, a second tag, a third tag and a fourth tag are respectively set for the cold data, the hot data, the metadata and the system data.
3. The garbage collection method for a solid state hard disk according to claim 2, characterized in that: The method of dividing the data in the distributed storage system into cold data, hot data, metadata, and system data, and setting a first tag, a second tag, a third tag, and a fourth tag for the cold data, the hot data, the metadata, and the system data, respectively, includes: Real-time detection of whether the storage pool of the distributed storage system has received the target data sent by the user end; If not, continue to execute the step of detecting in real time whether the storage pool of the distributed storage system has received the target data sent by the user end; If yes, the target data is differentiated by heat to obtain the cold data and the hot data; storing the cold data and the hot data in a slow storage pool and a fast storage pool respectively; Setting the first label and the second label for the cold data and the hot data respectively; Sending the cold data with the first label and the hot data with the second label to an object storage device of the distributed storage system; Using the object storage device to acquire data used to describe the cold data and the hot data, obtain the metadata, and set the third tag for the metadata; Sending the cold data with the first tag, the hot data with the second tag, and the metadata with the third tag to a storage device engine of the distributed storage system; The storage device engine is used to determine the data generated by the distributed storage system as the system data, and the fourth tag is set for the system data.
4. The garbage collection method for a solid state hard disk according to claim 3, characterized in that: The step of distinguishing the target data by heat to obtain the cold data and the hot data includes: The target data is differentiated by heat according to a plurality of data dimensions to obtain the cold data and the hot data; wherein the data dimensions include: data access frequency, user name, and data storage path.
5. The garbage collection method for a solid state hard disk according to claim 3, characterized in that: Also includes: Storing configuration information related to the hot data and the cold data in an object storage device mapping table; The object storage device mapping table is sent to the object storage device through a monitor in the distributed storage system.
6. The garbage collection method for a solid state hard disk according to claim 3, characterized in that: The step of writing the data in the distributed storage system to the solid state drive in a data stream manner according to different data tags includes: specifying, by the storage device engine, a first data stream, a second data stream, a third data stream, and a fourth data stream for the cold data, the hot data, the metadata, and the system data; The first data stream, the second data stream, the third data stream and the fourth data stream are encapsulated by using the driver layer of the distributed storage system, and the first data stream, the second data stream, the third data stream and the fourth data stream are written to the solid state drive.
7. A garbage collection method for a solid state hard disk according to claim 6, characterized in that: The encapsulating the first data stream, the second data stream, the third data stream, and the fourth data stream by using the driver layer of the distributed storage system includes: Based on the non-volatile memory host controller interface specification and using a storage system development kit, the first data stream, the second data stream, the third data stream and the fourth data stream are encapsulated.
8. A garbage collection device for a solid state hard disk, characterized in that: include: The data partitioning module is used to partition the data in the distributed storage system into different types of data and set corresponding data labels for each type of data; A data writing module, used for writing the data in the distributed storage system to the solid state drive in a data stream according to different data tags; The garbage collection module is used to control the solid-state hard disk to perform a garbage collection operation on the stored data in the solid-state hard disk according to different data streams when the solid-state hard disk receives a garbage collection operation instruction.
9. A garbage collection device for a solid state hard disk, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of a garbage collection method for a solid state hard disk as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the garbage collection method for a solid state hard disk as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and equipment for writing data into solid hard disk
CN104391661A
Full-process management method and system for garbage collection and readable storage medium
CN113779007A
Distributed data stream processing method, device and equipment based on memory grid
CN116954944A
Solid state disk configuration method, garbage collection method and related equipment
CN117909250A
STREAM IDENTIFIER BASED STORAGE SYSTEM FOR MANAGING AN ARRAY OF SSDs
US20180059988A1
Cited By
Data caching method and device, storage system, electronic equipment and storage medium
CN120256332A