Storage space management method

By calculating the effective capacity and expected usage capacity of the memory in the controller of the solid-state drive, and deciding whether to prohibit writing operations based on the difference between these capacities, the problem that the service life of the solid-state drive is limited by the number of bad blocks is solved and the storage life is extended. The service life of the device.

CN113360080BActive Publication Date: 2025-01-21REALTEK SEMICON CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010151211.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-06
Publication Date
2025-01-21
Estimated Expiration
2040-03-06

AI Technical Summary

Technical Problem

The service life of a solid-state drive is limited by the number of read and write times of its internal flash memory. When the memory block is marked as a bad block, the traditional memory controller will determine that the service life of the solid-state drive has expired and can no longer be carried out in the access operation.

Method used

The controller calculates the expected usage capacity and effective capacity of the memory, where the effective capacity is negatively correlated with the number of blocks marked as bad in multiple blocks of the memory, and determines whether to prohibit writing operations to the memory. Specific measures include prohibiting writing when the effective capacity is less than or equal to the announced capacity and the difference from the expected usage capacity is less than a predetermined critical capacity, and otherwise allowing writing.

Benefits of technology

It extends the service life of the solid-state drive, avoids the failure of the storage device to operate normally due to the effective capacity being lower than the declared capacity, and ensures the correct storage of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113360080B_ABST
    Figure CN113360080B_ABST
Patent Text Reader

Abstract

A storage space management method is used for a storage device including a controller and a memory, comprising: the controller calculates the expected usage capacity and effective capacity of the memory, wherein the effective capacity is negatively correlated with the number of bad blocks in multiple blocks of the memory; when the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is less than a predetermined critical capacity, the controller prohibits writing operations to the memory; and when the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is not less than the predetermined critical capacity, the controller allows writing operations to the memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a storage space management method, and in particular to a storage space management method for extending service life. Background Art

[0002] The lifespan of a solid-state drive (SSD) is limited by the number of read and write cycles it can handle. When the number of read and write cycles exceeds the upper limit, the flash memory may not be able to store data correctly. Consequently, the SSD's controller chip will mark this storage block as a bad block.

[0003] As more and more storage blocks are marked as bad blocks, when the remaining usable storage capacity of the SSD is less than the initially declared capacity, the conventional memory controller will determine that the SSD has reached the end of its service life and cannot be accessed any more.

[0004] In view of the above situation, how to extend the service life of solid-state drives is an important issue in this field. Summary of the Invention

[0005] One aspect of the present disclosure relates to a storage space management method for a storage device including a controller and a memory, comprising: calculating, by the controller, the expected usage capacity and the effective capacity of the memory, wherein the effective capacity is negatively correlated with the number of bad blocks in multiple blocks of the memory; prohibiting, by the controller, write operations to the memory when the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is less than a predetermined critical capacity; and allowing, by the controller, write operations to the memory when the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is not less than a predetermined critical capacity.

[0006] One aspect of the present disclosure relates to another storage space management method for a storage device including a controller and a memory, comprising: calculating, by the controller, an expected usage capacity and an effective capacity of the memory, wherein the effective capacity is negatively correlated with the number of blocks of the memory that are marked as bad blocks; determining, by the controller, whether each of these blocks of the memory is no longer in use; when one of these blocks is determined to be no longer in use, marking, by the controller, the block as a damaged block or a restricted block so that the effective capacity is not less than the declared capacity of the storage device; and determining, by the controller, whether to prohibit write operations on the memory by comparing the difference between the effective capacity and the number of blocks marked as restricted and the expected usage capacity.

[0007] One aspect of the present disclosure relates to another storage space management method for a storage device comprising a controller and a memory, comprising: the controller storing at least one reinitialization capacity, wherein the at least one reinitialization capacity is smaller than the declared capacity; the controller calculating the effective capacity of the memory, wherein the effective capacity is negatively correlated with the number of bad blocks in a plurality of blocks of the memory; and the controller determining whether to start a reinitialization procedure of the storage device with the at least one reinitialization capacity based on the difference between the effective capacity and the declared capacity. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 Schematic diagram of a storage device according to an embodiment of the present disclosure.

