CN112927749B - Solid state disk management method and device, electronic equipment and solid state disk - Google Patents

Solid state disk management method and device, electronic equipment and solid state disk Download PDF

Info

Publication number
CN112927749B
CN112927749B CN202110264032.2A CN202110264032A CN112927749B CN 112927749 B CN112927749 B CN 112927749B CN 202110264032 A CN202110264032 A CN 202110264032A CN 112927749 B CN112927749 B CN 112927749B
Authority
CN
China
Prior art keywords
solid state
state disk
die
block
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110264032.2A
Other languages
Chinese (zh)
Other versions
CN112927749A (en
Inventor
张宏海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202110264032.2A priority Critical patent/CN112927749B/en
Publication of CN112927749A publication Critical patent/CN112927749A/en
Application granted granted Critical
Publication of CN112927749B publication Critical patent/CN112927749B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/04Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
    • G11C29/08Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
    • G11C29/12Built-in arrangements for testing, e.g. built-in self testing [BIST] or interconnection details
    • G11C29/44Indication or identification of errors, e.g. for repair
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/70Masking faults in memories by using spares or by reconfiguring
    • G11C29/78Masking faults in memories by using spares or by reconfiguring using programmable devices
    • G11C29/835Masking faults in memories by using spares or by reconfiguring using programmable devices with roll call arrangements for redundant substitutions

Abstract

The embodiment of the application provides a solid state disk management method, a solid state disk management device, electronic equipment and a solid state disk, wherein under the condition that the number of available reserved block blocks in the solid state disk is not larger than a preset number threshold, crystal grains Die meeting a preset discarding condition are selected as target Die; backing up effective data in the solid state disk to other storage media; setting the target Die as unavailable, and formatting the solid state disk to obtain a solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk; and restoring the valid data to the solid state disk. When the number of the reserved blocks is insufficient and the number of the damaged blocks exceeds the number of the reserved blocks, the SSD locking protection method is different from the SSD locking protection method in the prior art, but the damaged Die is discarded, the bottom layer formatting is executed, and the service life of the SSD is prolonged by reducing the capacity of the SSD.

Description

Solid state disk management method and device, electronic equipment and solid state disk
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for managing a solid state disk, an electronic device, and a solid state disk.
Background
The basic structure of an SSD (Solid State Disk) includes: page, block, plane, Die, NAND (flash memory chip). Wherein, page is the most basic composition, and the size is generally 4 KB; each block typically contains 64 pages with a capacity of 256KB, or 128 pages with a capacity of 512 KB; a plurality of blocks form a plane, the plane is a Die in the flash memory, and one flash memory chip is formed by packaging a plurality of dice.
The SSD consists of an SSD controller and a plurality of NAND chip particles, wherein a plurality of Dies are arranged in the NAND chip, each Die consists of a plurality of blocks, and each block consists of a plurality of pages. For example, the parameters of the commonly used 256Gb and 512Gb SSDs can be as shown in the following table.
Flash die density 256Gb 512Gb
Page Size+Spare Size 16KB+1952B 16KB+1952B
Page per Block 768 768
Block Size 12MB 12MB
#of Blocks 2774-2956 5456-5916
#of Plane 2 2
Die is divided into a user area and a reserved area, the block of the user area is used for storing data of a user, the block is damaged probabilistically after being erased and written for many times, and an address remap (remapping) of the damaged block needs to be mapped onto the block of the reserved area, namely the damaged block is replaced by the block in the reserved area. As shown in fig. 1, blk4 in Die0 user area is replaced with blk (block)1024 in Die0 reserved area, blk9 in Die0 user area is replaced with blk1027 in Die0 reserved area, blk8 in Die1 user area is replaced with blk1026 in Die1 reserved area, and blk3 in Die1 user area is replaced with blk1025 in Die1 reserved area, wherein the shaded block is the damaged block. However, due to the characteristics of the chip manufacturing process, some Die can reach the target set value in the erasing-resisting times, and some Die cannot reach the target set value in the erasing-resisting times.
In the prior art, when the number of damaged blocks exceeds the number of reserved blocks, the SSD controller may perform deadlock protection, and only the SSD may be returned to the factory for processing, resulting in a low service life of the SSD.
Disclosure of Invention
An object of the embodiments of the present application is to provide a solid state disk management method and apparatus, an electronic device, and a solid state disk, so as to increase the service life of the solid state disk. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for managing a solid state disk, where the method includes:
under the condition that the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold, selecting crystal grains Die meeting a preset discarding condition as target Die;
backing up effective data in the solid state disk to other storage media, wherein the other storage media are storage media except the solid state disk;
setting the target Die as unavailable, and formatting the solid state disk to obtain a solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk;
and restoring the effective data to the solid state disk.
In a possible embodiment, the selecting a Die meeting a preset discarding condition as a target Die includes:
selecting Die with the most damaged blocks as target Die.
In one possible embodiment, the method further comprises:
under the condition that the block in the solid state disk is detected to be damaged, determining a Die mapped by the damaged block as a Die to be detected;
judging whether a block which can be used for remapping exists in a reserved area of the Die to be detected;
if the reserved area of the Die to be detected does not have the block which can be used for remapping, selecting the block which can be used for remapping from the reserved areas of the Die, except the Die to be detected, of which the other states are available, and using the block as a target block;
modifying the mapping relationship to replace the corrupted block with the target block.
In a possible implementation manner, before the setting the target Die as unavailable and formatting the solid state disk to obtain a solid state disk with degraded capacity, the method further includes:
releasing each block remapped in the target Die.
In one possible embodiment, the method further comprises:
and under the condition that the number of the available Dies in the solid state disk is not more than a preset Die number threshold, setting the solid state disk as write protection.
In a possible implementation manner, in a case that the number of Die available in the solid state disk is not greater than a preset Die number threshold, after the solid state disk is set as write protection, the method further includes:
and generating prompt information indicating that the solid state disk needs to be replaced.
In one possible embodiment, the method further comprises:
acquiring erasing times and a preset time threshold of the solid state disk;
and generating prompt information indicating that the solid state disk needs to be replaced under the condition that the erasing times are not less than the preset times threshold.
In one possible embodiment, the method further comprises:
acquiring a first numerical value, wherein the first numerical value is determined according to the upper limit of the erasing times;
calculating a second numerical value according to the erasing times and the preset time threshold, wherein the second numerical value is a difference value between the erasing times and the preset time threshold;
and migrating and backing up the data in the solid state disk once when the second numerical value is an integral multiple of the first numerical value.
In a second aspect, an embodiment of the present application provides a solid state disk management apparatus, where the apparatus includes:
the target Die determining module is used for selecting crystal grains Die meeting a preset discarding condition as the target Die under the condition that the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold;
the effective data backup module is used for backing up the effective data in the solid state disk to other storage media, wherein the other storage media are storage media except the solid state disk;
the target Die discarding module is used for setting the target Die as unavailable, formatting the solid state disk and obtaining the solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk;
an effective data recovery module for recovering the effective data to the solid state disk
In a possible embodiment, the apparatus further comprises:
the Die to be detected determining module is used for determining the Die mapped by the damaged block as the Die to be detected under the condition that the block in the solid state disk is detected to be damaged;
the remapping block judging module is used for judging whether a block which can be used for remapping exists in the reserved area of the Die to be detected;
a target block determining module, configured to, if a block that can be used for remapping does not exist in the reserved area of the Die to be detected, select a block that can be used for remapping from the reserved areas of the Die, other than the Die to be detected, whose states are available, as a target block;
a mapping modification module to modify a mapping to replace the corrupted block with the target block.
In a possible embodiment, the apparatus further comprises: and the remapping block releasing module is used for releasing each remapped block in the target Die.
In a possible embodiment, the apparatus further comprises: and the hard disk write protection module is used for setting the solid state disk as write protection under the condition that the number of the available Dies in the solid state disk is not more than a preset Die number threshold.
In a possible embodiment, the apparatus further comprises: and the first prompt message generation module is used for generating prompt messages which indicate that the solid state disk needs to be replaced.
In a possible embodiment, the apparatus further comprises:
the erasing and writing frequency obtaining module is used for obtaining the erasing and writing frequency of the solid state disk and a preset frequency threshold value;
and the second prompt information generation module is used for generating prompt information indicating that the solid state disk needs to be replaced under the condition that the erasing times is not less than the preset times threshold.
In a possible embodiment, the apparatus further comprises:
a first numerical value obtaining module, configured to obtain a first numerical value, where the first numerical value is determined according to the upper limit of the number of times of erasing;
the data migration backup module is used for calculating a second numerical value according to the erasing times and the preset times threshold, wherein the second numerical value is a difference value between the erasing times and the preset times threshold; and migrating and backing up the data in the solid state disk once when the second numerical value is an integral multiple of the first numerical value.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a solid state disk, and other storage media;
the processor is configured to implement the solid state disk management method according to any one of the present application during operation.
In a fourth aspect, an embodiment of the present application provides a solid state disk, where a computer program is stored in the solid state disk, and when the computer program is executed by a processor, the method for managing the solid state disk is implemented in any one of the present applications.
The embodiment of the application has the following beneficial effects:
according to the solid state disk management method and device, the electronic equipment and the solid state disk, when the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold, Dies meeting a preset discarding condition are selected as target Dies; the method comprises the steps of backing up effective data in the solid state disk to other storage media, wherein the other storage media are storage media except the solid state disk; setting the target Die as unavailable, and formatting the solid state disk to obtain a solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk; and restoring the valid data to the solid state disk. When the number of the reserved blocks is insufficient and the number of the damaged blocks exceeds the number of the reserved blocks, the SSD locking protection method is different from the SSD locking protection method in the prior art, but the damaged Die is discarded, the bottom layer formatting is executed, and the service life of the SSD is prolonged by reducing the capacity of the SSD. Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram illustrating block remapping in a solid state drive according to the related art;
fig. 2 is a first schematic diagram of a solid state disk management method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a cross-Die remapping process in the solid state disk management method according to the embodiment of the present application;
fig. 4 is a second schematic diagram of a solid state disk management method according to an embodiment of the present application;
fig. 5a is a schematic diagram of block remapping in a target Die according to an embodiment of the present application;
FIG. 5b is a diagram illustrating block release in a target Die according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating generation of a prompt message in the solid state disk management method according to the embodiment of the present application;
fig. 7 is a schematic diagram illustrating data backup migration in a solid state disk management method according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a solid state disk management apparatus according to an embodiment of the present application;
fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to increase the service life of the solid state disk, an embodiment of the present application provides a solid state disk management method, and referring to fig. 2, the method includes:
s101, under the condition that the number of available reserved block in the solid state disk is not larger than a preset number threshold, selecting crystal grains Die meeting a preset discarding condition as target Die.
The solid state disk data processing method can be realized through the electronic equipment provided with the solid state disk. In the embodiment of the present application, one solid state disk is taken as an example for description, and in a case that there are multiple solid state disks in an electronic device, the data processing method of the solid state disk in the embodiment of the present application may be executed for each solid state disk.
When the number of available reserved blocks in the solid state disk is not greater than a preset number threshold and a newly damaged block is detected, selecting a crystal grain Die meeting a preset discarding condition as a target Die to periodically acquire the number of available reserved blocks in the solid state disk, where the number of available reserved blocks refers to the total number of blocks that can also be remapped in reserved areas of all Die of the solid state disk, for example, as shown in a remapped part in fig. 1, the available reserved blocks include blk1022 and blk1029 in Die0 and blk1022, blk1023, blk1027, and blk1029 in Die 1. In one example, SSD smart may be used to count the number of reserved blocks available in the solid state disk; the preset number threshold may be set according to actual conditions, and may be set to 0, 1, 2, 5, and the like, for example. In one example, in order to utilize the capacity of the SSD to the maximum, the preset number threshold may be set to 0, that is, in a case where the number of available reserved blocks in the solid state disk is 0, and in a case where a block damage is detected, Die meeting a preset discarding condition is selected as the target Die. In an example, the selecting a Die meeting the preset discarding condition as a target Die includes: and selecting the Die with the most damaged blocks as a target Die. In general, the capacity of each Die is the same, so in order to ensure maximum utilization of the capacity of the SSD, in one example, a Die with the smallest number of undamaged blocks may be selected as the target Die.
And S102, backing up the effective data in the solid state disk to other storage media, wherein the other storage media are storage media except the solid state disk.
Backing up all valid data in the solid state disk to other storage media by using a processor in the electronic device, where the other storage media are storage media other than the solid state disk, including but not limited to RAM (Random Access Memory), NVM (Non-Volatile Memory), such as a disk or other SSD; the other storage medium may be a storage medium in the electronic device, a storage medium in a cloud storage system, or the like.
S103, setting the target Die as unavailable, and formatting the solid state disk to obtain a solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk.
Discarding the target Die in the solid state disk, namely setting the state of the target Die as unavailable; in the case that the state of the target Die is unavailable, operations such as reading and writing cannot be performed on the block in the target Die. A processor in the electronic equipment sends a bottom layer formatting instruction to the solid state disk, the solid state disk is formatted, and data in the Die with an available state can be deleted in the formatting process; after the target Die is discarded, the capacity of the solid state disk is correspondingly reduced, so that the capacity of the solid state disk needs to be degraded, and the capacity of the solid state disk is modified to the total capacity of all the dies in the solid state disk, which are available in all states.
And S104, restoring the effective data to the solid state disk.
And restoring the backed-up effective data from the other storage media to the solid state disk with degraded capacity. In a possible scenario, the degraded capacity of the solid state disk is smaller than the total capacity of the valid data, in this case, data of a corresponding size may be selected from the valid data and restored to the solid state disk according to the degraded capacity of the solid state disk, and the remaining data in the valid data may be restored to other storage media.
In the embodiment of the application, when the number of the reserved blocks is insufficient and the number of the damaged blocks exceeds the number of the reserved blocks, the SSD is not locked for protection in the prior art, but the damaged Die is discarded, the bottom layer formatting is executed, and the service life of the SSD is prolonged by reducing the capacity of the SSD.
In one possible embodiment, referring to fig. 3, the method further comprises:
s201, under the condition that the block in the solid state disk is detected to be damaged, determining Die mapped by the damaged block as Die to be detected.
When detecting that a new damaged block appears in the solid state disk, determining Die mapped by the damaged block according to the address of the damaged block, which is hereinafter referred to as Die to be detected. Determining the Die to be detected mapped by the damaged block generally includes three conditions: one is that the damaged block is a block in a Die user area to be detected; one is that the damaged block is the block in the Die reserved area to be detected, and is remapped to the user area of the Die to be detected in a remap mode; one is that the damaged block is a block in a reserved area of Die with an available state except Die to be detected, and is remapped to a user area of Die to be detected in a remap mode.
And S202, judging whether blocks which can be used for remapping exist in the reserved area of the Die to be detected.
Blocks that can be used for remapping refer to blocks that are uncorrupted and not remapped.
And S203, if the block which can be used for remapping does not exist in the reserved area of the Die to be detected, selecting the block which can be used for remapping from the reserved areas of the Die, the states of which are available, except the Die to be detected as the target block.
There may be a plurality of ways to select a target block that can be used for remapping from reserved areas of Die whose states other than Die to be detected are available, and in one example, Die whose states other than Die to be detected are available may be selected, and a block that can be used for remapping in a reserved area is selected as a target block, and for example, a block that can be used for remapping is selected from a reserved area of the Die, and the block with the highest default address ranking is selected as a target block from blocks that can be used for remapping in the reserved area of the Die; for example, a block that can be used for remapping is randomly selected from the reserved area of the Die as a target block, and the like.
S204, modifying the mapping relation so as to replace the damaged block by the target block.
For example, the address of the target block may be modified to the address of the corrupted block, thereby replacing the corrupted block with the target block.
In the embodiment of the application, if the block which can be used for remapping exists in the reserved area of the Die to be detected, the block in the reserved area of the Die to be detected is directly used for replacing the damaged block; if the block which can be used for remapping does not exist in the reserved area of the Die to be detected, selecting a target block which can be used for remapping in the reserved areas of the Die which are available except the Die to be detected, and replacing the damaged block with the target block. Compared with the prior art that remapping is only performed in Die, remapping across Die is realized, the service life of Die can be prolonged, and the service life of factory capacity of the solid state disk is prolonged.
In a possible implementation manner, referring to fig. 4, before the setting the target Die as unavailable and formatting the solid state disk to obtain a solid state disk with degraded capacity, the method further includes:
and S205, releasing each block remapped in the target Die.
In the case of cross-Die remapping, the remapped block that target Die consumed by the corrupted block also needs to be released again. For example, as shown in FIG. 5a, blk4 in Die0 in NAND _0 maps to blk1029 in Die0 in NAND _0, blk9 in Die0 in NAND _0 maps to blk1024 in Die0 in NAND _ n, and blk11 in Die0 in NAND _0 maps to blk1029 in Die1 in NAND _ 0. Die0 in NAND _0 is the target Die, releasing remapped block in target Die that is consumed by the corrupted block, as shown in FIG. 5 b.
In the embodiment of the application, each remapped block in the target Die is released under the condition of cross Die remapping, so that blocks which can be used for remapping can be released, the number of blocks which can be used for remapping and have other states of available Die can be increased, and the service life of the solid state disk is prolonged.
In a possible implementation, the method further includes: and under the condition that the number of the available Dies in the solid state disk is not more than a preset Die number threshold, setting the solid state disk as write protection.
In an example, in a case that the number of Die available in the solid state disk is not greater than a preset Die number threshold, after setting the solid state disk as write protection, the method further includes: and generating prompt information indicating that the solid state disk needs to be replaced. In an example, the prompt information may be directly displayed on a display connected to the electronic device including the solid state disk, for example, to display "the solid state disk X is damaged, please replace the solid state disk X"; in other examples, the prompt message may be sent to a mobile phone or a computer of the maintenance staff by a short message or an email, so as to prompt the maintenance staff to replace the solid state disk in time.
The preset Die quantity threshold can be set in a self-defined manner according to actual conditions, for example, the preset Die quantity threshold is set to be 0, 1 or 2, and the solid state disk is set to be write-protected under the condition that the quantity of the Die available in the solid state disk is not greater than the preset Die quantity threshold, so that the situation that a block is damaged due to continuous erasing and writing of data in the solid state disk is prevented, and the data in the solid state disk can be effectively protected.
In one possible embodiment, referring to fig. 6, the method further comprises:
s301, acquiring the erasing times and the preset times threshold of the solid state disk.
In an example, the preset number threshold is determined according to an upper limit of the number of times of erasing the solid state disk. For example, the preset number threshold is a product of an upper limit of the number of times of erasing the solid state disk and a first preset coefficient. The upper limit of the erasing times of the solid state disk is an experimental value or an empirical value, and for a solid state disk of a certain type, a manufacturer can experimentally measure the upper limit of the erasing times of the solid state disk of the type in a test stage, so that when the solid state disk of the type leaves a factory, the upper limit of the erasing times is marked in the solid state disk of the type. The first preset coefficient can be set in a self-defined way according to actual conditions, and is set to be 85%, 90% or 95% and the like. The erasing times of the solid state disk can be directly obtained from the solid state disk, and the solid state disk can record the erasing times of the solid state disk in the erasing process.
And S302, generating prompt information indicating that the solid state disk needs to be replaced under the condition that the erasing frequency is not less than the preset frequency threshold.
The erasing times of the solid state disk are not less than the preset times threshold, which indicates that the block in the solid state disk is in a state to be damaged due to more accumulated erasing times, so that prompt information indicating that the solid state disk needs to be replaced is generated, a user is prompted to replace the solid state disk, the situation that the block is damaged due to continuous use, so that data loss is reduced, and the safety of the data in the solid state disk is improved.
In one possible embodiment, referring to fig. 7, the method further comprises:
s401, acquiring a first numerical value, wherein the first numerical value is determined according to the upper limit of the erasing times.
In one example, the first value is a product of the upper limit of the number of times of erasing and a second predetermined coefficient. The second preset coefficient can be set in a self-defined way according to actual conditions, for example, the second preset coefficient is set to be 0.5%, 1% or 2% and the like.
S402, calculating a second numerical value according to the erasing times and the preset time threshold, wherein the second numerical value is a difference value between the erasing times and the preset time threshold; and migrating and backing up the data in the solid state disk once when the second numerical value is an integral multiple of the first numerical value.
When the erasing times exceed a preset time threshold value which is 1 time of the first numerical value and 2 times of the first numerical value which is … … n times of the first numerical value, data in the solid state disk are migrated and backed up once, so that the safety of the data in the solid state disk is improved. In one example, the first preset coefficient is represented as a, the second preset coefficient is represented as b, the upper limit of the number of times of erasing is represented as M, the number of times of erasing is represented as S, and data migration in the solid state disk is backed up once every time S ═ a + nb) M is satisfied, where n is a positive integer.
An embodiment of the present application further provides a solid state disk management apparatus, referring to fig. 8, the apparatus includes:
the target Die determining module 11 is configured to select a crystal grain Die meeting a preset discarding condition as a target Die when the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold;
the valid data backup module 12 is configured to backup valid data in the solid state disk to other storage media, where the other storage media are storage media other than the solid state disk;
a target Die discarding module 13, configured to set the target Die as unavailable, format the solid state disk, and obtain a capacity-degraded solid state disk, where the capacity of the capacity-degraded solid state disk is the current available Die capacity in the solid state disk;
and the valid data recovery module 14 is configured to recover the valid data to the solid state disk.
In a possible implementation manner, the target Die determining module is specifically configured to: and under the condition that the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold, selecting Die with the most damaged blocks as a target Die.
In a possible embodiment, the apparatus further comprises:
the Die to be detected determining module is used for determining the Die mapped by the damaged block as the Die to be detected under the condition that the block in the solid state disk is detected to be damaged;
the remapping block judging module is used for judging whether a block which can be used for remapping exists in the reserved area of the Die to be detected;
a target block determining module, configured to, if a block that can be used for remapping does not exist in the reserved area of the Die to be detected, select a block that can be used for remapping from the reserved areas of the Die, other than the Die to be detected, whose states are available, as a target block;
a mapping modification module to modify a mapping to replace the corrupted block with the target block.
In a possible embodiment, the apparatus further comprises: and the remapping block releasing module is used for releasing each remapped block in the target Die.
In a possible embodiment, the apparatus further comprises: and the hard disk write protection module is used for setting the solid state disk as write protection under the condition that the number of the available Dies in the solid state disk is not more than a preset Die number threshold.
In a possible embodiment, the apparatus further comprises: and the first prompt message generation module is used for generating prompt messages which indicate that the solid state disk needs to be replaced.
In a possible embodiment, the apparatus further comprises:
the erasing and writing frequency obtaining module is used for obtaining the erasing and writing frequency of the solid state disk and a preset frequency threshold value;
and the second prompt information generation module is used for generating prompt information indicating that the solid state disk needs to be replaced under the condition that the erasing times is not less than the preset times threshold.
In a possible embodiment, the apparatus further comprises:
a first numerical value obtaining module, configured to obtain a first numerical value, where the first numerical value is determined according to the upper limit of the number of times of erasing;
the data migration backup module is used for calculating a second numerical value according to the erasing times and the preset times threshold, wherein the second numerical value is a difference value between the erasing times and the preset times threshold; and migrating and backing up the data in the solid state disk once when the second numerical value is an integral multiple of the first numerical value.
An embodiment of the present application further provides an electronic device, see fig. 9, including a processor 91, a solid state disk 92, and other storage media 93;
the processor 91 is configured to implement the solid state disk management method according to any of the present application at runtime.
In one implementation manner, the electronic device according to the embodiment of the present application further includes a communication interface and a communication bus, where the processor, the solid state disk, the other storage medium, and the communication interface complete mutual communication through the communication bus.
The communication bus mentioned in the electronic device may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
Other storage media may include RAM (Random Access Memory) and NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The embodiment of the application also provides a solid state disk, wherein a computer program is stored in the solid state disk, and when the computer program is executed by a processor, the solid state disk management method is realized.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method for managing a solid state disk is implemented.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the solid state disk management method described in any of the present applications.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be noted that, in this document, the technical features in the various alternatives can be combined to form the scheme as long as the technical features are not contradictory, and the scheme is within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a related manner, each embodiment focuses on differences from other embodiments, and the same and similar parts in the embodiments are referred to each other.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (11)

