A data management method, system, computer device and storage medium for a hard disk

By correcting and updating the data retention time of the solid-state drive, the performance degradation caused by full-disk scanning is solved, and the operation performance and data storage reliability of the solid-state drive are improved.

CN116027972BActive Publication Date: 2025-08-01SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211391367.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-08
Publication Date
2025-08-01
Estimated Expiration
2042-11-08

AI Technical Summary

Technical Problem

In the prior art, performance degradation caused by the correctness of NAND data is maintained by performing a full disk scan of SSD.

Method used

By correcting the data hold time in response to power-on on the hard disk, updating the data hold time in the update cycle, adding it to the hold queue in response to full data blocks, and inspecting and recycling the data blocks in the queue in accordance with the inspection cycle, the performance degradation caused by full disk scanning is solved.

Benefits of technology

It realizes correction and update of SSD data retention time, improving the operating performance and data storage reliability of SSDs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116027972B_ABST
    Figure CN116027972B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of storage technologies, and particularly to a method and system for data management of a hard disk, a computer device, and a storage medium. The method includes: when the hard disk is powered on, calibrating the hard disk data retention time of the hard disk; updating the calibrated hard disk data retention time at an update period; when a first write operation is performed on a data block of the hard disk, marking the block data retention time of the data block performing the first write operation based on the updated hard disk data retention time; when the data block is full, adding the full data block to a retention queue and inspecting the data blocks in the retention queue; if the block data retention time of the inspected data block triggers a preset condition, recycling the inspected data block and removing it from the retention queue. Through the solution of the present invention, calibration and update of the data retention time of the solid-state drive, and regular inspection of the data blocks are achieved, which not only ensures the operation performance of the solid-state drive but also improves the reliability of data storage of the solid-state drive.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technologies, and in particular, to a method and system for data management of a hard disk, a computer device, and a storage medium. Background Art

[0002] With the rapid development of Internet technologies, human society has entered a big data era in which the amount of data has grown exponentially. The advent of the big data era has increased the need for storage technology support, and various big data applications have posed greater challenges to various aspects of the performance and reliability of storage systems. With the emergence and wide use of NAND (Negative AND, a flash memory technology name) flash memory, SSD (Solid State Drive) based on NAND flash memory has become a development hotspot in the storage field due to its higher reliability, better performance, lower power consumption, etc.

[0003] Determined by the characteristics of NAND, the data stored in NAND cannot be permanently stored, and there will be a time limit. After this time limit, the data on NAND will be incorrect, and even the ECC (Error Correction Codes) error correction technology cannot correct the error successfully. Moreover, the longer the NAND is used, the shorter the data retention time. This is because as the number of NAND erase / write cycles increases, the oxide layer ages, electrons passing through the oxide layer are trapped, resulting in the insulator having conductivity, and the charge runs faster from the floating gate. To solve the NAND data retention problem, in the prior art, the commonly adopted method is to perform a full disk scan on the SSD. When it is found that the number of flipped bits in a certain flash page exceeds a certain threshold, the data is rewritten to a new location to avoid the problem that the number of bit flips exceeds the error correction ability of the ECC algorithm due to the data being stored for too long. However, sampling such a method to reduce uncorrectable ECC errors consumes the operating performance of the SSD, is time-consuming, and consumes the operating performance of the SSD. Summary of the Invention

[0004] In view of this, the present invention proposes a method and system for data management of a hard disk, a computer device, and a storage medium, which solve the problem of the performance degradation of the SSD caused by performing a full disk data scan on the SSD to keep the NAND data correct.

[0005] Based on the above object, an aspect of an embodiment of the present invention provides a method for data management of a hard disk, specifically including the following steps:

[0006] In response to the hard disk being powered on, correct the current hard disk data retention time of the hard disk;

[0007] Update the corrected hard disk data retention time at an update period;

[0008] Execute the first write operation in response to the data block of the hard disk, and update the block data retention time of the data block for the first write operation based on the hard disk data retention time mark updated in the current update cycle;