[0009] Figure 2 The flowchart of a storage space management method according to an embodiment of the present disclosure is shown.

[0010] Figure 3 and Figure 4 Schematic diagram of capacity change of a storage device according to an embodiment of the present disclosure.

[0011] Figure 5 The present invention is a flowchart of information transmission between a storage device and an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0012] The following embodiments are described in detail with reference to the accompanying drawings. However, the specific embodiments described are only used to explain the present application and are not used to limit the present application. The description of the structural operation is not used to limit the order of their execution. Any structure recombined by the components and the resulting device with equal efficacy are within the scope of the present disclosure.

[0013] Please refer to Figure 1 . Figure 1 FIG. 1 is a schematic diagram of a storage device 100 according to an embodiment of the present disclosure. Figure 1 As shown, the storage device 100 includes a memory 110, a controller 120, and an alarm 130. The memory 110 includes a plurality of memory blocks. The controller 120 includes a control circuit 121, a read / write circuit 122, a storage circuit 123, and a communication interface 124.

[0014] Structurally, the controller 120 is coupled to the memory 110 and the alarm 130. The control circuit 121 is coupled to the read / write circuit 122, the storage circuit 123, the communication interface 124, and the alarm 130. Specifically, the control circuit 121 is coupled to the memory block BLOCK via the read / write circuit 122.

[0015] In some embodiments, the memory 110 may be a non-volatile memory, such as a NAND flash memory array. In some embodiments, the controller 120 may be various processing circuits or control chips.

[0016] In operation, the control circuit 121 is used to control the read / write circuit 122 to perform programming, reading, erasing, verification, or other actions on one or more of the storage blocks, and record the number of read / write cycles (P / E cycles) corresponding to each storage block in the storage circuit 123. When a storage block is written, it is used to store data. Based on the records in the storage circuit 123, the control circuit 121 can calculate the size of the space currently storing data in all storage blocks, which is the current used capacity. The control circuit 121 can also calculate the sum of the current used capacity and the data currently to be written, which is the expected used capacity. For example, if the current used capacity is 1TB and 0.2TB of data is to be written, the expected used capacity is 1.2TB.

[0017] Furthermore, when the control circuit 121 performs a write operation on one or more memory blocks, it determines whether the memory block is marked as a bad block. A block not marked as a bad block indicates that the memory cells in the block are still functioning normally, while a block marked as a bad block indicates that the block is no longer able to store data correctly. If the control circuit 121 determines that a memory block is unable to store data correctly, it marks the block as a bad block.

[0018] Specifically, in some embodiments, when the number of read and write operations corresponding to this storage block is greater than the upper limit of the number of read and write operations in the design specifications of this storage block, the control circuit 121 will determine that this storage block should be marked as a bad block. In other embodiments, the control circuit 121 performs a verification operation on this storage block through the read and write circuit. When this storage block fails the verification operation, the control circuit 121 will determine that this storage block needs to be marked as a bad block. In this way, the storage device 100 can know the current effective capacity of the memory 110 by calculating the number of storage blocks that are not marked (belonging to the space that can store data). In other words, the effective capacity is negatively correlated with the number of storage blocks in the memory 110 that are marked as bad blocks.

[0019] For the sake of convenience and clarity of description, the specific operation of the storage device 100 will be described below. Figures 1 to 5 The embodiments shown are for illustration only, but are not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of this application. Figure 2 . Figure 2FIG. 2 is a flow chart of a storage space management method 200 according to an embodiment of the present disclosure. Figure 2 As shown, the storage space management method 200 includes operations S210 , S220 , S230 , S240 , S250 , S260 , S270 , S280 , and 290 .

