CN112162934A - Storage block abnormal wear processing method and device, electronic equipment and storage medium - Google Patents

Storage block abnormal wear processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112162934A
CN112162934A CN202011047443.8A CN202011047443A CN112162934A CN 112162934 A CN112162934 A CN 112162934A CN 202011047443 A CN202011047443 A CN 202011047443A CN 112162934 A CN112162934 A CN 112162934A
Authority
CN
China
Prior art keywords
physical storage
erasing times
block
storage block
memory
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.)
Pending
Application number
CN202011047443.8A
Other languages
Chinese (zh)
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.)
Shenzhen Shichuangyi Electronic Co ltd
Original Assignee
Shenzhen Shichuangyi Electronic 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 Shenzhen Shichuangyi Electronic Co ltd filed Critical Shenzhen Shichuangyi Electronic Co ltd
Priority to CN202011047443.8A priority Critical patent/CN112162934A/en
Publication of CN112162934A publication Critical patent/CN112162934A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7211Wear leveling

Abstract

The invention is suitable for the technical field of computers, and provides a storage block abnormal wear processing method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: clearing the erasing times of all blank physical storage blocks in the storage equipment; when the storage device stores data, traversing and searching a physical storage block with the minimum erasing frequency in the storage device to obtain a target physical storage block; adding one to the erasing times of the target physical storage block; and storing the data into the target physical storage block. The method provided by the invention can realize that the data stored each time is stored in the blank physical storage block with the least erasing frequency, thereby avoiding the abnormal abrasion of the storage block and prolonging the service life of the storage equipment.

Description