[0009] In response to the data block of the hard disk being full, add the full data block to the retention queue;

[0010] Inspect the data blocks in the retention queue at the inspection cycle;

[0011] In response to the block data retention time of the inspected data block triggering a preset condition, recycle the inspected data block and remove the inspected data block from the retention queue.

[0012] In some embodiments, in response to the hard disk being powered on, correcting the current hard disk data retention time of the hard disk includes:

[0013] In response to the hard disk being powered on, obtain the power-off time when the hard disk was powered off last time, the hard disk data retention time at the time of power-off, and correct the current hard disk data retention time of the hard disk based on the power-off time when the hard disk was powered off last time, the hard disk data retention time at the time of power-off, and the power-on time of the hard disk.

[0014] In some embodiments, correcting the current hard disk data retention time of the hard disk based on the power-off time when the hard disk was powered off last time, the hard disk data retention time at the time of power-off, and the power-on time of the hard disk includes:

[0015] Correct the current hard disk data retention time based on formulas (1), (2), and (3),

[0016] T′ ssd_retention = T ssd_retention + ΔT (1)

[0017] ΔT = f(t up - t down ) (2)

[0018] f(t) = t * AF (3)

[0019] where, T′ ssd_retention is the corrected hard disk data retention time, T ssd_retention is the hard disk data retention time at the time of power-off, ΔT is the hard disk data retention time increment generated by the difference between the power-on time of the hard disk and the power-off time when the hard disk was powered off last time, t up is the power-on time of the hard disk, t down is the power-off time when the hard disk was powered off last time, f(t) is the calculation formula of the data retention time, t is the natural time, and AF is the acceleration factor.

[0020] In some embodiments, updating the corrected hard disk data retention time according to an update period includes:

[0021] Updating the corrected hard disk data retention time according to the update period and based on formula (4),

[0022]

[0023] where n is the cumulative number of times of updating the hard disk data retention time, T is the updated hard disk data retention time, f(d) is the calculation formula of the data retention time, and d is the update period.

[0024] In some embodiments, in response to the block data retention time of the inspected data block triggering a preset condition, recycling the inspected data block includes:

[0025] Setting a retention time threshold;

[0026] In response to the sum of the block data retention time of the inspected data block and the retention time threshold being greater than the hard disk data updated in the current update period, recycling the inspected data block.

[0027] In some embodiments, after the step of inspecting the data blocks in the retention queue according to an inspection period, the method further includes:

[0028] If the data retention time of the inspected data block does not trigger a preset condition, return to the step of inspecting the data blocks in the retention queue according to the inspection period, where

[0029] the preset condition includes: the sum of the block data retention time of the inspected data block and the retention time threshold being greater than the hard disk data updated in the current update period.

[0030] In some embodiments, after recycling the inspected data block in response to the block data retention time of the inspected data block triggering a preset condition and removing the inspected data block from the retention queue, the method further includes:

[0031] Return to the step of inspecting the data blocks in the retention queue according to the inspection period;

[0032] Inspecting the data blocks in the retention queue according to an inspection period includes:

[0033] Inspecting the first block in the retention queue according to the inspection period.

[0034] In some embodiments, the method further includes:

[0035] In response to powering down of the hard disk, power-down information of the hard disk is saved, where the power-down information includes a power-down time, a hard disk data retention time at the time of power-down, and retention queue information.

[0036] In some embodiments, the method further includes:

[0037] In response to the first power-on after the hard disk is burned, the data retention time of the hard disk is initialized.

[0038] On the other hand, an embodiment of the present invention further provides a data management system for a hard disk, including:

[0039] A calibration module configured to calibrate the current hard disk data retention time of the hard disk in response to power-on of the hard disk;

[0040] An update module configured to update the calibrated hard disk data retention time according to an update period;