1. A solid state disk management method is characterized by comprising the following steps:
under the condition that the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold, selecting crystal grains Die meeting a preset discarding condition as target Die;
backing up effective data in the solid state disk to other storage media, wherein the other storage media are storage media except the solid state disk;
setting the target Die as unavailable, and formatting the solid state disk to obtain a solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk;
restoring the effective data to the solid state disk;
under the condition that the block in the solid state disk is detected to be damaged, determining Die mapped by the damaged block as Die to be detected;
judging whether a block which can be used for remapping exists in a reserved area of the Die to be detected;
if the reserved area of the Die to be detected does not have the block which can be used for remapping, selecting the block which can be used for remapping from the reserved areas of the Die, except the Die to be detected, of which the other states are available, and using the block as a target block;
modifying the mapping relationship to replace the corrupted block with the target block.
2. The method according to claim 1, wherein the selecting the Die satisfying the predetermined discarding condition as the target Die comprises:
selecting Die with the most damaged blocks as target Die.
3. The method according to claim 1, wherein before the setting the target Die as unavailable and formatting the solid state disk to obtain the solid state disk with degraded capacity, the method further comprises:
releasing remapped blocks in the target Die.
4. The method of claim 1, further comprising:
and under the condition that the number of the available Dies in the solid state disk is not more than a preset Die number threshold, setting the solid state disk as write protection.
5. The method according to claim 1, wherein after setting the solid state disk as write protection in a case that the number of Die available in the solid state disk is not greater than a preset Die number threshold, the method further comprises:
and generating prompt information indicating that the solid state disk needs to be replaced.
6. The method of claim 1, further comprising:
acquiring erasing times and a preset time threshold of the solid state disk;
and generating prompt information indicating that the solid state disk needs to be replaced under the condition that the erasing times are not less than the preset times threshold.
7. The method of claim 6, further comprising:
acquiring a first numerical value, wherein the first numerical value is determined according to the upper limit of the erasing times;
calculating a second numerical value according to the erasing times and the preset time threshold, wherein the second numerical value is a difference value between the erasing times and the preset time threshold;
and migrating and backing up the data in the solid state disk once when the second numerical value is an integral multiple of the first numerical value.
8. A solid state disk management apparatus, comprising:
the target Die determining module is used for selecting crystal grains Die meeting a preset discarding condition as the target Die under the condition that the number of available reserved block blocks in the solid state disk is not greater than a preset number threshold;
the effective data backup module is used for backing up the effective data in the solid state disk to other storage media, wherein the other storage media are storage media except the solid state disk;
the target Die discarding module is used for setting the target Die as unavailable, formatting the solid state disk and obtaining the solid state disk with degraded capacity, wherein the capacity of the solid state disk with degraded capacity is the capacity of the currently available Die in the solid state disk;
the valid data recovery module is used for recovering the valid data to the solid state disk;
the Die determining module to be detected is used for determining the Die mapped by the damaged block as the Die to be detected under the condition that the block in the solid state disk is detected to be damaged;
the remapping block judging module is used for judging whether a block which can be used for remapping exists in the reserved area of the Die to be detected;
a target block determining module, configured to, if a block that can be used for remapping does not exist in the reserved area of the Die to be detected, select a block that can be used for remapping from the reserved areas of the Die, other than the Die to be detected, whose states are available, as a target block;
a mapping modification module to modify a mapping to replace the corrupted block with the target block.
9. The apparatus of claim 8, wherein the target Die determination module is specifically configured to: selecting Die with the most damaged blocks as a target Die under the condition that the number of available reserved block blocks in the solid state disk is not more than a preset number threshold;
the device further comprises:
a remap block release module, configured to release each remap block in the target Die;
the hard disk write protection module is used for setting the solid state disk as write protection under the condition that the number of the available Dies in the solid state disk is not larger than a preset Die number threshold;
the first prompt message generation module is used for generating prompt messages which indicate that the solid state disk needs to be replaced;
the erasing and writing frequency obtaining module is used for obtaining the erasing and writing frequency of the solid state disk and a preset frequency threshold value;
the second prompt information generation module is used for generating prompt information which represents that the solid state disk needs to be replaced under the condition that the erasing times are not less than the preset times threshold;
a first numerical value obtaining module, configured to obtain a first numerical value, where the first numerical value is determined according to the upper limit of the number of times of erasing;
the data migration backup module is used for calculating a second numerical value according to the erasing times and the preset times threshold, wherein the second numerical value is a difference value between the erasing times and the preset times threshold; and migrating and backing up the data in the solid state disk once when the second numerical value is an integral multiple of the first numerical value.
10. An electronic device, comprising a processor, a solid state drive, and other storage media;
the processor is configured to implement the solid state disk management method according to any one of claims 1 to 7 at runtime.
11. A solid state disk, wherein a computer program is stored in the solid state disk, and when the computer program is executed by a processor, the method for managing the solid state disk according to any one of claims 1 to 7 is implemented.
CN202110264032.2A 2021-03-09 2021-03-09 Solid state disk management method and device, electronic equipment and solid state disk Active CN112927749B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110264032.2A CN112927749B (en) 2021-03-09 2021-03-09 Solid state disk management method and device, electronic equipment and solid state disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110264032.2A CN112927749B (en) 2021-03-09 2021-03-09 Solid state disk management method and device, electronic equipment and solid state disk