Storage block abnormal wear processing method and device, electronic equipment and storage medium
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a storage block abnormal wear processing method and device, electronic equipment and a storage medium.
Background
A flash memory chip (Nand flash memory) is composed of thousands of storage units according to a certain organization structure, the flash memory chip includes a plurality of LUNs (Logical Unit numbers), each LUN includes a plurality of planes, each Plane is composed of a plurality of blocks (physical storage blocks), each Block is composed of a plurality of pages (computer programming language instructions), as shown in fig. 1.
Reading and writing the flash memory chip by taking a Page as a unit, and when the Page is programmed, firstly erasing a Block where the Page is located, wherein the flash memory is erased by taking the Block as a unit; the Block of each flash memory chip is limited by the number of erasing times, generally speaking, the number of erasing times of the Block of an SLC (Single Layer Cell) flash memory can reach 10 ten thousand, the number of erasing times of an MLC (Multi-Level Cell) flash memory is generally several thousand to several ten thousand, and the number of TLC (triple-Level Cell) flash memory is several hundreds to several thousands, so when the number of erasing times of the Block reaches a life value, the Block is about to be damaged, and the reliability of the data inside cannot be guaranteed until the Block is completely damaged and cannot be used.
In writing the LBA (Logical block address) data of the storage product in the computer device, the LBA address to be written needs to be mapped to the Physical address of the storage product, that is, the Logical address data is actually written to which Physical address of the FLASH (storage chip), and a Logical address to Physical address mapping Table (L2P Table) is needed to record; however, if the algorithm of the storage product does not well control the Physical address (Physical address) of the written data, the damage of the Physical memory blocks (blocks) of the storage product is inconsistent, some Physical memory blocks are used up soon, and the usage rate of some Physical memory blocks is low, so that the number of good Physical memory blocks of the storage product is reduced, which is not enough to ensure the operation of the storage product, and at the same time, the computer device is not provided with enough Physical memory blocks to store data and is discarded.
Disclosure of Invention
The embodiment of the invention aims to provide a method for processing abnormal wear of a storage block, and aims to solve the problem that the service life of the existing physical storage block is short.
The embodiment of the invention provides a method for processing abnormal wear of a memory block, which comprises the following steps:
clearing the erasing times of all blank physical storage blocks in the storage equipment;
when the storage device stores data, traversing and searching a physical storage block with the minimum erasing frequency in the storage device to obtain a target physical storage block;
adding one to the erasing times of the target physical storage block;
and storing the data into the target physical storage block.
Still further, the method further comprises the steps of:
traversing and searching the erasing times of all physical storage blocks in the whole storage equipment to obtain the maximum erasing times and the minimum erasing times;
judging whether the difference between the maximum erasing times and the minimum erasing times is within a preset threshold value;
if not, the physical storage block corresponding to the minimum erasing times is put into a recovery queue;
and transferring the data stored in the physical storage blocks in the recycle queue to the physical storage blocks corresponding to the maximum erasing times.
Furthermore, after the step of transferring the data stored in the physical storage blocks in the recycle queue to the physical storage blocks corresponding to the maximum erasing times, the method further includes the following steps:
updating a logic-to-entity address mapping table;
and releasing the physical storage block corresponding to the minimum erasing times and putting the physical storage block into a blank physical storage block area.
Further, after the step of traversing the erase/write times of all physical memory blocks in the entire memory device, the method further comprises the following steps:
and placing the physical storage block with the erasing times exceeding a first preset value into the isolation area.
Still further, the method further comprises the steps of:
when the erasing times of the physical storage blocks with the preset number in the storage equipment exceed a second preset value;
and closing the storage function of the storage device.
Another embodiment of the present invention is also directed to a memory block abnormal wear processing apparatus, including:
the reset module is used for clearing the erasing times of all blank physical storage blocks in the storage equipment;
the query module is used for traversing and searching any physical storage block with the minimum erasing frequency in the storage equipment to obtain a target physical storage block when the storage equipment stores data;
the writing module is used for adding one to the erasing times of the target physical storage block;
and the storage module is used for storing data into the target physical storage block.
Still further, the apparatus further comprises:
the erasing times counting module is used for searching the erasing times of all the physical storage blocks in the whole storage equipment in a traversing manner so as to obtain the maximum erasing times and the minimum erasing times;
the judging module is used for judging whether the difference between the maximum erasing times and the minimum erasing times is within a preset threshold value;
and the recovery module is used for putting the physical storage block corresponding to the minimum erasing times into a recovery queue when the difference between the maximum erasing times and the erasing times of the minimum erasing times is not within the preset threshold value.
Still further, the apparatus further comprises:
the updating module is used for updating the logic-to-entity address mapping table;
and the releasing module is used for releasing the physical storage block corresponding to the minimum erasing times and placing the physical storage block into a blank physical storage block area.
Another embodiment of the present invention further provides an electronic device, including: the memory, the processor and the computer program stored on the memory and capable of running on the processor, when the processor executes the computer program, the steps in the memory block abnormal wear processing method are realized.
Another embodiment of the present invention further provides a computer-readable storage medium, having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps in the method for processing abnormal wear of a memory block as described in any one of the above.
The invention has the beneficial effects that: clearing the erasing times of all blank physical storage blocks in the storage device; when the storage device stores data, traversing and searching a physical storage block with the minimum erasing frequency in the storage device to obtain a target physical storage block; then adding one to the erasing times of the target physical storage block; and finally, the data is stored into the target physical storage block, so that the data stored every time can be stored into the blank physical storage block with the least erasing times, the abnormal abrasion of the storage block is avoided, and the service life of the storage equipment is prolonged.
Drawings
FIG. 1 is a schematic diagram of the organization of a prior art storage device;
FIG. 2 is a flowchart of a method for processing abnormal wear of a memory block according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for processing abnormal wear of a memory block according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for processing abnormal wear of a memory block according to an embodiment of the present invention;
FIG. 5 is a schematic block diagram of an apparatus for processing abnormal wear of a memory block according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The invention provides a method for processing abnormal abrasion of a storage block, which avoids abnormal abrasion of the storage block and prolongs the service life of storage equipment by storing data into a blank physical storage block with the least erasing and writing times; the problem of low use times of the physical storage block where the static data is located is solved by searching the physical storage block with the maximum erasing times and the minimum erasing times in the storage device; the physical storage block with the erasing times exceeding the first preset value is placed in the isolation area, so that the problem that data is easily lost after the physical storage block is used for multiple times is solved; by detecting the erasing times of the physical storage block and closing the storage function of the storage device in time, the problem that the data is damaged due to the fact that the data is stored in the storage device at the future service life of the storage device is solved.
Specific implementations of the present invention are described in detail below with reference to specific examples.
Example one
Referring to fig. 2, a method for processing abnormal wear of a memory block according to a first embodiment of the present invention includes steps S01 to S04:
in step S01, the erasing count of all the blank physical memory blocks in the memory device is cleared.
When the memory device is just opened, the erasing times of all blank blocks are initialized to be 0 and recorded in the memory device.
Step S02, when the storage device stores data, traversing and searching a physical storage block with the smallest number of times of erasing in the storage device to obtain a target physical storage block.
Specifically, when an operator writes data into the storage device through the host side, the firmware of the storage device searches a physical storage block with the minimum erasing frequency in a blank physical storage block in a traversing manner, and uses the physical storage block with the minimum erasing frequency as a target for storing the data.
In step S03, one is added to the erase/write count of the target physical memory block.
Specifically, the target physical memory block is erased to increase the erasing times of the target physical memory block by one, and the erasing times at this time is recorded for the next query, as can be understood, because all the erasing times of the blank physical memory blocks are cleared, and after the erasing times of the target physical memory block are increased by one, the erase-write count of the target physical memory block is one more time than that of the other blank physical memory blocks, when the host terminal inputs data into the storage device, only the blank physical storage block which has more erasing times than the blank physical storage block is needed to be found, namely the target physical storage block, the searching convenience is improved, after the data is stored, the erasing frequency of the target physical storage block is increased by one, the data stored in the storage device at each time by the host end can be ensured to be stored in the physical storage block with the minimum erasing frequency.
And step S04, storing the data into the target physical storage block.
It should be noted that, when the host stores data again, only the steps S02 to S04 need to be repeated, so that it is ensured that the physical storage block into which data is written each time is the smallest erase-write frequency in the blank physical storage block, the erase-write frequencies in the blank physical storage block are not different, the damage caused by the flash increase of the erase-write frequency of a certain physical storage block is avoided, and the service life of the storage device is prolonged.
In the method for processing abnormal wear of the storage block, the erasing times of all blank physical storage blocks in the storage device are reset; when the storage device stores data, traversing and searching a physical storage block with the minimum erasing frequency in the storage device to obtain a target physical storage block; then adding one to the erasing times of the target physical storage block to obtain a target physical storage block; and storing the data into a target physical storage block, and repeating the steps after traversing and searching for any physical storage block with the minimum erasing frequency in the storage device to obtain a new target physical storage block.
Example two
Referring to fig. 3, the method for processing abnormal wear of a memory block according to another embodiment of the present invention further includes steps S21 through S30.
In step S21, the erasing count of all the blank physical memory blocks in the memory device is cleared.
Step S22, when the storage device stores data, traversing and searching a physical storage block with the smallest number of times of erasing in the storage device to obtain a target physical storage block.
In step S23, one is added to the erase/write count of the target physical memory block.
And step S24, storing the data into the target physical storage block.
Step S25, the erasing times of all physical storage blocks in the entire storage device are searched through traversal to obtain the maximum erasing times and the minimum erasing times.
It can be understood that, because static data usually does not need to be modified, and the probability of the static data being re-modified by the host is very low, the erasing times of the physical storage block storing the static data are not updated all the time, but are kept at a very small value, and the erasing times of the physical storage block are greatly different from those of other physical storage blocks which are updated all the time, so that the aging loss of other physical storage blocks which are updated quickly is accelerated, and the service life of the whole storage device is influenced. Therefore, the algorithm of the firmware is needed to intervene to process the situation, and the query times of the physical storage block where the static data is located can be counted at the same time by comparing the erasing times of all the physical storage blocks rather than only the blank physical storage block.
Specifically, the step of searching for the erasing times of all physical storage blocks in the entire storage device in a traversal manner includes: and accelerating to find the erasing times of all physical storage blocks in the whole storage device through an accelerator.
It can be understood that the storage capacity of the storage device is very large, if the erasing times of all the physical storage blocks in the whole storage device need to be searched in a traversal manner, a very long time is needed, and in order to improve the calculation efficiency, the erasing times of all the physical storage blocks in the whole storage device can be searched in an acceleration manner through the accelerator.
Step S26, determining whether the difference between the maximum erasure count and the minimum erasure count is within a preset threshold.
Step S27, if not, the physical storage block corresponding to the minimum erasing and writing times is put into a recycle queue. If so, the process proceeds directly to step S29 and steps S29 and thereafter.
Step S28, transferring the data stored in the physical storage block in the recycle queue to the physical storage block corresponding to the maximum erasing count.
Through the method, only when the effective static data on the physical storage block with the minimum erasing times is moved to the physical storage block with the highest erasing times in the blank block pool, the static data is prevented from being frequently moved to reduce writing amplification, so that the erasing times of all the physical storage blocks of the storage device are controlled between preset threshold values set by an algorithm, the balanced abrasion of each physical storage block is ensured, and the service life of the storage device is maximized. For example, the erasing frequency of a storage device of an MLC (Multi-Level Cell) flash memory is usually thousands to tens of thousands, for example, the erasing frequency is twenty thousands, a preset threshold may be set to nineteen thousands, when the maximum erasing frequency and the minimum erasing frequency exceed nineteen thousands, the physical storage block corresponding to the minimum erasing frequency may be placed in a recovery queue, and data stored in the physical storage block in the recovery queue is transferred to the physical storage block corresponding to the maximum erasing frequency, because the probability of erasing static data is very low, the erasing frequency of the physical storage block corresponding to the maximum erasing frequency may be reduced, thereby preventing the physical storage block from being damaged too quickly, and improving the service life of the storage device.
Step S29, the logical-to-physical address mapping table is updated.
Step S30, releasing the physical memory block corresponding to the minimum erasing times and placing it into the blank physical memory block area.
Specifically, after the step of transferring the data stored in the physical storage block in the recycle queue to the physical storage block corresponding to the maximum erasing times, the logical-to-physical address mapping table is updated for the next data writing. In order to ensure that the CPU can correctly access the memory unit when executing the instruction, the logical address in the user program needs to be converted into the physical address directly addressed by the machine during operation, and therefore the logical-to-physical address mapping table needs to be updated to ensure that the data of the replaced physical memory block can be normally accessed.
EXAMPLE III
In an embodiment of the present invention, a physical storage block with the number of times of erasing exceeding a first preset value may also be placed in the isolation area; specifically, after the erasing times of all the physical storage blocks in the entire storage device are searched in a traversal manner in step S25, the erasing times of all the physical storage blocks are compared with a first preset value, and the physical storage blocks with the erasing times exceeding the first preset value are selected and placed in the isolation region; it can be understood that when the erasing times of the physical storage blocks exceed a certain number, the physical storage blocks are easy to damage after being stored with data, so that the stored data are lost. For example, the first preset value may be ninety-nine percent of the maximum erasing frequency of the physical memory block, so as to ensure data security on the premise of ensuring that the physical memory block is fully used.
Example four
In an embodiment of the present invention, when the erasing times of the preset number of physical memory blocks in the memory device all exceed a second preset value, the memory function of the memory device is turned off, specifically, when the erasing times of the preset number of physical memory blocks in the memory device all exceed the second preset value, only the host is allowed to extract data, but the host is not allowed to store data, and the user is prompted to replace the memory device in time, for example, when the erasing times of ninety percent of the physical memory blocks of the current memory device exceed nineteen percent of the maximum erasing times, it indicates that the service life of the memory device will be exhausted, and when the data is stored again, the probability of data loss is very high, in order to ensure the data security of the user, the memory device needs to be replaced in time, and the remaining erasing times are reserved for the user to make data backup, so as to ensure the data security of the user, the user experience is improved.
EXAMPLE five
Referring to fig. 4, an apparatus for processing abnormal wear of a memory block according to another embodiment of the present invention includes:
the reset module 10 is used for unifying the erasing times of all blank physical storage blocks in the storage device;
the query module 20 is configured to search through a physical storage block with the smallest erasing frequency in the storage device when the storage device stores data, so as to obtain a target physical storage block;
the writing module 30 is configured to add one to the erasing times of the target physical storage block;
and the storage module 40 is used for storing data into the target physical storage block.
The abnormal wear processing device of the memory block unifies the erasing times of all blank physical memory blocks in the memory device through the reset module 10; when the data is stored in the storage device through the query module 20, traversing and searching any physical storage block with the minimum erasing frequency in the storage device to obtain a target physical storage block; adding one to the erasing times of the target physical storage block through the writing module 30; the data are stored into the target physical storage block through the storage module 40, so that the data stored each time can be stored into the blank physical storage block with the least erasing times, the abnormal abrasion of the storage block is avoided, and the service life of the storage device is prolonged.
EXAMPLE six
In another embodiment of the present invention, referring to fig. 5, the apparatus for processing abnormal wear of a memory block further includes:
the erasing times counting module 50 is configured to search erasing times of all physical storage blocks in the entire storage device in a traversing manner to obtain a maximum erasing time and a minimum erasing time;
a judging module 60, configured to judge whether a difference between the maximum erasure count and the minimum erasure count is within a preset threshold;
the recovery module 70 is configured to, when the difference between the maximum erasure count and the minimum erasure count is not within the preset threshold, place the physical storage block corresponding to the minimum erasure count into a recovery queue.
According to the abnormal abrasion processing device for the storage blocks, the effective static data on the physical storage block with the minimum erasing times are moved to the physical storage block with the maximum erasing times in the blank block pool through the recovery module 70, so that the static data is prevented from being frequently moved to reduce writing amplification, the erasing times difference values of all the physical storage blocks of the storage equipment are controlled between preset threshold values set by an algorithm, the balanced abrasion of each physical storage block is guaranteed, and the service life of the storage equipment is maximized.
EXAMPLE seven
In another embodiment of the present invention, referring to fig. 5, the apparatus for processing abnormal wear of a memory block further includes:
an update module 80 for updating the logical-to-physical address mapping table;
and a releasing module 90, configured to release the physical storage block corresponding to the minimum erasing and writing times, and place the physical storage block into a blank physical storage block area.
In the above device for processing abnormal wear of memory blocks, after the data stored in the physical memory blocks in the recycle queue is transferred into the physical memory blocks corresponding to the maximum erasing times by the recycle module 70, the logic to physical address mapping table is updated by the update module 80 for the next data writing. In order to ensure that the CPU can correctly access the memory unit when executing the instruction, the logical address in the user program needs to be converted into the physical address directly addressed by the machine during operation, and therefore the logical-to-physical address mapping table needs to be updated to ensure that the data of the replaced physical memory block can be normally accessed.
Example eight
Another embodiment of the present invention further provides an electronic device, including: the memory, the processor and the computer program stored on the memory and capable of running on the processor, when the processor executes the computer program, the steps in the memory block abnormal wear processing method are realized.
In order to solve the above technical problem, an embodiment of the present application further provides an electronic device, configured to handle abnormal wear of a storage block. Referring to fig. 6 in detail, fig. 6 is a block diagram of a basic structure of the electronic device of the present embodiment, as shown in fig. 6.
The electronic device 100 comprises a memory 101, a processor 102, and a network interface 103 communicatively coupled to each other via a system bus. It is noted that only electronic device 100 having components 101 and 103 is shown, but it is understood that not all of the illustrated components are required and that more or fewer components may alternatively be implemented. As will be understood by those skilled in the art, the electronic device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing device. The electronic equipment can be in man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 101 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 101 may be an internal storage unit of the electronic device 100, such as a hard disk or a memory of the electronic device 100. In other embodiments, the memory 101 may also be an external storage device of the electronic device 100, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic device 100. Of course, the memory 101 may also include both an internal storage unit and an external storage device of the electronic device 100. In this embodiment, the memory 101 is generally used for storing an operating system installed in the electronic device 100 and various types of application software, such as program codes of a crash file processing method. Further, the memory 101 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 102 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 102 is generally used to control the overall operation of the electronic device 100. In this embodiment, the processor 102 is configured to execute the program code stored in the memory 101 or process data, for example, execute the program code of the above memory block abnormal wear processing method.
The network interface 103 may include a wireless network interface or a wired network interface, and the network interface 103 is generally used for establishing a communication connection between the electronic device 100 and other electronic devices.
Example nine
Another embodiment of the present invention further provides a computer-readable storage medium, having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps in the method for processing abnormal wear of a memory block as described in any one of the above.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method for handling abnormal wear of a memory block, the method comprising the steps of:
clearing the erasing times of all blank physical storage blocks in the storage equipment;
when the storage device stores data, traversing and searching a physical storage block with the minimum erasing frequency in the storage device to obtain a target physical storage block;
adding one to the erasing times of the target physical storage block;
and storing the data into the target physical storage block.
2. The memory block abnormal wear handling method of claim 1, further comprising the steps of:
traversing and searching the erasing times of all physical storage blocks in the whole storage equipment to obtain the maximum erasing times and the minimum erasing times;
judging whether the difference between the maximum erasing times and the minimum erasing times is within a preset threshold value;
if not, the physical storage block corresponding to the minimum erasing times is put into a recovery queue;
and transferring the data stored in the physical storage blocks in the recycle queue to the physical storage blocks corresponding to the maximum erasing times.
3. The method for processing abnormal wear of memory blocks according to claim 2, wherein after the step of transferring the data stored in the physical memory blocks in the reclamation queue to the physical memory blocks corresponding to the maximum erase/write times, the method further comprises the steps of:
updating a logic-to-entity address mapping table;
and releasing the physical storage block corresponding to the minimum erasing times and putting the physical storage block into a blank physical storage block area.
4. The method of claim 2, wherein after the step of traversing the erase/write times of all physical memory blocks in the entire memory device, the method further comprises the steps of:
and placing the physical storage block with the erasing times exceeding a first preset value into the isolation area.
5. The memory block abnormal wear handling method of claim 1, further comprising the steps of:
and when the erasing times of the physical storage blocks with the preset number in the storage equipment exceed a second preset value, closing the storage function of the storage equipment.
6. A memory block abnormal wear processing apparatus, the apparatus comprising:
the reset module is used for clearing the erasing times of all blank physical storage blocks in the storage equipment;
the query module is used for traversing and searching any physical storage block with the minimum erasing frequency in the storage equipment to obtain a target physical storage block when the storage equipment stores data;
the writing module is used for adding one to the erasing times of the target physical storage block;
and the storage module is used for storing data into the target physical storage block.
7. The memory block abnormal wear processing apparatus according to claim 6, wherein the apparatus further comprises:
the erasing times counting module is used for searching the erasing times of all the physical storage blocks in the whole storage equipment in a traversing manner so as to obtain the maximum erasing times and the minimum erasing times;
the judging module is used for judging whether the difference between the maximum erasing times and the minimum erasing times is within a preset threshold value;
and the recovery module is used for putting the physical storage block corresponding to the minimum erasing times into a recovery queue when the difference between the maximum erasing times and the erasing times of the minimum erasing times is not within the preset threshold value.
8. The memory block abnormal wear processing apparatus according to claim 6, wherein the apparatus further comprises:
the updating module is used for updating the logic-to-entity address mapping table;
and the releasing module is used for releasing the physical storage block corresponding to the minimum erasing times and placing the physical storage block into a blank physical storage block area.
9. An electronic device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the memory block abnormal wear processing method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, realizes the steps in the storage block abnormal wear processing method according to any one of claims 1 to 5.
CN202011047443.8A 2020-09-29 2020-09-29 Storage block abnormal wear processing method and device, electronic equipment and storage medium Pending CN112162934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011047443.8A CN112162934A (en) 2020-09-29 2020-09-29 Storage block abnormal wear processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011047443.8A CN112162934A (en) 2020-09-29 2020-09-29 Storage block abnormal wear processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112162934A true CN112162934A (en) 2021-01-01