[0041] A queue management module configured to, in response to a first write operation being performed on a data block of the hard disk, mark the block data retention time of the data block on which the first write operation is performed based on the hard disk data retention time updated according to the current update period;

[0042] The queue management module is further configured to, in response to a data block of the hard disk being full, add the full data block to a retention queue;

[0043] An inspection module configured to inspect the data blocks in the retention queue according to an inspection period;

[0044] A recycling module configured to recycle the inspected data block and remove the inspected data block from the retention queue in response to a preset condition being triggered by the block data retention time of the inspected data block.

[0045] In yet another aspect, an embodiment of the present invention further provides a computer device, including: at least one processor; and a memory storing a computer program executable on the processor, where the computer program, when executed by the processor, implements the steps of the above method.

[0046] In still another aspect, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above method.

[0047] The present invention has at least the following beneficial technical effects: Through the solution of the present invention, the correction and update of the data retention time of the solid-state drive are realized, and by regularly inspecting and scanning the blocks in the retention queue, the problem of the performance degradation of the solid-state drive caused by the full-disk scan of the solid-state drive to ensure the accuracy of the stored data in the traditional solution is solved, which not only ensures the operating performance of the solid-state drive but also improves the reliability of the data storage of the solid-state drive. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other embodiments based on these drawings without creative efforts.

[0049] Figure 1 It is a block diagram of an embodiment of the data management method for the hard disk provided by the present invention;

[0050] Figure 2 It is a schematic diagram of an embodiment of the data management system for the hard disk provided by the present invention;

[0051] Figure 3 It is a schematic structural diagram of an embodiment of the computer device provided by the present invention;

[0052] Figure 4 It is a schematic structural diagram of an embodiment of the computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.

[0054] It should be noted that all the expressions using "first" and "second" in the embodiments of the present invention are used to distinguish two entities or parameters with the same name but different identities. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. This will not be elaborated one by one in the subsequent embodiments.

[0055] Based on the above objectives, in the first aspect of the embodiments of the present invention, an embodiment of a data management method for a hard disk is proposed. As Figure 1 shown, it includes the following steps:

[0056] S10. In response to the power-on of the hard disk, correct the current data retention time of the hard disk;

[0057] S20. Update the retained time of the corrected hard disk data according to the update period;

[0058] S30. In response to the first write operation being performed on a data block of the hard disk, mark the block data retention time of the data block on which the first write operation is performed based on the hard disk data retention time updated in the current update period;

[0059] S40. In response to a data block of the hard disk being full, add the full data block to the retention queue;

[0060] S50. Inspect the data blocks in the retention queue according to the inspection period;

[0061] S60. In response to the block data retention time of the inspected data block triggering a preset condition, recycle the inspected data block and remove the inspected data block from the retention queue.

[0062] Specifically, the embodiment of the present invention is applied to a solid-state drive. After the solid-state drive is powered on, it is determined whether the solid-state drive is powered on for the first time after burning. If so, the data retention time is initialized to 0. If not, the current hard disk data retention time is corrected based on the current power-on time of the solid-state drive and the previous power-off information; thereafter, when the solid-state drive is running, the retained time of the corrected or initialized hard disk data is updated regularly; when the first write operation is performed on each data block, i.e., block, of the solid-state drive, mark the block data retention time of the block on which the first write operation is performed based on the hard disk data retention time updated in the current update period; when a block in the solid-state drive is full, add the full block to the retention queue; inspect the blocks in the retention queue according to the inspection period; if the block data retention time of the inspected block triggers a preset condition, recycle the inspected data block and remove the inspected data block from the retention queue.

[0063] Through the above solution, the correction and update of the data retention time of the solid-state drive are realized, and by regularly inspecting and scanning the blocks in the retention queue, the problem of performance degradation of the solid-state drive caused by full-disk scanning of the solid-state drive to ensure the accuracy of stored data in the traditional solution is solved, which not only ensures the running performance of the solid-state drive but also improves the reliability of data storage in the solid-state drive.