[0020] First, in operation S210, the controller 120 calculates the current used capacity, the expected used capacity, and the effective capacity. Then, in operation S220, the controller 120 determines whether the effective capacity is less than or equal to the declared capacity.

[0021] When the effective capacity is greater than the declared capacity, it means that the memory 110 has not been excessively damaged or aged and has sufficient effective storage space. Therefore, operation S230 is performed, in which the controller 120 determines whether the expected usage capacity is greater than the declared capacity.

[0022] When the expected usage capacity is less than or equal to the declared capacity, it means that there is enough unused space in the memory 110 to write the current data. Therefore, operation S240 is performed to allow the write operation.

[0023] Conversely, when the expected usage capacity exceeds the declared capacity, it indicates that there is insufficient unused space in memory 110 to write the current data. Therefore, operation S250 is performed, where controller 120 first prohibits write operations to memory 110 and generates a corresponding signal, thereby initiating a corresponding operation to reduce the usage capacity. The corresponding signal includes a warning notification, a safety capacity, the current usage capacity, and the capacity to be deleted. Details are described below.

[0024] For example, if Figure 3 As shown, the horizontal axis is time and the vertical axis is capacity. Figure 3 At time point T0, the initial capacity accessible to users (i.e., the factory-set marked capacity) is shown. The currently used capacity Bu increases as users write data and decreases as users delete data. The effective capacity Ba decreases as the number of storage blocks marked as bad increases.

[0025] At time point T0, the effective capacity Ba of storage device 100 must be greater than or equal to its declared capacity. For example, a storage device 100 with a declared capacity Bd of 2.0 TB has an actual capacity B0 of 2.2 TB. After time point T0, write operations to memory 110 begin, so the currently used capacity Bu increases from zero.

[0026] During period P1, since the effective capacity Ba is greater than the declared capacity Bd (i.e., the memory 110 has not been excessively damaged or aged and has sufficient effective storage space), operations S230 to S250 are repeatedly performed after operation S220. For example, between time points T0 and T1, since the expected usage capacity to be written each time is less than the declared capacity Bd, operations S220, S230, and S240 are repeatedly performed, and the write operation is maintained so that the current usage capacity Bu continues to increase. Until time point T1, the current usage capacity Bu is equal to the declared capacity Bd, which means that the 2TB declared capacity Bd in the memory 110 has already stored data. At this time, regardless of the size of the content of the new data currently to be written, the expected usage capacity will exceed the declared capacity, so operation S250 will be performed to prohibit the write operation. Until the data is deleted (i.e., the current usage capacity Bu is reduced) on the memory 110 and the current usage capacity Bu is again less than the declared capacity Bd, operation S220 will be performed again.

[0027] On the other hand, Figure 3 At time point T2, when the effective capacity Ba equals the declared capacity Bd, the memory blocks in memory 110 have become damaged and aged to the point where the remaining effective storage space is less than the declared capacity Bd. During period P2, the controller of the conventional storage device determines that the SSD has reached the end of its service life and is no longer capable of access.

[0028] However, in this application, if Figure 2 As shown, in operation S220, when the effective capacity is less than or equal to the declared capacity, operation S260 is performed, in which the controller 120 determines whether the currently used capacity is less than the effective capacity. If the currently used capacity is greater than or equal to the effective capacity, operation S290 is performed to prohibit the write operation. If the currently used capacity is less than the effective capacity, operation S270 is performed, in which the controller 120 determines whether the expected used capacity is less than or equal to the effective capacity.

[0029] When the expected usage capacity is less than or equal to the effective capacity, operation S280 is performed to allow the write operation. Conversely, when the expected usage capacity is greater than the effective capacity, operation S290 is performed to prohibit the write operation.