Family

ID=73862081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011047443.8A Pending CN112162934A (en) 2020-09-29 2020-09-29 Storage block abnormal wear processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112162934A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112907913A (en) * 2021-02-09 2021-06-04 北京小米移动软件有限公司 Detection method, device and equipment of electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571833A (en) * 2008-04-29 2009-11-04 深圳市朗科科技股份有限公司 Method and device for protecting storage medium
CN101777026A (en) * 2009-01-09 2010-07-14 成都市华为赛门铁克科技有限公司 Memory management method, hard disk and memory system
CN102789423A (en) * 2012-07-11 2012-11-21 山东华芯半导体有限公司 Four-pool flash wear leveling method
CN103092766A (en) * 2012-12-28 2013-05-08 北京时代民芯科技有限公司 Balanced loss achievement method for NAND FLASH
CN104778127A (en) * 2015-03-25 2015-07-15 合肥格易集成电路有限公司 Method and device for writing data by NAND FLASH
CN106844227A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 Solid state hard disc abrasion equilibrium method and device based on grouping mechanism
CN107025066A (en) * 2016-09-14 2017-08-08 阿里巴巴集团控股有限公司 The method and apparatus that data storage is write in the storage medium based on flash memory
CN109254927A (en) * 2018-08-30 2019-01-22 浪潮电子信息产业股份有限公司 A kind of implementation method of solid state hard disk abrasion equilibrium
CN109783020A (en) * 2018-12-28 2019-05-21 西安交通大学 A kind of rubbish recovering method based on SSD-SMR mixing key assignments storage system
CN111562882A (en) * 2020-04-22 2020-08-21 深圳震有科技股份有限公司 Data writing method, intelligent terminal and storage medium
CN111651126A (en) * 2020-06-04 2020-09-11 重庆芯讯通无线科技有限公司 Write operation method, system, electronic device and medium of memory

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571833A (en) * 2008-04-29 2009-11-04 深圳市朗科科技股份有限公司 Method and device for protecting storage medium
CN101777026A (en) * 2009-01-09 2010-07-14 成都市华为赛门铁克科技有限公司 Memory management method, hard disk and memory system
CN102789423A (en) * 2012-07-11 2012-11-21 山东华芯半导体有限公司 Four-pool flash wear leveling method
CN103092766A (en) * 2012-12-28 2013-05-08 北京时代民芯科技有限公司 Balanced loss achievement method for NAND FLASH
CN104778127A (en) * 2015-03-25 2015-07-15 合肥格易集成电路有限公司 Method and device for writing data by NAND FLASH
CN107025066A (en) * 2016-09-14 2017-08-08 阿里巴巴集团控股有限公司 The method and apparatus that data storage is write in the storage medium based on flash memory
CN106844227A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 Solid state hard disc abrasion equilibrium method and device based on grouping mechanism
CN109254927A (en) * 2018-08-30 2019-01-22 浪潮电子信息产业股份有限公司 A kind of implementation method of solid state hard disk abrasion equilibrium
CN109783020A (en) * 2018-12-28 2019-05-21 西安交通大学 A kind of rubbish recovering method based on SSD-SMR mixing key assignments storage system
CN111562882A (en) * 2020-04-22 2020-08-21 深圳震有科技股份有限公司 Data writing method, intelligent terminal and storage medium
CN111651126A (en) * 2020-06-04 2020-09-11 重庆芯讯通无线科技有限公司 Write operation method, system, electronic device and medium of memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112907913A (en) * 2021-02-09 2021-06-04 北京小米移动软件有限公司 Detection method, device and equipment of electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10713178B2 (en) Mapping table updating method, memory controlling circuit unit and memory storage device
US8892814B2 (en) Data storing method, and memory controller and memory storage apparatus using the same
US9043536B2 (en) Method of recording mapping information, and memory controller and memory storage apparatus using the same
CN104714893A (en) Method and system for garbage collection scaling
CN110928807B (en) Apparatus and method for checking valid data in a memory system
US9058256B2 (en) Data writing method, memory controller and memory storage apparatus
TWI423026B (en) Data writing method, memory controller and memory storage apparatus
US20150012687A1 (en) Method for managing commands in command queue, memory control circuit unit and memory storage apparatus
CN110674056B (en) Garbage recovery method and device
US8812772B2 (en) Data merging method for non-volatile memory and controller and storage apparatus using the same
KR20200068941A (en) Apparatus and method for controlling data stored in memory system
CN106445401B (en) Table updating method, memory storage device and memory control circuit unit
CN102890655B (en) Memory storage device, memory controller and valid data recognition method thereof
CN102053796A (en) Flash memory storage system, flash memory controller and data processing method
CN107357520B (en) Finishing instruction processing method, memory control circuit unit and memory device thereof
CN111831578A (en) Apparatus and method for processing different types of data in a memory system
US10423524B2 (en) Memory storage device, control circuit unit and method including storing logical-to-physical table bit map information in a management unit and not storing identical data content
CN105224238B (en) Storage management method, memory storage apparatus and memorizer control circuit unit
CN110532195B (en) Workload clustering for memory systems and methods of performing the same
CN113885808B (en) Mapping information recording method, memory control circuit unit and memory device
CN111562882A (en) Data writing method, intelligent terminal and storage medium
CN111435334A (en) Apparatus and method for checking valid data in memory system
CN100456263C (en) Method for treating broken block when using flash memory in tax-controlled cashing machine
CN104008070A (en) Master boot record protection in solid state drive
CN112162934A (en) Storage block abnormal wear processing method and device, electronic equipment 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210101