[0064] In some embodiments, correcting the current hard disk data retention time of the hard disk in response to the hard disk being powered on includes:

[0065] In response to the hard disk being powered on, obtain the power-off time of the hard disk during the last power-off, the hard disk data retention time during power-off, and correct the current hard disk data retention time of the hard disk based on the power-off time during the last power-off, the hard disk data retention time during power-off, and the power-on time of the hard disk.

[0066] Specifically, define the ssd_retention field in the SSD storage information, that is, the SSD data retention time identification field, to save the hard disk data retention time information of the SSD. After mass production of the SSD, when it is powered on for the first time, initialize the ssd_retention value to 0. When the SSD is powered off each time, save the power-off time, the ssd_retention value, and the retention queue information of the block. When it is powered on again, correct the ssd_retention value according to the current power-on time, the saved last power-off time, and the ssd_retention value, and restore the retention queue information of the block again. Through the above initialization scheme when the hard disk is powered on, it prepares for subsequent data inspection.

[0067] In some embodiments, correcting the current hard disk data retention time of the hard disk based on the power-off time during the last power-off, the hard disk data retention time during power-off, and the power-on time of the hard disk includes:

[0068] Correct the current hard disk data retention time based on formulas (1), (2), and (3).

[0069] T′ ssd_retention = T ssd_retention + ΔT (1)

[0070] ΔT = f(t up - t down ) (2)

[0071] f(t) = t * AF (3)

[0072] Wherein, T′ ssd_retention is the corrected hard disk data retention time, T ssd_retention is the hard disk data retention time during power-off, ΔT is the hard disk data retention time increment generated by the difference between the power-on time of the hard disk and the power-off time during the last power-off, t up is the power-on time of the hard disk, t down is the power-off time of the hard disk during the last power-off, f(t) is the calculation formula of the data retention time, t is the natural time, and AF is the acceleration factor.

[0073] Specifically, refer to the following formula for ssd_retention correction:

[0074] T' ssd_retention = T ssd_retention + ΔT (1)

[0075] ΔT = f(t up - t down ) (2)

[0076] f(t) = t * AF (3)

[0077] Wherein, T' ssd_retention is the corrected hard disk data retention time, that is, the ssd_retention value corrected according to the difference between the current power-on time and the previous power-off save time when power-on, T ssd_retention is the hard disk data retention time when the hard disk powers off, that is, the current hard disk data retention time, that is, the ssd_retention value saved at the previous power-off, ΔT is the hard disk data retention time increment generated by the difference between the power-on time of the hard disk and the power-off time at the previous power-off, that is, the ssd_retention increment generated by the difference between the current power-on time and the previous power-off save time, t up is the current power-on time of the hard disk, t down is the power-off time when the hard disk was saved last time, f(t) is the calculation formula of the data retention time, which refers to the calculation formula for calculating the ssd_retention increment according to the natural time t in this embodiment, AF is the acceleration factor corresponding to the natural temperature (temp) of the NAND particles in the SSD. Generally, the calculation method of the acceleration factor AF is provided by the NAND manufacturer.

[0078] Through the above solution, the correction of the hard disk data retention time when the hard disk powers off and then powers on is realized to ensure the accuracy of the hard disk data retention time when the hard disk powers off and then powers on, thereby improving the reliability of the solid-state drive data storage.

[0079] In some embodiments, updating the corrected hard disk data retention time according to the update period includes:

[0080] Updating the corrected hard disk data retention time according to the update period and based on formula (4),

[0081]

[0082] Wherein, n is the cumulative number of times of updating the hard disk data retention time, T is the updated hard disk data retention time, f(d) is the calculation formula of the data retention time, and d is the update period.

[0083] Specifically, set the update period dur_time of the hard disk data retention time, for example, set it to any time within 10 - 20s, and update the hard disk data retention time based on formula (4).

[0084]

[0085] Where n is the cumulative number of times of updating the hard disk data retention time, T is the updated hard disk data retention time, f(d) is the calculation formula of the data retention time, the same as formula (3), and d is the update period.