[0030] For example, if Figure 3 As shown, after time point T2, even if the effective capacity Ba is less than or equal to the declared capacity Bd (e.g., the effective capacity Ba is 1.8 TB, which is less than the initially declared capacity Bd of 2 TB), since the used capacity Bu (e.g., 1.5 TB) is not greater than or equal to the effective capacity Ba (e.g., 1.8 TB), the effective capacity Ba is still sufficient to normally store the data of the currently used capacity Bu. Furthermore, as long as the expected used capacity is not greater than the effective capacity Ba, operation S280 can be performed, allowing the write operation.

[0031] However, at time T3, since the currently used capacity Bu will exceed the effective capacity Ba, the data stored in the currently used capacity Bu may not be correctly saved. Therefore, operation S290 is executed to prohibit the write operation. Until the memory 110 is erased and the used capacity Bu is again less than the declared capacity Bd and the effective capacity Ba (e.g., after time T3), operation S270 can be performed again to determine whether the current data write operation can be allowed.

[0032] In this way, even if the storage block in the storage device 100 is aged or damaged to the point where its effective capacity Ba is less than the declared capacity Bd, the actual available effective capacity Ba, the current used capacity Bu, and the expected used capacity can still be judged to determine whether to allow or prohibit write operations, thereby extending the service life of the storage device 100. Figure 3 Take an example to illustrate, at time point T2, when the effective capacity Ba decreases from 2.2TB to 2.0TB of the declared capacity Bd, the currently used capacity Bu is about 1.5TB. Even if the currently used capacity Bu is still 0.5TB away from the declared capacity Bd, a general storage device will not be able to operate normally due to the effective capacity Ba decreasing to the declared capacity Bd. In contrast, in this application, after time point T2, although the effective capacity Ba has decreased to below the declared capacity Bd, as long as there is space between the effective capacity Ba and the currently used capacity Bu, data writing, deletion and other operations can continue to be allowed, thereby greatly extending the service life of the storage device 100.

