技术领域technical field
本申请涉及电子存储技术,尤其涉及一种固态存储设备的垃圾回收的方法以及计算机设备。The present application relates to electronic storage technology, and in particular to a garbage collection method for a solid-state storage device and a computer device.
背景技术Background technique
随着电子存储技术的发展,固态存储设备的应用越来越广泛。而固态存储设备存储数据是通过计算机设备重定向写入数据的方式,即同一内存地址之前的写入的数据在下一次同一内存地址再次写入数据时,那么之前写入的数据就会变为无效数据。因此,固态存储设备中无效数据需要进行垃圾回收,即对无效数据的删除。With the development of electronic storage technology, the application of solid-state storage devices is becoming more and more extensive. The solid-state storage device stores data by redirecting and writing data through computer equipment, that is, when the data written before the same memory address is written again at the same memory address next time, the previously written data will become invalid. data. Therefore, the invalid data in the solid-state storage device needs to be garbage collected, that is, the invalid data is deleted.
目前,固态存储设备中垃圾回收的方式主要是通过计算机设备在写入数据的过程中,将写入的数据存储至固态存储设备中的目标内存地址所对应的的数据块中,然后,写入数据的这个内存地址原本已写入的数据就会变为无效数据,那么此时确定了该无效数据时,就要对该无效数据进行删除,即垃圾回收,实现释放无效数据所对应的数据块的存储空间。At present, the way of garbage collection in solid-state storage devices is mainly to store the written data in the data block corresponding to the target memory address in the solid-state storage device during the process of writing data by the computer device, and then write The data originally written in the memory address of the data will become invalid data, then when the invalid data is determined at this time, the invalid data must be deleted, that is, garbage collection, to realize the release of the data block corresponding to the invalid data storage space.
因此,目前计算机设备对数据块的无效数据进行垃圾回收处理依赖于计算机设备写入数据至数据块的过程,即计算机设备对无效数据进行垃圾回收只能在写入数据的过程中处理,导致了对固态存储设备中的无效数据所在的数据块的存储空间的释放在时间上的局限性较大,灵活性差。Therefore, at present, computer equipment performs garbage collection processing on invalid data of data blocks depending on the process of computer equipment writing data to data blocks, that is, computer equipment can only process garbage collection on invalid data during the process of writing data, resulting in The release of the storage space of the data block where the invalid data is located in the solid-state storage device has relatively large time limitations and poor flexibility.
发明内容Contents of the invention
本申请实施例提供了一种固态存储设备的垃圾回收的方法以及计算机设备,用于提高对固态存储设备的待回收数据块进行垃圾回收的灵活性。Embodiments of the present application provide a garbage collection method for a solid-state storage device and a computer device, which are used to improve the flexibility of garbage collection for data blocks to be recycled in the solid-state storage device.
第一方面,本申请实施例提供了一种固态存储设备的垃圾回收的方法,所述方法包括:In a first aspect, an embodiment of the present application provides a method for garbage collection of a solid-state storage device, the method comprising:
计算机设备确定所述固态存储设备中的待回收数据块,所述待回收数据块为存储有写入的数据的数据块;The computer device determines a data block to be reclaimed in the solid-state storage device, and the data block to be reclaimed is a data block storing written data;
所述计算机设备根据所述待回收数据块生成列表,所述列表包含有所述待回收数据块的相关信息;The computer device generates a list according to the data block to be reclaimed, and the list includes relevant information of the data block to be reclaimed;
所述计算机设备判断所述列表中所述待回收数据块中存储的数据是否存在有效数据;The computer device judges whether there is valid data in the data stored in the data block to be recovered in the list;
若是,则所述计算机设备将所述有效数据拷贝至所述固态存储设备的空闲数据块中,所述空闲数据块为所述固态存储设备中未存储有数据的数据块;If so, the computer device copies the valid data to an idle data block of the solid-state storage device, and the idle data block is a data block in which no data is stored in the solid-state storage device;
所述计算机设备释放所述列表中所述待回收数据块所对应的存储空间。The computer device releases the storage space corresponding to the data blocks to be reclaimed in the list.
一种可能的实现方式中,若所述计算机设备确定待回收数据块中不存在有效数据,所述方法还包括:In a possible implementation manner, if the computer device determines that there is no valid data in the data block to be reclaimed, the method further includes:
所述计算机设备释放所述列表中所述待回收数据块所对应的存储空间。The computer device releases the storage space corresponding to the data blocks to be reclaimed in the list.
另一种可能的实现方式中,所述计算机设备确定所述固态存储设备中待回收数据块之后,所述计算机设备根据所述待回收数据块生成列表之前,所述方法还包括:In another possible implementation manner, after the computer device determines the data blocks to be reclaimed in the solid-state storage device and before the computer device generates a list according to the data blocks to be reclaimed, the method further includes:
所述计算机设备确定所述待回收数据块的个数大于预设个数;The computer device determines that the number of data blocks to be reclaimed is greater than a preset number;
所述计算机设备确定所述待回收数据块中的每个数据块的无效数据占比;The computer device determines the proportion of invalid data of each data block in the data block to be reclaimed;
所述计算机设备从所述待回收数据块中确定无效数据占比大于预设阈值的目标数据块。The computer device determines, from the data blocks to be reclaimed, target data blocks whose proportion of invalid data is greater than a preset threshold.
所述计算机设备根据所述待回收数据块生成列表包括:The generating list of the computer equipment according to the data block to be reclaimed includes:
所述计算机设备所述将所述目标数据块的编号填写至列表,所述列表包含所述目标数据块的相关信息。The computer device fills the number of the target data block into a list, and the list includes related information of the target data block.
另一种可能的实现方式中,所述计算机设备释放所述列表中所述待回收数据块所对应的存储空间包括:In another possible implementation manner, releasing the storage space corresponding to the data block to be reclaimed in the list by the computer device includes:
所述计算机设备优先释放所述目标数据块中无效数据占比最大的数据块所对应的存储空间。The computer device preferentially releases the storage space corresponding to the data block with the largest proportion of invalid data among the target data blocks.
另一种可能的实现方式中,所述计算机设备释放所述列表中所述待回收数据块所对应的存储空间之后,所述方法还包括:In another possible implementation manner, after the computer device releases the storage space corresponding to the data block to be reclaimed in the list, the method further includes:
所述计算机设备按照预设时长检测所述待回收数据块所对应的存储空间的释放情况;The computer device detects the release of the storage space corresponding to the data block to be reclaimed according to a preset duration;
当所述计算机设备确定所述待回收数据块中的第一数据块所对应的存储空间未释放完成时,所述计算机设备将所述第一数据块的编号填写至所述列表中,以使得所述计算机设备对所述第一数据块所对应的存储空间进行释放。When the computer device determines that the storage space corresponding to the first data block in the data blocks to be reclaimed has not been released, the computer device fills the number of the first data block into the list, so that The computer device releases the storage space corresponding to the first data block.
另一种可能的实现方式中,所述计算机设备确定所述固态存储设备中的待回收数据块包括:In another possible implementation manner, the determining by the computer device that the data block to be reclaimed in the solid-state storage device includes:
所述计算机设备根据所述固态存储设备中卷的分配位图确定所述固态存储设备中待回收数据块。The computer device determines the data block to be reclaimed in the solid-state storage device according to the allocation bitmap of the volume in the solid-state storage device.
另一种可能的实现方式中,所述计算机设备判断所述待回收数据块中存储的数据是否存在有效数据包括:In another possible implementation manner, the determining by the computer device whether valid data exists in the data stored in the data block to be reclaimed includes:
所述计算机设备判断所述待回收数据块中的每个物理块是否与所述固态存储设备中的逻辑块存在映射关系;The computer device judges whether each physical block in the data block to be reclaimed has a mapping relationship with a logical block in the solid-state storage device;
若是,则所述计算机设备确定所述待回收数据块中存储的数据存在有效数据;If so, the computer device determines that there is valid data in the data stored in the data block to be reclaimed;
若否,则所述计算机设备确定所述待回收数据块中存储的数据不存在有效数据。If not, the computer device determines that there is no valid data in the data stored in the data block to be reclaimed.
第二方面,本申请实施例提供了一种计算机设备,所述计算机设备包括:In a second aspect, an embodiment of the present application provides a computer device, and the computer device includes:
第一确定单元,用于确定所述固态存储设备中待回收数据块,所述待回收数据块为存储有写入的数据的数据块;A first determining unit, configured to determine a data block to be reclaimed in the solid-state storage device, where the data block to be reclaimed is a data block storing written data;
生成单元,用于根据所述待回收数据块生成列表,所述列表包含有所述待回收数据块的相关信息;A generating unit, configured to generate a list according to the data blocks to be reclaimed, the list including relevant information of the data blocks to be reclaimed;
判断单元,用于判断所述待回收数据块中存储的数据是否存在有效数据;a judging unit, configured to judge whether valid data exists in the data stored in the data block to be recovered;
拷贝单元,用于若所述计算机设备确定所述待回收数据块中存储的数据存在有效数据,将所述有效数据拷贝至所述固态存储设备的空闲数据块中,所述空闲数据块为所述固态存储设备中未存储有数据的数据块;A copying unit, configured to copy the valid data to a free data block of the solid-state storage device if the computer device determines that there is valid data in the data stored in the data block to be reclaimed, and the free data block is the A data block that does not store data in the solid-state storage device;
释放单元,用于释放所述列表中所述待回收数据块所对应的存储空间。A releasing unit, configured to release the storage space corresponding to the data blocks to be reclaimed in the list.
一种可能的实现方式中,所述释放单元还用于:In a possible implementation manner, the releasing unit is also used for:
若所述计算机设备确定所述待回收数据块中存储的数据不存在有效数据,释放所述列表中待回收数据块所对应的存储空间。If the computer device determines that there is no valid data in the data stored in the data block to be reclaimed, release the storage space corresponding to the data block to be reclaimed in the list.
另一种可能的实现方式中,所述计算机设备还包括:In another possible implementation manner, the computer device further includes:
第二确定单元,用于确定所述待回收数据块的个数大于预设个数;A second determining unit, configured to determine that the number of data blocks to be reclaimed is greater than a preset number;
第三确定单元,用于确定待回收数据块中的每个数据块的无效数据占比;The third determination unit is used to determine the proportion of invalid data of each data block in the data block to be recycled;
第四确定单元,用于从所述待回收数据块中确定无效数据占比大于预设阈值的目标数据块;A fourth determination unit, configured to determine a target data block whose proportion of invalid data is greater than a preset threshold value from the data blocks to be reclaimed;
所述生成单元具体用于:The generating unit is specifically used for:
将所述目标数据块的编号填写至列表,所述列表包含有所述目标数据块的相关信息。Fill in the number of the target data block into a list, and the list includes relevant information of the target data block.
另一种可能的实现方式中,所述释放单元具体用于:In another possible implementation manner, the releasing unit is specifically used for:
优先释放所述目标数据块中无效数据占比最大的数据块所对应的存储空间。The storage space corresponding to the data block with the largest proportion of invalid data among the target data blocks is preferentially released.
另一种可能的实现方式中,所述计算机设备还包括:In another possible implementation manner, the computer device further includes:
检测单元,用于按照预设时长检测所述待回收数据块所对应的存储空间的释放情况;A detection unit, configured to detect the release of the storage space corresponding to the data block to be reclaimed according to a preset duration;
填写单元,用于当所述计算机设备确定所述待回收数据块中的第一数据块所对应的存储空间未释放完成时,将所述第一数据块的编号填写至所述列表中,以使得所述计算机设备对所述第一数据块所对应的存储空间进行释放。A filling unit, configured to fill in the number of the first data block in the list when the computer device determines that the storage space corresponding to the first data block in the data blocks to be reclaimed has not been released, so as to enabling the computer device to release the storage space corresponding to the first data block.
另一种可能的实现方式中,所述第一确定单元具体用于:In another possible implementation manner, the first determining unit is specifically configured to:
根据所述固态存储设备中卷的分配位图确定所述固态存储设备中的待回收数据块。The data block to be reclaimed in the solid state storage device is determined according to the allocation bitmap of the volume in the solid state storage device.
另一种可能的实现方式中,所述判断单元具体用于:In another possible implementation manner, the judging unit is specifically configured to:
判断所述待回收数据块中的每个物理块是否与所述固态存储设备中的逻辑块存在映射关系;Judging whether each physical block in the data block to be reclaimed has a mapping relationship with a logical block in the solid-state storage device;
若是,则确定所述待回收数据块中存储的数据存在有效数据;If so, then determine that there is valid data in the data stored in the data block to be reclaimed;
若否,则确定所述待回收数据块中存储的数据不存在有效数据。If not, it is determined that there is no valid data in the data stored in the data block to be reclaimed.
从以上技术方案可以看出,本申请实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
经由上述技术方案可知,计算机设备确定固态存储设备中的待回收数据块,该待回收数据块为存储有写入数据的数据块;然后根据该待回收数据块生成列表,该列表中存储有该待回收数据块的相关信息,然后计算机设备再判断该待回收数据块中存储的数据是否存在有效数据,如果存储,那么将该有效数据拷贝至该固态存储设备的空闲数据块中,该空闲数据块为该固态存储设备中未存储有数据的数据块,然后计算机设备可以释放该列表中待回收数据块所对应的存储空间。因此,通过本申请的技术方案,通过确定待回收数据块,然后将待回收数据块当中的有效数据拷贝至空闲的数据块当中,再释放该待回收数据块所对应的存储空间,因此,对待回收数据块所对应的存储空间的释放不需要依赖于在写入数据至数据块的过程中立即处理,因此,本申请的方案中对待回收数据块所对应的存储空间的释放在时间上没有限制,随时都可以对无效数据进行处理,因此,本申请在对固态存储设备的待回收数据块进行垃圾回收的灵活性较高。It can be known from the above technical solution that the computer device determines the data block to be reclaimed in the solid-state storage device, and the data block to be reclaimed is a data block storing written data; and then generates a list according to the data block to be reclaimed, and the list stores the The relevant information of the data block to be reclaimed, and then the computer device judges whether there is valid data in the data stored in the data block to be reclaimed. If it is stored, the valid data is copied to the free data block of the solid-state storage device. The block is a data block that does not store data in the solid-state storage device, and then the computer device can release the storage space corresponding to the data block to be reclaimed in the list. Therefore, through the technical solution of the present application, by determining the data block to be reclaimed, then copying the valid data in the data block to be reclaimed to the free data block, and then releasing the storage space corresponding to the data block to be reclaimed, therefore, the The release of the storage space corresponding to the reclaimed data block does not need to be processed immediately during the process of writing data to the data block. Therefore, in the solution of this application, there is no time limit for the release of the storage space corresponding to the data block to be reclaimed. , the invalid data can be processed at any time, therefore, the present application has high flexibility in performing garbage collection on the data blocks to be recycled in the solid-state storage device.
附图说明Description of drawings
图1为本申请实施例中的一种应用场景框架示意图;FIG. 1 is a schematic diagram of an application scenario framework in an embodiment of the present application;
图2为本申请实施例中固态存储设备的垃圾回收的方法的一个实施例示意图;FIG. 2 is a schematic diagram of an embodiment of a method for garbage collection of a solid-state storage device in an embodiment of the present application;
图3为本申请实施例中固态存储设备的垃圾回收的方法的另一个实施例示意图;FIG. 3 is a schematic diagram of another embodiment of a method for garbage collection of a solid-state storage device in the embodiment of the present application;
图4为本申请实施例中计算机设备的一种结构示意图;FIG. 4 is a schematic structural diagram of a computer device in an embodiment of the present application;
图5为本申请实施例中计算机设备的另一种结构示意图。FIG. 5 is another schematic structural diagram of a computer device in an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供了一种固态存储设备的垃圾回收的方法以及计算机设备,用于提高对固态存储设备的待回收数据块进行垃圾回收的灵活性。Embodiments of the present application provide a garbage collection method for a solid-state storage device and a computer device, which are used to improve the flexibility of garbage collection for data blocks to be recycled in the solid-state storage device.
请参阅图1,图1为本申请实施例中的一种应用场景系统框架示意图,其中,计算机设备用于对固态存储设备产生的无效数据的扫描以及对无效数据的处理,实现对固态存储设备的垃圾回收操作,即释放无效数据所存储在的数据块所对应的存储空间。固态存储设备用于存储计算机设备写入的数据,该固态存储设备可以为固态硬盘,其中,固态硬盘采用重定向写入数据的方式。例如,采用闪存作为存储介质的固态存储设备,由卷来分配写入的数据单元,每次写入的数据分配新的数据单元,因此,在长时间写入数据的过程中,就会出现大量无效数据存储于对应的数据单元,因此,需要对固态存储设备存储的无效数据进行删除,即垃圾回收操作。Please refer to Figure 1, Figure 1 is a schematic diagram of an application scenario system framework in an embodiment of the present application, wherein the computer device is used to scan invalid data generated by a solid-state storage device and process invalid data to realize the solid-state storage device Garbage collection operation, that is, to release the storage space corresponding to the data block where the invalid data is stored. A solid-state storage device is used to store data written by a computer device, and the solid-state storage device may be a solid-state hard disk, wherein the solid-state hard disk adopts a manner of redirecting data to be written. For example, for a solid-state storage device that uses flash memory as a storage medium, volumes are used to allocate written data units, and each time data is written, a new data unit is allocated. Therefore, in the process of writing data for a long time, a large number of The invalid data is stored in the corresponding data unit, therefore, it is necessary to delete the invalid data stored in the solid-state storage device, that is, garbage collection operation.
需要说明的是,该固态存储设备可以是该计算机设备中的一个模块,也可以是单独的固态存储设备,对此本申请不做限定。对于图1仅仅是为了说明本申请方案的一种场景示意图。It should be noted that the solid-state storage device may be a module in the computer device, or may be a separate solid-state storage device, which is not limited in this application. FIG. 1 is only a schematic diagram of a scene for illustrating the solution of the present application.
下面从计算机设备的角度对本申请的固态存储设备的垃圾回收的方法进行详细描述,请参阅图2,本申请实施例中固态存储设备的垃圾回收的方法的一个实施例包括:The following is a detailed description of the garbage collection method of the solid-state storage device of the present application from the perspective of computer equipment. Please refer to FIG. 2. An embodiment of the garbage collection method of the solid-state storage device in the embodiment of the present application includes:
201、计算机设备确定该固态存储设备中待回收数据块。201. The computer device determines a data block to be reclaimed in the solid-state storage device.
当需要对固态存储设备进行垃圾回收操作时,此时计算机设备可以确定该固态存储设备中待回收数据块,其中,该待回收数据块为该固态存储设备中存储有写入数据的数据块。具体的,该计算机设备可以通过该固态存储设备中的卷的分配位图来确定已经存储有写入数据的数据块,还可以通过其他方式确定,具体本申请不做限定。When it is necessary to perform a garbage collection operation on the solid-state storage device, the computer device can determine the data block to be reclaimed in the solid-state storage device, wherein the data block to be reclaimed is a data block that stores written data in the solid-state storage device. Specifically, the computer device may determine the data block that has stored the written data through the allocation bitmap of the volume in the solid-state storage device, and may also determine through other methods, which are not limited in this application.
202、计算机设备根据待回收数据块生成列表。202. The computer device generates a list according to the data blocks to be recycled.
计算机设备可以根据该待回收数据块生成列表,其中,该列表存储有待回收数据块的相关信息。具体的,计算机设备可以将待回收数据块的编号填写至列表,该列表中存储有待回收数据块的相关信息,其中,该相关信息即可为该待回收数据块的编号等。The computer device can generate a list according to the data blocks to be reclaimed, where the list stores relevant information of the data blocks to be reclaimed. Specifically, the computer device may fill in the number of the data block to be reclaimed in the list, and the list stores relevant information of the data block to be reclaimed, wherein the relevant information may be the number of the data block to be reclaimed, etc.
203、计算机设备判断该待回收数据块中存储的数据是否存在有效数据,若是,则执行步骤204;若否,则执行步骤206。203. The computer device judges whether there is valid data in the data stored in the data block to be reclaimed, and if yes, execute step 204; if not, execute step 206.
计算机设备可以判断该待回收数据块中存储的数据是否存在有效数据,如果存在,那么执行步骤204,如果不存在,那么执行步骤206。具体的,该计算机设备可以根据该待回收数据块中的每个物理块是否与该固态存储设备的逻辑块存在映射关系,如果存在,那么计算机设备可以确定该待回收数据块中存储的数据存在有效数据,如果不存在,那么计算机设备可以确定该待回收数据块中存储的数据不存在有效数据。The computer device can determine whether there is valid data in the data stored in the data block to be reclaimed, and if yes, then perform step 204, and if not, then perform step 206. Specifically, the computer device can determine whether there is a mapping relationship between each physical block in the data block to be reclaimed and the logical block of the solid-state storage device, and if so, the computer device can determine that the data stored in the data block to be reclaimed exists If there is no valid data, the computer device can determine that there is no valid data in the data stored in the data block to be reclaimed.
204、计算机设备将该有效数据拷贝至该固态存储设备的空闲数据块中。204. The computer device copies the valid data to a free data block of the solid state storage device.
如果计算机设备确定存在有效数据,那么计算机设备可以将该有效数据拷贝至该固态存储设备的空闲数据块中。If the computer device determines that valid data exists, the computer device may copy the valid data to a free data block of the solid-state storage device.
205、计算机设备释放该列表中该待回收数据块所对应的存储空间。205. The computer device releases the storage space corresponding to the data block to be reclaimed in the list.
计算机设备将有效数据拷贝完成后,该计算机设备可以释放该列表中待回收数据块所对应的存储空间,实现对该待回收数据块的垃圾回收操作。After the computer device finishes copying the valid data, the computer device can release the storage space corresponding to the data block to be reclaimed in the list, so as to realize the garbage collection operation on the data block to be reclaimed.
206、计算机设备执行其他操作。206. The computer device performs other operations.
如果该计算机设备确定该待回收数据块中存储的数据不存在有效数据,那么计算机设备可以执行其他操作,比如,可以直接将该待回收数据块所对应的存储空间释放。If the computer device determines that there is no valid data in the data stored in the data block to be reclaimed, the computer device may perform other operations, for example, directly release the storage space corresponding to the data block to be reclaimed.
本申请实施例中,计算机设备确定固态存储设备中的待回收数据块,该待回收数据块为存储有写入数据的数据块;然后根据该待回收数据块生成列表,该列表中存储有该待回收数据块的相关信息,然后计算机设备再判断该待回收数据块中存储的数据是否存在有效数据,如果存储,那么将该有效数据拷贝至该固态存储设备的空闲数据块中,该空闲数据块为该固态存储设备中未存储有数据的数据块,然后计算机设备可以释放该列表中待回收数据块所对应的存储空间。因此,通过本申请的技术方案,通过确定待回收数据块,然后将待回收数据块当中的有效数据拷贝至空闲的数据块当中,再释放该待回收数据块所对应的存储空间,因此,对待回收数据块所对应的存储空间的释放不需要依赖于在写入数据至数据块的过程中立即处理,因此,本申请的方案中对待回收数据块所对应的存储空间的释放在时间上没有限制,随时都可以对无效数据进行处理,因此,本申请在对固态存储设备的待回收数据块进行垃圾回收的灵活性较高。In the embodiment of the present application, the computer device determines the data block to be reclaimed in the solid-state storage device, and the data block to be reclaimed is a data block storing written data; and then generates a list according to the data block to be reclaimed, and the list stores the The relevant information of the data block to be reclaimed, and then the computer device judges whether there is valid data in the data stored in the data block to be reclaimed. If it is stored, the valid data is copied to the free data block of the solid-state storage device. The block is a data block that does not store data in the solid-state storage device, and then the computer device can release the storage space corresponding to the data block to be reclaimed in the list. Therefore, through the technical solution of the present application, by determining the data block to be reclaimed, then copying the valid data in the data block to be reclaimed to the free data block, and then releasing the storage space corresponding to the data block to be reclaimed, therefore, the The release of the storage space corresponding to the reclaimed data block does not need to be processed immediately during the process of writing data to the data block. Therefore, in the solution of this application, there is no time limit for the release of the storage space corresponding to the data block to be reclaimed. , the invalid data can be processed at any time, therefore, the present application has high flexibility in performing garbage collection on the data blocks to be recycled in the solid-state storage device.
本申请实施例中,计算机设备确定固态存储设备中的待回收数据块可以是计算机设备根据固态存储设备的卷的分配位图确定固态存储设备中的已分配数据块,该已分配数据块即为待回收数据块,计算机设备还可以通过其他方式来确定待回收数据块,具体此处不做限定。在后续的实施例中仅以计算机设备根据卷的分配位图来确定待回收数据块为例进行说明。In this embodiment of the application, the computer device determines the data block to be reclaimed in the solid-state storage device may be that the computer device determines the allocated data block in the solid-state storage device according to the allocation bitmap of the volume of the solid-state storage device, and the allocated data block is For the data blocks to be reclaimed, the computer device may also determine the data blocks to be reclaimed in other ways, which are not specifically limited here. In the subsequent embodiments, only the computer device determines the data block to be reclaimed according to the allocation bitmap of the volume as an example for illustration.
本申请实施例中,计算机设备在对待回收数据块所对应的存储空间进行释放之后,计算机设备可以按照预设时长检测待回收数据块所对应的存储空间的释放情况,当该计算机设备确定该待回收数据块中的第一数据块所对应的存储空间未释放完成时,此时计算机设备可以将该第一数据块的编号填写至该列表中,使得该计算机设备可以对该第一数据块的存储空间进行再次释放。通过对待回收数据块所对应的存储空间的释放情况的检测,使得本申请方案在对待回收数据块所对应的存储空间的释放能够真正做到释放完全。In the embodiment of the present application, after the computer device releases the storage space corresponding to the data block to be reclaimed, the computer device can detect the release of the storage space corresponding to the data block to be reclaimed according to a preset duration. When the storage space corresponding to the first data block in the reclaimed data block has not been released, the computer device can fill the number of the first data block into the list at this time, so that the computer device can use the number of the first data block The storage space is released again. By detecting the release of the storage space corresponding to the data block to be reclaimed, the release of the storage space corresponding to the data block to be reclaimed in the solution of the present application can be completely released.
本申请实施例中,计算机设备判断待回收数据块中存储的数据是否存在有效数据可以是计算机设备判断该待回收数据块中每个物理块是否与该固态存储设备中的逻辑块存在映射关系,如果存在可以确定该待回收数据块存在有效数据,如果不存在,那么可以确定该待回收数据块不存在有效数据;计算机设备也可以通过其他方式来判断该待回收数据块是否存在有效数据,本申请对此不做限定,在后续的实施例中,仅以计算机设备通过判断该待回收数据块中每个物理块是否与该固态存储设备中的逻辑块存在映射关系来确定该待回收数据块是否存在有效数据为例进行说明。In the embodiment of the present application, the computer device judging whether there is valid data in the data stored in the data block to be reclaimed may be that the computer device judges whether each physical block in the data block to be reclaimed has a mapping relationship with the logical block in the solid-state storage device, If it exists, it can be determined that there is valid data in the data block to be reclaimed, and if it does not exist, it can be determined that there is no valid data in the data block to be reclaimed; the computer device can also judge whether there is valid data in the data block to be reclaimed by other methods. The application does not limit this, and in subsequent embodiments, only the computer device determines whether each physical block in the data block to be reclaimed has a mapping relationship with the logical block in the solid-state storage device to determine the data block to be reclaimed The existence of valid data is used as an example to illustrate.
本申请实施例中,在计算机设备确定了固态存储设备中待回收数据块之后,该计算机设备还可以确定该待回收数据块的个数,然后确定该待回收数据块的个数大于预设个数时,计算机设备可以确定该待回收数据块中的每个数据块的无效数据占比,然后确定该待回收数据块中的无效数据占比大于预设阈值的目标数据块,再将该目标数据块的编号填写至列表中,该列表包含该目标数据块的编号,下面通过图3来详细介绍该实施方式,请参阅图3,本申请实施例中固态存储设备的垃圾回收的方法的另一个实施例包括:In the embodiment of the present application, after the computer device determines the data blocks to be reclaimed in the solid-state storage device, the computer device may also determine the number of data blocks to be reclaimed, and then determine that the number of data blocks to be reclaimed is greater than the preset number When counting, the computer device can determine the invalid data ratio of each data block in the data block to be recycled, and then determine the target data block whose invalid data ratio in the data block to be recycled is greater than the preset threshold, and then set the target The number of the data block is filled in the list, and the list includes the number of the target data block. The implementation is described in detail below through FIG. One embodiment includes:
301、计算机设备根据固态存储设备中卷的分配位图确定待回收数据块。301. The computer device determines the data block to be reclaimed according to the allocation bitmap of the volume in the solid state storage device.
计算机设备可以根据固态存储设备的卷的分配位图来确定固态存储设备中已分配的数据块,该已分配的数据块为存储有写入数据的数据块,然后计算机设备可以确定该已分配的数据块为该待回收数据块。The computer device can determine the allocated data block in the solid-state storage device according to the allocation bitmap of the volume of the solid-state storage device, and the allocated data block is a data block storing written data, and then the computer device can determine the allocated data block The data block is the data block to be recycled.
302、计算机设备确定该待回收数据块的个数超过预设个数。302. The computer device determines that the number of data blocks to be reclaimed exceeds a preset number.
计算机设备确定了待回收数据块之后,该计算机设备可以确定该待回收数据块的个数大于预设个数。需要说明的是,当该计算机设备确定该待回收数据块的个数不大于预设个数时,此时计算机设备可以直接对该待回收数据块进行处理。After the computer device determines the data blocks to be reclaimed, the computer device may determine that the number of data blocks to be reclaimed is greater than a preset number. It should be noted that when the computer device determines that the number of data blocks to be reclaimed is not greater than the preset number, the computer device may directly process the data blocks to be reclaimed.
303、计算机设备确定该待回收数据块的每个数据块的无效数据占比。303. The computer device determines the proportion of invalid data in each data block of the data block to be reclaimed.
计算机设备确定待回收数据块的个数大于预设个数,那么此时计算机设备可以确定该待回收数据块中的每个数据块的无效数据占比,具体可以是计算机设备通过该待回收数据块中与待回收数据块的逻辑块存在映射关系的物理块占比来确定无效数据占比。The computer device determines that the number of data blocks to be reclaimed is greater than the preset number, then the computer device can determine the proportion of invalid data in each data block in the data block to be reclaimed, specifically, the computer device can use the data to be reclaimed Determine the proportion of invalid data based on the proportion of physical blocks that have a mapping relationship with the logical blocks of the data blocks to be reclaimed.
304、计算机设备从该待回收数据块中确定无效数据占比大于预设阈值的目标数据块。304. The computer device determines, from the data blocks to be reclaimed, target data blocks whose proportion of invalid data is greater than a preset threshold.
计算机设备可以从待回收数据块中确定无效数据占比大于预设阈值的目标数据块。例如,计算机设备从待回收数据块中选取大于预设阈值的100个待回收数据块。The computer device may determine target data blocks whose proportion of invalid data is greater than a preset threshold from the data blocks to be reclaimed. For example, the computer device selects 100 data blocks to be reclaimed that are larger than a preset threshold from the data blocks to be reclaimed.
305、计算机设备将该目标数据块的编号填写至列表。305. The computer device fills the number of the target data block into the list.
计算机设备可以该确定的目标数据块的编号填写至列表中,比如,步骤304中确定100个待回收数据块,那么此时计算机设备可以将该100个待回收数据块的编号填写至列表中,其中,填写至列表的编号可以时根据无效数据占比的大小来填写,即可以是将无效数据占比最大的目标数据块放置于列表最前面,将无效数据占比最小的目标数据块放置于列表最后面。The computer device can fill in the list with the number of the determined target data block. For example, if 100 data blocks to be recycled are determined in step 304, then the computer device can fill in the number of the 100 data blocks to be recycled in the list. Among them, the number filled in the list can be filled in according to the proportion of invalid data, that is, the target data block with the largest proportion of invalid data can be placed at the top of the list, and the target data block with the smallest proportion of invalid data can be placed at the top of the list. at the end of the list.
306、计算机设备确定该目标数据块中的物理块存在与目标数据块中的逻辑块的映射关系。306. The computer device determines that there is a mapping relationship between the physical blocks in the target data block and the logical blocks in the target data block.
计算机设备可以确定目标数据块中物理块与目标数据块的逻辑块的映射关系存在。需要说明的是,当该计算机设备确定不存在映射关系时,此时计算机设备可以确定该目标数据块不存在无效数据,那么可以直接对该目标数据块进行垃圾回收。The computer device can determine that there is a mapping relationship between the physical blocks in the target data block and the logical blocks in the target data block. It should be noted that when the computer device determines that there is no mapping relationship, the computer device can determine that there is no invalid data in the target data block, and then directly perform garbage collection on the target data block.
307、计算机设备确定该目标数据块中存储的数据存在有效数据。307. The computer device determines that valid data exists in the data stored in the target data block.
计算机设备确定了映射关系存在,那么计算机设备可以确定该目标数据块存储的数据中的有效数据,具体可以时该计算机设备根据该映射关系确定对应的物理块,然后确定该对应的物理块中存储的有效数据。If the computer device determines that the mapping relationship exists, then the computer device can determine the valid data in the data stored in the target data block. Specifically, the computer device can determine the corresponding physical block according to the mapping relationship, and then determine the data stored in the corresponding physical block. valid data.
308、计算机设备将有效数据拷贝至固态存储设备的空闲数据块中。308. The computer device copies the valid data to an idle data block of the solid state storage device.
309、计算机设备释放目标数据块所对应的存储空间。309. The computer device releases the storage space corresponding to the target data block.
步骤308至步骤309与前述图2中的步骤204至步骤205类似,具体此处不再赘述。Steps 308 to 309 are similar to steps 204 to 205 in FIG. 2 , and details are not repeated here.
需要说明的时,计算机设备在对目标数据块所对应的存储空间进行释放时,可以将无效数据占比最大的数据块有效处理,还可以是随机抽取一个目标数据块然后进行处理,本申请对此不做限定。When it needs to be explained, when the computer device releases the storage space corresponding to the target data block, it can effectively process the data block with the largest proportion of invalid data, or randomly extract a target data block and then process it. This is not limited.
310、计算机设备按照预设时长检测目标数据块所对应的存储空间的释放情况。310. The computer device detects the release of the storage space corresponding to the target data block according to the preset duration.
计算机设备对目标数据块所对应的存储空间进行释放之后,计算机设备可以按照预设时长检测目标数据块所对应的存储空间的释放情况。After the computer device releases the storage space corresponding to the target data block, the computer device may detect the release of the storage space corresponding to the target data block according to a preset period of time.
311、计算机设备将第一数据块的编号填写至列表中。311. The computer device fills in the number of the first data block in the list.
当计算机设备通过检测确定目标数据块中的第一数据块所对应的存储空间释放未完成时,此时计算机设备可以再次将该第一数据块的编号填写至列表中。需要说明的是,将第一数据块的编号填写至列表时可以将其填写在列表最前面,使得该计算机设备优先处理该第一数据块中存储的无效数据。When the computer device determines through detection that the release of the storage space corresponding to the first data block in the target data block has not been completed, the computer device may fill the number of the first data block into the list again at this time. It should be noted that when filling the serial number of the first data block into the list, it may be filled in at the top of the list, so that the computer device preferentially processes the invalid data stored in the first data block.
312、计算机设备释放该第一数据块所对应的存储空间。312. The computer device releases the storage space corresponding to the first data block.
计算机设备再次将第一数据块填写至列表后,计算机设备可以释放该第一数据块所对应的存储空间。After the computer device fills the first data block into the list again, the computer device may release the storage space corresponding to the first data block.
本申请实施例中,计算机设备确定固态存储设备中的待回收数据块,该待回收数据块为存储有写入数据的数据块;然后根据该待回收数据块生成列表,该列表中存储有该待回收数据块的相关信息,然后计算机设备再判断该待回收数据块中存储的数据是否存在有效数据,如果存储,那么将该有效数据拷贝至该固态存储设备的空闲数据块中,该空闲数据块为该固态存储设备中未存储有数据的数据块,然后计算机设备可以释放该列表中待回收数据块所对应的存储空间。因此,通过本申请的技术方案,通过确定待回收数据块,然后将待回收数据块当中的有效数据拷贝至空闲的数据块当中,再释放该待回收数据块所对应的存储空间,因此,对待回收数据块所对应的存储空间的释放不需要依赖于在写入数据至数据块的过程中立即处理,因此,本申请的方案中对待回收数据块所对应的存储空间的释放在时间上没有限制,随时都可以对无效数据进行处理,因此,本申请在对固态存储设备的待回收数据块进行垃圾回收的灵活性较高。In the embodiment of the present application, the computer device determines the data block to be reclaimed in the solid-state storage device, and the data block to be reclaimed is a data block storing written data; and then generates a list according to the data block to be reclaimed, and the list stores the Relevant information of the data block to be reclaimed, and then the computer device judges whether there is valid data in the data stored in the data block to be reclaimed, if stored, then copy the valid data to the free data block of the solid-state storage device, the free data The block is a data block that does not store data in the solid-state storage device, and then the computer device can release the storage space corresponding to the data block to be reclaimed in the list. Therefore, through the technical solution of the present application, by determining the data block to be reclaimed, then copying the valid data in the data block to be reclaimed to the free data block, and then releasing the storage space corresponding to the data block to be reclaimed, therefore, the The release of the storage space corresponding to the reclaimed data block does not need to be processed immediately during the process of writing data to the data block. Therefore, in the solution of this application, there is no time limit for the release of the storage space corresponding to the data block to be reclaimed. , invalid data can be processed at any time, therefore, the present application has high flexibility in performing garbage collection on data blocks to be recycled in the solid-state storage device.
上述对本申请固态存储设备的垃圾回收的方法进行了介绍,下面对本申请固态存储设备的垃圾回收的计算机设备进行详细介绍,请参阅图4,其中,第二确定单元406、第三确定单元407、第四确定单元408、检测单元409以及填写单元410为可选单元,本申请实施例中计算机设备的一个实施例包括:The above describes the garbage collection method of the solid-state storage device of the present application. The computer equipment for the garbage collection of the solid-state storage device of the present application is introduced in detail below. Please refer to FIG. 4, wherein the second determination unit 406, the third determination unit 407, The fourth determination unit 408, the detection unit 409, and the filling unit 410 are optional units. An embodiment of the computer device in the embodiment of the present application includes:
第一确定单元401,用于确定固态存储设备中待回收数据块,该待回收数据块为存储有写入的数据的数据块;The first determining unit 401 is configured to determine a data block to be reclaimed in the solid-state storage device, where the data block to be reclaimed is a data block storing written data;
生成单元402,用于根据该待回收数据块生成列表,该列表包含有该待回收数据块的相关信息;A generating unit 402, configured to generate a list according to the data block to be reclaimed, the list including relevant information of the data block to be reclaimed;
判断单元403,用于判断该待回收数据块中存储的数据是否存在有效数据;A judging unit 403, configured to judge whether valid data exists in the data stored in the data block to be reclaimed;
拷贝单元404,用于若该计算机设备确定该待回收数据块中存储的数据存在有效数据,将该有效数据拷贝至该固态存储设备的空闲数据块中,该空闲数据块为所述固态存储设备中未存储有数据的数据块;The copying unit 404 is configured to copy the valid data to a free data block of the solid-state storage device if the computer device determines that there is valid data in the data stored in the data block to be reclaimed, and the free data block is the solid-state storage device A data block with no data stored in it;
释放单元405,用于释放该列表中该待回收数据块所对应的存储空间。The release unit 405 is configured to release the storage space corresponding to the data block to be reclaimed in the list.
本实施例中,该释放单元405还用于:In this embodiment, the releasing unit 405 is also used for:
若该计算机设备确定该待回收数据块中存储的数据不存在有效数据,释放该列表中待回收数据块所对应的存储空间。If the computer device determines that there is no valid data in the data stored in the data block to be reclaimed, release the storage space corresponding to the data block to be reclaimed in the list.
本实施例中,该计算机设备还包括:In this embodiment, the computer equipment also includes:
第二确定单元406,用于确定该待回收数据块的个数大于预设个数;The second determining unit 406 is configured to determine that the number of data blocks to be reclaimed is greater than a preset number;
第三确定单元407,用于确定待回收数据块中的每个数据块的无效数据占比;The third determining unit 407 is configured to determine the proportion of invalid data of each data block in the data blocks to be reclaimed;
第四确定单元408,用于从该待回收数据块中确定无效数据占比大于预设阈值的目标数据块;The fourth determination unit 408 is configured to determine a target data block whose proportion of invalid data is greater than a preset threshold from the data blocks to be reclaimed;
该生成单元402具体用于:The generating unit 402 is specifically used for:
将该目标数据块的编号填写至列表,该列表包含有该目标数据块的相关信息。The number of the target data block is filled in the list, and the list contains relevant information of the target data block.
本实施例中,该释放单元405具体用于:In this embodiment, the release unit 405 is specifically used for:
优先释放该目标数据块中无效数据占比最大的数据块所对应的存储空间。The storage space corresponding to the data block with the largest proportion of invalid data in the target data block is released first.
本实施例中,该计算机设备还包括:In this embodiment, the computer equipment also includes:
检测单元409,用于按照预设时长检测该待回收数据块所对应的存储空间的释放情况;The detection unit 409 is configured to detect the release of the storage space corresponding to the data block to be reclaimed according to a preset duration;
填写单元410,用于当该计算机设备确定该待回收数据块中的第一数据块所对应的存储空间未释放完成时,将该第一数据块的编号填写至该列表中,以使得该计算机设备对该第一数据块所对应的存储空间进行释放。The filling unit 410 is used to fill in the number of the first data block in the list when the computer device determines that the storage space corresponding to the first data block in the data blocks to be reclaimed has not been released, so that the computer The device releases the storage space corresponding to the first data block.
本实施例中,该第一确定单元401具体用于:In this embodiment, the first determining unit 401 is specifically configured to:
根据该固态存储设备中卷的分配位图确定该固态存储设备中的待回收数据块。The data block to be reclaimed in the solid state storage device is determined according to the allocation bitmap of the volume in the solid state storage device.
本实施例中,该判断单元403具体用于:In this embodiment, the judging unit 403 is specifically used for:
判断该待回收数据块中的每个物理块是否存在与该固态存储设备中的逻辑块的映射关系;Judging whether each physical block in the data block to be reclaimed has a mapping relationship with a logical block in the solid-state storage device;
若是,则确定该待回收数据块中存储的数据存在有效数据;If so, it is determined that there is valid data in the data stored in the data block to be reclaimed;
若否,则确定该待回收数据块中存储的数据不存在有效数据。If not, it is determined that there is no valid data in the data stored in the data block to be reclaimed.
本申请实施例中,第一确定单元401确定固态存储设备中的待回收数据块,该待回收数据块为存储有写入数据的数据块;然后生成单元402根据该待回收数据块生成列表,该列表中存储有该待回收数据块的相关信息,然后判断单元403再判断该待回收数据块中存储的数据是否存在有效数据,如果存储,那么拷贝单元404将该有效数据拷贝至该固态存储设备的空闲数据块中,该空闲数据块为该固态存储设备中未存储有数据的数据块,然后释放单元405可以释放该列表中待回收数据块所对应的存储空间。因此,通过本申请的技术方案,通过第一确定单元401确定待回收数据块,然后拷贝单元404将待回收数据块当中的有效数据拷贝至空闲的数据块当中,释放单元405再释放该待回收数据块所对应的存储空间,因此,对待回收数据块所对应的存储空间的释放不需要依赖于在写入数据至数据块的过程中立即处理,因此,本申请的方案中对待回收数据块所对应的存储空间的释放在时间上没有限制,随时都可以对无效数据进行处理,因此,本申请在对固态存储设备的待回收数据块进行垃圾回收的灵活性较高。In the embodiment of the present application, the first determining unit 401 determines the data block to be reclaimed in the solid-state storage device, and the data block to be reclaimed is a data block storing written data; then the generating unit 402 generates a list according to the data block to be reclaimed, The relevant information of the data block to be reclaimed is stored in the list, and then the judging unit 403 judges whether there is valid data in the data stored in the data block to be reclaimed, and if it is stored, the copying unit 404 copies the valid data to the solid-state storage Among the free data blocks of the device, the free data blocks are data blocks that do not store data in the solid-state storage device, and then the release unit 405 may release the storage space corresponding to the data blocks to be reclaimed in the list. Therefore, through the technical solution of this application, the data block to be reclaimed is determined by the first determination unit 401, and then the copying unit 404 copies the valid data in the data block to be reclaimed to a free data block, and the release unit 405 releases the data block to be reclaimed. The storage space corresponding to the data block, therefore, the release of the storage space corresponding to the data block to be reclaimed does not need to rely on immediate processing during the process of writing data to the data block. Therefore, in the solution of this application, the data block to be reclaimed The release of the corresponding storage space is not limited in time, and invalid data can be processed at any time. Therefore, this application has high flexibility in garbage collection of data blocks to be recycled in the solid-state storage device.
本申请还提供一种计算机设备500,请参阅图5,本申请实施例中计算机设备500一个实施例包括:The present application also provides a computer device 500, please refer to FIG. 5, an embodiment of the computer device 500 in the embodiment of the present application includes:
处理器501、存储器502、输入输出设备503以及总线504;Processor 501, memory 502, input and output device 503 and bus 504;
该处理器501、存储器502、输入输出设备503分别与总线504相连,该存储器502中存储有计算机指令;The processor 501, memory 502, and input/output device 503 are respectively connected to the bus 504, and computer instructions are stored in the memory 502;
该处理器501用于确定固态存储设备中待回收数据块,该待回收数据块为存储有写入的数据的数据块;根据该待回收数据块生成列表,该列表包含有该待回收数据块的相关信息;判断该待回收数据块中存储的数据是否存在有效数据;若该计算机设备确定该待回收数据块中存储的数据存在有效数据,将该有效数据拷贝至该固态存储设备的空闲数据块中,该空闲数据块为所述固态存储设备中未存储有数据的数据块;释放该列表中该待回收数据块所对应的存储空间。The processor 501 is configured to determine a data block to be reclaimed in the solid-state storage device, the data block to be reclaimed is a data block storing written data; a list is generated according to the data block to be reclaimed, and the list includes the data block to be reclaimed relevant information; determine whether the data stored in the data block to be recovered has valid data; if the computer device determines that the data stored in the data block to be recovered has valid data, copy the valid data to the idle data of the solid-state storage device In the block, the free data block is a data block that does not store data in the solid-state storage device; release the storage space corresponding to the data block to be reclaimed in the list.
一种可能的实现方式中,该处理器501还用于:In a possible implementation manner, the processor 501 is further configured to:
若该计算机设备确定该待回收数据块中存储的数据不存在有效数据,释放该列表中待回收数据块所对应的存储空间。If the computer device determines that there is no valid data in the data stored in the data block to be reclaimed, release the storage space corresponding to the data block to be reclaimed in the list.
另一种可能的实现方式中,该处理器501还用于:In another possible implementation manner, the processor 501 is also used to:
确定该待回收数据块的个数大于预设个数;Determine that the number of data blocks to be reclaimed is greater than a preset number;
确定待回收数据块中的每个数据块的无效数据占比;Determine the proportion of invalid data in each data block in the data block to be recycled;
从该待回收数据块中确定无效数据占比大于预设阈值的目标数据块;Determining a target data block whose proportion of invalid data is greater than a preset threshold value from the data block to be recycled;
该处理器501具体用于:The processor 501 is specifically used for:
将该目标数据块的编号填写至列表,该列表包含有该目标数据块的相关信息。The number of the target data block is filled in the list, and the list contains relevant information of the target data block.
另一种可能的实现方式中,该处理器501具体用于:In another possible implementation manner, the processor 501 is specifically configured to:
优先释放该目标数据块中无效数据占比最大的数据块所对应的存储空间。The storage space corresponding to the data block with the largest proportion of invalid data in the target data block is released first.
另一种可能的实现方式中,该处理器501还用于:In another possible implementation manner, the processor 501 is also used to:
按照预设时长检测该待回收数据块所对应的存储空间的释放情况;Detect the release of the storage space corresponding to the data block to be reclaimed according to the preset duration;
当该计算机设备确定该待回收数据块中的第一数据块所对应的存储空间未释放完成时,将该第一数据块的编号填写至该列表中,以使得该计算机设备对该第一数据块所对应的存储空间进行释放。When the computer device determines that the storage space corresponding to the first data block in the data blocks to be reclaimed has not been released, the number of the first data block is filled in the list, so that the computer device The storage space corresponding to the block is released.
另一种可能的实现方式中,该处理器501具体用于:In another possible implementation manner, the processor 501 is specifically configured to:
根据该固态存储设备中卷的分配位图确定该固态存储设备中的待回收数据块。The data block to be reclaimed in the solid state storage device is determined according to the allocation bitmap of the volume in the solid state storage device.
另一种可能的实现方式中,该处理器501具体用于:In another possible implementation manner, the processor 501 is specifically configured to:
判断该待回收数据块中的每个物理块是否存在与该固态存储设备中的逻辑块的映射关系;Judging whether each physical block in the data block to be reclaimed has a mapping relationship with a logical block in the solid-state storage device;
若是,则确定该待回收数据块中存储的数据存在有效数据;If so, it is determined that there is valid data in the data stored in the data block to be reclaimed;
若否,则确定该待回收数据块中存储的数据不存在有效数据。If not, it is determined that there is no valid data in the data stored in the data block to be reclaimed.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still understand the foregoing The technical solutions described in each embodiment are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application.
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| CN201810542520.3ACN108874683A (en) | 2018-05-30 | 2018-05-30 | The method and computer equipment of the garbage reclamation of solid storage device | 
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| CN201810542520.3ACN108874683A (en) | 2018-05-30 | 2018-05-30 | The method and computer equipment of the garbage reclamation of solid storage device | 
| Publication Number | Publication Date | 
|---|---|
| CN108874683Atrue CN108874683A (en) | 2018-11-23 | 
| Application Number | Title | Priority Date | Filing Date | 
|---|---|---|---|
| CN201810542520.3AWithdrawnCN108874683A (en) | 2018-05-30 | 2018-05-30 | The method and computer equipment of the garbage reclamation of solid storage device | 
| Country | Link | 
|---|---|
| CN (1) | CN108874683A (en) | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| CN111949200A (en)* | 2019-05-17 | 2020-11-17 | 北京兆易创新科技股份有限公司 | Memory and control method and control device thereof | 
| CN112764662A (en)* | 2019-10-21 | 2021-05-07 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for storage management | 
| CN113641304A (en)* | 2021-07-05 | 2021-11-12 | 深圳市宏旺微电子有限公司 | Method, device, terminal equipment and storage medium for managing data blocks | 
| CN113849422A (en)* | 2021-09-26 | 2021-12-28 | 苏州浪潮智能科技有限公司 | Method, device and equipment for selecting garbage collection target block and readable storage medium | 
| CN114840450A (en)* | 2022-07-04 | 2022-08-02 | 荣耀终端有限公司 | A storage space arrangement method and electronic device | 
| CN114895848A (en)* | 2022-04-29 | 2022-08-12 | 联想(北京)有限公司 | Data processing method and electronic equipment | 
| CN116860179A (en)* | 2023-08-31 | 2023-10-10 | 合肥康芯威存储技术有限公司 | Storage device, data processing method for storage device, computer apparatus, and medium | 
| WO2025055420A1 (en)* | 2023-09-12 | 2025-03-20 | 华为云计算技术有限公司 | Method and apparatus for deleting invalid data | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| CN111949200A (en)* | 2019-05-17 | 2020-11-17 | 北京兆易创新科技股份有限公司 | Memory and control method and control device thereof | 
| CN112764662A (en)* | 2019-10-21 | 2021-05-07 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for storage management | 
| CN112764662B (en)* | 2019-10-21 | 2024-04-19 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for storage management | 
| CN113641304A (en)* | 2021-07-05 | 2021-11-12 | 深圳市宏旺微电子有限公司 | Method, device, terminal equipment and storage medium for managing data blocks | 
| CN113641304B (en)* | 2021-07-05 | 2023-10-20 | 深圳市宏旺微电子有限公司 | Method, device, terminal equipment and storage medium for managing data blocks | 
| CN113849422A (en)* | 2021-09-26 | 2021-12-28 | 苏州浪潮智能科技有限公司 | Method, device and equipment for selecting garbage collection target block and readable storage medium | 
| CN113849422B (en)* | 2021-09-26 | 2024-08-06 | 苏州浪潮智能科技有限公司 | Method, device, equipment and readable storage medium for selecting garbage collection target blocks | 
| CN114895848A (en)* | 2022-04-29 | 2022-08-12 | 联想(北京)有限公司 | Data processing method and electronic equipment | 
| CN114840450A (en)* | 2022-07-04 | 2022-08-02 | 荣耀终端有限公司 | A storage space arrangement method and electronic device | 
| US12293078B2 (en) | 2022-07-04 | 2025-05-06 | Honor Device Co., Ltd. | Storage space organization method and electronic device | 
| CN116860179A (en)* | 2023-08-31 | 2023-10-10 | 合肥康芯威存储技术有限公司 | Storage device, data processing method for storage device, computer apparatus, and medium | 
| WO2025055420A1 (en)* | 2023-09-12 | 2025-03-20 | 华为云计算技术有限公司 | Method and apparatus for deleting invalid data | 
| Publication | Publication Date | Title | 
|---|---|---|
| CN108874683A (en) | The method and computer equipment of the garbage reclamation of solid storage device | |
| US20220413706A1 (en) | Data Storage Method, Apparatus and Storage System | |
| CN106445414B (en) | Method and system for expanding available storage space of terminal equipment | |
| CN106933493B (en) | Method and equipment for capacity expansion of cache disk array | |
| CN105701024B (en) | A kind of storage device and its method of junk data recycling | |
| CN107632791A (en) | The distribution method and system of a kind of memory space | |
| CN107665098B (en) | Information processing method, storage device, and computer storage medium | |
| CN107562915A (en) | Read the method, apparatus and equipment and computer-readable recording medium of small documents | |
| CN109614045B (en) | Metadata dropping method and device and related equipment | |
| CN105373487B (en) | The scrap cleaning method and system of a kind of storage program area | |
| CN106775496A (en) | A kind of stored data processing method and device | |
| CN109150642B (en) | Application memory error detection method, detection device and storage medium | |
| CN109491606B (en) | An all-flash storage space management method, system, device and computer medium | |
| CN103530322B (en) | Data processing method and device | |
| CN110377616A (en) | A kind of data-erasure method, device, electronic equipment and storage medium | |
| CN109144403B (en) | Method and equipment for switching cloud disk modes | |
| CN112162701A (en) | Storage space recovery method, device, equipment and computer storage medium | |
| CN103631682B (en) | The implementation method of data backup and device | |
| CN103164492A (en) | File copying method between electronic devices and electronic devices | |
| CN106293498B (en) | Method and device for copying data | |
| CN110658993A (en) | Snapshot rollback method, device, equipment and storage medium | |
| CN104246716B (en) | The processing method and equipment of memory space object | |
| CN110767258A (en) | Data erasure command test method and related device | |
| CN112199042B (en) | Storage space management method, device, chip, equipment and storage medium | |
| CN108984779A (en) | Distributed file system snapshot rollback metadata processing method, device and equipment | 
| Date | Code | Title | Description | 
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WW01 | Invention patent application withdrawn after publication | ||
| WW01 | Invention patent application withdrawn after publication | Application publication date:20181123 |