[0086] Calculate and accumulate the ssd_retention value every dur_time through formula (4).

[0087] In this embodiment, the updated hard disk data retention time is the hard disk data retention time continuously accumulated based on the update period, which increases with the increase of the hard disk running time. The reliability of the solid - state drive data storage is ensured through the accumulated hard disk data retention time, providing a basis for ensuring the performance of the solid - state drive during subsequent inspections.

[0088] In some embodiments, in response to the block data retention time of the inspected data block triggering a preset condition, recycling the inspected data block includes:

[0089] Set a retention time threshold;

[0090] In response to the block data retention time of the inspected data block plus the retention time threshold being greater than the hard disk data updated by the current update period, recycle the inspected data block.

[0091] In some embodiments, after the step of inspecting the data blocks in the retention queue according to the inspection period, the method further includes:

[0092] In response to the data retention time of the inspected data block not triggering a preset condition, return to the step of inspecting the data blocks in the retention queue according to the inspection period, where

[0093] The preset condition includes: the block data retention time of the inspected data block plus the retention time threshold is greater than the hard disk data updated by the current update period.

[0094] In some embodiments, after the step of recycling the inspected data block in response to the block data retention time of the inspected data block triggering a preset condition and removing the inspected data block from the retention queue, it further includes:

[0095] Return to the step of inspecting the data blocks in the retention queue according to the inspection period;

[0096] Performing an inspection on the data blocks in the retention queue according to the inspection period includes:

[0097] Performing an inspection on the first block in the retention queue according to the inspection period.

[0098] Specifically, the updated hard disk data retention time can be used to mark the block data retention time and the inspection of the block.

[0099] The specific scheme for marking the block data retention time is as follows:

[0100] When performing the first write operation on each block, assign the ssd_retention value of the current update period to the block data retention time blk_retention, that is, the block_retetnion records the ssd_retention value at the time point when the first data is written to the block.

[0101] After each block is filled with data, hang the block on the retention queue. According to the characteristic of cumulative calculation of the ssd_retention value, the blk_retention value of the block that enters the retention queue first must be less than the blk_retention value of the block that enters the retention queue later. Therefore, during subsequent inspections, only the first block in the retention queue needs to be inspected, which greatly reduces the inspection time and does not affect the running performance of the solid-state drive during the inspection.

[0102] The specific scheme for block inspection is as follows:

[0103] Set the block inspection period inspec_time and the retention time threshold. The inspec_time can be set to 3 to 5 hours, and the retention time threshold can be set according to the data provided by the NAND manufacturer. For example, the NAND data retention characteristics of the Toshiba B5 type of NAND particles are described in its NAND manual: it can be stored for 90 days at 40°C. Therefore, the retention time threshold of this type can be set to: 90 days * AF(40°C).

[0104] During each inspection at the inspec_time, the block with the smallest retention value in the retention queue is maintained (i.e., the first block in the retention queue). The blk_retention value of this block is compared with the current ssd_retention value. If the blk_retention value does not meet the recycling condition, then after inspecting this block, no other blocks will be inspected, and it will wait for the next inspec_time interval to perform block inspection again. If the recycling condition is met, then garbage collection (GC) is forcibly started to recycle this block, and this block is removed from the retention queue, and the above operations are repeated. Continue to inspect the block with the largest value in the retention queue until the maximum value in the retention queue does not meet the recycling condition.

[0105] The recycling condition is a preset condition, which can be set such that the blk_retention value plus the retention threshold is greater than the ssd_retention value.

[0106] Through the above solution, the inspection of the blocks of the solid-state drive is realized, which improves the reliability of data storage on the solid-state drive while ensuring the operating performance of the solid-state drive.

[0107] In some embodiments, the method further includes:

[0108] In response to the power-down of the hard disk, the power-down information of the hard disk is saved, where the power-down information includes the power-down time, the hard disk data retention time at the time of power-down, and the retention queue information.