Publications (2)

Publication Number Publication Date
CN112927749A CN112927749A (en) 2021-06-08
CN112927749B true CN112927749B (en) 2022-07-05

Family

ID=76172595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110264032.2A Active CN112927749B (en) 2021-03-09 2021-03-09 Solid state disk management method and device, electronic equipment and solid state disk

Country Status (1)

Country Link
CN (1) CN112927749B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149093B (en) * 2023-10-27 2024-03-26 四川省华存智谷科技有限责任公司 Method for improving reliability of storage system through SSD (solid State disk) capacity shrinkage
CN117542403B (en) * 2024-01-09 2024-04-05 深圳市领德创科技有限公司 Solid state disk operation management system and method based on temperature control technology

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559138A (en) * 2013-10-09 2014-02-05 华为技术有限公司 Solid state disk (SSD) and space management method thereof
CN105573872A (en) * 2014-10-09 2016-05-11 腾讯科技(深圳)有限公司 Hardware maintenance method and device of data storage system
CN108509154A (en) * 2018-03-31 2018-09-07 北京联想核芯科技有限公司 A kind of method and apparatus being grouped according to bad block distribution dynamic time raid

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016181528A1 (en) * 2015-05-13 2016-11-17 株式会社日立製作所 Storage device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559138A (en) * 2013-10-09 2014-02-05 华为技术有限公司 Solid state disk (SSD) and space management method thereof
CN105573872A (en) * 2014-10-09 2016-05-11 腾讯科技(深圳)有限公司 Hardware maintenance method and device of data storage system
CN108509154A (en) * 2018-03-31 2018-09-07 北京联想核芯科技有限公司 A kind of method and apparatus being grouped according to bad block distribution dynamic time raid

