CN114879916B - Method and device for managing storage unit - Google Patents

Method and device for managing storage unit Download PDF

Info

Publication number
CN114879916B
CN114879916B CN202210811916.XA CN202210811916A CN114879916B CN 114879916 B CN114879916 B CN 114879916B CN 202210811916 A CN202210811916 A CN 202210811916A CN 114879916 B CN114879916 B CN 114879916B
Authority
CN
China
Prior art keywords
storage unit
target
storage
page
error
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
CN202210811916.XA
Other languages
Chinese (zh)
Other versions
CN114879916A (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.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage 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 Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202210811916.XA priority Critical patent/CN114879916B/en
Publication of CN114879916A publication Critical patent/CN114879916A/en
Application granted granted Critical
Publication of CN114879916B publication Critical patent/CN114879916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention provides a method and a device for managing a storage unit, and belongs to the technical field of data storage. The method comprises the following steps: in response to the fact that one or more storage pages in the storage device are determined to have read-write errors, determining target storage units to which the one or more storage pages belong, and recording the target storage units; in response to determining that the storage device is in a set state, obtaining each of the target storage units, performing: traversing each storage page contained in the target storage unit; and taking the target storage unit as an error storage unit when judging that any storage page is an uncorrectable error page, and taking the target storage unit as an available storage unit if not. By adopting the invention, the service life of the storage equipment can be prolonged.

Description

Method and device for managing storage unit
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method and an apparatus for managing a storage unit.
Background
With the rapid development of information technology and the dramatic increase in data volume, data storage devices (e.g., flash memory devices, etc.) are widely used.
In general, a data storage device may have a read-write error when processing data read-write, and an existing method directly determines a storage unit (e.g., a storage block) in which the read-write error occurs as an error storage block; however, in some cases, the memory cell read/write error may be caused by external environmental noise or internal noise of the memory device. The existing method judges the available storage unit affected by noise as an error storage block by mistake, so that the available storage unit cannot be used, thereby affecting the available space and the read-write efficiency of the storage device and reducing the service life of the storage device.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for managing storage units, which are capable of determining, in response to determining that a read/write error occurs in one or more storage pages in a storage device, a target storage unit to which the one or more storage pages belong, and regarding each of the target storage units recorded, in a case that it is determined that any storage page is an uncorrectable error page, regarding the target storage unit as an error storage unit, otherwise, regarding the target storage unit as an available storage unit. By further judging the target storage unit, the problem that the usable storage unit influenced by noise is judged as an error storage block by mistake is solved, the read-write efficiency of the storage device is improved, and the service life of the storage device is prolonged.
To achieve the above object, according to an aspect of the present invention, there is provided a method of managing a memory cell, including:
in response to the fact that one or more storage pages in the storage device are determined to have read-write errors, determining target storage units to which the one or more storage pages belong, and recording the target storage units;
in response to determining that the storage device is in a set state, obtaining each of the target storage units, performing:
traversing each storage page contained in the target storage unit;
and taking the target storage unit as an error storage unit when judging that any storage page is an uncorrectable error page, and taking the target storage unit as an available storage unit if not.
Optionally, the method further comprises:
under the condition that any storage page of the storage device is detected to have read-write abnormity, an error correction module is utilized to correct the storage page with the read-write abnormity;
under the condition that the error correction module fails to correct the error of the storage page, triggering a retry strategy of reading and writing the storage page for multiple times;
and determining that the memory page in the memory device has read and write errors when the memory page fails to be corrected by using the retry strategy.
Optionally, before the determining the target storage unit to which the one or more storage pages belong and recording each target storage unit, the method further includes:
acquiring current erasing times and current reading times corresponding to the target storage unit;
judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not; if so, the step of recording the target storage unit is performed.
Optionally, the obtaining each target storage unit in response to determining that the storage device is in the set state includes:
monitoring the state of the storage device, and acquiring each recorded target storage unit under the condition that the running state is judged to be in a set state, wherein the set state is an idle state or a power-on process.
Optionally, the recording each target storage unit includes:
storing each target storage unit by using a target queue;
the method further comprises the following steps:
removing the target storage unit from the target queue if the target storage unit is determined to be an erroneous storage unit or an available storage unit.
Optionally, when it is determined that any storage page is an uncorrectable error page, the target storage unit is regarded as an error storage unit, otherwise, the target storage unit is regarded as an available storage unit, further including:
when judging that any storage page is an uncorrectable error page, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from the target queue, and adding the error storage unit to an error storage unit set;
otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set;
and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
According to another aspect of the present invention, there is provided an apparatus for managing a storage unit, including a determining storage unit module and a managing storage unit module; wherein,
the storage unit determining module is used for determining target storage units to which one or more storage pages belong in response to the fact that read-write errors occur to the one or more storage pages in the storage device, and recording the target storage units;
the management storage unit module is configured to acquire each of the target storage units of the record, and execute: traversing each storage page contained in the target storage unit; and taking the target storage unit as an error storage unit when judging that any storage page is an uncorrectable error page, and taking the target storage unit as an available storage unit if not.
Optionally, the determine storage unit module is further configured to:
under the condition that any storage page of the storage device is detected to have read-write abnormity, an error correction module is utilized to correct the storage page with the read-write abnormity;
under the condition that the error correction module fails to correct the error of the storage page, triggering a retry strategy of reading and writing the storage page for multiple times;
and determining that the memory page in the memory device has read and write errors when the memory page fails to be corrected by using the retry strategy.
Optionally, the determine storage unit module is further configured to:
acquiring current erasing times and current reading times corresponding to the target storage unit;
judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not; if so, the step of recording the target storage unit is performed.
Optionally, the management storage unit module is configured to:
and monitoring the state of the storage equipment, and acquiring each recorded target storage unit under the condition that the running state is judged to be in a set state, wherein the set state is an idle state or a power-on process.
Optionally, the determine storage unit module is configured to: storing each target storage unit by using a target queue;
the management storage unit module is further configured to: removing the target storage unit from the target queue if the target storage unit is determined to be an erroneous storage unit or an available storage unit.
Optionally, the management storage unit module is further configured to:
when judging that any storage page is an uncorrectable error page, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from the target queue, and adding the error storage unit to an error storage unit set;
otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set;
and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
According to another aspect of the present invention, there is provided an electronic apparatus including:
a processor; and
a memory for storing a program, wherein the program is stored in the memory,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the above-described method of managing a storage unit.
According to another aspect of the present invention, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the above-described method of managing a storage unit.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of determining a target storage unit to which one or more storage pages belong in response to the fact that read-write errors occur in the one or more storage pages in the storage device, and regarding each target storage unit of records as an error storage unit when judging that any storage page is an uncorrectable error page, and regarding the target storage unit as an available storage unit if not. By further judging the target storage unit, the problem that the usable storage unit influenced by noise is judged as an error storage block by mistake is solved, the read-write efficiency of the storage device is improved, and the service life of the storage device is prolonged.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments with reference to the drawings, in which:
FIG. 1 is a flow chart illustrating a method for managing memory cells in accordance with an exemplary embodiment of the present invention;
FIG. 1A is a schematic diagram of a queue of record storage units according to an exemplary embodiment of the present invention;
FIG. 1B is a flowchart illustrating a method for managing error memory cells according to an exemplary embodiment of the present invention;
FIG. 1C is a flow chart illustrating a method for managing available memory locations in accordance with an exemplary embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for managing memory cells in accordance with an exemplary embodiment of the present invention;
FIG. 3 is a schematic diagram of an apparatus for managing memory cells according to an exemplary embodiment of the present invention;
FIG. 4 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and the embodiments of the present invention are illustrative only and are not intended to limit the scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "including" and variations thereof as used herein is intended to be open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description. It should be noted that the terms "first", "second", and the like in the present invention are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in the present invention are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present invention are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
As shown in fig. 1, an embodiment of the present invention provides a method for managing a memory cell, which may include the following steps:
step S101: and in response to determining that read-write errors occur to one or more storage pages in the storage device, determining target storage units to which the one or more storage pages belong, and recording the target storage units.
In particular, the storage device is a computer device containing a portion for storing data, such as a desktop, a laptop, a tablet, a server device, a smartphone, etc., and the storage device is, for example, ssd, emmc, ufs, etc., which are types of flash memory.
Further, the minimum unit of read data in a flash memory device (i.e., a storage device) is a storage page (for example, indicated by page), and generally, error correction code encoding is required when processing write data to a flash memory array, and decoding is required when processing read data from the flash memory array; due to the physical properties of the flash memory array, a certain probability of data bit flipping occurs when reading data in the flash memory array, and if the bit flipping is too much, a decoding failure (i.e., a read error) occurs; or, write errors for a variety of reasons; wherein one or more memory pages are attributed to a memory block (i.e., memory unit).
The method for determining the read-write error of one or more storage pages in the storage device comprises the following steps:
when one or more storage pages (pages) detected by the storage device have read and write errors, the storage device firstly corrects the storage pages with read and write abnormalities by using an error correction module, wherein the error correction module can be realized based on a Low Density Parity Check Code (abbreviated as lpc) technology, the lpc is a forward error correction Code and is packaged in a storage device main control, and when the storage device has errors due to factors such as environmental temperature and self service life, the error correction can be firstly carried out by using the lpc; and exiting if the error correction is successful, otherwise, entering a retry (read) flow (namely triggering a retry strategy for reading and writing the memory page for multiple times) in the case of failure of the error correction. When the read-write abnormity of any storage page of the storage device is detected, the error correction module is used for correcting the storage page with the read-write abnormity; under the condition that the error correction module fails to correct the error of the storage page, triggering a retry strategy of reading and writing the storage page for multiple times; and determining that the memory page in the memory device has read and write errors when the memory page fails to be corrected by using the retry strategy.
Further, under the condition that both error correction by using an error correction module and a retry strategy fails, it is determined that a read-write error occurs in the memory page in the memory device, and further judgment and processing are performed. Specifically, in an embodiment of the present invention, current erasing times and current reading times corresponding to the target storage unit are obtained; judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not; if so, the step of recording the target storage unit is performed. The target storage unit may be a storage block (block), it may be understood that the storage device has a use duration (i.e., a use life), and in order to ensure the availability of the storage device, an erasing number threshold (the larger the erasing number threshold is, the longer the use life is) and a reading number threshold are set for a storage block of the storage device, so that it may be determined whether a current erasing number and a current reading number of the storage device are both within a corresponding threshold range by obtaining a current erasing number (e.g., represented by pec) and a current reading number (e.g., represented by rc) of a certain storage block, and if so, the step of storing the storage block (i.e., the target storage unit) is performed. That is, before the determining the target storage unit to which the one or more storage pages belong and recording the target storage unit, the method further includes: acquiring current erasing times and current reading times corresponding to the target storage unit; judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not; if so, the step of recording the target storage unit is performed.
Further, a method of recording the target storage unit: the target storage unit may be stored in a data structure such as a queue, array, database, file, etc. One embodiment of the invention is illustrated with queues: the recording the target storage unit includes: storing each target storage unit by using a target queue; obtaining each of the target storage units of a record, further comprising: removing the target storage unit from the target queue if the target storage unit is determined to be an error storage unit or an available storage unit. FIG. 1A is a schematic diagram of a queue (circular queue), wherein when any target storage unit is determined, the target storage unit is added to the tail (position indicated by tail) of the target queue; further, when each memory cell of the circular queue is acquired, the memory cell is acquired from the head (the position indicated by the head, the memory cell represented by blkA) of the circular queue. And after judgment, removing the target storage unit from the target queue under the condition that the target storage unit judges an error storage unit or an available storage unit. By storing the target storage unit using the data structure of the queue, the efficiency of locating and acquiring the storage unit is improved.
Step S102: in response to determining that the storage device is in a set state, obtaining each of the target storage units, performing: traversing each storage page contained in the target storage unit; and under the condition that any storage page is judged to be an uncorrectable error page, taking the target storage unit as an error storage unit, otherwise, taking the target storage unit as an available storage unit.
Specifically, as described in step S101, a target queue includes a plurality of target storage units (blocks) to be processed;
further, each of the target storage units is obtained in response to determining that the storage device is in a set state. The setting state comprises an idle state or a power-on process; namely: and monitoring the state of the storage equipment, and triggering to acquire each recorded target storage unit under the condition that the running state is judged to be in a set state. By acquiring each target storage unit after judging the state (idle state or power-on process) of the storage device, the influence of various external interference factors is reduced. The effectiveness and efficiency of managing the target storage unit are improved.
Further, managing individual target storage units (blocks) in the target queue; specifically, under the condition that the data stored in the target queue is judged not to be empty, the stored target storage unit is obtained from the head of the target queue, the step of traversing each storage page contained in the storage unit is executed for the target storage unit, and the step of removing the target storage unit from the target queue is executed.
In an embodiment of the present invention, the step of traversing each memory page included in the memory unit for the target memory unit includes: and taking the target storage unit as an error storage unit when judging that any storage page is an uncorrectable error page, and taking the target storage unit as an available storage unit if not.
Specifically, when it is determined that any memory page is an uncorrectable error page, the target memory cell is regarded as an error memory cell, otherwise, the target memory cell is regarded as an available memory cell, further including: when judging that any storage page is an uncorrectable error page, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from the target queue, and adding the error storage unit to an error storage unit set; otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set; and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
The processing steps are described below with reference to the schematic diagrams of fig. 1B and 1C:
as shown in fig. 1B, the stored target storage units are obtained from the head of the target queue, and taking blkA as the target storage unit of the head of the queue as an example, each storage page (page) included in blkA is read by using a binary method, where it is possible to determine whether there is a uecc (uncorrectable error code) in the storage page, and further determine the storage unit (block) to which the storage page belongs. And if the uecc exists, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from the target queue, and adding the error storage unit into an error storage unit set. The error storage unit set can be various data structures such as an array, a queue, a data table and the like. Fig. 1B shows a schematic diagram of an array structure as an error storage unit set, and assuming that blkA is determined to be an error storage unit, blkA is removed from the target queue (ring queue) (the storage unit corresponding to the head of the queue is changed from blkA to blkB), and added to the array, and the corresponding record is index 3: the badblkA.
As shown in fig. 1C, the stored target storage unit is obtained from the head of the target queue, and taking blkB as the target storage unit of the head of the queue as an example, each storage page (page) included in blkB is obtained, and when it is determined that any storage page is not an uncorrectable error page, the target storage unit is taken as an available storage unit, and the available storage unit is removed from the target queue and added to the available storage unit set. The available storage unit set may be various data structures such as an array, a queue, a data table, a linked list, and the like. Fig. 1C shows a schematic diagram of using a linked list structure as an available storage unit set, and assuming that blkB is determined to be an available storage unit, blkB is removed from a target queue (circular queue) (a storage unit corresponding to the head of the queue is changed from blkB to blkC), and added to the linked list, where the corresponding record is usedblkB.
That is, if it is determined that any memory page is an uncorrectable error page, the target memory cell is regarded as an error memory cell, otherwise, the target memory cell is regarded as an available memory cell, and the method further includes: when judging that any storage page is an uncorrectable error page, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from the target queue, and adding the error storage unit to an error storage unit set; otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set; and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
After each storage unit of the target queue is judged, the storage device is managed according to the formed error storage unit set and the available storage unit set, for example, each storage unit contained in the available storage unit set is used as an available storage block, so that the problem that the available storage unit cannot be used due to the fact that the available storage unit influenced by noise is judged as the error storage block by mistake in the prior art is solved, the read-write efficiency of the storage device is improved, and the service life of the storage device is prolonged.
As shown in fig. 2, an embodiment of the present invention provides a process for managing a storage unit, where the process may include the following steps:
step S201: under the condition that any storage page of the storage device is detected to have read-write abnormity, an error correction module is utilized to correct the storage page with the read-write abnormity; and under the condition that the error correction module fails to correct the memory page, triggering a retry strategy of reading and writing the memory page for multiple times.
Step S202: and acquiring the current erasing times and the current reading times corresponding to the target storage unit under the condition that the error correction of the storage page by utilizing the retry strategy is failed.
Step S203: and judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not.
If yes, go to step S204, otherwise go to step S211.
Step S204: storing unit identifications corresponding to all target storage units by using a target queue; and under the condition that any target storage unit is determined, adding a unit identifier corresponding to the target storage unit to the tail of the target queue.
Step S205: and judging whether the running state of the equipment is an idle state or a power-on process.
If so, step S206 is executed, otherwise, step S211 is executed.
Step S206: and judging whether the target queue is empty or not.
If yes, go to step S211, otherwise go to step S207.
Step S207: and acquiring the stored target storage unit from the head of the target queue, and executing traversal of each storage page contained in the storage unit for the target storage unit.
Step S208: it is determined whether any of the memory pages is an uncorrectable error page.
If so, step S209 is performed, otherwise step S210 is performed.
Step S209: taking the target storage unit as an error storage unit; and removing the error storage unit from the target queue and adding the error storage unit to the error storage unit set.
And performs step S205 for the next target storage unit.
Step S210: and taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to the available storage unit set.
And performs step S205 for the next target storage unit.
Step S211: and (4) other processing flows.
The flow of managing the storage unit described in step S201 to step S211 is consistent with the content of the description in step S101 to step S102, and is not described again here.
In an embodiment of the present invention, a Flash Translation Layer (FTL) may be utilized to process the method for managing storage data of the present invention; other flow processes may also be performed using the flash translation layer.
Therefore, the embodiment of the invention can reserve the memory blocks which are read out incorrectly due to channel noise (channel noise) generated by environmental noise in the memory device (namely, not due to the error of the memory unit); thereby reducing the wear of the memory cells (i.e., memory blocks) and further extending the lifetime of the memory device.
The embodiment of the invention provides a device for managing a storage unit, which is used for realizing the method for managing the storage unit. As shown in the schematic block diagram of fig. 3, an apparatus 300 for managing storage units comprises: a memory cell determining module 301 and a memory cell managing module 302. Wherein,
the memory location determining module 301 is configured to determine, in response to determining that a read/write error occurs in one or more memory pages in the storage device, a target memory location to which the one or more memory pages belong, and record each target memory location;
the management storage unit module 302 is configured to obtain each of the target storage units of the record, and perform: traversing each storage page contained in the target storage unit; and taking the target storage unit as an error storage unit when judging that any storage page is an uncorrectable error page, and taking the target storage unit as an available storage unit if not.
Optionally, the memory location determining module 301 is further configured to:
under the condition that any storage page of the storage device is detected to have read-write abnormity, an error correction module is utilized to correct the storage page with the read-write abnormity;
under the condition that the error correction module fails to correct the error of the storage page, triggering a retry strategy of reading and writing the storage page for multiple times;
and determining that the memory page in the memory device has read and write errors when the memory page fails to be corrected by using the retry strategy.
Optionally, the memory location determining module 301 is further configured to:
acquiring current erasing times and current reading times corresponding to the target storage unit;
judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not; if so, the step of recording the target storage unit is performed.
Optionally, the management storage unit module 302 is configured to:
monitoring the state of the storage device, and acquiring each recorded target storage unit under the condition that the running state is judged to be in a set state, wherein the set state is an idle state or a power-on process.
Optionally, the memory location determining module 301 is configured to: storing each target storage unit by using a target queue;
the manage memory unit module 302 is further configured to: removing the target storage unit from the target queue if the target storage unit is determined to be an erroneous storage unit or an available storage unit.
Optionally, the management storage unit module 302 is further configured to:
when judging that any storage page is an uncorrectable error page, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from the target queue, and adding the error storage unit to an error storage unit set;
otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set;
and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
In this embodiment, in response to determining that a read/write error occurs in one or more storage pages in the storage device, a target storage unit to which the one or more storage pages belong may be determined, and for each of the target storage units recorded, when it is determined that any storage page is an uncorrectable error page, the target storage unit is taken as an error storage unit, otherwise, the target storage unit is taken as an available storage unit. By further judging the target storage unit, the problem that the usable storage unit influenced by noise is judged as an error storage block by mistake is solved, the read-write efficiency of the storage device is improved, and the service life of the storage device is prolonged.
An exemplary embodiment of the present invention also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the invention.
Exemplary embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is operable to cause the computer to perform a method according to an embodiment of the present invention.
Exemplary embodiments of the present invention also provide a computer program product comprising a computer program, wherein the computer program is operative, when executed by a processor of a computer, to cause the computer to perform a method according to an embodiment of the present invention.
Referring to fig. 4, a block diagram of a structure of an electronic device 400 that can be the present invention, which is an example of a hardware device that can be applied to aspects of the present invention, will now be described. Electronic equipment is intended to represent various forms of digital electronic computer equipment, such as data center servers, notebook computers, thin clients, laptop computers, desktop computers, workstations, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in the electronic device 400 are connected to the I/O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 may be any type of device capable of inputting information to the electronic device 400, and the input unit 406 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device. Output unit 407 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 408 may include, but is not limited to, magnetic or optical disks. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 401 executes the respective methods and processes described above. For example, in some embodiments, the above-described method of managing storage units may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM 402 and/or the communication unit 409. In some embodiments, the computing unit 401 may be configured in any other suitable manner (e.g., by means of firmware) as the above-described method of managing storage units.
Program code for implementing the methods of the present invention may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (9)

1. A method of managing a memory cell, the method comprising:
in response to the fact that one or more storage pages in the storage device are determined to have read-write errors, determining target storage units to which the one or more storage pages belong, and recording the target storage units;
wherein the recording each of the target storage units comprises: storing each target storage unit by using a target queue;
wherein the target queue is a circular queue; under the condition that any target storage unit is determined, adding the target storage unit to the tail of the target queue, and acquiring from the head of the circular queue when each storage unit of the circular queue is acquired;
in response to determining that the storage device is in a set state, obtaining each of the target storage units, performing:
traversing each storage page contained in the target storage unit;
taking the target storage unit as an error storage unit under the condition that any storage page is judged to be an uncorrectable error page, otherwise taking the target storage unit as an available storage unit;
wherein the setting state comprises an idle state or a power-on process.
2. The method of claim 1, further comprising:
under the condition that any storage page of the storage device is detected to have read-write abnormity, an error correction module is utilized to correct the storage page with the read-write abnormity;
under the condition that the error correction module fails to correct the error of the storage page, triggering a retry strategy of reading and writing the storage page for multiple times;
and determining that the memory page in the memory device has read and write errors when the memory page fails to be corrected by using the retry strategy.
3. The method according to claim 1, wherein before said determining the target storage unit to which the one or more storage pages belong and recording each target storage unit, further comprising:
acquiring current erasing times and current reading times corresponding to the target storage unit;
judging whether the current erasing times are smaller than an erasing times threshold value or not and whether the current reading times are smaller than a reading times threshold value or not; if so, the step of recording the target storage unit is performed.
4. The method of claim 1, further comprising: removing the target storage unit from the target queue if the target storage unit is determined to be an erroneous storage unit or an available storage unit.
5. The method according to claim 1, wherein if it is determined that any of the memory pages is an uncorrectable error page, the target memory cell is regarded as an error memory cell, otherwise, the target memory cell is regarded as an available memory cell, further comprising:
when judging that any memory page is an uncorrectable error page, taking the target memory cell to which the memory page belongs as an error memory cell, removing the error memory cell from a target queue, and adding the error memory cell to an error memory cell set;
otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set;
and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
6. An apparatus for managing memory cells, comprising: determining a storage unit module and a management storage unit module; wherein,
the storage unit determining module is used for determining target storage units to which one or more storage pages belong in response to the fact that read-write errors occur to the one or more storage pages in the storage device, and recording the target storage units;
wherein the determine memory cell module is configured to: storing each target storage unit by using a target queue;
wherein the target queue is a circular queue; under the condition that any target storage unit is determined, adding the target storage unit to the tail of the target queue, and acquiring from the head of the annular queue when each storage unit of the annular queue is acquired;
the management storage unit module is configured to, in response to determining that the storage device is in a set state, acquire each of the target storage units of the record, and perform: traversing each storage page contained in the target storage unit; taking the target storage unit as an error storage unit under the condition that any storage page is judged to be an uncorrectable error page, and taking the target storage unit as an available storage unit if the error page is judged to be an uncorrectable error page; wherein the setting state comprises an idle state or a power-on process.
7. The apparatus of claim 6, wherein the manage storage unit module is further configured to:
under the condition that any storage page is judged to be an uncorrectable error page, taking the target storage unit to which the storage page belongs as an error storage unit, removing the error storage unit from a target queue, and adding the error storage unit to an error storage unit set;
otherwise, taking the target storage unit as an available storage unit, removing the available storage unit from the target queue, and adding the available storage unit to an available storage unit set;
and managing the storage device to which the storage device belongs by utilizing the error storage unit set and the available storage unit set.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
9. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202210811916.XA 2022-07-12 2022-07-12 Method and device for managing storage unit Active CN114879916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210811916.XA CN114879916B (en) 2022-07-12 2022-07-12 Method and device for managing storage unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210811916.XA CN114879916B (en) 2022-07-12 2022-07-12 Method and device for managing storage unit

Publications (2)

Publication Number Publication Date
CN114879916A CN114879916A (en) 2022-08-09
CN114879916B true CN114879916B (en) 2022-09-30

Family

ID=82683559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210811916.XA Active CN114879916B (en) 2022-07-12 2022-07-12 Method and device for managing storage unit

Country Status (1)

Country Link
CN (1) CN114879916B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622306A (en) * 2012-02-21 2012-08-01 中颖电子股份有限公司 Bad block management method for storage device
CN111274061A (en) * 2018-12-04 2020-06-12 阿里巴巴集团控股有限公司 System and method for handling uncorrectable data errors in mass storage
CN111708495A (en) * 2020-06-19 2020-09-25 深圳前海微众银行股份有限公司 Annular queue storage method and device, computing equipment and storage medium
CN112558860A (en) * 2019-09-10 2021-03-26 爱思开海力士有限公司 Memory system for distributing and reading data and operating method thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104216665B (en) * 2014-09-01 2017-03-08 上海新储集成电路有限公司 The memory management method of multilevel-cell solid state hard disc
US9997258B2 (en) * 2016-05-10 2018-06-12 Sandisk Technologies Llc Using non-volatile memory bad blocks
CN106601305A (en) * 2016-11-18 2017-04-26 华中科技大学 Solid-state disk error correction method combining error detection code with error correction code
CN111459708B (en) * 2020-03-11 2023-08-29 深圳佰维存储科技股份有限公司 Bad block processing method and device
CN111722803A (en) * 2020-06-12 2020-09-29 苏州浪潮智能科技有限公司 Data writing method and device for solid state disk, computer equipment and storage medium
KR20210156563A (en) * 2020-06-18 2021-12-27 삼성전자주식회사 Error check code (ECC) decoder and a memory system including an ECC decoder

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622306A (en) * 2012-02-21 2012-08-01 中颖电子股份有限公司 Bad block management method for storage device
CN111274061A (en) * 2018-12-04 2020-06-12 阿里巴巴集团控股有限公司 System and method for handling uncorrectable data errors in mass storage
CN112558860A (en) * 2019-09-10 2021-03-26 爱思开海力士有限公司 Memory system for distributing and reading data and operating method thereof
CN111708495A (en) * 2020-06-19 2020-09-25 深圳前海微众银行股份有限公司 Annular queue storage method and device, computing equipment and storage medium

Also Published As

Publication number Publication date
CN114879916A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
US8671330B2 (en) Storage device, electronic device, and data error correction method
JP5211751B2 (en) Calculator, dump program and dump method
CN104572489B (en) Wear leveling method and device
CN115495025B (en) Method and device for managing abnormal memory block
US20150074461A1 (en) Method and relevant apparatus for starting boot program
CN110442473B (en) Nonvolatile data storage method and device, electronic equipment and medium
CN107315616B (en) Firmware loading method and device and electronic equipment
US8863110B2 (en) Firmware updating system and method
CN109150642B (en) Application memory error detection method, detection device and storage medium
CN107451006B (en) Techniques to limit performance variations in storage devices
CN114996173B (en) Method and device for managing write operation of storage equipment
CN112650446A (en) Intelligent storage method, device and equipment of NVMe full flash memory system
CN108874441B (en) Board card configuration method, device, server and storage medium
CN116126581B (en) Memory fault processing method, device, system, equipment and storage medium
US9658922B2 (en) Computer-readable recording medium having stored therein program for write inspection, information processing device, and method for write inspection
US9785374B2 (en) Storage device management in computing systems
CN114138838A (en) Data processing method and device, equipment and medium
CN113590405A (en) Hard disk error detection method and device, storage medium and electronic device
WO2021027271A1 (en) Bad block information protection method and apparatus, computer device and storage medium
CN114879916B (en) Method and device for managing storage unit
CN109343800B (en) Storage device management method and device and readable storage medium
CN110865772A (en) Method and device for protecting system data physical block erasure count value, computer equipment and storage medium
CN114880164B (en) Method and device for managing storage pages
CN115827308A (en) Solid state disk data error correction method and solid state disk
CN111435323A (en) Information transmission method, device, terminal, server and storage medium

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