[0109] Specifically, after the ssd receives the power-down notification sent by the host, key information is saved, including the current power-down time, the ssd_retention value, and the retention queue information of the blocks, which is used to restore and correct the ssd_retention value and the retention queue information of the blocks when powering on again.

[0110] In some embodiments, the method further includes:

[0111] In response to the first power-on after the hard disk is burned, the data retention time of the hard disk is initialized.

[0112] Based on the same inventive concept, according to another aspect of the present invention, as Figure 2 shown, an embodiment of the present invention further provides a data management system for a hard disk, including:

[0113] A calibration module 110 configured to calibrate the current hard disk data retention time of the hard disk in response to the hard disk being powered on;

[0114] An update module 120 configured to update the calibrated hard disk data retention time at an update period;

[0115] A queue management module 130 configured to, in response to a first write operation being performed on a data block of the hard disk, mark the block data retention time of the data block on which the first write operation is performed based on the hard disk data retention time updated in the current update period;

[0116] The queue management module 130 is further configured to, in response to a data block of the hard disk being full, add the full data block to a retention queue;

[0117] An inspection module 140 configured to inspect the data blocks in the retention queue at an inspection period;

[0118] A recycling module 150 configured to, in response to a preset condition being triggered by the block data retention time of an inspected data block, recycle the inspected data block and remove the inspected data block from the retention queue.

[0119] Based on the same inventive concept, according to another aspect of the present invention, as Figure 3 shown, an embodiment of the present invention further provides a computer device 30, which includes a processor 310 and a memory 320. The memory 320 stores a computer program 321 that can run on the processor. When the processor 310 executes the program, it executes the steps of the above method.

[0120] Among them, the memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the hard disk data management method in the embodiments of the present application. The processor executes various functional applications and data processing of the system by running the non-volatile software programs, instructions, and modules stored in the memory, that is, implements the hard disk data management method in the above method embodiments.

[0121] The memory may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the system, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely set relative to the processor, and these remote memories may be connected to the local module through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0122] Based on the same inventive concept, according to another aspect of the present invention, as Figure 4 shown, an embodiment of the present invention further provides a computer-readable storage medium 40, and the computer-readable storage medium 40 stores a computer program 410 that, when executed by a processor, executes the above method.

[0123] Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the above method embodiments. Among them, the storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc. The above embodiments of the computer program can achieve the same or similar effects as the corresponding foregoing method embodiments.

[0124] Those skilled in the art will also understand that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, a general description of the functions of various illustrative components, blocks, modules, circuits, and steps has been presented. Whether this function is implemented as software or hardware depends on the particular application and the design constraints imposed on the overall system. The functions that those skilled in the art can implement in various ways for each specific application, but this implementation decision should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.

[0125] The above are exemplary embodiments disclosed by the present invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein do not need to be performed in any specific order. The serial numbers of the disclosed embodiments of the present invention above are only for description and do not represent the superiority or inferiority of the embodiments. In addition, although the elements disclosed by the embodiments of the present invention can be described or claimed in an individual form, they can also be understood as plural unless explicitly limited to the singular form.

[0126] It should be understood that, as used herein, unless the context clearly supports the exception, the singular form "a" is also intended to include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations of one or more of the related listed items.

[0127] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present invention (including the claims) disclosed by the embodiments is limited to these examples; under the concept of the embodiments of the present invention, the technical features between the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the present invention as above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention.

Claims