Also Published As

Publication number Publication date
CN112927749A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
TWI662552B (en) Memory system with configurable error thresholds and failure analysis capability
CN112927749B (en) Solid state disk management method and device, electronic equipment and solid state disk
US8108595B2 (en) Storage apparatus and method of managing data storage area
US10459639B2 (en) Storage unit and storage system that suppress performance degradation of the storage unit
CA3036415C (en) Method and device for writing stored data into storage medium based on flash memory
US7962807B2 (en) Semiconductor storage apparatus managing system, semiconductor storage apparatus, host apparatus, program and method of managing semiconductor storage apparatus
TWI436369B (en) Methods for measuring usable lifespan and replacing an in-system programming code of a memory device, and data storage system using the same
US9785384B2 (en) Semiconductor storage device and method for controlling nonvolatile semiconductor memory
TWI501252B (en) Solid state storage system for controlling reserved area and method of controlling the same
US10204003B2 (en) Memory device and storage apparatus
CN115576505B (en) Data storage method, device and equipment and readable storage medium
CN115495025B (en) Method and device for managing abnormal memory block
CN109801668B (en) Data storage device and operation method applied to same
CN111198780B (en) Apparatus and method for performing a restore operation of a memory system
CN105320621A (en) Memory system and information processing device
CN105868046B (en) The method of management, write-in and loading firmware code in storage device
CN112805686B (en) Storage block processing method and related equipment
CN114489504A (en) SSD data management method and related components
JP2010256944A (en) Device, program and method for maintaining nand type flash memory
US20230305721A1 (en) Method and apparatus for memory management in memory disaggregation environment
CN114879916B (en) Method and device for managing storage unit
EP3504627B1 (en) Read operation redirect
CN117056125A (en) Management data backup method, memory storage device and memory controller
CN115658355A (en) Medium error processing method and device and medium
KR20230135346A (en) Memory controller and operating method thereof

Legal Events

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
GR01 Patent grant
GR01 Patent grant