[0033] In another embodiment, please refer to Figure 3, during period P2, the effective capacity Ba' can always be maintained at no less than the declared capacity Bd. Specifically, during period P1, the control circuit 121 will mark the storage blocks that cannot correctly store data as "bad blocks", wherein the number of storage blocks marked as bad blocks is approximately the difference between the actual capacity B0 and the effective capacity Ba. During period P2, the control circuit 121 will mark the storage blocks that cannot correctly store data as "restricted blocks", wherein the number of storage blocks marked as "restricted blocks" is approximately the difference between the declared capacity Bd and the effective capacity Ba. The blocks marked as "restricted blocks" are storage blocks that are prohibited from reading and writing. However, the storage blocks marked as restricted blocks are not included in the calculation of the number of "bad blocks", but are included in the number of "non-bad blocks" (i.e., the effective capacity Ba'). In other words, during period P2, the control circuit 121 marks blocks that cannot correctly store data as "restricted blocks." This effectively marks them as "bad blocks" (reading and writing are prohibited), but they are not counted in the "bad block" statistics (i.e., they are included in the effective capacity Ba'). Specifically, when a storage block is determined to be no longer in use, the controller 121 marks the storage block as a damaged block if the effective capacity Ba' is greater than the declared capacity Bd, and marks the storage block as a restricted block if the effective capacity Ba' is equal to the declared capacity Bd. Therefore, during period P2, the controller 120 of the storage device 100 of the present application can still ensure that the effective capacity Ba' is no less than the declared capacity Bd of the storage device 100. The controller compares the difference between the effective capacity and the number of blocks marked as restricted and the expected usage capacity to determine whether to prohibit write operations on the memory; when the expected usage capacity is greater than the difference between the effective capacity and the number of blocks marked as restricted, the controller prohibits the write operation on the memory; and when the expected usage capacity is not greater than the difference between the effective capacity and the number of blocks marked as restricted, the controller allows the write operation on the memory.

[0034] From the perspective of the controller 120, a simple implementation method is described as follows: during period P1, the control circuit 121 directly marks the storage blocks that need to be marked as "bad blocks" as "bad blocks"; and when period P1 transitions to period P2, the control circuit 121 begins to change the storage blocks that need to be marked as "bad blocks" to "restricted blocks" to achieve the above effect. As can be seen from the above description, the number of blocks marked as "bad blocks" is not greater than the difference between the actual capacity B0 and the declared capacity Bd, so as to ensure that the effective capacity Ba' is not less than the declared capacity Bd (e.g. Figure 3 As shown), the effective capacity Ba' is equal to the effective capacity Ba of the storage block that is normally read and written plus the capacity of the storage block marked as "restricted block".

[0035] In another embodiment, the control circuit 121 has a declared capacity table. The declared capacity table has multiple declared capacities (e.g., 2.0T, 1.0T, 512G, 500G, 480G, 250G, etc.) and / or other related information of the corresponding capacities. When the control circuit 121 finds that the effective capacity Ba is less than or equal to the declared capacity Bd (e.g., Figure 3 As shown, after time point T2), the control circuit 121 selects an initialization operation of a new (smaller capacity) capacity in the declared capacity table with the user's permission, so that the declared capacity Bd can be gradually reduced, thereby extending the service life of the storage device 100.

[0036] In some other embodiments, when performing operation S290, the control circuit 121 in the controller 120 may send a warning signal to the alarm 130, causing the alarm 130 to emit a warning sound or flash a warning light in response to the warning signal, thereby alerting the user that the current effective capacity Ba is lower than the declared capacity Bd and that the memory 110 is in a write-prohibited state. Alternatively, the control circuit 121 may send the warning signal to an electronic device via the communication interface 124, causing the electronic device to display a warning notification.

[0037] Furthermore, in some embodiments, the control circuit 121 in the controller 120 calculates the corresponding warning capacity based on the effective capacity Ba. When the effective capacity Ba is less than or equal to the declared capacity Bd and the current usage capacity Bu is greater than or equal to the warning capacity or the expected usage capacity is greater than the warning capacity, the control circuit 121 in the controller 120 sends a warning signal to the alarm 130, or sends a warning signal to the electronic device through the communication interface 124. For example, when the current effective capacity Ba is 1.8TB, the warning capacity can be 1.7TB, so as to reserve 0.1TB of storage space to remind the user in advance. The alarm 130 can flash lights of different colors, frequencies or quantities according to the warning signal and the warning signal.

[0038] In addition, when the effective capacity Ba is less than the declared capacity Bd, in some embodiments, the controller 120 is further configured to calculate the safety capacity based on the effective capacity Ba. That is, in operations S260 and S270, the controller 120 is configured to determine whether the current used capacity Bu is less than the safety capacity, and whether the expected used capacity is less than or equal to the safety capacity. Specifically, Figure 4 As shown, when the effective capacity Ba decreases to the declared capacity Bd (i.e., time point T4), the control circuit 121 deducts a default capacity from the effective capacity Ba to set the safety capacity Bs. Whenever the effective capacity Ba decreases to the safety capacity Bs (e.g., time point T5), the control circuit 121 further deducts a default capacity from the effective capacity Ba to set the new safety capacity Bs. In other words, the safety capacity Bs equals the effective capacity Ba minus the predetermined critical capacity.

[0039] Thus, when the effective capacity Ba is less than the declared capacity Bd, the safety capacity Bs can prevent the gap between the currently used capacity Bu and the effective capacity Ba from being too small, which could result in a failure to correctly save data. Furthermore, the safety capacity Bs can also prevent the storage device 100 from issuing warning messages too frequently when the currently used capacity Bu is insufficiently reduced.

[0040] It is worth noting that although Figure 4 The default capacity deducted at each time is shown to be equal. In some other embodiments, the default capacity deducted at each time may increase as the effective capacity Ba decreases. For example, if the default capacity deducted is 0.1TB, 0.2TB, and 0.3TB, the safety capacity may be 1.9TB, 1.7TB, 1.4TB, and so on. In other words, the safety capacity is adjustable. The safety capacity is proportional to the effective capacity.

[0041] In the above embodiment, the controller 120 of the storage device 100 determines whether to prohibit write operations to the memory 110, and the alarm 130 of the storage device 100 displays the current status. In other embodiments, the control circuit 121 in the storage device can communicate with other electronic devices via the communication interface 124, so that the electronic device 300 determines whether to prohibit write operations and displays relevant information accordingly.

[0042] Specifically, if Figure 5 As shown, when the storage device 100 issues a warning message, the processor 310 in the electronic device 300 sends a polling query based on the warning message. In response to the polling query, the storage device 100 returns the current effective capacity Ba and the currently used capacity Bu. The processor 310 determines whether to prohibit the write operation based on the safety capacity Bs and the currently used capacity Bu or the expected used capacity. When the currently used capacity Bu or the expected used capacity is greater than the safety capacity Bs, the processor 310 calculates the capacity to be deleted based on the safety capacity Bs and the currently used capacity Bu or the expected used capacity and / or provides a list of recommended deletions or cloud backups, and transmits the warning notification, the safety capacity Bs, the currently used capacity Bu, the expected used capacity, and the capacity to be deleted to the display 320.

[0043] Specifically, if Figure 4 As shown, at time point T4, when the current used capacity Bu is about to exceed the safety capacity Bs, the processor 310 uses the difference between the current used capacity Bu and the safety capacity Bs as the capacity to be deleted Bd1. For another example, at time point T5, the processor 310 uses the difference between the current used capacity Bu and the safety capacity Bs as the capacity to be deleted Bd2.

[0044] Then, if Figure 5As shown, if the processor 310 performs an erase operation on the storage device 100, the current used capacity Bu of the storage device 100 will decrease. By returning the safety capacity Bs and the current used capacity Bu to the storage device 100, the processor 310 can re-allow the write operation based on the current used capacity Bu being less than the safety capacity Bs, and update the safety capacity Bs and the current used capacity Bu on the display 320.

[0045] In this way, the electronic device 300 can inform the user of the effective capacity Ba of the storage device 100 that is less than the declared capacity Bd but can still be used. By continuously monitoring, the electronic device 300 can prompt the user to delete a certain amount of content to release sufficient effective space Ba to ensure the accuracy of data storage.

[0046] In summary, storage space management method 200 temporarily prohibits writing when the effective capacity Ba is less than the declared capacity Bd, based on the current used capacity Bu or the expected used capacity exceeding the effective capacity Ba. Writing is then re-enabled when the expected used capacity falls below the effective capacity Ba. This ensures that data can be properly stored while extending the service life of storage device 100.

[0047] Although the present disclosure has been disclosed in the form of an implementation method as described above, it is not intended to limit the present disclosure. A person having ordinary knowledge in the technical field may make various changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope defined by the scope of the appended claims of this application.

[0048]

Explanation of symbols

[0049] 100...Storage device

[0050] 110...Memory

[0051] 120...Controller

[0052] 121...Control circuit

[0053] 122...Read and write circuit

[0054] 123...Storage Circuit

[0055] 124...communication interface

[0056] 130... warning device

[0057] BLOCK...storage block

[0058] 200...Storage Space Management Method

[0059] S210, S220, S230, S240a, S240b, S250, S260, S270, S280, 290...operations

[0060] B0...actual capacity

[0061] Bd...declared capacity

[0062] Ba...Effective capacity

[0063] Bu...Currently used capacity

[0064] Bs...Safety Capacity

[0065] Bd1, Bd2...Capacity to be deleted

[0066] T1, T2, T3, T4, T5...time points

[0067] During P1, P2...

[0068] 300...Electronic devices

[0069] 310...processor

[0070] 320...display

Claims

1. A storage space management method for a storage device, the storage device comprising a controller and a memory, the storage device having a declared capacity, the storage space management method comprising: The controller calculates the expected usage capacity and the effective capacity of the memory, wherein the effective capacity is negatively correlated with the number of bad blocks in the multiple blocks of the memory; When the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is less than a predetermined critical capacity, the controller prohibits writing to the memory; as well as When the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is not less than a predetermined critical capacity, the controller allows the write operation to be performed on the memory; The declared capacity is the initial capacity of the storage device when it is initialized; the expected usage capacity is the sum of the current usage capacity of the storage device and the data currently to be written; the effective capacity is the space capacity of the storage device that can currently store data; The storage space management method further includes: The controller stores at least one reinitialization capacity, wherein the at least one reinitialization capacity is smaller than the declared capacity; The controller determines whether to start the storage device to perform a re-initialization procedure with the at least one re-initialization capacity according to the difference between the effective capacity and the declared capacity.

2. The storage space management method according to claim 1, wherein the effective capacity minus the predetermined critical capacity equals the safety capacity.

3. The storage space management method according to claim 2, wherein the safety capacity is adjustable, and there is a proportional relationship between the safety capacity and the effective capacity.

4. The storage space management method according to claim 2, further comprising: When the effective capacity is less than or equal to the declared capacity and the difference between the effective capacity and the expected usage capacity is less than the predetermined critical capacity, the controller sends a warning signal.

5. The storage space management method according to claim 4, further comprising: When the effective capacity is less than or equal to the declared capacity and the expected usage capacity is greater than or equal to the safety capacity, the controller transmits a warning signal, the expected usage capacity and the effective capacity to the electronic device; and The electronic device stops the writing operation to the memory in response to the warning signal and displays the capacity to be deleted, wherein: The capacity to be deleted is generated according to the difference between the expected usage capacity and the safety capacity.

6. The storage space management method according to claim 1, wherein the storage device has a declared capacity table, the declared capacity table includes a plurality of re-initialized capacities, and the storage space management method further comprises: When the effective capacity is less than or equal to the declared capacity, one of the re-initialization capacities that is smaller than the declared capacity is selected to perform a re-initialization procedure.

7. A storage space management method for a storage device, the storage device comprising a controller and a memory, the storage device having a declared capacity, the storage space management method comprising: The controller calculates the expected usage capacity and the effective capacity of the memory, wherein the effective capacity is negatively correlated with the number of bad blocks in the multiple blocks of the memory; The controller determines whether each of the blocks of the memory is no longer in use; when one of the blocks is determined to be no longer in use, the controller marks the block as a damaged block or a restricted block so that the effective capacity is not less than the declared capacity of the storage device; in, When the space capacity of the memory that can currently store data is greater than the declared capacity, if one of the blocks is determined to be no longer in use, the controller marks the block as the damaged block; at this time, the effective capacity is the space capacity of the memory that can currently store data; When the current data storage space of the memory is equal to or less than the declared capacity, if one of the blocks is determined to be no longer in use, the controller marks the block as the restricted block; at this time, the effective capacity is the current data storage space of the memory plus the capacity of the storage block marked as the restricted block, so that the effective capacity is not less than the declared capacity of the storage device; and the controller compares the difference between the effective capacity and the capacity of the storage block marked as the restricted block with the expected usage capacity to determine whether to prohibit the write operation to the storage; wherein, when the expected usage capacity is greater than the difference between the effective capacity and the capacity of the storage block marked as the restricted block, the controller prohibits the write operation to the storage; and when the expected usage capacity is not greater than the difference between the effective capacity and the capacity of the storage block marked as the restricted block, the controller allows the write operation to the storage; The declared capacity is the initial capacity of the storage device when it is initialized; and the expected usage capacity is the sum of the current usage capacity of the memory and the data currently to be written.

Citation Information

Patent Citations

  • Solid state storage device with variable logical capacity based on memory life cycle

    CN108139871A

  • Efficiently Managing Unmapped Blocks to Extend Life of Solid State Drive with Low Over-Provisioning

    US20170160976A1