1. A data management method for a hard disk, characterized in that, Including: In response to the hard disk power-on, correcting the current hard disk data retention time of the hard disk based on formulas (1), (2), and (3); Updating the corrected hard disk data retention time based on formula (4) according to the update period; In response to the first write operation being performed on a data block of the hard disk, marking the block data retention time of the data block on which the first write operation is performed based on the hard disk data retention time updated in the current update period; In response to a data block of the hard disk being full, adding the full data block to the retention queue; Inspecting the data blocks in the retention queue according to the inspection period; In response to the block data retention time of the inspected data block triggering a preset condition, recycling the inspected data block and removing the inspected data block from the retention queue; Wherein, formulas (1), (2), (3), and (4) are as follows: (1) (2) (3) (4) Among them, is the hard disk data retention time after calibration, is the hard disk data retention time when powering off, is the hard disk data retention time increment generated by the difference between the hard disk power-on time and the power-off time of the previous power-off, is the hard disk power-on time, is the power-off time of the hard disk at the previous power-off, is the calculation formula for data retention time based on natural time, where t is natural time and AF is the acceleration factor; among them, is the number of times of accumulating the updated hard disk data retention time, T is the updated hard disk data retention time, is the calculation formula for data retention time based on the update period, and d is the update period.

2. The method according to claim 1, characterized in that, In response to the block data retention time of the inspected data block triggering a preset condition, recycling the inspected data block includes: Setting a retention time threshold; In response to the block data retention time of the inspected data block plus the retention time threshold being greater than the hard disk data updated in the current update period, recycling the inspected data block.

3. The method according to claim 1, wherein After the step of inspecting the data blocks in the retention queue according to the inspection period, it further includes: In response to the data retention time of the inspected data block not triggering a preset condition, returning to the step of inspecting the data blocks in the retention queue according to the inspection period, wherein, The preset condition includes: the block data retention time of the inspected data block plus the retention time threshold being greater than the hard disk data updated in the current update period.

4. The method according to claim 1, characterized in that, After the step of recycling the inspected data block and removing the inspected data block from the retention queue in response to the block data retention time of the inspected data block triggering a preset condition, it further includes: Returning to the step of inspecting the data blocks in the retention queue according to the inspection period; Inspecting the data blocks in the retention queue according to the inspection period includes: Inspecting the first block in the retention queue according to the inspection period.

5. The method according to claim 1, characterized in that It further includes: In response to the hard disk power-off, saving the power-off information of the hard disk, wherein the power-off information includes the power-off time, the hard disk data retention time at power-off, and the retention queue information.

6. The method according to claim 1, wherein It further includes: In response to the hard disk being powered on for the first time after being burned, initializing the data retention time of the hard disk.

7. A data management system for a hard disk, characterized in that, Including: A correction module configured to correct the current hard disk data retention time of the hard disk based on formulas (1), (2), and (3) in response to the hard disk power-on; An update module configured to update the corrected hard disk data retention time based on formula (4) according to the update period; A queue management module configured to mark the block data retention time of the data block on which the first write operation is performed based on the hard disk data retention time updated in the current update period in response to the first write operation being performed on a data block of the hard disk; The queue management module is further configured to add the full data block to the retention queue in response to a data block of the hard disk being full; An inspection module, where the inspection module is configured to inspect the data blocks in the retention queue according to an inspection period; A recycling module, where the recycling module is configured to, in response to a preset condition being triggered by the block data retention time of the inspected data block, recycle the inspected data block and remove the inspected data block from the retention queue; Among them, formulas (1), (2), (3) and (4) are as follows: (1) (2) (3) (4) Wherein, is the hard disk data retention time after calibration, is the hard disk data retention time when powering off, is the hard disk data retention time increment generated by the difference between the hard disk power-on time and the power-off time at the previous power-off, is the hard disk power-on time, is the power-off time at the previous power-off of the hard disk, is the calculation formula for data retention time calculated according to natural time, t is the natural time, and AF is the acceleration factor; wherein, is the number of times of accumulating the updated hard disk data retention time, T is the updated hard disk data retention time, is the calculation formula for data retention time calculated according to the update period, d is the update period.

8. A computer device, comprising: At least one processor; And A memory, where the memory stores a computer program that can run on the processor, and is characterized in that when the processor executes the program, it executes the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it executes the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • NAND memory

    CN101981627A

  • Method, device and system for inspecting data in storage device

    CN103049713A