WO2020077489A1 - Method for processing storage block, and related device - Google Patents
Method for processing storage block, and related device Download PDFInfo
- Publication number
- WO2020077489A1 WO2020077489A1 PCT/CN2018/110223 CN2018110223W WO2020077489A1 WO 2020077489 A1 WO2020077489 A1 WO 2020077489A1 CN 2018110223 W CN2018110223 W CN 2018110223W WO 2020077489 A1 WO2020077489 A1 WO 2020077489A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- page
- bad
- target
- storage
- bad page
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to the field of data storage, in particular to a storage block processing method and related equipment.
- a solid state drive is a type of storage device, which uses a flash memory (nand flash, NAND) as the main storage medium.
- NAND flash memory
- the smallest operation unit for reading and writing data from a solid state drive is a page, which is erased
- the smallest operating unit of data is a block.
- each storage block is composed of hundreds to thousands of pages in succession.
- RBER raw bit error rate
- ECC error correction code
- SSD When the above problem occurs on some pages of NAND, SSD will mark the block where the problem page is located as a bad block, no longer participate in the read and write operation, and reduce the leakage current by increasing the threshold voltage of a part of the transistors in the bad block, thereby reducing The impact of bad blocks on the remaining blocks, thereby ensuring data integrity. Because the SSD reserves redundant blocks, the data space visible to the user is not reduced due to bad blocks, so the SSD can continue to be used. However, due to the limited number of SSD redundant blocks, when the bad blocks reach a certain number, the SSD reaches the end of life.
- An embodiment of the present application provides a storage block processing method and related equipment.
- the present application obtains a continuous maximum storage interval that does not include the bad page in the storage block, and continues to use the continuous maximum storage interval In order to avoid directly marking the entire storage block as a bad block, slow down the consumption of redundant blocks and prolong the service life of the storage device.
- a first aspect of an embodiment of the present application provides a storage block processing method that is applied to a controller, where the controller is applied to a storage device, and the storage device includes the controller and a memory, and the memory includes multiple Memory blocks, the memory block contains multiple pages, and the controller includes storage interval information of each memory block, and the storage interval information is used to indicate an available storage interval of the memory block.
- the method may include: when the controller detects that there is at least one bad page in the target storage block, acquiring at least one bad page position corresponding to the at least one bad page one by one, the at least one bad page position including the at least one bad page position At least one bad page number corresponding to each bad page, the at least one bad page number is used to indicate the sort position of the at least one bad page among the multiple pages included in the target storage block, wherein, when the at least one bad page is In the case of a bad page, the at least one bad page position is the bad page number of the one bad page. When there are at least two bad pages in the at least one bad page, the at least one bad page position includes the at least two bad pages.
- the controller may divide the available storage interval of the target memory block according to the at least one bad page number to determine a good area, wherein the good area is the target storage The maximum storage interval of the block that is continuous and free of the bad page in the available storage interval of the block; the controller can be based on the second start page number of the start page of the good area and the second end of the end page Number, update the storage section information of the target storage block, wherein the storage section information of the target storage block includes the first start page number of the start page of the available storage section of the target storage block and the first end page number of the end page , The updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area, so that the controller can store subsequently received user data into the good area.
- the available storage interval of the target storage block of the storage block may be divided according to the position of the bad page, so that the available storage interval of the target storage block does not include the bad page
- the maximum continuous interval is determined as a good area, and then the available storage interval of the storage block is updated according to the good area, which avoids directly marking the entire storage block as a bad block, slows down the consumption of redundant blocks, and extends the use of solid state drives Longevity, and because the consumption of redundant blocks is reduced, the increase of the write amplification factor is also avoided, which further extends the service life of the solid-state hard disk; in addition, this application can also be applied to other storage devices containing storage blocks, thereby extending storage The service life of the equipment.
- the at least one bad page is a bad page
- the controller obtains the bad page position of the one bad page, that is, the bad page number of the one bad page, the bad page
- the bad page number as the number of the separator page divides the available storage interval of the target memory block to determine the good area, that is, the second start page number of the start page of the good area or the end page of the good area The second end page number.
- the controller may directly use the position of the one bad page as the position of the separation page to divide the available storage interval of the target storage block, thereby determining the good area and increasing The operability of this program.
- the bad page position of the one bad page includes the bad page number of the one bad page
- the storage interval information of the target storage block includes the first starting page of the start page of the available storage interval of the target storage block Start page number, the bad page number of the one bad page and the first start page number are used to determine the multiple pages contained in the target memory block by the start page of the one bad page and the available storage interval of the target memory block
- the sorting position in the controller the controller can obtain the availability of the target storage block if the sorting position of the one bad page is in the first half of the available storage interval of the target storage block according to the bad page number of the one bad page
- the number of the next page of the one bad page in the storage interval to determine that the multiple pages contained in the next page of the one bad page to the end page of the available storage interval of the target memory block are the good areas; the controller can The first starting page number in the storage interval information of the target storage block is updated to the number of the next page of the one bad page, so that the available storage interval of the target
- the controller may number the multiple pages included in the target storage block, so that when the at least one bad page is a bad page, it can determine whether the one bad page is located according to the bad page number of the one bad page.
- the first half of the available storage interval of the target memory block when it is determined to be in the first half, the first start page number can be updated to the number of the next page of the one bad page, thus completing the storage of the target memory block
- the update operation of the interval information avoids the operation of counting the number of pages located before and after the one bad page in the available storage interval of the target storage block page by page after detecting a bad page, and improves the target storage block
- the update efficiency of the storage interval information avoids the operation of counting the number of pages located before and after the one bad page in the available storage interval of the target storage block page by page after detecting a bad page, and improves the target storage block The update efficiency of the storage interval information.
- the bad page position of the one bad page includes the bad page number of the one bad page
- the storage interval information of the target storage block includes the first termination of the end page of the available storage interval of the target storage block Page number, the bad page number of the one bad page and the first end page number are used to determine the end page of the one bad page and the available storage interval of the target memory block among the multiple pages included in the target memory block Sorting position;
- the controller can obtain the available storage of the target storage block when determining the sorting position of the one bad page in the second half of the available storage interval of the target storage block according to the bad page number of the one bad page The number of the previous page of the one bad page in the interval to determine the number of pages contained in the start page of the available storage interval of the target memory block to the previous page of the one bad page as the good area; the controller can The first termination page number is updated to the number of the previous page of the one bad page, so that the available storage interval of the target storage block is updated to the good area.
- the controller may number the multiple pages included in the target storage block, so that when the at least one bad page is a bad page, it can determine whether the one bad page is located according to the bad page number of the one bad page.
- the second half of the available storage interval of the target memory block when it is determined to be in the first half, the first end page number can be updated to the number of the previous page of the one bad page, thus completing the target memory block
- the update operation of the storage interval information of the computer avoids the operation of counting the number of pages located before and after the one bad page in the available storage interval of the target storage block after detecting a bad page, which improves the target Update efficiency of storage block information in the storage block.
- the controller determines the target bad page according to the target bad page position
- the available storage interval of the target storage block is divided by using the target bad page position as the position of the separation page to determine a good area.
- the controller when there are at least two bad pages in the at least one bad page, since the controller processes the at least two bad pages page by page, the post-processed bad pages may appear in the available storage interval of the target storage block
- the controller only divides the available storage interval of the target storage block according to the target bad page location when the target bad page is located in the available storage interval of the target storage block, so that when the bad page occurs in When the unavailable storage interval of the target storage block does not affect the available storage interval of the target storage block, the operation of re-dividing the available storage interval is no longer performed, which avoids the waste of processing resources of the controller and reduces the storage block Management complexity.
- the at least two bad pages in the at least one bad page there are at least two bad pages in the at least one bad page, and at least two bad page positions in one-to-one correspondence with the at least two bad pages in the at least one bad page position
- the at least two Each bad page position contains at least two bad page numbers corresponding to at least two bad pages, and the at least two bad page numbers are used to determine that the at least two bad pages are among the multiple pages included in the target storage block
- the sorting position of the controller may determine the edge bad page according to the at least two bad page numbers, and the edge bad page is the bad page with the sorting position at the top or the sorting position at the bottom of the at least two bad pages, where , In the case that it is determined according to the at least two bad page numbers that the sort positions of the at least two bad pages are all in the first half of the available storage interval of the target storage block, it can be obtained that the sort positions of the at least two bad pages are located in the most The bad page position of the next bad page is used as the edge bad page
- the controller may acquire the edge bad pages in the at least two bad pages, so that only the available storage of the target storage block according to the edge bad pages The interval is divided to avoid repeated operations when processing the at least two bad pages page by page, thereby improving the efficiency of processing the bad pages.
- the controller may also set an isolation area in the good area to divide the good area into an isolation area and a user data area, where the isolation area contains at least one page of random data and is located in Between the at least one bad page and the user data area, the user data area is used to store valid data, wherein, when the at least one bad page is a bad page, the isolation area is at least adjacent to the one bad page One page; when there are at least two bad pages in the at least one bad page, the isolation area is at least one page adjacent to the edge page in the at least two bad pages.
- this program interference may further increase.
- the bad page is in the first half of the available storage interval of the target memory block, the The top-ranked page in the good area is used as the starting page, and at least one page of random data is written, so that an isolation area is set between the bad page and the user data area, which can block the impact of the bad page on the available pages, thereby Improve the reliability of available storage areas.
- the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block
- the sorting position in the plurality of pages when it is determined that the sorting position of the at least one bad page is in the first half of the available storage interval of the target memory block according to the at least one bad page number, the controller may sort in the good area
- the page at the top is used as the starting position, and random data of the at least one page is written to form the isolation area.
- the controller after the controller performs the erase operation on the good area, it can trigger the operation of setting the isolation area when the target memory block receives valid data; it can also set the timing after performing the erase operation on the good area After the time set by the timer is reached, the operation of setting the isolation zone is triggered.
- the random data refers to invalid data randomly generated by the controller.
- the controller when the at least one bad page is located in the first half of the available storage interval of the target storage block, the controller writes the at least one page with the sorted position in the good area at the top as the starting position.
- One page of random data, thus forming the isolated area improves the operability of this solution.
- the top-ranked page in the good area is the next page of the bad page in the available storage interval of the target storage block;
- the topmost page in the good area is the next page of the target bad page in the available storage interval of the target storage block, and the target bad page is Any one of the at least two bad pages.
- the isolation area can be set by the scheme in this application, thereby improving the flexibility and operability of the scheme.
- the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block
- the controller will be effective when determining that the sorting position of the at least one bad page is in the second half of the available storage interval of the target memory block according to the at least one bad page number
- the at least one bad page is in the second half of the available storage interval of the target storage block, if the written valid data has already occupied the user data area, the next page of the user data area As the starting position, the random data of the at least one page is written, thereby forming the isolation area, which improves the operability of the solution.
- the controller may determine the third termination page number of the termination page of the user data area according to the second termination page number of the termination page of the good area and the preset number of pages in the isolation area, and After performing the write operation in the target memory block twice, obtain the number of the last page of the page where valid data has been written, and determine whether the valid data written by determining whether the number of the last page reaches the third end page number User data area has been occupied.
- the storage interval information of the target storage block includes the first start page number of the start page of the available storage interval of the target storage block, and there are multiple pages in the good area Start page, the second start page number and the first start page number of the start page of the good area are used to determine the start page of the good area and the start page of the available storage interval of the target memory block in The sorting position among the multiple pages included in the target storage block, and the controller may obtain the first pre-order when determining that the start page of the good area exists in the first preset interval according to the second start page number Set a number, where the first preset interval contains multiple pages, the first preset number is the number of the next page of the first preset interval; after the controller determines the first preset number, The first starting page number may be updated to the first preset number.
- the number of the start page of the storage interval information of the target storage block is updated to correspond to the first preset interval
- the first preset number that is, the starting position of the available storage interval of the target storage block is limited to a specific value, because the location of the bad page has a specific rule, you can set the start of the available storage interval according to statistical rules
- the numbered preset value set so that the edges of the available storage interval are aligned, thereby reducing the management complexity of the storage block.
- the storage interval information of the target storage block includes the first end page number of the end page of the available storage interval of the target storage block, and the multiple areas included in the good area have the end of the good area Page, the second end page number and the first end page number of the end page of the good area are used to determine the end page of the good area and the end page of the available storage interval of the target storage block included in the target storage block
- the sorting position in the multiple pages the controller can obtain the second preset number if it is determined that the end page of the good area exists in the second preset interval according to the second end page number, wherein the second The preset interval includes multiple pages, and the second preset number is the number of the previous page in the second preset interval; after the controller determines the second preset number, the first end page number can be Update to the second preset number.
- the first start page number is updated to the second preset number corresponding to the second preset interval, which is
- the end position of the available storage interval of the target storage block is limited to a specific value. Since the location of the bad page has a specific law, the preset value set of the end number of the available storage interval can be set according to the statistical law to make it available The edges of the storage interval are aligned, thereby reducing the management complexity of the storage block.
- the storage interval information of the target storage block includes the first start page number of the start page and the first end page number of the end page of the available storage interval of the target storage block, and the controller can obtain The difference between the first start page number and the first end page number; when the difference reaches or falls below a preset threshold, the target memory block is marked as an unusable memory block.
- the storage block where the available storage interval is located is marked as a bad block, so that the storage block is no longer managed, thereby reducing the complexity of the management of the storage block by the controller degree.
- an embodiment of the present application provides a controller that is applied to a storage device and the controller is applied to a storage device.
- the storage device includes the controller and a memory, and the memory includes multiple storage blocks.
- the storage block contains multiple pages.
- the controller contains storage interval information for each storage block.
- the storage interval information is used to determine the available storage interval of the storage block.
- the controller includes an acquisition unit, a determination unit, and an update unit: the acquisition The unit is configured to, when it is detected that at least one bad page exists in the target storage block, acquire the position of the at least one bad page corresponding to the at least one bad page, where the at least one bad page is a bad page In the case of pages, the at least one bad page position is the bad page number of the one bad page.
- the at least one bad page position contains A corresponding at least two bad page numbers; the determining unit is used to determine a good area according to the bad page number of the at least one bad page, wherein the good area is the target storage block The maximum storage interval in the available storage interval of the continuous and without the bad page; the update unit is used to update the second page number of the start page of the good area and the second page number of the end page
- the storage interval information of the target storage block wherein the storage interval information of the target storage block includes the first start page number and the first end page number of the start page of the available storage interval of the target storage block
- the storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area, so that the controller can store subsequently received user data into the good area.
- the available storage interval of the target storage block of the storage block may be divided according to the location of the bad page, so that the determination unit does not include the available storage interval of the target storage block
- the maximum continuous interval of bad pages is determined as a good area, and the update unit updates the available storage interval of the storage block according to the good area, avoiding directly marking the entire storage block as a bad block, slowing down the consumption of redundant blocks, and extending
- the service life of the solid state hard disk is reduced, and because the consumption of redundant blocks is reduced, the increase in the write amplification factor is also avoided, and the service life of the solid state hard disk is further extended; in addition, the application can also be applied to other storage devices that include storage blocks , Thereby extending the life of storage devices.
- an embodiment of the present application provides a storage device, the storage device includes a controller and a memory, the memory includes a storage block, and the storage block includes a plurality of pages; wherein, the controller is used to execute the first
- the aspect of the storage block processing method is also used to generate instructions; the memory is used to store data according to the instructions.
- an embodiment of the present application provides a terminal.
- the terminal includes an interface, a processor, and a storage device.
- the storage device includes a controller and a memory.
- the memory includes a storage block.
- the storage block includes multiple pages.
- the controller sends data to the controller through the interface; the controller is used to perform the method of processing memory blocks as described in the first aspect, and is also used to receive the data sent by the processor through the interface and generate instructions; the memory Used to store the data according to the instruction.
- an embodiment of the present application provides a computer program product containing instructions, which, when the computer program product runs on a computer, causes the computer to execute the method for processing a storage block as described in the first aspect.
- an embodiment of the present application provides a computer-readable storage medium, in which a message processing instruction is stored, and when it is run on a computer, the computer is allowed to execute the above-described first aspect.
- Storage block processing method in which a message processing instruction is stored, and when it is run on a computer, the computer is allowed to execute the above-described first aspect.
- an embodiment of the present application provides a chip system including a processor for supporting a network device to implement the functions involved in the above aspects, for example, for example, sending or processing data and data involved in the above method / Or information.
- the chip system further includes a memory for storing necessary program instructions and data of the network device.
- the chip system may be composed of chips, and may also include chips and other discrete devices.
- FIG. 1a is a schematic structural diagram of a storage device provided by an embodiment of this application.
- FIG. 1b is another schematic structural diagram of a storage device provided by an embodiment of this application.
- 1c is a schematic structural diagram of a memory provided by an embodiment of this application.
- FIG. 2 is a schematic flowchart of a storage block processing method provided by an embodiment of the present application.
- 3a is a schematic structural diagram of a target storage block provided by an embodiment of this application.
- 3b is another schematic structural diagram of a target storage block provided by an embodiment of this application.
- FIG. 4 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application.
- 5a is another schematic structural diagram of a target storage block provided by an embodiment of this application.
- 5b is another schematic structural diagram of a target storage block provided by an embodiment of the present application.
- FIG. 6 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application.
- FIG. 7 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application.
- FIG. 8 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of a controller provided by an embodiment of the present application.
- An embodiment of the present application provides a storage block processing method and related equipment.
- a continuous maximum storage interval that does not include the bad page in the storage block is acquired, and the continuous maximum The storage interval avoids directly marking the entire storage block as a bad block, slows down the consumption of redundant blocks, and extends the service life of the storage device.
- the present application is applied to a storage device 10 that is connected to a host 20, and the storage device 10 is used to store data according to an instruction of the host 20.
- the storage device 10 may include a non-embedded storage device, as an example, such as a solid state drive.
- the storage device 10 may also include an embedded storage device, as an example, such as a stand-alone chip applied to a mobile terminal.
- the storage device 10 may also be other forms of storage devices, which are not specifically listed here.
- the storage device 10 may include a controller 100 and a memory 110.
- the controller 100 communicates with the host 20 and is connected to the memory 110.
- the controller 100 is used to receive an instruction transmitted by the host and to the memory according to the instruction 110 Perform operations such as erase and write.
- the controller 100 is also used to manage the storage space in the memory 110.
- the front end of the controller 100 may include a first interface for communicating with the host 20, and the first interface may be a non-volatile storage high-speed Interface (non-volatile memory express, NVME), serial small computing system interface (serial attached) small computer system interface (SAS), peripheral component extended high-speed interface (peripheral component interconnect interconnect express, PCIE) or other hosts and non-embedded storage devices
- NVME non-volatile storage high-speed Interface
- SAS serial attached small computing system interface
- PCIE peripheral component extended high-speed interface
- One of the interfaces between the two, the back end of the controller 100 may further include a second interface connected to the memory 110, the second interface may be a flash media interface (nand flash interface, NFI) or other types used inside the memory
- NFI flash media interface
- the controller receives commands from the host through the first interface, and performs operations such as erasing and writing on the memory 110 through the second interface according to the received commands.
- the controller 100 and the memory 110 may be independent chips packaged by the controller circuit and the storage particle array. Therefore, the controller 100 and the memory There may be no interface between 110.
- the controller 100 communicates with the host 20 through a third interface, which may be a universal flash storage interface (universal flash storage (UFS), an embedded multimedia card interface (embedded multimedia card, EMMC), or other host and embedded One of the interfaces between storage devices, the specific is not limited here.
- UFS universal flash storage
- EMMC embedded multimedia card interface
- the memory 110 may include a flash memory, a random access memory, a read-only memory, or other memory types, etc.
- the memory 110 may be a storage array composed of storage particles, where the flash memory refers to the flash particles as the storage
- the memory of the medium is included in the flash memory. It should be understood that, in this embodiment, the flash memory is used as an example for description.
- the memory 110 may include multiple independent logical units (Die / LUN), and each independent logical unit may include multiple storage planes (Plane), and each storage plane It can contain multiple memory blocks (Block) 1100, and each memory block can contain multiple pages.
- Die / LUN multiple independent logical units
- Plane multiple storage planes
- Block multiple memory blocks
- each memory block can contain multiple pages.
- the introduction of the memory 110 here is only for easy understanding. As long as there is a storage block 1100 in the memory 110, the storage block processing method provided in this application can be adopted.
- the storage interval corresponding to the storage block 1100 is a storage interval that can be independently managed in the controller 100. Since according to different manufacturing processes, one physical block can correspond to a storage interval of the storage block 1100, as an example, for example, There is no layering inside the 32-layer physical block, and the storage interval of the storage block 1100 corresponds to the storage interval formed by the entire physical block. A physical block may also correspond to the storage interval of two or more storage blocks 1100.
- a 64-layer physical block may be formed by stacking two 32-layer sub-physical blocks, and each physical block contains two
- the storage interval of one storage block 1100 corresponds to the storage interval formed by the sub-physical block, that is, one physical block corresponds to the storage interval of two storage blocks 1100.
- An embodiment of the present application provides a storage block processing method.
- the method is applied to the controller 100, and the storage interval information of each storage block 1100 may be recorded in the controller 100, and the storage interval information is used to indicate the available storage of the storage block.
- the controller 100 detects a bad page in the target memory block, it can re-divide the good area according to the position of the bad page.
- the good area is the largest continuous storage area in the available memory interval of the target memory block without bad pages . By dividing the good area, the data can be written to the good area later, making the data safer.
- the bad page may be one page, or may have at least two pages. Since the bad page is a page and there are at least two pages between the two cases, the corresponding processing method of the controller 100 is different, and the above two cases will be described in detail below.
- At least one bad page is a page
- the controller 100 determines that the detected bad page is a page, it is necessary to use the position of the one bad page as the position of the separation page to divide the available storage interval of the target storage block, To determine the good area.
- the bad page can occur in the first half of the available storage interval of the target storage block, or it can occur in the second half of the available storage interval of the target storage block.
- the target storage block The available storage interval as a whole, the available storage interval includes a lot of pages arranged in sequence, the page in front of the middle page or two pages is called the first half, and the page in the middle is behind the two pages The page of is called the second half, and the middle page or two pages can belong to the first half or the second half. It should be understood that, in this embodiment and the subsequent embodiments, only the middlemost one also belongs to the first half, the first page of the two pages is the first half, and the next page is the second half. For example, explain. Hereinafter, the above two cases will be described separately.
- the location of the bad page may be the absolute storage path of the bad page, the relative path of the bad page, or the number of the bad page that has a mapping relationship with the position of the bad page, or For other location information that can indicate bad pages. It should be understood that, in this embodiment and subsequent embodiments, the position of the bad page is taken as the number of the bad page as an example for description.
- the bad page is in the first half of the available storage interval
- an embodiment of a processing method of a storage block may include:
- the controller detects that there is a bad page in the target storage block, the controller obtains the bad page number of the one bad page.
- the controller 100 may number the multiple pages included in the storage block 1100, and the number of each page is used to indicate the sort position of the page in the multiple pages included in the target storage block, When the controller detects that a bad page appears in a memory block among the multiple memory blocks contained in the memory, the memory block where the bad page appears is the target memory block, and then the controller can obtain the bad page of the bad page Number, the bad page number of the one bad page is used to indicate the sort position of the bad page among the multiple pages included in the target storage block.
- the number of the bad page may only include the page number in a digital form.
- the bad page is identified as the 23rd of the multiple pages included in the target storage block.
- Page; bad page number can also be used to contain both numbers and / or letters and / or other types of information, as an example, for example, the bad page number can be the storage address of the bad page, as another example, the bad page number It can also be part of the information extracted from the storage location of the bad page, such as F0083, indicating that the bad page is on page 83 of the F storage block; the number of the bad page can also be in other forms, and specific examples are not given here. It should be understood that the number of any one of the multiple pages included in the memory block may be in the above-mentioned form.
- the controller may store a correspondence table between the position of the bad page and the number of the bad page, and after determining the position of the bad page, the controller may determine the number of the bad page according to the correspondence table ; You can also include the bad page number information in the position of the bad page, that is, the controller can obtain the bad page number when determining the position of the bad page; the controller can also obtain the bad page number in other ways , Specific here is not limited. It should be understood that the number of any one of the multiple pages included in the memory block can be obtained in the above manner.
- the controller obtains the number of the next page of the one bad page in the available storage interval of the target storage block.
- the controller may obtain the number of the next page of the bad page in the available storage interval of the target storage block, so as to include the multiple of the next page of the bad page to the end page of the available storage interval of the target storage block.
- the page is determined to be a good area, and the good area is the largest storage area that is continuous among the available storage intervals of the target memory block and does not exist the bad page.
- the number of the end page of the available storage interval of the target memory block is 0996
- the number of the one bad page is 0023
- the number of the next page of the one bad page may be 0024
- the good area is numbered 0024 to Multiple pages included in the number 0996
- the end page of the available storage interval of the target memory block is F0996
- the number of the one bad page is F0083
- the next page of the one bad page The number can be F0084
- the good area is the number of pages contained between F0084 and F0996. It should be understood that the examples here are for convenience only, and the value of the number of any page is not limited.
- the good area is a storage area that does not contain bad pages, after the controller determines the good area, after subsequently receiving valid data, it will only store the valid data in the good area .
- the controller can record the available storage interval of each storage block by recording the number of the start page and the number of the end page of each storage block.
- the page number can indicate the sort position of the bad page corresponding to the bad page number among the multiple pages included in the target memory block, then the controller can obtain the number of the start page and the end page of the available storage interval of the target memory block , And then determine whether the one bad page exists in the first half of the available storage interval of the target storage block.
- Storage block Available storage interval Storage block 0 Start Page Number PageSt, End Page Number PageEd Storage block 1 Start Page Number PageSt, End Page Number PageEd ... ... Storage block N Start Page Number PageSt, End Page Number PageEd
- the start page number and the end page number of the memory blocks shown in Table 1 and Table 2 may be stored in an array, a linked list, or other data structures.
- the starting page number of the storage block is the starting page number of the physical block
- the ending page number of the storage block is The end page number of the physical block, as an example, for example, the storage interval provided by physical block 0 is [0001,1000], then the number of the start page of storage block 0 is 0001, and the number of the end page is 1000;
- the start page number and end page number of the storage block correspond to the start page number and end page number of the sub-physical block, as an example, for example, physical
- the storage interval provided by block 1 is [0001,1000]
- the physical block includes sub-physical block 0 and sub-physical block 1, wherein the storage interval provided by sub
- the target A bad page occurs in the storage block.
- the bad page is determined to exist in the target storage
- the first half of the available storage interval of the block for example, the page number of the starting page of the target storage block is 0008, the page number of the end page is 0996, the page number of the one bad page is 0015, then the page number of a bad page indicates The bad page is in the first half of the available storage interval of the target storage block.
- start page number, end page number, and bad page number of the available storage interval of the target memory block all contain numbers and / or letters and / or other types of information, you can The number of the start page and the number of the end page determine the number of the middle page.
- the middle page is one, and if the one bad page does not exceed the middle page, it is determined that the one bad page is located in the first half of the available storage interval of the target storage block ;
- there are even pages in the available storage interval of the target storage block there are two intermediate pages. If the one bad page does not exceed the first page of the two intermediate pages, it is determined that the one bad page is located in the target storage block.
- the first half of the available storage interval for example, for example, the starting page number of the available storage interval of the target memory block is F0008, the end page number is F0996, then the middle page is F0502, if the bad page number of the bad page is F0015, the one bad page is in the first half of the available storage interval of the target storage block; as another example, for example, the start page number of the target storage block available storage area is F0008, and the end page number is F0995, then the middle The pages are F0501 and F0502.
- the number of the one bad page is F0015, because the one bad page does not exceed F0501, the one bad page is in the available storage area of the target storage block
- the first half it should be understood that the number of the above-described example, only for ease of understanding the present embodiment, the selection of the specific number, should be combined with the actual situation, and flexible setting.
- the controller may also use the bad page as a separation page to respectively obtain the number of pages in front of the one bad page and the number of pages in the available storage interval of the target storage block The number of pages after the bad page, if the number of pages before the one bad page is greater than the number of pages after the one bad page, it can be determined that the one bad page exists in the first half of the available storage interval of the target storage block. It should be understood that the controller may also determine whether the one bad page exists in the first half of the available storage interval of the target storage block through other methods, which should be flexibly set according to actual conditions.
- the controller updates the first start page number of the start page of the storage interval information of the target memory block.
- the controller may obtain the first preset number according to the second start page number of the start page of the good area, so that the start page of the storage interval information of the target storage block
- the first start page number of is updated to the first preset number; the first start page number of the start page of the storage interval information of the target memory block can also be updated to the second start page number.
- the first start page number is updated to the first preset number
- the controller when the controller determines that the second start page number of the start page of the good area exists in the first preset interval, the first preset number is obtained, wherein, in the first preset interval Containing multiple pages, the first preset number is the number of the next page in the first preset interval; the controller updates the first starting page number to the first preset number.
- a preset interval may be preset in the controller, or multiple preset intervals may be set. If multiple preset intervals are set, multiple preset numbers also exist, The preset number and the preset interval may be in one-to-one correspondence, where the preset interval is an interval including multiple pages, and the first preset interval is the preset interval to which the start page of the good area belongs.
- the controller may determine the first preset interval to which the start page of the good area belongs according to the second start page number, Furthermore, a first preset number corresponding to the first preset interval is acquired, so that the number of the starting page of the storage interval information of the target storage block can be updated to the first preset number, as an example, for example, the first preset The section contains pages numbered 0001 to 0010, the first preset number is 0010, and when the number of the start page of the good area is 0008, the controller updates the number of the start page of the storage section information of the target memory block to 0010 .
- the number of the start page of the storage interval information of the target storage block is updated to the corresponding preset number, That is, the starting position of the available storage interval of the target storage block is limited to a specific value. Since the position of the bad page has a specific law, the preset value set of the starting number of the available storage interval can be set according to the statistical law , So that the edges of the available storage interval are aligned, thereby reducing the management complexity of the storage block.
- the first starting page number is updated to the starting page number of the good area
- the controller can update the available storage interval of the target storage block by updating the starting page number in the storage interval information of the target storage block
- the controller can obtain the After the numbering, the first starting page number in the storage interval information of the target storage block is updated to the number of the starting page of the good area, so that the updated storage interval information of the target storage block indicates the availability of the target storage block
- the storage area is the good area.
- the available storage interval of the target storage block is directly updated to a good area, which avoids the waste of any pages, further slows down the consumption of redundant blocks, and extends the service life of the storage device.
- the controller writes at least one page of random data with the page at the top of the sorted position in the good area as a starting position to form an isolation area.
- the controller may set an isolation area in the good area to divide the good area into an isolation area and a user data area, among which, see FIGS. 3a and 3b
- the isolation area contains at least one page of random data, located between the at least one bad page and the user data area, and the user data area is used to store valid data.
- Fig. 3a shows the distribution of the bad page, the isolation area and the user data area when the bad page first appears in the target storage block, and the bad page is located in the first half of the target storage block
- Fig. 3b shows The distribution of the one bad page, the isolation area, and the user data area when the bad page does not appear for the first time in the target storage block, and the one bad page is located in the first half of the target storage block.
- the controller may place the sort position in the good area at the top One page is used as the starting position, that is, the next page of the one bad page is used as the starting position, and random data of at least one page is written to form an isolated area.
- this program interference may further increase.
- the The top-ranked page in the good area is used as the starting page, and at least one page of random data is written, so that an isolation area is set between the bad page and the user data area, which can block the impact of the bad page on the available pages, thereby Improve the reliability of available storage areas.
- the controller after the controller determines the good area, it can perform the erase operation on the good area. Since the one bad page is in the first half of the available storage interval of the target memory block, after performing the erase operation on the good area, When the target memory block receives valid data, it triggers the operation of setting the isolation area; it can also set the timer after performing the erase operation on the good area, and triggers the operation of setting the isolation area after the time set by the timer; also The operation of setting the isolation zone can be triggered by other methods. The specific triggering method of setting the isolation zone can be flexibly selected according to the actual situation, and will not be enumerated here one by one.
- the random data refers to invalid data randomly generated by the controller.
- the number of pages in the isolation area may be determined according to the particle type of the flash memory particles. Since at a physical level, multiple pages included in a physical block or sub-physical block are physically shown to include multiple layers ( Layer), each layer contains multiple pages, and when setting the isolation area, at least one layer of random data is written, because when the type of flash memory particles is different, the number of pages contained in each layer is different, as an example, for example, when a When the layer contains 12 pages, the number of pages in the isolation area is a multiple of 12 pages; as another example, when the layer contains 24 pages, the number of pages in the isolation area is a multiple of 24. It should be understood that the examples here are only To facilitate understanding of this solution, the number of pages in the specific isolation area should be flexibly selected according to the actual situation, which is not limited here.
- step 204 may be executed first, and then step 203 may be executed; or step 203 may be executed first, and then step 204 is executed.
- the controller obtains the difference between the first start page number of the start page and the first end page number of the end page of the available storage interval of the target storage block.
- the controller may acquire the first start page number and the first end page number of the start page of the available storage interval of the target memory block, thereby determining the first start page number and the first end page The difference between the numbers.
- the controller marks the target memory block as an unusable memory block.
- the threshold of the difference may be stored in the controller in advance, so that after determining the difference between the first start page number and the first end page number, it is determined whether the difference reaches the preset threshold, When the preset threshold is reached or below, the memory block may be marked as an unusable memory block; or a threshold value with the difference value pre-stored in the host, the controller is determining the first start page number and the first end After the difference between the page numbers, the difference is sent to the host, and the host determines whether the difference reaches the preset threshold, and when the preset threshold is reached or below, the controller marks the storage block as Unavailable memory block.
- the storage block where the available storage interval is located is marked as a bad block, so that the storage block is no longer managed, thereby reducing the complexity of the management of the storage block by the controller degree.
- steps 205 and 206 are optional steps. If steps 205 and 206 are executed, the relationship between steps 205 and 206 and step 204 is not limited. Step 204 can be executed first, and then steps 205 and 206 can be executed; steps can also be executed first 205 and 206, and then execute step 204. If steps 205 and 206 are not executed, step 207 can be entered after step 204 is executed.
- the controller executes other programs.
- the bad page is in the second half of the available storage interval
- another embodiment of the storage block processing method may include:
- step 401 is similar to step 201 in the embodiment described in FIG. 2 and will not be repeated here.
- the controller obtains the number of the next page of the one bad page in the available storage interval of the target storage block.
- the controller may obtain the number of the previous page of the one bad page in the available storage interval of the target memory block, so as to change the start page of the available storage interval of the target memory block to the one From the previous page of the bad page to the included pages are determined as good areas, and the good area is the largest storage area that is continuous among the available storage intervals of the target memory block without the bad page.
- the number of the starting page of the available storage interval of the target memory block is 0006, the number of the one bad page is 0998, the number of the previous page of the one bad page may be 0997, and the number of the good area is 0006 Multiple pages included in the number 0997; as another example, for example, the end page of the available storage interval of the target memory block is F0006, and the number of the one bad page is F0998, then the previous page of the one bad page The number can be F0997, then the good area is the number of pages contained between F0006 and F0997. It should be understood that the examples here are for convenience only, and the value of any page number is not limited.
- the controller determines the one according to the bad page number of the one bad page The way that the bad page is in the first half of the available storage interval of the target storage block may be to obtain the number of the start page and the number of the end page of the available storage interval of the target storage block, and then determine whether the bad page exists in the target storage The second half of the block's available storage interval.
- start page number, end page number, and the bad page number of a bad page in the available storage interval of the target memory block are all page numbers in the form of numbers, then when the bad page occurs in the target memory block, the one The page number of the bad page is PageX, the page number of the start page of the available storage area of the target memory block is PageSt, and the page number of the end page is PageEd, if 2PageX> PageSt + PageEd, that is, the page number of the bad page exceeds the start page The average of the page number of the page and the page number of the end page, then the page number of the bad page indicates that the bad page is in the second half of the available storage interval of the target storage block.
- the examples of the numbers here are for convenience only. This plan, the specific choice of number, should be flexibly set according to the actual situation.
- the The number of the start page and the end page of the available storage interval determine the number of the intermediate page.
- the intermediate page When there are odd pages in the available storage interval of the target storage block, there is one intermediate page. If the bad page exceeds the intermediate page, It is determined that the one bad page is located in the second half of the available storage interval of the target storage block; when there are even pages in the available storage interval of the target storage block, there are two intermediate pages, if the one bad page exceeds the two intermediate pages The first page of the page determines that the one bad page is in the second half of the available storage interval of the target storage block.
- the controller may also use the one bad page as a separation page to respectively obtain the number of pages in front of the one bad page in the available storage interval of the target storage block and The number of pages behind the one bad page, if the number of pages before the one bad page is less than the number of pages behind the one bad page, it can be determined that the one bad page exists in the second half of the available storage interval of the target storage block section. It should be understood that the controller may also determine whether the one bad page exists in the second half of the available storage interval of the target storage block through other methods, which should be flexibly set according to actual conditions.
- the controller updates the first termination page number of the termination page of the storage interval information of the target storage block.
- the controller may obtain the second preset number according to the second end page number of the end page of the good area, so that the second page of the start page of the storage interval information of the target storage block
- the end page number is updated to the second preset number; the second end page number of the end page of the storage interval information of the target storage block may also be updated to the first end page number, and the above two cases will be described in detail below .
- the first termination page number is updated to the second preset number
- the controller updates the first end page number to the second preset number.
- a preset interval may be preset in the controller, or multiple preset intervals may be set. If multiple preset intervals are set, multiple preset numbers also exist, The preset number and the preset interval may be in one-to-one correspondence, where the preset interval is an interval including multiple pages, and the second preset interval is a preset interval to which the end page of the good area belongs.
- the controller may determine the second preset interval to which the end page of the good area belongs according to the second end page number, and then acquire the The second preset number corresponding to the two preset intervals, so that the first end page number of the end page of the storage interval information of the target storage block can be updated to the second preset number.
- the first preset interval contains pages numbered 0990 to 1000, the first preset number is 0990, and when the number of the end page of the good area is 0998, the controller terminates the storage interval information of the target memory block The page number is updated to 0990. It should be understood that the above examples of the number of the second preset interval, the second preset number, and the end page of the good area are only for the convenience of understanding the solution, and the selection of the specific number should be flexibly set according to the actual statistical law.
- the first termination page number is updated to the first termination page number
- the controller may update the first end page number of the end page in the storage interval information of the target storage block to the second end page number , So that the updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area.
- the controller writes the random data of the at least one page with the next page of the user data area as a starting position.
- the controller may set an isolation area in the good area to divide the good area into an isolation area and a user data area. See FIGS. 5a and 5b.
- the quarantine area contains at least one page of random data, located between the one bad page and the user data area, and the user data area is used to store valid data.
- Figure 5a shows the distribution of the bad page, the isolation area and the user data area when the bad page first appears in the target storage block, and the bad page is located in the second half of the target storage block
- Figure 5b shows It is the distribution of the one bad page, the isolation area and the user data area when the bad page does not appear for the first time in the target storage block and the one bad page is located in the second half of the target storage block.
- the controller when the bad page number of the one bad page indicates that the sort position of the one bad page is in the second half of the available storage interval of the target memory block, referring to FIG. 6, the controller writes valid data After entering the user data area, it can be determined whether the written valid data has occupied the user data area. If the user data area has been filled, the next page of the user data area is used as the starting position to write the at least one Random data of the page to form the isolated area.
- the storage block since the one bad page is in the second half of the available storage interval of the target storage block, and the storage block writes data in order according to the order of the pages, it is determined whether the written valid data is full of user data
- the method of the area may be: after determining the number of pages in the isolation area, determine the number of the end page of the user data area according to the number of the end page of the good area and the number of pages in the isolation area, and the controller may execute each time in the target storage block After the write operation, obtain the number of the last page of the page where valid data has been written, and determine whether the number of valid data written has occupied the user data by judging whether the number of the last page reaches the number of the end page of the user data area Area.
- the number of the end page of the good area is 0990
- the number of pages in the quarantine area is 12
- the number of the end page of the user data area is 0978. If the number of the last page of the page where valid data has been written is 0920, the user data area is not occupied. It should be understood that the example of numbering here is only for convenience of understanding and has no limiting meaning.
- the controller obtains the difference between the first start page number and the first end page number of the start page of the available storage interval of the target storage block.
- the controller marks the target memory block as an unusable memory block.
- the controller executes other programs.
- steps 405 to 407 are similar to steps 205 to 207 in the embodiment described in FIG. 2 and will not be repeated here.
- the controller when it detects that there are at least two bad pages in the target storage block, it may use the available storage for the target storage block according to at least two bad page positions corresponding to the at least two bad pages The interval is divided to determine the good area.
- the controller can process the at least two bad pages page by page; it can also determine an edge bad page according to the position of the at least two bad pages, where the edge bad page is the top position or the bottom position of the at least two bad pages A bad page, and then using the edge bad page as the position of the separation page, divide the available storage interval of the target storage block to determine the good area.
- the controller processes the at least two bad pages page by page.
- another embodiment of the storage block processing method may include:
- the controller detects that there are at least two bad pages in the target storage block, acquire at least two bad page positions corresponding to the at least two bad pages.
- step 703 is entered; if not, step 812 is entered.
- the controller when the controller detects that there are at least two bad pages in the target storage block, the controller may obtain at least two bad page positions corresponding to the at least two bad pages, the at least two bad pages
- the location includes a target bad page location corresponding to the target bad page, and the target bad page is any one of the at least two bad pages, so that the controller can obtain the target bad page location.
- the target bad page position may be the target bad page number corresponding to the target bad page.
- the controller since the controller first obtains at least two bad pages containing the target bad page, and then processes the at least two bad pages one by one, there may be one that does not exist in the target storage block among the at least two bad pages
- the bad pages of the available storage area as an example, for example, the controller detects three bad pages, the bad page number of the first bad page is 0012, the bad page number of the second bad page is 0008, the first bad page The bad page number is 0016, after the controller processes the first bad page, the starting page number of the available storage interval of the target memory block is 0012, when the second bad page is processed, the second The bad page does not exist in the available storage interval of the target storage block.
- the examples of the three bad pages here are only for easy understanding. The specific bad page number should be flexibly set according to the actual situation. Be limited.
- the controller uses the target bad page position as the separation page when determining that the target bad page exists in the available storage section of the target storage block according to the target bad page position
- the location of the target memory block is divided to determine the good area. That is, the controller may determine whether the target bad page exists in the available storage interval of the target storage block according to the target bad page number. If yes, go to step 703; if no, go to step 812.
- the controller judges whether the target bad page exists in the first half of the available storage interval of the target storage block. If it exists in the first half, it proceeds to step 704; if it does not exist in the first half, it proceeds to step 707.
- the controller may determine whether the target bad page exists in the first half of the available storage interval of the target storage block according to the page number of the target bad page, and according to the target bad page
- the controller may determine whether the target bad page exists in the available storage interval of the target storage block according to the page number of the target bad page, and according to the target bad page
- step 202 provides how to determine the target page based on the bad page number of a bad page. Whether the bad page exists in the first half of the available storage interval of the target storage block.
- the target bad page is also any one of the at least two bad pages. Therefore, specific The implementation manner is similar to how to determine whether a bad page exists in the first half of the available storage interval of the target storage block according to the bad page number of the bad page in step 202, and details are not described here.
- the controller obtains the number of the next page of the target bad page in the available storage interval of the target storage block.
- the controller updates the first start page number of the start page of the storage information of the target storage block.
- the controller writes at least one page of random data using the page with the highest sorting position in the good area as a starting position to form an isolation area.
- steps 704 to 706 are similar to steps 202 to 204 in the embodiment described in FIG. 2, the difference is that steps 202 to 204 perform corresponding operations according to a bad page number of a bad page, and in this embodiment are based on Perform the corresponding operation on the bad page number of the target bad page, which will not be repeated here.
- the controller obtains the number of the previous page of the target bad page in the available storage interval of the target storage block.
- the controller updates the first termination page number of the termination page of the storage information of the target storage block.
- the controller writes the random data of the at least one page with the next page of the user data area as a starting position.
- steps 707 to 709 are similar to steps 402 to 404 in the embodiment described in FIG. 4, the difference is that steps 402 to 404 perform corresponding operations according to a bad page number of a bad page. In this embodiment, it is based on Perform the corresponding operation on the bad page number of the target bad page, which will not be repeated here.
- the controller obtains the difference between the first start page number and the first end page number of the start page of the available storage interval of the target storage block.
- the controller marks the target memory block as an unusable memory block.
- steps 810 and 811 are similar to steps 205 and 206 in the embodiment described in FIG. 2 and will not be repeated here.
- the controller executes other programs.
- the controller after acquiring the target bad page position corresponding to the target bad page, the controller does not acquire the target bad page in the case that the target bad page exists in the unavailable storage section of the target storage block. Good area, and the storage interval information of the target storage block is not updated.
- the controller when it detects that there is a bad page in the target memory block, it can obtain the number of the bad page, and obtain the number of the start page and the end page of the target memory block recorded by the controller. Record the available storage interval of each memory block. If the number of the bad page is not between the number of the start page and the number of the end page, it is determined that the bad page occurs in the unusable storage interval of the target memory block. Therefore, The existence of the bad page does not affect the available storage interval of the target storage block, so that the controller may not acquire the good area, and may not update the storage interval information of the target storage block.
- control terminal since the control terminal detects at least two bad pages, the control terminal may repeatedly perform steps 702 to 812 to process the at least two bad pages page by page.
- another embodiment of the storage block processing method may include:
- step 801 is similar to step 701 in the embodiment described in FIG. 7, and steps 803 to 811 are similar to steps 704 to 712 in the embodiment described in FIG. 7, the only difference is that this embodiment is based on the bad edge
- the corresponding operation is performed on the bad page number of the page. In the embodiment described in FIG. 7, the corresponding operation is performed according to the bad page number of the target bad page, which will not be repeated here.
- this embodiment further includes:
- the controller obtains the position of the edge bad page corresponding to the edge bad page.
- the controller may determine an edge bad page according to the at least two bad page numbers, and the edge bad page is a bad position in which the sort position is at the top or the sort position is at the bottom in the at least two bad pages page.
- the at least two bad pages may be acquired
- the bad page position of the bad page with the middle sort position at the bottom is taken as the edge bad page position, and step 803 is entered.
- step 806 is entered.
- the controller may obtain the edge bad pages in the at least two bad pages, so that only the edge bad pages are available to the target storage block
- the storage interval is divided to avoid repeated operations when processing the at least two bad pages page by page, thereby improving the efficiency of processing the bad pages.
- the controller is applied to a storage device, and the controller is applied to a storage device.
- the storage device includes the controller and the memory, and the memory includes multiple storage blocks.
- the storage block contains multiple pages, and the controller contains storage interval information for each storage block.
- the storage interval information is used to determine the available storage interval of the storage block.
- the controller includes:
- the obtaining unit 901 is configured to obtain the position of at least one bad page corresponding to the at least one bad page when it is detected that at least one bad page exists in the target storage block;
- the determining unit 902 is configured to determine a good area according to the position of the at least one bad page; wherein, the good area is the largest storage area that is continuous among the available storage intervals of the target storage block and does not exist the bad page;
- the updating unit 903 is configured to update the storage interval information of the target storage block, wherein the updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area.
- the available storage interval of the target storage block of the storage block may be divided according to the position of the bad page, so that the determining unit 902 does not identify the available storage interval of the target storage block.
- the maximum continuous interval containing the bad page is determined as a good area, and then the update unit 903 updates the available storage interval of the storage block according to the good area, avoiding directly marking the entire storage block as a bad block, and slowing down the redundant block Consumption, prolongs the service life of the solid state drive, and because the consumption of redundant blocks is reduced, the increase of the write amplification factor is also avoided, and the service life of the solid state drive is further extended; in addition, the application can also be applied to other storage blocks Storage devices, thereby extending the life of storage devices.
- the at least one bad page is a bad page
- the determining unit 902 is specifically configured to divide the available storage interval of the target storage block by using the position of the bad page of the one bad page as the position of the separation page to determine the good area.
- the bad page position of the one bad page includes the bad page number of the one bad page
- the storage interval information of the target storage block includes the first starting page of the start page of the available storage interval of the target storage block Start page number, the bad page number of the one bad page and the first start page number are used to determine the multiple pages contained in the target memory block by the start page of the one bad page and the available storage interval of the target memory block Sort position in
- the determination unit 902 is specifically used for:
- the sort position of the one bad page is determined according to the bad page number of the one bad page in the first half of the available storage interval of the target storage block, the lower part of the one bad page in the available storage interval of the target storage block is acquired
- the number of one page to determine that the multiple pages contained in the next page of a bad page to the end page of the available storage interval of the target memory block are the good areas;
- the updating unit 903 is specifically configured to: update the first starting page number to the number of the next page of the one bad page.
- the bad page position of the one bad page includes the bad page number of the one bad page
- the storage interval information of the target storage block includes the first termination of the end page of the available storage interval of the target storage block
- the page number, the bad page number of the one bad page and the first end page number are respectively used to determine the end page of the available storage interval of the one bad page and the target memory block among the multiple pages included in the target memory block Sort position
- the determination unit 902 is specifically used for:
- the updating unit 903 is specifically configured to: update the first termination page number to the previous page number of the one bad page.
- the determination unit 902 is specifically used for:
- the available storage interval of the target storage block is divided using the target bad page location as the position of the separation page to determine Good area.
- the controller also includes:
- the setting unit 904 is configured to set an isolation area in the good area to divide the good area into an isolation area and a user data area, wherein the isolation area contains random data of at least one page, and is located on the at least one bad page and the Between user data areas, the user data area is used to store valid data.
- the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block Sorting position in multiple pages,
- the setting unit 904 is specifically used for:
- the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block Sorting position in multiple pages,
- the setting unit 904 is specifically used for:
- the sorting position of the at least one bad page is in the second half of the available storage interval of the target memory block, if the written valid data has already occupied the user data area, use the The next page of the user data area is the starting position, and the random data of the at least one page is written to form the isolation area.
- the storage interval information of the target storage block includes the first start page number of the start page of the available storage interval of the target storage block, and there are multiple pages in the good area that have the good area Start page, the second start page number and the first start page number of the start page of the good area are used to determine the start page of the good area and the start page of the available storage interval of the target memory block in The sort position in the multiple pages contained in the target storage block;
- the obtaining unit 901 is also used to:
- the first preset number is obtained, where the first preset interval includes multiple pages, the The first preset number is the number of the next page of the first preset interval;
- the updating unit 903 is specifically configured to: update the first starting page number to the first preset number.
- the storage interval information of the target storage block includes the first end page number of the end page of the available storage interval of the target storage block, and the multiple areas included in the good area have the end of the good area Page, the second end page number and the first end page number of the end page of the good area are used to determine the end page of the good area and the end page of the available storage interval of the target storage block included in the target storage block Sorting position in multiple pages;
- the obtaining unit 901 is also used to:
- a second preset number is obtained, where the second preset interval includes multiple pages, the second The preset number is the number of the previous page of the second preset interval;
- the updating unit 903 is specifically configured to: update the first termination page number to the second preset number.
- the storage interval information of the target storage block includes the first start page number of the start page of the available storage interval of the target storage block and the first end page number of the end page;
- the acquiring unit 901 is further configured to: acquire the difference between the first start page number and the first end page number;
- the controller also includes:
- the marking unit 905 is configured to mark the target storage block as an unusable storage block when the difference reaches a preset threshold.
- An embodiment of the present application further provides a storage device, the storage device includes a controller and a memory, the memory includes a storage block, and the storage block includes multiple pages;
- controller is used to execute the steps performed by the controller in the method described in the foregoing embodiments shown in FIG. 2 to FIG. 8, and is also used to generate instructions;
- the memory is used to store data according to the instruction.
- the storage device may be a non-embedded storage device or an embedded storage device. It should be understood that the specific expression form of the storage device should be flexibly set according to actual conditions, and is not limited herein.
- An embodiment of the present application further provides a terminal.
- the terminal includes an interface, a processor, and a storage device.
- the storage device includes a controller and a memory.
- the memory includes a storage block.
- the storage block includes multiple pages. ;
- the processor sends data to the controller through the interface
- the controller is used to perform the steps performed by the controller in the method described in the foregoing embodiments shown in FIG. 2 to FIG. 8, and is also used to receive the data sent by the processor through the interface and generate instructions;
- the memory is used to store the data according to the instruction.
- An embodiment of the present application also provides a computer program product containing storage block management instructions, which when executed on a computer, causes the computer to execute the method as described in the foregoing embodiments shown in FIGS. 2 to 8 by the controller A step of.
- An embodiment of the present application also provides a computer-readable storage medium, which stores instructions for processing a storage block, and when it runs on a computer, causes the computer to execute as shown in FIGS. 2 to 8 described above The steps performed by the controller in the method described in the embodiments.
- An embodiment of the present application further provides a chip system including a processor, which is used to support a network device to implement the functions involved in the above aspects, for example, for example, to send or process data and / or information involved in the above method .
- the chip system further includes a memory, which is used to store necessary program instructions and data of the network device.
- the chip system may be composed of chips, and may also include chips and other discrete devices.
- the computer program product includes one or more computer instructions.
- the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
- Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions can be transmitted from a website site, computer, server, or data center via wire (e.g. Coaxial cable, optical fiber, digital subscriber line (digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center for transmission.
- wire e.g. Coaxial cable, optical fiber, digital subscriber line (digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.
- the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device including a server, a data center, and the like integrated with one or more available media.
- the available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media, or semiconductor media, such as solid state disks (SSD).
- the disclosed system, device, and method may be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of units is only a division of logical functions.
- there may be other divisions for example, multiple units or components may be combined or integrated To another system, or some features can be ignored, or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or software function unit.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
- the technical solution of the present application may be essentially or part of the contribution to the existing technology or all or part of the technical solution may be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Disclosed is a method for processing a storage block, comprising: when detecting that at least one bad page is comprised in a target storage block, obtaining at least one bad page position having one-to-one correspondence to the at least one bad page; determining one good region according to the at least one bad page position, the good region being the continuous maximum storage interval which does not comprise the bad page in the available storage interval of the target storage block; and updating storage interval information of the target storage block, the updated storage interval information of the target storage block indicating that the available storage interval of the target storage block is the good region. Embodiments of the present application also provide a corresponding terminal, a computer program product, and a readable storage medium. According to the present application, when the bad page is comprised in the storage block, the continuous maximum storage interval which does not comprise the bad page in the storage block is obtained, and is continued using so as to avoid directly marking the overall storage block as a bad block, reduce the consumption of redundant blocks, and prolong the service life of a storage device.
Description
本申请涉及数据存储领域,尤其涉及一种存储块处理方法及相关设备。The present application relates to the field of data storage, in particular to a storage block processing method and related equipment.
固态硬盘(solid state drive,SSD)为存储设备的一种,以一种闪存介质(nand flash,NAND)作为主要存储介质,一般而言,固态硬盘读写数据的最小操作单元为页,擦除数据的最小操作单元为块。其中,每个存储块由连续的几百至几千个页组成。随着反复擦写数据,NAND的可靠性不断下降,会逐渐出现擦/写失败或者原始比特出错率(raw bit error rate,RBER)超过错误纠正码(error correction code,ECC)纠错能力的情况。A solid state drive (SSD) is a type of storage device, which uses a flash memory (nand flash, NAND) as the main storage medium. In general, the smallest operation unit for reading and writing data from a solid state drive is a page, which is erased The smallest operating unit of data is a block. Among them, each storage block is composed of hundreds to thousands of pages in succession. With repeated data erasing, the reliability of NAND continues to decline, and erasing / writing failures or raw bit error rate (RBER) exceeding the error correction code (ECC) error correction capability will gradually occur .
当NAND的部分页出现上述问题时,SSD会将问题页所在的块标记为坏块,不再参与读写擦操作,并且通过提升坏块内一部分晶体管的阈值电压,减少漏电流,进而减小坏块对剩余块的影响,从而保证数据完整性。因为SSD预留了冗余块,用户可见的数据空间不因坏块而减少,所以SSD可以继续使用。但由于SSD的冗余块数量有限,当坏块达到特定数量时,SSD就到了寿命终点。When the above problem occurs on some pages of NAND, SSD will mark the block where the problem page is located as a bad block, no longer participate in the read and write operation, and reduce the leakage current by increasing the threshold voltage of a part of the transistors in the bad block, thereby reducing The impact of bad blocks on the remaining blocks, thereby ensuring data integrity. Because the SSD reserves redundant blocks, the data space visible to the user is not reduced due to bad blocks, so the SSD can continue to be used. However, due to the limited number of SSD redundant blocks, when the bad blocks reach a certain number, the SSD reaches the end of life.
由于现有技术中,一旦存储块中出现坏页,就会把整个存储块标记为坏块,导致冗余块的消耗较快,且随着冗余块数量的减少,会导致写放大系数的增加,也会进一步缩短SSD的使用寿命,因此,现有技术中的SSD的使用寿命较短。In the prior art, once a bad page appears in a storage block, the entire storage block will be marked as a bad block, resulting in faster consumption of redundant blocks, and as the number of redundant blocks decreases, it will cause a write amplification factor The increase will also further shorten the service life of the SSD, therefore, the service life of the SSD in the prior art is shorter.
发明内容Summary of the invention
本申请实施例提供了一种存储块处理方法及相关设备,本申请当存储块中出现坏页时,获取该存储块中不包含该坏页的连续最大存储区间,继续使用该连续最大存储区间,从而避免了直接将该整个存储块标记为坏块,减缓了冗余块的消耗,延长了存储设备的使用寿命。An embodiment of the present application provides a storage block processing method and related equipment. When a bad page appears in a storage block, the present application obtains a continuous maximum storage interval that does not include the bad page in the storage block, and continues to use the continuous maximum storage interval In order to avoid directly marking the entire storage block as a bad block, slow down the consumption of redundant blocks and prolong the service life of the storage device.
本申请实施例的第一方面提供一种存储块处理方法,该存储块处理方法应用于控制器,其中,该控制器应用于存储设备,该存储设备包含该控制器和存储器,该存储器包含多个存储块,该存储块包含多个页,该控制器中包含每个存储块的存储区间信息,该存储区间信息用于指示存储块的可用存储区间。该方法可以包括:当该控制器检测到目标存储块中存在至少一个坏页时,获取与该至少一个坏页一一对应的至少一个坏页位置,该至少一个坏页位置包含与该至少一个坏页一一对应的至少一个坏页编号,该至少一个坏页编号用于指示该至少一个坏页在该目标存储块包含的多个页中的排序位置,其中,当该至少一个坏页为一个坏页时,该至少一个坏页位置为该一个坏页的坏页编号,当该至少一个坏页中有至少两个坏页时,该至少一个坏页位置中包含与该至少两个坏页一一对应的至少两个坏页编号;该控制器可以根据该至少一个坏页编号,对该目标存储块的可用存储区间进行划分,以确定好区,其中,该好区为该目标存储块的可用存储区间中连续且不存在该坏页的最大存储区间;该控制器可以根据该好区的起始页的第二起始页编号和终止页的第二终止页编号,更新该目标存储块的存储区间信息,其中,该目标存储块的存储区间信息中包含目标 存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号,该更新后的该目标存储块的存储区间信息指示该目标存储块的可用存储区间为该好区,从而该控制器可以将后续接收到的用户数据存入到该好区中。A first aspect of an embodiment of the present application provides a storage block processing method that is applied to a controller, where the controller is applied to a storage device, and the storage device includes the controller and a memory, and the memory includes multiple Memory blocks, the memory block contains multiple pages, and the controller includes storage interval information of each memory block, and the storage interval information is used to indicate an available storage interval of the memory block. The method may include: when the controller detects that there is at least one bad page in the target storage block, acquiring at least one bad page position corresponding to the at least one bad page one by one, the at least one bad page position including the at least one bad page position At least one bad page number corresponding to each bad page, the at least one bad page number is used to indicate the sort position of the at least one bad page among the multiple pages included in the target storage block, wherein, when the at least one bad page is In the case of a bad page, the at least one bad page position is the bad page number of the one bad page. When there are at least two bad pages in the at least one bad page, the at least one bad page position includes the at least two bad pages. At least two bad page numbers corresponding to pages one by one; the controller may divide the available storage interval of the target memory block according to the at least one bad page number to determine a good area, wherein the good area is the target storage The maximum storage interval of the block that is continuous and free of the bad page in the available storage interval of the block; the controller can be based on the second start page number of the start page of the good area and the second end of the end page Number, update the storage section information of the target storage block, wherein the storage section information of the target storage block includes the first start page number of the start page of the available storage section of the target storage block and the first end page number of the end page , The updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area, so that the controller can store subsequently received user data into the good area.
本申请中,当目标存储块中出现坏页时,可以根据坏页的位置将存储块的目标存储块的可用存储区间进行划分,从而将该目标存储块的可用存储区间中不包含该坏页的最大连续区间确定为好区,进而根据该好区更新该存储块的可用存储区间,避免了直接将该整个存储块标记为坏块,减缓了冗余块的消耗,延长了固态硬盘的使用寿命,而且,由于冗余块的消耗减少,也避免了写放大系数的增加,进一步延长了固态硬盘的使用寿命;此外,本申请还可以适用于其他包含存储块的存储设备,从而延长了存储设备的使用寿命。In this application, when a bad page appears in the target storage block, the available storage interval of the target storage block of the storage block may be divided according to the position of the bad page, so that the available storage interval of the target storage block does not include the bad page The maximum continuous interval is determined as a good area, and then the available storage interval of the storage block is updated according to the good area, which avoids directly marking the entire storage block as a bad block, slows down the consumption of redundant blocks, and extends the use of solid state drives Longevity, and because the consumption of redundant blocks is reduced, the increase of the write amplification factor is also avoided, which further extends the service life of the solid-state hard disk; in addition, this application can also be applied to other storage devices containing storage blocks, thereby extending storage The service life of the equipment.
一种可能的实现方式下,该至少一个坏页为一个坏页,该控制器在获取到该一个坏页的坏页位置时,也即该一个坏页的坏页编号,以该一个坏页的坏页编号作为分隔页的编号对该目标存储块的可用存储区间进行划分,以确定好区,也即确定该好区的起始页的第二起始页编号或该好区的终止页的第二终止页编号。In a possible implementation manner, the at least one bad page is a bad page, and when the controller obtains the bad page position of the one bad page, that is, the bad page number of the one bad page, the bad page The bad page number as the number of the separator page divides the available storage interval of the target memory block to determine the good area, that is, the second start page number of the start page of the good area or the end page of the good area The second end page number.
本申请中,当该至少一个坏页为一个坏页时,控制器可直接以该一个坏页的位置作为分隔页的位置对该目标存储块的可用存储区间进行划分,从而确定好区,增加了本方案的可操作性。In the present application, when the at least one bad page is a bad page, the controller may directly use the position of the one bad page as the position of the separation page to divide the available storage interval of the target storage block, thereby determining the good area and increasing The operability of this program.
一种可能的实现方式下,该一个坏页的坏页位置包含该一个坏页的坏页编号,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的起始页的第一起始页编号,该一个坏页的坏页编号和该第一起始页编号分别用于确定该一个坏页和该目标存储块的可用存储区间的起始页在该目标存储块包含的多个页中的排序位置;该控制器在根据该一个坏页的坏页编号确定该一个坏页的排序位置在该目标存储块的可用存储区间的前半部分的情况下,可以获取该目标存储块的可用存储区间内该一个坏页的下一页的编号,以确定该一个坏页的下一页至该目标存储块的可用存储区间的终止页包含的多个页为该好区;该控制器可以将该目标存储块的存储区间信息中第一起始页编号更新为该一个坏页的下一页的编号,从而将该目标存储块的可用存储区间更新为了该好区。In a possible implementation manner, the bad page position of the one bad page includes the bad page number of the one bad page, and the storage interval information of the target storage block includes the first starting page of the start page of the available storage interval of the target storage block Start page number, the bad page number of the one bad page and the first start page number are used to determine the multiple pages contained in the target memory block by the start page of the one bad page and the available storage interval of the target memory block The sorting position in the controller; the controller can obtain the availability of the target storage block if the sorting position of the one bad page is in the first half of the available storage interval of the target storage block according to the bad page number of the one bad page The number of the next page of the one bad page in the storage interval to determine that the multiple pages contained in the next page of the one bad page to the end page of the available storage interval of the target memory block are the good areas; the controller can The first starting page number in the storage interval information of the target storage block is updated to the number of the next page of the one bad page, so that the available storage interval of the target storage block is updated to the Area.
本申请中,控制器可以对该目标存储块包含的多个页进行编号,从而当该至少一个坏页为一个坏页时,可以根据该一个坏页的坏页编号确定该一个坏页是否位于该目标存储块的可用存储区间的前半部分,当确定在位于前半部分的情况下,可以将第一起始页编号更新为该一个坏页的下一页的编号,从而完成了目标存储块的存储区间信息的更新操作,避免了在检测到一个坏页后,避免了逐页数该目标存储块的可用存储区间内位于该一个坏页的前面和后面的页数的操作,提高了目标存储块的存储区间信息的更新效率。In this application, the controller may number the multiple pages included in the target storage block, so that when the at least one bad page is a bad page, it can determine whether the one bad page is located according to the bad page number of the one bad page The first half of the available storage interval of the target memory block, when it is determined to be in the first half, the first start page number can be updated to the number of the next page of the one bad page, thus completing the storage of the target memory block The update operation of the interval information avoids the operation of counting the number of pages located before and after the one bad page in the available storage interval of the target storage block page by page after detecting a bad page, and improves the target storage block The update efficiency of the storage interval information.
一种可能的实现方式下,该一个坏页的坏页位置包含该一个坏页的坏页编号,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的终止页的第一终止页编号,该一个坏页的坏页编号和该第一终止页编号分别用于确定该一个坏页和该目标存储块的可用存储区间的终止页在该目标存储块包含的多个页中的排序位置;该控制器在根据该一个坏页的坏页编号确定该一个坏页的排序位置在该目标存储块的可用存储区间的后半部分的情况下,可以获取该目标存储块的可用存储区间内该一个坏页的上一页的编号,以确定该目 标存储块的可用存储区间的起始页至该一个坏页的上一页包含的多个页为该好区;该控制器可以将该第一终止页编号更新为该一个坏页的上一页的编号,从而将该目标存储块的可用存储区间更新为了该好区。In a possible implementation manner, the bad page position of the one bad page includes the bad page number of the one bad page, and the storage interval information of the target storage block includes the first termination of the end page of the available storage interval of the target storage block Page number, the bad page number of the one bad page and the first end page number are used to determine the end page of the one bad page and the available storage interval of the target memory block among the multiple pages included in the target memory block Sorting position; the controller can obtain the available storage of the target storage block when determining the sorting position of the one bad page in the second half of the available storage interval of the target storage block according to the bad page number of the one bad page The number of the previous page of the one bad page in the interval to determine the number of pages contained in the start page of the available storage interval of the target memory block to the previous page of the one bad page as the good area; the controller can The first termination page number is updated to the number of the previous page of the one bad page, so that the available storage interval of the target storage block is updated to the good area.
本申请中,控制器可以对该目标存储块包含的多个页进行编号,从而当该至少一个坏页为一个坏页时,可以根据该一个坏页的坏页编号确定该一个坏页是否位于该目标存储块的可用存储区间的后半部分,当确定在位于前半部分的情况下,可以将该第一终止页编号更新为该一个坏页的上一页的编号,从而完成了目标存储块的存储区间信息的更新操作,避免了在检测到一个坏页后,避免了逐页数该目标存储块的可用存储区间内位于该一个坏页的前面和后面的页数的操作,提高了目标存储块的存储区间信息的更新效率。In this application, the controller may number the multiple pages included in the target storage block, so that when the at least one bad page is a bad page, it can determine whether the one bad page is located according to the bad page number of the one bad page The second half of the available storage interval of the target memory block, when it is determined to be in the first half, the first end page number can be updated to the number of the previous page of the one bad page, thus completing the target memory block The update operation of the storage interval information of the computer avoids the operation of counting the number of pages located before and after the one bad page in the available storage interval of the target storage block after detecting a bad page, which improves the target Update efficiency of storage block information in the storage block.
一种可能的实现方式下,该至少一个坏页中有至少两个坏页,该至少一个坏页位置中有与该至少两个坏页一一对应的至少两个坏页位置,该至少两个坏页位置中包含与目标坏页对应的目标坏页位置,该目标坏页为该至少两个坏页中的任一坏页;该控制器在根据该目标坏页位置确定该目标坏页存在于目标存储块的可用存储区间的情况下,以该目标坏页位置作为分隔页的位置对该目标存储块的可用存储区间进行划分,以确定好区。In a possible implementation manner, there are at least two bad pages in the at least one bad page, and at least two bad page positions in one-to-one correspondence with the at least two bad pages in the at least one bad page position, the at least two Each bad page position includes a target bad page position corresponding to the target bad page, and the target bad page is any of the at least two bad pages; the controller determines the target bad page according to the target bad page position When there is an available storage interval in the target storage block, the available storage interval of the target storage block is divided by using the target bad page position as the position of the separation page to determine a good area.
本申请中,当该至少一个坏页中有至少两个坏页时,由于该控制器逐页处理该至少两个坏页,则后处理的坏页有可能出现在目标存储块的可用存储区间中,而本申请中,该控制器只有在目标坏页位于目标存储块的可用存储区间时,才根据该目标坏页位置对该目标存储块的可用存储区间进行划分,从而当坏页发生在目标存储块的不可用存储区间时,由于不会对目标存储块的可用存储区间产生影响,则不再执行重新划分可用存储区间的操作,避免了控制器处理资源的浪费,且降低了存储块管理的复杂度。In this application, when there are at least two bad pages in the at least one bad page, since the controller processes the at least two bad pages page by page, the post-processed bad pages may appear in the available storage interval of the target storage block In this application, the controller only divides the available storage interval of the target storage block according to the target bad page location when the target bad page is located in the available storage interval of the target storage block, so that when the bad page occurs in When the unavailable storage interval of the target storage block does not affect the available storage interval of the target storage block, the operation of re-dividing the available storage interval is no longer performed, which avoids the waste of processing resources of the controller and reduces the storage block Management complexity.
一种可能的实现方式下,该至少一个坏页中有至少两个坏页,该至少一个坏页位置中有与该至少两个坏页一一对应的至少两个坏页位置,该至少两个坏页位置中包含与至少两个坏页一一对应的至少两个坏页编号,该至少两个坏页编号用于确定该至少两个坏页在该目标存储块包含的多个页中的排序位置;该控制器可以根据该至少两个坏页编号,确定边缘坏页,该边缘坏页为该至少两个坏页中排序位置位于最上或排序位置位于最下的一个坏页,其中,在根据该至少两个坏页编号确定该至少两个坏页的排序位置均在该目标存储块的可用存储区间的前半部分的情况下,可以获取该至少两个坏页中排序位置位于最下的一个坏页的坏页位置作为边缘坏页位置;在根据该至少两个坏页编号确定该至少两个坏页的排序位置均在该目标存储块的可用存储区间的后半部分的情况下,可以获取该至少两个坏页中排序位置位于最上的一个坏页的坏页位置作为边缘坏页位置。控制器在获取到该边缘坏页位置后,以该边缘坏页的坏页编号作为分隔页的编号对该目标存储块的可用存储区间进行划分,以确定好区。In a possible implementation manner, there are at least two bad pages in the at least one bad page, and at least two bad page positions in one-to-one correspondence with the at least two bad pages in the at least one bad page position, the at least two Each bad page position contains at least two bad page numbers corresponding to at least two bad pages, and the at least two bad page numbers are used to determine that the at least two bad pages are among the multiple pages included in the target storage block The sorting position of the controller; the controller may determine the edge bad page according to the at least two bad page numbers, and the edge bad page is the bad page with the sorting position at the top or the sorting position at the bottom of the at least two bad pages, where , In the case that it is determined according to the at least two bad page numbers that the sort positions of the at least two bad pages are all in the first half of the available storage interval of the target storage block, it can be obtained that the sort positions of the at least two bad pages are located in the most The bad page position of the next bad page is used as the edge bad page position; the sorting position of the at least two bad pages determined according to the at least two bad page numbers is in the second half of the available storage interval of the target memory block In a case may be obtained at least two sort bad page located on a bad page most bad bad page page position as the edge position. After acquiring the position of the bad edge page, the controller divides the available storage interval of the target storage block by using the bad page number of the bad edge page as the number of the separation page to determine the good area.
本申请中,当该至少一个坏页中有至少两个坏页时,控制器可以获取该至少两个坏页中的边缘坏页,从而仅根据该边缘坏页对该目标存储块的可用存储区间进行划分,避免了逐页处理该至少两个坏页时的重复操作,提高了坏页处理的效率。In the present application, when there are at least two bad pages in the at least one bad page, the controller may acquire the edge bad pages in the at least two bad pages, so that only the available storage of the target storage block according to the edge bad pages The interval is divided to avoid repeated operations when processing the at least two bad pages page by page, thereby improving the efficiency of processing the bad pages.
一种可能的实现方式下,该控制器还可以在该好区内设置隔离区,以将该好区划分为隔离区和用户数据区,其中,该隔离区包含至少一个页的随机数据,位于该至少一个坏页 和该用户数据区之间,该用户数据区用于存储有效数据,其中,当该至少一个坏页为一个坏页时,该隔离区为与该一个坏页相邻的至少一个页;当该至少一个坏页中有至少两个坏页时,该隔离区为与该至少两个坏页中的边缘页相邻的至少一个页。In a possible implementation manner, the controller may also set an isolation area in the good area to divide the good area into an isolation area and a user data area, where the isolation area contains at least one page of random data and is located in Between the at least one bad page and the user data area, the user data area is used to store valid data, wherein, when the at least one bad page is a bad page, the isolation area is at least adjacent to the one bad page One page; when there are at least two bad pages in the at least one bad page, the isolation area is at least one page adjacent to the edge page in the at least two bad pages.
本申请中,由于不同页之间普遍存在编程干扰,而当存储块内出现坏页时,这种编程干扰可能进一步增大,当坏页在目标存储块的可用存储区间的前半部分时,以好区中排序位置位于最上的一个页作为起始页,写入至少一个页的随机数据,从而在坏页和用户数据区之间设置隔离区,可以阻断坏页对可用页的影响,从而提升可用存储区的可靠性。In this application, due to the general existence of program interference between different pages, and when a bad page appears in the memory block, this program interference may further increase. When the bad page is in the first half of the available storage interval of the target memory block, the The top-ranked page in the good area is used as the starting page, and at least one page of random data is written, so that an isolation area is set between the bad page and the user data area, which can block the impact of the bad page on the available pages, thereby Improve the reliability of available storage areas.
一种可能的实现方式下,该至少一个坏页位置包含与该至少一个坏页一一对应的至少一个坏页编号,该至少一个坏页编号用于确定该坏页在该目标存储块包含的多个页中的排序位置,在根据该至少一个坏页编号确定该至少一个坏页的排序位置在该目标存储块的可用存储区间的前半部分的情况下,该控制器可以该好区中排序位置位于最上的一个页作为起始位置,写入该至少一个页的随机数据,以形成该隔离区。其中,该控制器在对该好区执行擦除操作后,可以在该目标存储块接收到有效数据时,触发设置隔离区操作;也可以为在对该好区执行擦除操作后,设置定时器,在达到定时器设置的时间后,触发设置隔离区操作,该随机数据指由控制器随机生成的无效数据。In a possible implementation manner, the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block The sorting position in the plurality of pages, when it is determined that the sorting position of the at least one bad page is in the first half of the available storage interval of the target memory block according to the at least one bad page number, the controller may sort in the good area The page at the top is used as the starting position, and random data of the at least one page is written to form the isolation area. Among them, after the controller performs the erase operation on the good area, it can trigger the operation of setting the isolation area when the target memory block receives valid data; it can also set the timing after performing the erase operation on the good area After the time set by the timer is reached, the operation of setting the isolation zone is triggered. The random data refers to invalid data randomly generated by the controller.
本申请中,在该至少一个坏页位于该目标存储块的可用存储区间的前半部分的情况下,该控制器以该好区中排序位置位于最上的一个页作为起始位置,写入该至少一个页的随机数据,从而形成了该隔离区,提高了本方案的可操作性。In this application, when the at least one bad page is located in the first half of the available storage interval of the target storage block, the controller writes the at least one page with the sorted position in the good area at the top as the starting position. One page of random data, thus forming the isolated area, improves the operability of this solution.
一种可能的实现方式下,当该至少一个坏页为一个坏页时,该好区中排序位置位于最上的一个页为该目标存储块的可用存储区间内该一个坏页的下一页;当该至少一个坏页中有至少两个坏页时,该好区中排序位置位于最上的一个页为该目标存储块的可用存储区间内该目标坏页的下一页,该目标坏页为该至少两个坏页中任一坏页。In a possible implementation manner, when the at least one bad page is a bad page, the top-ranked page in the good area is the next page of the bad page in the available storage interval of the target storage block; When there are at least two bad pages in the at least one bad page, the topmost page in the good area is the next page of the target bad page in the available storage interval of the target storage block, and the target bad page is Any one of the at least two bad pages.
本申请中,无论该至少一个坏页为一个坏页还是至少两个坏页,均可通过本申请中的方案设置隔离区,从而提高了本方案的灵活性和可操作性。In this application, no matter whether the at least one bad page is one bad page or at least two bad pages, the isolation area can be set by the scheme in this application, thereby improving the flexibility and operability of the scheme.
一种可能的实现方式下,该至少一个坏页位置包含与该至少一个坏页一一对应的至少一个坏页编号,该至少一个坏页编号用于确定该坏页在该目标存储块包含的多个页中的排序位置,该控制器在根据该至少一个坏页编号确定该至少一个坏页的排序位置在该目标存储块的可用存储区间的后半部分的情况下,控制器在将有效数据写入用户数据区后,可以判断写入的有效数据是否已经占满该用户数据区,若已占满该用户数据区,以该用户数据区的下一页为起始位置,写入该至少一个页的随机数据,以形成该隔离区。In a possible implementation manner, the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block The sorting position in the multiple pages, the controller will be effective when determining that the sorting position of the at least one bad page is in the second half of the available storage interval of the target memory block according to the at least one bad page number After the data is written into the user data area, you can determine whether the written valid data has occupied the user data area. If the user data area has been filled, the next page of the user data area is used as the starting position to write At least one page of random data to form the isolated area.
本申请中,在该至少一个坏页在该目标存储块的可用存储区间的后半部分的情况下,若写入的有效数据已占满该用户数据区,以该用户数据区的下一页为起始位置,写入该至少一个页的随机数据,从而形成了该隔离区,提高了本方案的可操作性。In this application, if the at least one bad page is in the second half of the available storage interval of the target storage block, if the written valid data has already occupied the user data area, the next page of the user data area As the starting position, the random data of the at least one page is written, thereby forming the isolation area, which improves the operability of the solution.
一种可能实现方式下,该控制器可以根据好区的终止页的第二终止页编号和该隔离区的预设页数确定该用户数据区的终止页的第三终止页编号,并在每次在目标存储块中执行写操作后,获取已写入有效数据的页的最后一页的编号,通过判断最后一页的编号是否达到该第三终止页编号,从而判断写入的有效数据是否已占满用户数据区。In a possible implementation manner, the controller may determine the third termination page number of the termination page of the user data area according to the second termination page number of the termination page of the good area and the preset number of pages in the isolation area, and After performing the write operation in the target memory block twice, obtain the number of the last page of the page where valid data has been written, and determine whether the valid data written by determining whether the number of the last page reaches the third end page number User data area has been occupied.
本申请中,通过判断写入有效数据的页的最后一页的编号是否达到该第三终止页编号的方式来判断写入的有效数据是否已占满用户数据区,提高了本方案的可实现性。In this application, it is determined whether the written valid data has occupied the user data area by determining whether the number of the last page of the page where valid data is written reaches the third end page number, which improves the achievability of this solution Sex.
一种可能的实现方式下,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的起始页的第一起始页编号,该好区包含的多个页中有该好区的起始页,该好区的起始页的第二起始页编号和该第一起始页编号分别用于确定该好区的起始页和该目标存储块的可用存储区间的起始页在该目标存储块包含的多个页中的排序位置,该控制器在根据该第二起始页编号确定该好区的起始页存在于第一预设区间的情况下,可以获取第一预设编号,其中,该第一预设区间中包含多个页,该第一预设编号为该第一预设区间的下一页的编号;该控制器在确定该第一预设编号之后,可以将该第一起始页编号更新为该第一预设编号。In a possible implementation manner, the storage interval information of the target storage block includes the first start page number of the start page of the available storage interval of the target storage block, and there are multiple pages in the good area Start page, the second start page number and the first start page number of the start page of the good area are used to determine the start page of the good area and the start page of the available storage interval of the target memory block in The sorting position among the multiple pages included in the target storage block, and the controller may obtain the first pre-order when determining that the start page of the good area exists in the first preset interval according to the second start page number Set a number, where the first preset interval contains multiple pages, the first preset number is the number of the next page of the first preset interval; after the controller determines the first preset number, The first starting page number may be updated to the first preset number.
本申请中,只要好区的起始页的编号存在于第一预设区间的情况下,则将目标存储块的存储区间信息的起始页的编号均更新为与该第一预设区间对应的第一预设编号,也即将目标存储块的可用存储区间的起始位置限定为特定的取值,由于坏页出现的位置有特定的规律,可以按照统计规律设定可用存储区间的起始编号的预设取值集合,以使得可用存储区间的边缘是对齐的,从而降低了存储块的管理复杂度。In this application, as long as the number of the start page of the good area exists in the first preset interval, the number of the start page of the storage interval information of the target storage block is updated to correspond to the first preset interval The first preset number, that is, the starting position of the available storage interval of the target storage block is limited to a specific value, because the location of the bad page has a specific rule, you can set the start of the available storage interval according to statistical rules The numbered preset value set, so that the edges of the available storage interval are aligned, thereby reducing the management complexity of the storage block.
一种可能的实现方式下,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的终止页的第一终止页编号,该好区包含的多个页中有该好区的终止页,该好区的终止页的第二终止页编号和该第一终止页编号分别用于确定该好区的终止页和该目标存储块的可用存储区间的终止页在该目标存储块包含的多个页中的排序位置,该控制器在根据该第二终止页编号确定该好区的终止页存在于第二预设区间的情况下,可以获取第二预设编号,其中,该第二预设区间中包含多个页,该第二预设编号为该第二预设区间的上一页的编号;该控制器在确定该第二预设编号后,可以将该第一终止页编号更新为该第二预设编号。In a possible implementation manner, the storage interval information of the target storage block includes the first end page number of the end page of the available storage interval of the target storage block, and the multiple areas included in the good area have the end of the good area Page, the second end page number and the first end page number of the end page of the good area are used to determine the end page of the good area and the end page of the available storage interval of the target storage block included in the target storage block The sorting position in the multiple pages, the controller can obtain the second preset number if it is determined that the end page of the good area exists in the second preset interval according to the second end page number, wherein the second The preset interval includes multiple pages, and the second preset number is the number of the previous page in the second preset interval; after the controller determines the second preset number, the first end page number can be Update to the second preset number.
本申请中,只要好区的终止页的编号存在于第二预设区间的情况下,则将第一起始页编号均更新为与该第二预设区间对应的第二预设编号,也即将目标存储块的可用存储区间的终止位置限定为特定的取值,由于坏页出现的位置有特定的规律,可以按照统计规律设定可用存储区间的终止编号的预设取值集合,以使得可用存储区间的边缘是对齐的,从而降低了存储块的管理复杂度。In this application, as long as the number of the end page of the good area exists in the second preset interval, the first start page number is updated to the second preset number corresponding to the second preset interval, which is The end position of the available storage interval of the target storage block is limited to a specific value. Since the location of the bad page has a specific law, the preset value set of the end number of the available storage interval can be set according to the statistical law to make it available The edges of the storage interval are aligned, thereby reducing the management complexity of the storage block.
一种可能的实现方式下,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号,该控制器可以获取该第一起始页编号和该第一终止页编号之间的差值;在该差值达到或低于预设阈值的情况下,将该目标存储块标记为不可用存储块。In a possible implementation manner, the storage interval information of the target storage block includes the first start page number of the start page and the first end page number of the end page of the available storage interval of the target storage block, and the controller can obtain The difference between the first start page number and the first end page number; when the difference reaches or falls below a preset threshold, the target memory block is marked as an unusable memory block.
本申请中,在可用存储区间的页数低于预设阈值时,将该可用存储区间所在的存储块标记为坏块,从而不再管理该存储块,从而降低控制器对存储块的管理复杂度。In this application, when the number of pages in the available storage interval is lower than the preset threshold, the storage block where the available storage interval is located is marked as a bad block, so that the storage block is no longer managed, thereby reducing the complexity of the management of the storage block by the controller degree.
第二方面,本申请实施例提供了一种控制器,该控制器应用于存储设备,该控制器应用于存储设备,该存储设备包含该控制器和存储器,该存储器包含多个存储块,该存储块包含多个页,该控制器中包含每个存储块的存储区间信息,该存储区间信息用于确定存储 块的可用存储区间,该控制器包括获取单元、确定单元和更新单元:该获取单元用于,当检测到目标存储块中存在至少一个坏页时,获取与该至少一个坏页一一对应的至少一个坏页该坏页的位置,其中,当该至少一个坏页为一个坏页时,该至少一个坏页位置为该一个坏页的坏页编号,当该至少一个坏页中有至少两个坏页时,该至少一个坏页位置中包含与该至少两个坏页一一对应的至少两个坏页编号;该确定单元用于,根据该至少一个坏页的坏页编号,确定好区,其中,该好区为该目标存储块的可用存储区间中连续且不存在该坏页的最大存储区间;该更新单元用于,根据该好区的起始页的第二起始页编号和终止页的第二终止页编号,更新该目标存储块的存储区间信息,其中,该目标存储块的存储区间信息中包含目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号,更新后的该目标存储块的存储区间信息指示该目标存储块的可用存储区间为该好区,从而该控制器可以将后续接收到的用户数据存入到该好区中。In a second aspect, an embodiment of the present application provides a controller that is applied to a storage device and the controller is applied to a storage device. The storage device includes the controller and a memory, and the memory includes multiple storage blocks. The storage block contains multiple pages. The controller contains storage interval information for each storage block. The storage interval information is used to determine the available storage interval of the storage block. The controller includes an acquisition unit, a determination unit, and an update unit: the acquisition The unit is configured to, when it is detected that at least one bad page exists in the target storage block, acquire the position of the at least one bad page corresponding to the at least one bad page, where the at least one bad page is a bad page In the case of pages, the at least one bad page position is the bad page number of the one bad page. When there are at least two bad pages in the at least one bad page, the at least one bad page position contains A corresponding at least two bad page numbers; the determining unit is used to determine a good area according to the bad page number of the at least one bad page, wherein the good area is the target storage block The maximum storage interval in the available storage interval of the continuous and without the bad page; the update unit is used to update the second page number of the start page of the good area and the second page number of the end page The storage interval information of the target storage block, wherein the storage interval information of the target storage block includes the first start page number and the first end page number of the start page of the available storage interval of the target storage block The storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area, so that the controller can store subsequently received user data into the good area.
本申请中,当目标存储块中出现坏页时,可以根据坏页的位置将存储块的目标存储块的可用存储区间进行划分,从而确定单元将该目标存储块的可用存储区间中不包含该坏页的最大连续区间确定为好区,进而由更新单元根据该好区更新该存储块的可用存储区间,避免了直接将该整个存储块标记为坏块,减缓了冗余块的消耗,延长了固态硬盘的使用寿命,而且,由于冗余块的消耗减少,也避免了写放大系数的增加,进一步延长了固态硬盘的使用寿命;此外,本申请还可以适用于其他包含存储块的存储设备,从而延长了存储设备的使用寿命。In the present application, when a bad page appears in the target storage block, the available storage interval of the target storage block of the storage block may be divided according to the location of the bad page, so that the determination unit does not include the available storage interval of the target storage block The maximum continuous interval of bad pages is determined as a good area, and the update unit updates the available storage interval of the storage block according to the good area, avoiding directly marking the entire storage block as a bad block, slowing down the consumption of redundant blocks, and extending The service life of the solid state hard disk is reduced, and because the consumption of redundant blocks is reduced, the increase in the write amplification factor is also avoided, and the service life of the solid state hard disk is further extended; in addition, the application can also be applied to other storage devices that include storage blocks , Thereby extending the life of storage devices.
第三方面,本申请实施例提供了一种存储设备,该存储设备包括控制器和存储器,该存储器包含存储块,该存储块包含多个页;其中,该控制器用于执行如如上述第一方面的存储块处理的方法,还用于生成指令;该存储器用于根据该指令存储数据。In a third aspect, an embodiment of the present application provides a storage device, the storage device includes a controller and a memory, the memory includes a storage block, and the storage block includes a plurality of pages; wherein, the controller is used to execute the first The aspect of the storage block processing method is also used to generate instructions; the memory is used to store data according to the instructions.
第四方面,本申请实施例提供了一种终端,该终端包含接口、处理器和存储设备,该存储设备包括控制器和存储器,该存储器包含存储块,该存储块包含多个页;该处理器通过该接口将数据发送至该控制器;该控制器用于执行如上述第一方面的存储块处理的方法,还用于通过该接口接收该处理器发送的该数据,并生成指令;该存储器用于根据该指令存储该数据。According to a fourth aspect, an embodiment of the present application provides a terminal. The terminal includes an interface, a processor, and a storage device. The storage device includes a controller and a memory. The memory includes a storage block. The storage block includes multiple pages. The controller sends data to the controller through the interface; the controller is used to perform the method of processing memory blocks as described in the first aspect, and is also used to receive the data sent by the processor through the interface and generate instructions; the memory Used to store the data according to the instruction.
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述第一方面的存储块处理的方法。According to a fifth aspect, an embodiment of the present application provides a computer program product containing instructions, which, when the computer program product runs on a computer, causes the computer to execute the method for processing a storage block as described in the first aspect.
第六方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质中存储有报文处理的指令,当其在计算机上运行时,使得计算机执行上述第一方面描述的存储块处理的方法。According to a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a message processing instruction is stored, and when it is run on a computer, the computer is allowed to execute the above-described first aspect. Storage block processing method.
第七方面,本申请实施例提供了一种芯片***,该芯片***包括处理器,用于支持网络设备实现上述方面中所涉及的功能,例如,例如发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,该芯片***还包括存储器,该存储器,用于保存网络设备必要的程序指令和数据。该芯片***,可以由芯片构成,也可以包括芯片和其他分立器件。According to a seventh aspect, an embodiment of the present application provides a chip system including a processor for supporting a network device to implement the functions involved in the above aspects, for example, for example, sending or processing data and data involved in the above method / Or information. In a possible design, the chip system further includes a memory for storing necessary program instructions and data of the network device. The chip system may be composed of chips, and may also include chips and other discrete devices.
本申请第三方面至第七方面的有益效果,可以参考第一方面。For the beneficial effects of the third aspect to the seventh aspect of the present application, refer to the first aspect.
图1a为本申请实施例提供的存储设备的一种结构示意图;FIG. 1a is a schematic structural diagram of a storage device provided by an embodiment of this application;
图1b为本申请实施例提供的存储设备的又一种结构示意图;FIG. 1b is another schematic structural diagram of a storage device provided by an embodiment of this application;
图1c为本申请实施例提供的存储器的一种结构示意图;1c is a schematic structural diagram of a memory provided by an embodiment of this application;
图2为本申请实施例提供的存储块处理方法一种流程示意图;2 is a schematic flowchart of a storage block processing method provided by an embodiment of the present application;
图3a为本申请实施例提供的目标存储块的一种结构示意图;3a is a schematic structural diagram of a target storage block provided by an embodiment of this application;
图3b为本申请实施例提供的目标存储块的另一种结构示意图;3b is another schematic structural diagram of a target storage block provided by an embodiment of this application;
图4为本申请实施例提供的存储块处理方法另一种流程示意图;4 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application;
图5a为本申请实施例提供的目标存储块的又一种结构示意图;5a is another schematic structural diagram of a target storage block provided by an embodiment of this application;
图5b为本申请实施例提供的目标存储块的再一种结构示意图;5b is another schematic structural diagram of a target storage block provided by an embodiment of the present application;
图6为本申请实施例提供的存储块处理方法又一种流程示意图;6 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application;
图7为本申请实施例提供的存储块处理方法再一种流程示意图;7 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application;
图8为本申请实施例提供的存储块处理方法再一种流程示意图;8 is another schematic flowchart of a storage block processing method provided by an embodiment of the present application;
图9为本申请实施例提供的控制器的一种结构示意图。9 is a schematic structural diagram of a controller provided by an embodiment of the present application.
本申请实施例提供了一种存储块处理方法及相关设备,本申请中,当存储块中出现坏页时,获取该存储块中不包含该坏页的连续最大存储区间,继续使用该连续最大存储区间,从而避免了直接将该整个存储块标记为坏块,减缓了冗余块的消耗,延长了存储设备的使用寿命。An embodiment of the present application provides a storage block processing method and related equipment. In this application, when a bad page appears in a storage block, a continuous maximum storage interval that does not include the bad page in the storage block is acquired, and the continuous maximum The storage interval avoids directly marking the entire storage block as a bad block, slows down the consumption of redundant blocks, and extends the service life of the storage device.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。术语“至少一个”是指一个或者多个,“多个”是指两个或两个以上。The terms "first", "second", "third", etc. (if any) in the description and claims of the present application and the above drawings are used to distinguish similar objects, not necessarily to describe a specific order Or in order. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than what is illustrated or described herein. In addition, the term "comprising" is intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units need not be limited to those steps or units that are clearly listed, but may include no Other steps or units that are clearly listed or inherent to these processes, methods, products or equipment. The term "at least one" refers to one or more, and "multiple" refers to two or more.
本申请实施例中,参见图1a和图1b,本申请应用于存储设备10中,该存储设备10与主机20相连,存储设备10用于根据主机20的指令存储数据。其中,存储设备10可以包括非嵌入式存储设备,作为示例,例如固态硬盘。存储设备10也可以包括嵌入式存储设备,作为示例,例如应用于移动终端的独立芯片。存储设备10还可以为其他形式的存储设备,具体此处不一一列举。In the embodiment of the present application, referring to FIGS. 1a and 1b, the present application is applied to a storage device 10 that is connected to a host 20, and the storage device 10 is used to store data according to an instruction of the host 20. The storage device 10 may include a non-embedded storage device, as an example, such as a solid state drive. The storage device 10 may also include an embedded storage device, as an example, such as a stand-alone chip applied to a mobile terminal. The storage device 10 may also be other forms of storage devices, which are not specifically listed here.
本申请实施例中,该存储设备10可以包括控制器100和存储器110,控制器100与主机20通信,以及与存储器110相连,控制器100用于接收主机传送的指令,并根据该指令对存储器110执行擦写等操作。控制器100还用于对存储器110中的存储空间进行管理。In the embodiment of the present application, the storage device 10 may include a controller 100 and a memory 110. The controller 100 communicates with the host 20 and is connected to the memory 110. The controller 100 is used to receive an instruction transmitted by the host and to the memory according to the instruction 110 Perform operations such as erase and write. The controller 100 is also used to manage the storage space in the memory 110.
本申请实施例中,当存储设备10为非嵌入式存储设备时,参见图1a,控制器100前端可以包含与主机20进行通信的第一接口,该第一接口可以为非易失性存储高速接口 (non-volatile memory express,NVME)、串行小型计算***接口(serial attached small computer system interface,SAS)、周边元件扩展高速接口(peripheral component interconnect express,PCIE)或者其他主机与非嵌入式存储设备之间的接口中的一种,控制器100后端还可以包含与存储器110相连的第二接口,该第二接口可以为闪存介质接口(nand flash interface,NFI)或者其他类型的用于存储器内部控制器与存储颗粒阵列之间的接口,控制器通过该第一接口接收主机的指令,并根据接收到的指令通过该第二接口对存储器110执行擦写等操作。In the embodiment of the present application, when the storage device 10 is a non-embedded storage device, referring to FIG. 1a, the front end of the controller 100 may include a first interface for communicating with the host 20, and the first interface may be a non-volatile storage high-speed Interface (non-volatile memory express, NVME), serial small computing system interface (serial attached) small computer system interface (SAS), peripheral component extended high-speed interface (peripheral component interconnect interconnect express, PCIE) or other hosts and non-embedded storage devices One of the interfaces between the two, the back end of the controller 100 may further include a second interface connected to the memory 110, the second interface may be a flash media interface (nand flash interface, NFI) or other types used inside the memory An interface between the controller and the storage particle array. The controller receives commands from the host through the first interface, and performs operations such as erasing and writing on the memory 110 through the second interface according to the received commands.
本申请实施例中,当存储设备10为嵌入式存储设备时,参见图1b,控制器100与存储器110可以为由控制器电路和存储颗粒阵列封装成的独立芯片,因此,控制器100与存储器110之间可以不存在接口。控制器100与主机20之间通过第三接口进行通信,该第三接口可以为通用闪存存储接口(universal flash storage,UFS)、嵌入式多媒体卡接口(embedded multimedia card,EMMC)或者其他主机与嵌入式存储设备之间的接口中的一种,具体此处不做限定。In the embodiment of the present application, when the storage device 10 is an embedded storage device, referring to FIG. 1b, the controller 100 and the memory 110 may be independent chips packaged by the controller circuit and the storage particle array. Therefore, the controller 100 and the memory There may be no interface between 110. The controller 100 communicates with the host 20 through a third interface, which may be a universal flash storage interface (universal flash storage (UFS), an embedded multimedia card interface (embedded multimedia card, EMMC), or other host and embedded One of the interfaces between storage devices, the specific is not limited here.
本申请实施例中,存储器110可以包括闪存存储器、随机存取存储器、只读存储器或其他存储器类型等,存储器110可以是由存储颗粒构成的存储阵列,其中,闪存存储器是指以闪存颗粒为存储介质的存储器,也即在闪存存储器中包含。应当理解,本实施例中,以存储器为闪存存储器为例进行说明。In the embodiment of the present application, the memory 110 may include a flash memory, a random access memory, a read-only memory, or other memory types, etc. The memory 110 may be a storage array composed of storage particles, where the flash memory refers to the flash particles as the storage The memory of the medium is included in the flash memory. It should be understood that, in this embodiment, the flash memory is used as an example for description.
本申请实施例中,参见图1c,在逻辑层面,存储器110可以包括多个独立逻辑单元(Die/LUN),每个独立逻辑单元中可以包含多个存储平面(Plane),每个存储平面中可以包含多个存储块(Block)1100,每个存储块中可以包含多个页,应当理解,存储器110的结构还可以随着技术的发展发生改变,此处对存储器110的介绍仅为方便理解,只要存储器110中存在存储块1100,均可采用本申请提供的存储块处理方法。In the embodiment of the present application, referring to FIG. 1c, at the logical level, the memory 110 may include multiple independent logical units (Die / LUN), and each independent logical unit may include multiple storage planes (Plane), and each storage plane It can contain multiple memory blocks (Block) 1100, and each memory block can contain multiple pages. It should be understood that the structure of the memory 110 may also change with the development of technology. The introduction of the memory 110 here is only for easy understanding. As long as there is a storage block 1100 in the memory 110, the storage block processing method provided in this application can be adopted.
本申请实施例中,存储块1100对应的存储区间为控制器100中可以独立管理的存储区间,由于根据不同的制造工艺,一个物理块中可以对应一个存储块1100的存储区间,作为示例,例如32层的物理块的块内部没有分层,则存储块1100的存储区间对应的就是这整个物理块形成的存储区间。一个物理块也可以对应两个或多个存储块1100的存储区间,作为示例,例如64层的物理块可以为由两个32层的子物理块堆叠而成,则每个物理块中包含两个子物理块,则一个存储块1100的存储区间对应的就是子物理块形成的存储区间,也即一个物理块对应两个存储块1100的存储区间。In the embodiment of the present application, the storage interval corresponding to the storage block 1100 is a storage interval that can be independently managed in the controller 100. Since according to different manufacturing processes, one physical block can correspond to a storage interval of the storage block 1100, as an example, for example, There is no layering inside the 32-layer physical block, and the storage interval of the storage block 1100 corresponds to the storage interval formed by the entire physical block. A physical block may also correspond to the storage interval of two or more storage blocks 1100. For example, a 64-layer physical block may be formed by stacking two 32-layer sub-physical blocks, and each physical block contains two For a sub-physical block, the storage interval of one storage block 1100 corresponds to the storage interval formed by the sub-physical block, that is, one physical block corresponds to the storage interval of two storage blocks 1100.
本申请实施例提供了一种存储块处理方法,该方法应用于控制器100,控制器100中可以记录有每个存储块1100的存储区间信息,该存储区间信息用于指示存储块的可用存储区间,当控制器100检测到目标存储块中出现坏页时,可以根据坏页的位置重新划分好区,该好区为目标存储块的可用存储区间中连续且不存在坏页的最大存储区间。通过划分好区,后续可以将数据写到好区中,使得数据安全性更好。An embodiment of the present application provides a storage block processing method. The method is applied to the controller 100, and the storage interval information of each storage block 1100 may be recorded in the controller 100, and the storage interval information is used to indicate the available storage of the storage block. When the controller 100 detects a bad page in the target memory block, it can re-divide the good area according to the position of the bad page. The good area is the largest continuous storage area in the available memory interval of the target memory block without bad pages . By dividing the good area, the data can be written to the good area later, making the data safer.
本申请中,其中,坏页可以为一个页,也可以有至少两个页。由于当坏页为一个页和坏页有至少两个页间两种情况下,控制器100相应的处理方式不同,下面对上述两种情况分别进行详细说明。In this application, among them, the bad page may be one page, or may have at least two pages. Since the bad page is a page and there are at least two pages between the two cases, the corresponding processing method of the controller 100 is different, and the above two cases will be described in detail below.
一、至少一个坏页为一个页1. At least one bad page is a page
本实施例及后续实施例中,在控制器100根据检测到的坏页为一个页时,需要以该一个坏页的位置作为分隔页的位置,对该目标存储块的可用存储区间进行划分,以确定好区。In this embodiment and subsequent embodiments, when the controller 100 determines that the detected bad page is a page, it is necessary to use the position of the one bad page as the position of the separation page to divide the available storage interval of the target storage block, To determine the good area.
其中,坏页可以发生于目标存储块的可用存储区间的前半部分,也可以发生于目标存储块的可用存储区间的后半部分,关于前半部分和后半部分的划分,可以将目标存储块的可用存储区间作为一个整体,该可用存储区间包括很多个顺序排列的页,将位于最中间的一个页或两个页的前面的页称为前半部分,最中间的一个页或两个页的后面的页称为后半部分,该最中间的一个页或两个页可以属于前半部分,也可以属于后半部分。应当理解,本实施例及后续实施例中,仅以该最中间的一个也属于前半部分,该两个页中的排序在前的一页属于前半部分,排序在后的一页属于后半部分为例,进行解释说明。以下,对上述两种情况分别说明。Among them, the bad page can occur in the first half of the available storage interval of the target storage block, or it can occur in the second half of the available storage interval of the target storage block. Regarding the division of the first half and the second half, the target storage block The available storage interval as a whole, the available storage interval includes a lot of pages arranged in sequence, the page in front of the middle page or two pages is called the first half, and the page in the middle is behind the two pages The page of is called the second half, and the middle page or two pages can belong to the first half or the second half. It should be understood that, in this embodiment and the subsequent embodiments, only the middlemost one also belongs to the first half, the first page of the two pages is the first half, and the next page is the second half. For example, explain. Hereinafter, the above two cases will be described separately.
本实施例及后续实施例中,坏页的位置可以为坏页的绝对存储路径,也可以为坏页的相对路径,也可以为与坏页的位置具有映射关系的坏页的编号,还可以为其他可以指示坏页的位置信息。应当理解,本实施例及后续实施例中,以坏页的位置为坏页的编号为例,进行说明。In this and subsequent embodiments, the location of the bad page may be the absolute storage path of the bad page, the relative path of the bad page, or the number of the bad page that has a mapping relationship with the position of the bad page, or For other location information that can indicate bad pages. It should be understood that, in this embodiment and subsequent embodiments, the position of the bad page is taken as the number of the bad page as an example for description.
1、该一个坏页在可用存储区间的前半部分1. The bad page is in the first half of the available storage interval
具体参阅图2,本申请实施例中,存储块处理方法的一个实施例可以包括:Referring specifically to FIG. 2, in an embodiment of the present application, an embodiment of a processing method of a storage block may include:
201、当控制器检测到目标存储块中存在一个坏页时,控制器获取该一个坏页的坏页编号。201. When the controller detects that there is a bad page in the target storage block, the controller obtains the bad page number of the one bad page.
本实施例及后续实施例中,控制器100可以对存储块1100中包含的多个页进行编号,每个页的编号用于指示该页在目标存储块包含的多个页中的排序位置,当控制器检测到存储器中包含的多个存储块中某一存储块出现一个坏页时,出现该一个坏页的存储块即为目标存储块,进而控制器可以获取该一个坏页的坏页编号,该一个坏页的坏页编号用于指示该坏页在目标存储块包含的多个页中的排序位置。In this embodiment and subsequent embodiments, the controller 100 may number the multiple pages included in the storage block 1100, and the number of each page is used to indicate the sort position of the page in the multiple pages included in the target storage block, When the controller detects that a bad page appears in a memory block among the multiple memory blocks contained in the memory, the memory block where the bad page appears is the target memory block, and then the controller can obtain the bad page of the bad page Number, the bad page number of the one bad page is used to indicate the sort position of the bad page among the multiple pages included in the target storage block.
本实施例及后续实施例中,坏页的编号可以只包含数字形式的页码,作为示例,例如坏页的编号为0023,则标识该坏页为目标存储块包含的多个页中的第23页;坏页的编号也可以用于同时包含数字和/或字母和/或其他类型的信息,作为示例,例如坏页的编号可以为坏页的存储地址,作为另一示例,坏页的编号也可以为从坏页的存储位置中抽取的部分信息,例如F0083,表示该坏页在F存储块的第83页;坏页的编号还可以为其他形式,具体此处不再一一举例。应当理解,存储块包含的多个页中的任何一页的编号均可为上述形式。In this embodiment and subsequent embodiments, the number of the bad page may only include the page number in a digital form. For example, if the number of the bad page is 0023, the bad page is identified as the 23rd of the multiple pages included in the target storage block. Page; bad page number can also be used to contain both numbers and / or letters and / or other types of information, as an example, for example, the bad page number can be the storage address of the bad page, as another example, the bad page number It can also be part of the information extracted from the storage location of the bad page, such as F0083, indicating that the bad page is on page 83 of the F storage block; the number of the bad page can also be in other forms, and specific examples are not given here. It should be understood that the number of any one of the multiple pages included in the memory block may be in the above-mentioned form.
本实施例及后续实施例中,控制器中可以存储有坏页的位置与坏页的编号的对应关系表,控制器可以在确定坏页的位置后,根据该对应关系表确定坏页的编号;也可以为坏页的位置中包含坏页的编号信息,也即控制器在确定坏页的位置时,即可获取到坏页的编号;控制器还可以通过其他方式获取到坏页的编号,具体此处不做限定。应当理解,存储块包含的多个页中的任何一页的编号均可通过上述方式获取到。In this embodiment and subsequent embodiments, the controller may store a correspondence table between the position of the bad page and the number of the bad page, and after determining the position of the bad page, the controller may determine the number of the bad page according to the correspondence table ; You can also include the bad page number information in the position of the bad page, that is, the controller can obtain the bad page number when determining the position of the bad page; the controller can also obtain the bad page number in other ways , Specific here is not limited. It should be understood that the number of any one of the multiple pages included in the memory block can be obtained in the above manner.
202、控制器获取该目标存储块的可用存储区间内该一个坏页的下一页的编号。202. The controller obtains the number of the next page of the one bad page in the available storage interval of the target storage block.
本实施例中,由于该一个坏页发生在目标存储块的可用存储区间内,且该一个坏页的坏页编号指示该坏页的排序位置在该目标存储块的可用存储区间的前半部分的情况下,控制器可以获取该目标存储块的可用存储区间内该坏页的下一页的编号,从而将坏页的下一页至该目标存储块的可用存储区间的终止页包含的多个页确定为好区,该好区为该目标存储块的可用存储区间中连续且不存在该坏页的最大存储区间。作为示例,例如目标存储块的可用存储区间终止页的编号为0996,该一个坏页的编号为0023,则该一个坏页的下一页的编号可以为0024,则好区为编号为0024至编号为0996之间包含的多个页;作为另一示例,例如目标存储块的可用存储区间终止页的编号为F0996,该一个坏页的编号为F0083,则该一个坏页的下一页的编号可以为F0084,则好区为编号为F0084至编号为F0996之间包含的多个页应当理解,此处举例,仅为方便理解,对于任何一页的编号的取值,不做限定。In this embodiment, since the one bad page occurs in the available storage interval of the target storage block, and the bad page number of the one bad page indicates that the sort position of the bad page is in the first half of the available storage interval of the target storage block In this case, the controller may obtain the number of the next page of the bad page in the available storage interval of the target storage block, so as to include the multiple of the next page of the bad page to the end page of the available storage interval of the target storage block. The page is determined to be a good area, and the good area is the largest storage area that is continuous among the available storage intervals of the target memory block and does not exist the bad page. As an example, for example, the number of the end page of the available storage interval of the target memory block is 0996, the number of the one bad page is 0023, then the number of the next page of the one bad page may be 0024, and the good area is numbered 0024 to Multiple pages included in the number 0996; as another example, for example, the end page of the available storage interval of the target memory block is F0996, and the number of the one bad page is F0083, then the next page of the one bad page The number can be F0084, then the good area is the number of pages contained between F0084 and F0996. It should be understood that the examples here are for convenience only, and the value of the number of any page is not limited.
本实施例及后续实施例中,由于好区为不包含坏页的存储区间,则控制器在确定好区后,在后续接收到有效数据后,只会将该有效数据存储至该好区中。In this and subsequent embodiments, since the good area is a storage area that does not contain bad pages, after the controller determines the good area, after subsequently receiving valid data, it will only store the valid data in the good area .
作为一种实现方式,如表1和表2所示,控制器可以通过记录每个存储块的起始页的编号和终止页的编号的方式来记录每个存储块的可用存储区间,而坏页编号可以指示与该坏页编号对应的坏页在目标存储块包含的多个页中的排序位置,则控制器可以获取目标存储块的可用存储区间的起始页的编号和终止页的编号,并进而判断该一个坏页是否存在于目标存储块的可用存储区间的前半部分。As an implementation, as shown in Table 1 and Table 2, the controller can record the available storage interval of each storage block by recording the number of the start page and the number of the end page of each storage block. The page number can indicate the sort position of the bad page corresponding to the bad page number among the multiple pages included in the target memory block, then the controller can obtain the number of the start page and the end page of the available storage interval of the target memory block , And then determine whether the one bad page exists in the first half of the available storage interval of the target storage block.
存储块Storage block | 可用存储区间Available storage interval |
存储块0Storage block 0 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
存储块1Storage block 1 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
…… | …… |
存储块NStorage block N | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
表1Table 1
存储块Storage block | 可用存储区间Available storage interval |
物理块0存储块0Physical block 0 storage block 0 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
物理块0存储块1Physical block 0 storage block 1 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
物理块1存储块0Physical block 1 storage block 0 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
物理块1存储块1Physical block 1 Storage block 1 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
…… | …… |
物理块N存储块1Physical block N storage block 1 | 起始页编号PageSt,终止页编号PageEdStart Page Number PageSt, End Page Number PageEd |
表2Table 2
本实施例及后续实施例中,表1和表2中的所示的存储块的起始页编号和终止页编号可以数组、链表或者其他数据结构进行保存。在初始化阶段,若一个存储块对应的是一个完整的物理块,如表1所示,则该存储块的起始页编号为该物理块的起始页编号,该存储块的终止页编号为该物理块的终止页编号,作为示例,例如物理块0提供的存储区间为[0001,1000],则存储块0的起始页的编号为0001,终止页的编号为1000;若一个存储块 对应的是子物理块形成的存储区间,如表2所示,则存储块的起始页编号和终止页编号对应的是子物理块的起始页编号和终止页编号,作为示例,例如物理块1提供的存储区间为[0001,1000],该物理块包含子物理块0和子物理块1,其中子物理块0提供的存储区间为[0001,0500],子物理块1提供的存储区间为[0501,1000],则物理块1存储块0的起始页编号为0001,终止页编号为0500,物理块1存储块1的起始页编号为0501,终止页编号为1000。In this embodiment and subsequent embodiments, the start page number and the end page number of the memory blocks shown in Table 1 and Table 2 may be stored in an array, a linked list, or other data structures. In the initialization phase, if a storage block corresponds to a complete physical block, as shown in Table 1, the starting page number of the storage block is the starting page number of the physical block, and the ending page number of the storage block is The end page number of the physical block, as an example, for example, the storage interval provided by physical block 0 is [0001,1000], then the number of the start page of storage block 0 is 0001, and the number of the end page is 1000; if a storage block Corresponding to the storage interval formed by the sub-physical block, as shown in Table 2, the start page number and end page number of the storage block correspond to the start page number and end page number of the sub-physical block, as an example, for example, physical The storage interval provided by block 1 is [0001,1000], the physical block includes sub-physical block 0 and sub-physical block 1, wherein the storage interval provided by sub-physical block 0 is [0001,0500], and the storage interval provided by sub-physical block 1 is If it is [0501,1000], the starting page number of physical block 1 storage block 0 is 0001, the ending page number is 0500, the starting page number of physical block 1 storage block 1 is 0501, and the ending page number is 1000.
在对目标存储块的可用存储区间重新划分阶段,若目标存储块的可用存储区间的起始页的编号、终止页的编号和一个坏页的坏页编号均为数字形式的页码,则当目标存储块中发生坏页,该一个坏页的坏页编号为PageX,获取目标存储块的可用存储区间的起始页编号PageSt和终止页编号PageEd,若PageSt<=PageX<=PageEd,则确定坏页发生在目标存储块的可用存储区间,若2PageX<=PageSt+PageEd,也即坏页的页码未超过起始页的页码和终止页的页码的平均值,则确定该坏页存在于目标存储块的可用存储区间的前半部分,例如,目标存储块的可用存储区间的起始页的页码为0008,终止页的页码为0996,该一个坏页的页码为0015,则一个坏页的页码指示该坏页在目标存储块的可用存储区间的前半部分。In the stage of re-division of the available storage interval of the target storage block, if the number of the starting page, the number of the end page, and the number of the bad page of a bad page are all the page numbers in the form of numbers, then the target A bad page occurs in the storage block. The bad page number of the bad page is PageX. Get the start page number PageSt and the end page number PageEd of the available storage interval of the target storage block. If PageSt <= PageX <= PageEd, the bad page is determined. The page occurs in the available storage interval of the target storage block. If 2PageX <= PageSt + PageEd, that is, the page number of the bad page does not exceed the average of the page number of the start page and the end page, then the bad page is determined to exist in the target storage The first half of the available storage interval of the block, for example, the page number of the starting page of the target storage block is 0008, the page number of the end page is 0996, the page number of the one bad page is 0015, then the page number of a bad page indicates The bad page is in the first half of the available storage interval of the target storage block.
若目标存储块的可用存储区间的起始页的编号、终止页的编号和坏页的编号均包含数字和/或字母和/或其他类型的信息,则可以根据目标存储块的可用存储区间的起始页的编号和终止页的编号确定中间页的编号。If the start page number, end page number, and bad page number of the available storage interval of the target memory block all contain numbers and / or letters and / or other types of information, you can The number of the start page and the number of the end page determine the number of the middle page.
其中,当目标存储块的可用存储区间内存在奇数页时,则中间页为一个,若该一个坏页未超过该中间页,则确定该一个坏页位于目标存储块的可用存储区间的前半部分;当目标存储块的可用存储区间内存在偶数页时,则中间页为两个,若该一个坏页未超过该两个中间页的第一页,则确定该一个坏页位于目标存储块的可用存储区间的前半部分,作为示例,例如目标存储块的可用存储区间的起始页的编号为F0008,终止页的编号为F0996,则中间页为F0502,若该一个坏页的坏页编号为F0015,则该一个坏页在目标存储块的可用存储区间的前半部分;作为另一示例,例如目标存储块的可用存储区间的起始页的编号为F0008,终止页的编号为F0995,则中间页为F0501和F0502,若该一个坏页的编号为F0015,由于该一个坏页未超过F0501,则该一个坏页在目标存储块的可用存储区间的前半部分,应当理解,上述对编号的举例,仅为方便理解本方案,具体对编号的选择,应当结合实际情况,灵活设定。Among them, when there are odd pages in the available storage interval of the target storage block, the middle page is one, and if the one bad page does not exceed the middle page, it is determined that the one bad page is located in the first half of the available storage interval of the target storage block ; When there are even pages in the available storage interval of the target storage block, there are two intermediate pages. If the one bad page does not exceed the first page of the two intermediate pages, it is determined that the one bad page is located in the target storage block. The first half of the available storage interval, for example, for example, the starting page number of the available storage interval of the target memory block is F0008, the end page number is F0996, then the middle page is F0502, if the bad page number of the bad page is F0015, the one bad page is in the first half of the available storage interval of the target storage block; as another example, for example, the start page number of the target storage block available storage area is F0008, and the end page number is F0995, then the middle The pages are F0501 and F0502. If the number of the one bad page is F0015, because the one bad page does not exceed F0501, the one bad page is in the available storage area of the target storage block The first half, it should be understood that the number of the above-described example, only for ease of understanding the present embodiment, the selection of the specific number, should be combined with the actual situation, and flexible setting.
作为另一种实现方式,控制器也可以在确定坏页的位置后,以该坏页为分隔页,分别获取目标存储块的可用存储区间内位于该一个坏页前面的页数和位于该一个坏页后面的页数,若位于该一个坏页前面的页数大于位于该一个坏页后面的页数,则可以确定该一个坏页存在于目标存储块的可用存储区间的前半部分。应当理解,控制器还可以通过其他方式确定该一个坏页是否存在于目标存储块的可用存储区间的前半部分,具体应结合实际情况灵活设定。As another implementation manner, after determining the location of the bad page, the controller may also use the bad page as a separation page to respectively obtain the number of pages in front of the one bad page and the number of pages in the available storage interval of the target storage block The number of pages after the bad page, if the number of pages before the one bad page is greater than the number of pages after the one bad page, it can be determined that the one bad page exists in the first half of the available storage interval of the target storage block. It should be understood that the controller may also determine whether the one bad page exists in the first half of the available storage interval of the target storage block through other methods, which should be flexibly set according to actual conditions.
203、控制器更新该目标存储块的存储区间信息的起始页的第一起始页编号。203. The controller updates the first start page number of the start page of the storage interval information of the target memory block.
本实施例中,控制器在确定好区后,可以根据好区的起始页的第二起始页编号获取到第一预设编号后,从而将目标存储块的存储区间信息的起始页的第一起始页编号更新为该 第一预设编号;也可以将目标存储块的存储区间信息的起始页的第一起始页编号更新为该第二起始页编号,下面分别对上述两种情况进行详细说明。In this embodiment, after determining the good area, the controller may obtain the first preset number according to the second start page number of the start page of the good area, so that the start page of the storage interval information of the target storage block The first start page number of is updated to the first preset number; the first start page number of the start page of the storage interval information of the target memory block can also be updated to the second start page number. This will be explained in detail.
A、第一起始页编号更新为第一预设编号A. The first start page number is updated to the first preset number
本实施例中,在控制器确定该好区的起始页的第二起始页编号存在于第一预设区间的情况下,获取第一预设编号,其中,该第一预设区间中包含多个页,该第一预设编号为该第一预设区间的下一页的编号;控制器将该第一起始页编号更新为该第一预设编号。In this embodiment, when the controller determines that the second start page number of the start page of the good area exists in the first preset interval, the first preset number is obtained, wherein, in the first preset interval Containing multiple pages, the first preset number is the number of the next page in the first preset interval; the controller updates the first starting page number to the first preset number.
本实施例及后续实施例中,控制器中可以预先设定有一个预设区间,也可以设定多个预设区间,若设定多个预设区间,则也存在多个预设编号,预设编号与预设区间可以一一对应,其中预设区间为包含多个页的区间,其中,第一预设区间为该好区的起始页归属的预设区间。In this embodiment and subsequent embodiments, a preset interval may be preset in the controller, or multiple preset intervals may be set. If multiple preset intervals are set, multiple preset numbers also exist, The preset number and the preset interval may be in one-to-one correspondence, where the preset interval is an interval including multiple pages, and the first preset interval is the preset interval to which the start page of the good area belongs.
本实施例中,控制器在获取到好区的起始页的第二起始页编号后,可以根据该第二起始页编号确定该好区的起始页归属的第一预设区间,进而获取与第一预设区间对应的第一预设编号,从而可以将该目标存储块的存储区间信息的起始页的编号更新为该第一预设编号,作为示例,例如第一预设区间包含编号为0001至0010的页,第一预设编号为0010,当好区的起始页的编号为0008时,控制器将目标存储块的存储区间信息的起始页的编号更新为0010。本申请中,只要好区的起始页的编号存在于某一预设区间的情况下,则将目标存储块的存储区间信息的起始页的编号均更新为与之对应的预设编号,也即将目标存储块的可用存储区间的起始位置限定为特定的取值,由于坏页出现的位置有特定的规律,可以按照统计规律设定可用存储区间的起始编号的预设取值集合,以使得可用存储区间的边缘是对齐的,从而降低了存储块的管理复杂度。In this embodiment, after acquiring the second start page number of the start page of the good area, the controller may determine the first preset interval to which the start page of the good area belongs according to the second start page number, Furthermore, a first preset number corresponding to the first preset interval is acquired, so that the number of the starting page of the storage interval information of the target storage block can be updated to the first preset number, as an example, for example, the first preset The section contains pages numbered 0001 to 0010, the first preset number is 0010, and when the number of the start page of the good area is 0008, the controller updates the number of the start page of the storage section information of the target memory block to 0010 . In this application, as long as the number of the start page of the good area exists in a preset interval, the number of the start page of the storage interval information of the target storage block is updated to the corresponding preset number, That is, the starting position of the available storage interval of the target storage block is limited to a specific value. Since the position of the bad page has a specific law, the preset value set of the starting number of the available storage interval can be set according to the statistical law , So that the edges of the available storage interval are aligned, thereby reducing the management complexity of the storage block.
应当理解,上述对第一预设区间、第一预设编号以及好区的起始页的编号的举例仅为方便理解本方案,具体编号的选择应按照实际统计规律灵活设定。It should be understood that the above examples of the numbers of the first preset interval, the first preset number, and the start page of the good area are only for the convenience of understanding the solution, and the selection of the specific number should be flexibly set according to the actual statistical law.
B、第一起始页编号更新为好区的起始页编号B. The first starting page number is updated to the starting page number of the good area
本实施例中,由于控制器可以通过更新该目标存储块的存储区间信息中的起始页编号来更新目标存储块的可用存储区间,因此,控制器可以在获取到好区的起始页的编号后,将目标存储块的存储区间信息中的第一起始页编号更新为该好区的起始页的编号,从而使得更新后的该目标存储块的存储区间信息指示该目标存储块的可用存储区间为该好区。本申请中,直接将目标存储块的可用存储区间更新为好区,避免了任何页的浪费,进一步减缓了冗余块的消耗,延长了存储设备的使用寿命。In this embodiment, since the controller can update the available storage interval of the target storage block by updating the starting page number in the storage interval information of the target storage block, the controller can obtain the After the numbering, the first starting page number in the storage interval information of the target storage block is updated to the number of the starting page of the good area, so that the updated storage interval information of the target storage block indicates the availability of the target storage block The storage area is the good area. In this application, the available storage interval of the target storage block is directly updated to a good area, which avoids the waste of any pages, further slows down the consumption of redundant blocks, and extends the service life of the storage device.
204、控制器以该好区中排序位置位于最上的一个页作为起始位置,写入至少一个页的随机数据,以形成隔离区。204. The controller writes at least one page of random data with the page at the top of the sorted position in the good area as a starting position to form an isolation area.
本实施例中,控制器在根据该一个坏页确定好区后,可以在该好区内设置隔离区,以将该好区划分为隔离区和用户数据区,其中,参见图3a和图3b该隔离区包含至少一个页的随机数据,位于该至少一个坏页和该用户数据区之间,该用户数据区用于存储有效数据。其中,图3a展示的为目标存储块中首次出现坏页,且该一个坏页位于目标存储块的前半部分时,该一个坏页、隔离区和用户数据区的分布情况;图3b展示的为目标存储块中非首次出现坏页,且该一个坏页位于目标存储块的前半部分时,该一个坏页、隔离区和用户数据 区的分布情况。In this embodiment, after determining a good area according to the one bad page, the controller may set an isolation area in the good area to divide the good area into an isolation area and a user data area, among which, see FIGS. 3a and 3b The isolation area contains at least one page of random data, located between the at least one bad page and the user data area, and the user data area is used to store valid data. Among them, Fig. 3a shows the distribution of the bad page, the isolation area and the user data area when the bad page first appears in the target storage block, and the bad page is located in the first half of the target storage block; Fig. 3b shows The distribution of the one bad page, the isolation area, and the user data area when the bad page does not appear for the first time in the target storage block, and the one bad page is located in the first half of the target storage block.
本实施例中,在该一个坏页的坏页编号指示该一个坏页的排序位置在该目标存储块的可用存储区间的前半部分的情况下,控制器可以该好区中排序位置位于最上的一个页作为起始位置,也即以该一个坏页的下一页为起始位置,写入至少一个页的随机数据,以形成隔离区。本申请中,由于不同页之间普遍存在编程干扰,而当存储块内出现坏页时,这种编程干扰可能进一步增大,当坏页在目标存储块的可用存储区间的前半部分时,以好区中排序位置位于最上的一个页作为起始页,写入至少一个页的随机数据,从而在坏页和用户数据区之间设置隔离区,可以阻断坏页对可用页的影响,从而提升可用存储区的可靠性。In this embodiment, in the case where the bad page number of the one bad page indicates that the sort position of the one bad page is in the first half of the available storage interval of the target storage block, the controller may place the sort position in the good area at the top One page is used as the starting position, that is, the next page of the one bad page is used as the starting position, and random data of at least one page is written to form an isolated area. In this application, due to the general existence of program interference between different pages, and when a bad page appears in the memory block, this program interference may further increase. When the bad page is in the first half of the available storage interval of the target memory block, the The top-ranked page in the good area is used as the starting page, and at least one page of random data is written, so that an isolation area is set between the bad page and the user data area, which can block the impact of the bad page on the available pages, thereby Improve the reliability of available storage areas.
本实施例中,控制器在确定好区后,可以对好区执行擦除操作,由于该一个坏页在目标存储块的可用存储区间的前半部分,在对好区执行擦除操作后,可以在该目标存储块接收到有效数据时,触发设置隔离区操作;也可以为在对好区执行擦除操作后,设置定时器,在达到定时器设置的时间后,触发设置隔离区操作;还可以通过其他方式触发设置隔离区操作,具体触发设置隔离区的方式,可根据实际情况灵活选择,此处不再一一列举。In this embodiment, after the controller determines the good area, it can perform the erase operation on the good area. Since the one bad page is in the first half of the available storage interval of the target memory block, after performing the erase operation on the good area, When the target memory block receives valid data, it triggers the operation of setting the isolation area; it can also set the timer after performing the erase operation on the good area, and triggers the operation of setting the isolation area after the time set by the timer; also The operation of setting the isolation zone can be triggered by other methods. The specific triggering method of setting the isolation zone can be flexibly selected according to the actual situation, and will not be enumerated here one by one.
本实施例及后续实施例中,随机数据是指由控制器随机生成的无效数据。In this embodiment and subsequent embodiments, the random data refers to invalid data randomly generated by the controller.
本实施例及后续实施例中,隔离区的页数可以根据闪存颗粒的颗粒类型确定,由于在物理层面,物理块或子物理块中包含的多个页在物理上展现为包含多个层(Layer),每层包含多个页,而在设置隔离区时,至少写入一层的随机数据,由于当闪存颗粒的类型不同时,则每层包含的页数不同,作为示例,例如当一层包含12页时,则隔离区的页数是12页的倍数;作为另一示例,当一层包含24页时,则隔离区的页数为24的倍数,应当理解,此处举例仅为方便理解本方案,具体隔离区的页数的设定应根据实际情况灵活选择,此处不做限定。In this embodiment and subsequent embodiments, the number of pages in the isolation area may be determined according to the particle type of the flash memory particles. Since at a physical level, multiple pages included in a physical block or sub-physical block are physically shown to include multiple layers ( Layer), each layer contains multiple pages, and when setting the isolation area, at least one layer of random data is written, because when the type of flash memory particles is different, the number of pages contained in each layer is different, as an example, for example, when a When the layer contains 12 pages, the number of pages in the isolation area is a multiple of 12 pages; as another example, when the layer contains 24 pages, the number of pages in the isolation area is a multiple of 24. It should be understood that the examples here are only To facilitate understanding of this solution, the number of pages in the specific isolation area should be flexibly selected according to the actual situation, which is not limited here.
应当理解,本实施例不限定步骤203与步骤204的关系,可以先执行步骤204,再执行步骤203;也可以先执行步骤203,再执行步骤204。It should be understood that the relationship between step 203 and step 204 is not limited in this embodiment. Step 204 may be executed first, and then step 203 may be executed; or step 203 may be executed first, and then step 204 is executed.
205、控制器获取该目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号之间的差值。205. The controller obtains the difference between the first start page number of the start page and the first end page number of the end page of the available storage interval of the target storage block.
本实施例中,控制器可以获取目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号,从而确定该第一起始页编号和该第一终止页编号之间的差值。In this embodiment, the controller may acquire the first start page number and the first end page number of the start page of the available storage interval of the target memory block, thereby determining the first start page number and the first end page The difference between the numbers.
206、在该差值达到预设阈值的情况下,控制器将该目标存储块标记为不可用存储块。206. When the difference reaches a preset threshold, the controller marks the target memory block as an unusable memory block.
本实施例中,控制器中可以预先存储有该差值的阈值,从而在确定第一起始页编号和该第一终止页编号之间的差值后,判断该差值是否达到预设阈值,在达到或低于预设阈值的情况,可以将存储块标记为不可用存储块;也可以为主机中预先存储有该差值的阈值,控制器在确定第一起始页编号和该第一终止页编号之间的差值后,将该差值发送至主机,由主机判断该差值是否达到该预设阈值,在达到或低于预设阈值的情况,由控制器将该存储块标记为不可用存储块。本申请中,在可用存储区间的页数低于预设阈值时,将该可用存储区间所在的存储块标记为坏块,从而不再管理该存储块,从而降低控制器对存储块的管理复杂度。In this embodiment, the threshold of the difference may be stored in the controller in advance, so that after determining the difference between the first start page number and the first end page number, it is determined whether the difference reaches the preset threshold, When the preset threshold is reached or below, the memory block may be marked as an unusable memory block; or a threshold value with the difference value pre-stored in the host, the controller is determining the first start page number and the first end After the difference between the page numbers, the difference is sent to the host, and the host determines whether the difference reaches the preset threshold, and when the preset threshold is reached or below, the controller marks the storage block as Unavailable memory block. In this application, when the number of pages in the available storage interval is lower than the preset threshold, the storage block where the available storage interval is located is marked as a bad block, so that the storage block is no longer managed, thereby reducing the complexity of the management of the storage block by the controller degree.
应当理解,步骤205和206为可选步骤,若执行步骤205和206,则不限定步骤205 和206与步骤204的关系,可以先执行步骤204,再执行步骤205和206;也可以先执行步骤205和206,再执行步骤204,若不执行步骤205和206,可以在执行完步骤204后,进入步骤207。It should be understood that steps 205 and 206 are optional steps. If steps 205 and 206 are executed, the relationship between steps 205 and 206 and step 204 is not limited. Step 204 can be executed first, and then steps 205 and 206 can be executed; steps can also be executed first 205 and 206, and then execute step 204. If steps 205 and 206 are not executed, step 207 can be entered after step 204 is executed.
本实施例中,In this embodiment,
207、控制器执行其他程序。207. The controller executes other programs.
2、该一个坏页在可用存储区间的后半部分2. The bad page is in the second half of the available storage interval
具体参阅图4,本申请实施例中,存储块处理方法的另一个实施例可以包括:Referring specifically to FIG. 4, in the embodiment of the present application, another embodiment of the storage block processing method may include:
401、当控制器检测到目标存储块中存在一个坏页时,获取该一个坏页的坏页编号。401. When the controller detects that there is a bad page in the target storage block, obtain the bad page number of the one bad page.
本实施例中,步骤401与图2所描述的实施例中步骤201类似,此处不再赘述。In this embodiment, step 401 is similar to step 201 in the embodiment described in FIG. 2 and will not be repeated here.
402、控制器获取该目标存储块的可用存储区间内该一个坏页的下一页的编号。402. The controller obtains the number of the next page of the one bad page in the available storage interval of the target storage block.
本实施例中,由于该一个坏页发生在目标存储块的目标存储块的可用存储区间内,且该一个坏页的坏页编号指示该一个坏页的排序位置在该目标存储块的可用存储区间的后半部分的情况下,控制器可以获取该目标存储块的可用存储区间内该一个坏页的上一页的编号,从而将该目标存储块的可用存储区间的起始页至该一个坏页的上一页至包含的多个页确定为好区,该好区为该目标存储块的可用存储区间中连续且不存在该坏页的最大存储区间。作为示例,例如目标存储块的可用存储区间起始页的编号为0006,该一个坏页的编号为0998,则该一个坏页的上一页的编号可以为0997,则好区为编号为0006至编号为0997之间包含的多个页;作为另一示例,例如目标存储块的可用存储区间终止页的编号为F0006,该一个坏页的编号为F0998,则该一个坏页的上一页的编号可以为F0997,则好区为编号为F0006至编号为F0997之间包含的多个页应当理解,此处举例,仅为方便理解,对于任何一页的编号的取值,不做限定。In this embodiment, since the one bad page occurs in the available storage interval of the target storage block of the target storage block, and the bad page number of the one bad page indicates that the sort position of the one bad page is available for storage in the target storage block In the case of the second half of the interval, the controller may obtain the number of the previous page of the one bad page in the available storage interval of the target memory block, so as to change the start page of the available storage interval of the target memory block to the one From the previous page of the bad page to the included pages are determined as good areas, and the good area is the largest storage area that is continuous among the available storage intervals of the target memory block without the bad page. As an example, for example, the number of the starting page of the available storage interval of the target memory block is 0006, the number of the one bad page is 0998, the number of the previous page of the one bad page may be 0997, and the number of the good area is 0006 Multiple pages included in the number 0997; as another example, for example, the end page of the available storage interval of the target memory block is F0006, and the number of the one bad page is F0998, then the previous page of the one bad page The number can be F0997, then the good area is the number of pages contained between F0006 and F0997. It should be understood that the examples here are for convenience only, and the value of any page number is not limited.
作为一种实现方式,由于该一个坏页的坏页编号可以指示与该一个坏页在目标存储块包含的多个页中的排序位置,控制器根据该一个坏页的坏页编号确定该一个坏页在该目标存储块的可用存储区间的前半部分的方式可以为获取目标存储块的可用存储区间的起始页的编号和终止页的编号,并进而判断该一个坏页是否存在于目标存储块的可用存储区间的后半部分。As an implementation manner, since the bad page number of the one bad page can indicate the sort position of the one bad page among the multiple pages included in the target storage block, the controller determines the one according to the bad page number of the one bad page The way that the bad page is in the first half of the available storage interval of the target storage block may be to obtain the number of the start page and the number of the end page of the available storage interval of the target storage block, and then determine whether the bad page exists in the target storage The second half of the block's available storage interval.
若目标存储块的可用存储区间的起始页的编号、终止页的编号和该一个坏页的坏页编号均为数字形式的页码,则当目标存储块中发生该一个坏页,获取该一个坏页的页码PageX,目标存储块的可用存储区间的起始页的页码为PageSt,终止页的页码为PageEd,,若2PageX>PageSt+PageEd,也即该一个坏页的页码超过了起始页的页码和终止页的页码的平均值,则该一个坏页的页码指示该一个坏页在目标存储块的可用存储区间的后半部分,应当理解,此处对编号的举例,仅为方便理解本方案,具体对编号的选择,应当结合实际情况,灵活设定。If the start page number, end page number, and the bad page number of a bad page in the available storage interval of the target memory block are all page numbers in the form of numbers, then when the bad page occurs in the target memory block, the one The page number of the bad page is PageX, the page number of the start page of the available storage area of the target memory block is PageSt, and the page number of the end page is PageEd, if 2PageX> PageSt + PageEd, that is, the page number of the bad page exceeds the start page The average of the page number of the page and the page number of the end page, then the page number of the bad page indicates that the bad page is in the second half of the available storage interval of the target storage block. It should be understood that the examples of the numbers here are for convenience only. This plan, the specific choice of number, should be flexibly set according to the actual situation.
若目标存储块的可用存储区间的起始页的编号、终止页的编号和该一个坏页的坏页编号均包含数字和/或字母和/或其他类型的信息,则可以根据目标存储块的可用存储区间的起始页的编号和终止页的编号确定中间页的编号,当目标存储块的可用存储区间内存在奇数页时,则中间页为一个,若该一个坏页超过该中间页,则确定该一个坏页位于目标存储 块的可用存储区间的后半部分;当目标存储块的可用存储区间内存在偶数页时,则中间页为两个,若该一个坏页超过该两个中间页的第一页,则确定该一个坏页位于目标存储块的可用存储区间的后半部分。If the start page number, end page number, and the bad page number of a bad page of the available storage interval of the target memory block all contain numbers and / or letters and / or other types of information, then the The number of the start page and the end page of the available storage interval determine the number of the intermediate page. When there are odd pages in the available storage interval of the target storage block, there is one intermediate page. If the bad page exceeds the intermediate page, It is determined that the one bad page is located in the second half of the available storage interval of the target storage block; when there are even pages in the available storage interval of the target storage block, there are two intermediate pages, if the one bad page exceeds the two intermediate pages The first page of the page determines that the one bad page is in the second half of the available storage interval of the target storage block.
作为另一种实现方式,控制器也可以在确定该一个坏页的位置后,以该一个坏页为分隔页,分别获取目标存储块的可用存储区间内位于该一个坏页前面的页数和位于该一个坏页后面的页数,若位于该一个坏页前面的页数小于位于该一个坏页后面的页数,则可以确定该一个坏页存在于目标存储块的可用存储区间的后半部分。应当理解,控制器还可以通过其他方式确定该一个坏页是否存在于目标存储块的可用存储区间的后半部分,具体应结合实际情况灵活设定。As another implementation manner, after determining the location of the one bad page, the controller may also use the one bad page as a separation page to respectively obtain the number of pages in front of the one bad page in the available storage interval of the target storage block and The number of pages behind the one bad page, if the number of pages before the one bad page is less than the number of pages behind the one bad page, it can be determined that the one bad page exists in the second half of the available storage interval of the target storage block section. It should be understood that the controller may also determine whether the one bad page exists in the second half of the available storage interval of the target storage block through other methods, which should be flexibly set according to actual conditions.
403、控制器更新该目标存储块的存储区间信息的终止页的第一终止页编号。403. The controller updates the first termination page number of the termination page of the storage interval information of the target storage block.
本实施例中,控制器在确定好区后,可以根据好区的终止页的第二终止页编号获取到第二预设编号后,从而将目标存储块的存储区间信息的起始页的二终止页编号更新为该第二预设编号;也可以将目标存储块的存储区间信息的终止页的第二终止页编号更新为该第一终止页编号,下面分别对上述两种情况进行详细说明。In this embodiment, after determining the good area, the controller may obtain the second preset number according to the second end page number of the end page of the good area, so that the second page of the start page of the storage interval information of the target storage block The end page number is updated to the second preset number; the second end page number of the end page of the storage interval information of the target storage block may also be updated to the first end page number, and the above two cases will be described in detail below .
a、第一终止页编号更新为第二预设编号a. The first termination page number is updated to the second preset number
本实施例中,在该好区的终止页的第二终止页编号存在于第二预设区间的情况下,获取第二预设编号,其中,该第二预设区间中包含多个页,该第二预设编号为该第二预设区间的上一页的编号;控制器将该第一终止页编号更新为该第二预设编号。In this embodiment, when the second end page number of the end page of the good area exists in the second preset interval, the second preset number is obtained, where the second preset interval includes multiple pages, The second preset number is the number of the previous page of the second preset interval; the controller updates the first end page number to the second preset number.
本实施例及后续实施例中,控制器中可以预先设定有一个预设区间,也可以设定多个预设区间,若设定多个预设区间,则也存在多个预设编号,预设编号与预设区间可以一一对应,其中预设区间为包含多个页的区间,其中,第二预设区间为该好区的终止页归属的预设区间。In this embodiment and subsequent embodiments, a preset interval may be preset in the controller, or multiple preset intervals may be set. If multiple preset intervals are set, multiple preset numbers also exist, The preset number and the preset interval may be in one-to-one correspondence, where the preset interval is an interval including multiple pages, and the second preset interval is a preset interval to which the end page of the good area belongs.
本实施例中,控制器在获取到好区的终止页的第二终止页编号后,可以根据该第二终止页编号确定该好区的终止页归属的第二预设区间,进而获取与第二预设区间对应的第二预设编号,从而可以将该目标存储块的存储区间信息的终止页的第一终止页编号更新为该第二预设编号。作为示例,例如第一预设区间包含编号为0990至1000的页,第一预设编号为0990,当好区的终止页的编号为0998时,控制器将目标存储块的存储区间信息的终止页的编号更新为0990。应当理解,上述对第二预设区间、第二预设编号以及好区的终止页的编号的举例仅为方便理解本方案,具体编号的选择应按照实际统计规律灵活设定。In this embodiment, after acquiring the second end page number of the end page of the good area, the controller may determine the second preset interval to which the end page of the good area belongs according to the second end page number, and then acquire the The second preset number corresponding to the two preset intervals, so that the first end page number of the end page of the storage interval information of the target storage block can be updated to the second preset number. As an example, for example, the first preset interval contains pages numbered 0990 to 1000, the first preset number is 0990, and when the number of the end page of the good area is 0998, the controller terminates the storage interval information of the target memory block The page number is updated to 0990. It should be understood that the above examples of the number of the second preset interval, the second preset number, and the end page of the good area are only for the convenience of understanding the solution, and the selection of the specific number should be flexibly set according to the actual statistical law.
b、第一终止页编号更新为第一终止页编号b. The first termination page number is updated to the first termination page number
本实施例中,控制器可以在获取到好区的终止页的第二终止页编号后,将目标存储块的存储区间信息中的终止页的第一终止页编号更新为该第二终止页编号,从而使得更新后的该目标存储块的存储区间信息指示该目标存储块的可用存储区间为该好区。In this embodiment, after acquiring the second end page number of the end page of the good area, the controller may update the first end page number of the end page in the storage interval information of the target storage block to the second end page number , So that the updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area.
404、控制器以用户数据区的下一页为起始位置,写入该至少一个页的随机数据。404. The controller writes the random data of the at least one page with the next page of the user data area as a starting position.
本实施例中,控制器在根据该一个坏页确定好区后,可以在该好区内设置隔离区,以将该好区划分为隔离区和用户数据区,参见图5a和图5b,该隔离区包含至少一个页的随机数据,位于该一个坏页和该用户数据区之间,该用户数据区用于存储有效数据。其中, 图5a展示的为目标存储块中首次出现坏页,且该一个坏页位于目标存储块的后半部分时,该一个坏页、隔离区和用户数据区的分布情况;图5b展示的为目标存储块中非首次出现坏页,且该一个坏页位于目标存储块的后半部分时,该一个坏页、隔离区和用户数据区的分布情况。In this embodiment, after determining a good area according to the one bad page, the controller may set an isolation area in the good area to divide the good area into an isolation area and a user data area. See FIGS. 5a and 5b. The quarantine area contains at least one page of random data, located between the one bad page and the user data area, and the user data area is used to store valid data. Among them, Figure 5a shows the distribution of the bad page, the isolation area and the user data area when the bad page first appears in the target storage block, and the bad page is located in the second half of the target storage block; Figure 5b shows It is the distribution of the one bad page, the isolation area and the user data area when the bad page does not appear for the first time in the target storage block and the one bad page is located in the second half of the target storage block.
本实施例中,在该一个坏页的坏页编号指示该一个坏页的排序位置在该目标存储块的可用存储区间的后半部分的情况下,参见图6,控制器在将有效数据写入用户数据区后,可以判断写入的有效数据是否已经占满该用户数据区,若已占满该用户数据区,以该用户数据区的下一页为起始位置,写入该至少一个页的随机数据,以形成该隔离区。In this embodiment, when the bad page number of the one bad page indicates that the sort position of the one bad page is in the second half of the available storage interval of the target memory block, referring to FIG. 6, the controller writes valid data After entering the user data area, it can be determined whether the written valid data has occupied the user data area. If the user data area has been filled, the next page of the user data area is used as the starting position to write the at least one Random data of the page to form the isolated area.
本实施例中,由于该一个坏页在目标存储块的可用存储区间的后半部分,而存储块中按照页的排列顺序依次写入数据,因此,判断写入的有效数据是否占满用户数据区的方式可以为在确定隔离区的页数后,根据好区的终止页的编号和隔离区的页数确定用户数据区的终止页的编号,控制器可以在每次在目标存储块中执行写操作后,获取已写入有效数据的页的最后一页的编号,通过判断最后一页的编号是否达到用户数据区的终止页的编号,从而判断写入的有效数据是否已占满用户数据区。作为示例,例如好区的终止页的编号为0990,隔离区的页数为12页,则用户数据区的终止页的编号为0978,若已写入有效数据的页的最后一页的编号为0920,则未占满该用户数据区,应当理解,此处对编号的举例仅为方便理解,不具有限定意义。In this embodiment, since the one bad page is in the second half of the available storage interval of the target storage block, and the storage block writes data in order according to the order of the pages, it is determined whether the written valid data is full of user data The method of the area may be: after determining the number of pages in the isolation area, determine the number of the end page of the user data area according to the number of the end page of the good area and the number of pages in the isolation area, and the controller may execute each time in the target storage block After the write operation, obtain the number of the last page of the page where valid data has been written, and determine whether the number of valid data written has occupied the user data by judging whether the number of the last page reaches the number of the end page of the user data area Area. As an example, for example, the number of the end page of the good area is 0990, and the number of pages in the quarantine area is 12, the number of the end page of the user data area is 0978. If the number of the last page of the page where valid data has been written is 0920, the user data area is not occupied. It should be understood that the example of numbering here is only for convenience of understanding and has no limiting meaning.
405、控制器获取目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号之间的差值。405. The controller obtains the difference between the first start page number and the first end page number of the start page of the available storage interval of the target storage block.
406、在该差值达到预设阈值的情况下,控制器将该目标存储块标记为不可用存储块。406. When the difference reaches a preset threshold, the controller marks the target memory block as an unusable memory block.
407、控制器执行其他程序。407. The controller executes other programs.
本实施例中,步骤405至407与图2所描述的实施例中步骤205至207类似,此处不再赘述。In this embodiment, steps 405 to 407 are similar to steps 205 to 207 in the embodiment described in FIG. 2 and will not be repeated here.
二、至少一个坏页中有至少两个坏页2. There are at least two bad pages in at least one bad page
本实施例中,当控制器检测到目标存储块中存在至少两个坏页时,可以根据与该至少两个坏页一一对应的至少两个坏页位置,对该目标存储块的可用存储区间进行划分,以确定好区。控制器可以逐页处理该至少两个坏页;也可以根据该至少两个坏页位置确定边缘坏页,其中该边缘坏页为该至少两个坏页中位置位于最上或位置位于最下的一个坏页,进而以该边缘坏页为分隔页的位置,对目标存储块的可用存储区间进行划分,以确定好区。In this embodiment, when the controller detects that there are at least two bad pages in the target storage block, it may use the available storage for the target storage block according to at least two bad page positions corresponding to the at least two bad pages The interval is divided to determine the good area. The controller can process the at least two bad pages page by page; it can also determine an edge bad page according to the position of the at least two bad pages, where the edge bad page is the top position or the bottom position of the at least two bad pages A bad page, and then using the edge bad page as the position of the separation page, divide the available storage interval of the target storage block to determine the good area.
(1)控制器逐页处理该至少两个坏页具体参阅图7,本申请实施例中,存储块处理方法的另一个实施例可以包括:(1) The controller processes the at least two bad pages page by page. Refer specifically to FIG. 7. In the embodiment of the present application, another embodiment of the storage block processing method may include:
701、当控制器检测到目标存储块中存在至少两个坏页时,获取与该至少两个坏页一一对应的至少两个坏页位置。701. When the controller detects that there are at least two bad pages in the target storage block, acquire at least two bad page positions corresponding to the at least two bad pages.
702、控制器判断目标坏页是否存在于该目标存储块的可用存储区间,若是,则进入步骤703;若否,则进入步骤812。702. The controller determines whether the target bad page exists in the available storage interval of the target storage block. If yes, step 703 is entered; if not, step 812 is entered.
本实施例中,当控制器检测到目标存储块中存在至少两个坏页时,控制器可以获取与该至少两个坏页一一对应的至少两个坏页位置,该至少两个坏页位置中包含与目标坏页对 应的目标坏页位置,该目标坏页为该至少两个坏页中的任一坏页,从而该控制器可以获取该目标坏页位置。其中,目标坏页位置可以为与该目标坏页对应的目标坏页编号。In this embodiment, when the controller detects that there are at least two bad pages in the target storage block, the controller may obtain at least two bad page positions corresponding to the at least two bad pages, the at least two bad pages The location includes a target bad page location corresponding to the target bad page, and the target bad page is any one of the at least two bad pages, so that the controller can obtain the target bad page location. The target bad page position may be the target bad page number corresponding to the target bad page.
本实施例中,由于控制器先获取包含该目标坏页的至少两个坏页,再逐个处理该至少两个坏页,则该至少两个坏页中可以存在不存在于该目标存储块的可用存储区间的坏页,作为示例,例如,控制器检测到三个坏页,第一个坏页的坏页编号为0012,第二个坏页的坏页编号为0008,第一个坏页的坏页编号为0016,则控制器在处理完第一个坏页之后,该目标存储块的可用存储区间的起始页编号为0012之后,当处理第二个坏页时,则第二个坏页不存在于目标存储块的可用存储区间内了,应当理解,此处对三个坏页的举例,仅为方便理解,具体坏页的编号,应按照实际情况灵活设定,此处不进行限定。In this embodiment, since the controller first obtains at least two bad pages containing the target bad page, and then processes the at least two bad pages one by one, there may be one that does not exist in the target storage block among the at least two bad pages The bad pages of the available storage area, as an example, for example, the controller detects three bad pages, the bad page number of the first bad page is 0012, the bad page number of the second bad page is 0008, the first bad page The bad page number is 0016, after the controller processes the first bad page, the starting page number of the available storage interval of the target memory block is 0012, when the second bad page is processed, the second The bad page does not exist in the available storage interval of the target storage block. It should be understood that the examples of the three bad pages here are only for easy understanding. The specific bad page number should be flexibly set according to the actual situation. Be limited.
本实施例中,控制器在获取到目标坏页位置后,在根据该目标坏页位置确定该目标坏页存在于目标存储块的可用存储区间的情况下,以该目标坏页位置作为分隔页的位置对该目标存储块的可用存储区间进行划分,以确定好区。也即,控制器可以根据该目标坏页编号判断该目标坏页是否存在于该目标存储块的可用存储区间,若是,则进入步骤703;若否,则进入步骤812。In this embodiment, after obtaining the target bad page position, the controller uses the target bad page position as the separation page when determining that the target bad page exists in the available storage section of the target storage block according to the target bad page position The location of the target memory block is divided to determine the good area. That is, the controller may determine whether the target bad page exists in the available storage interval of the target storage block according to the target bad page number. If yes, go to step 703; if no, go to step 812.
703、控制器判断该目标坏页是否存在于该目标存储块的可用存储区间的前半部分,若存在于前半部分,则进入步骤704;若不存在于前半部分,则进入步骤707。703. The controller judges whether the target bad page exists in the first half of the available storage interval of the target storage block. If it exists in the first half, it proceeds to step 704; if it does not exist in the first half, it proceeds to step 707.
本实施例中,控制器在获取到目标坏页的页码之后,可以根据该目标坏页的页码判断该目标坏页是否存在于该目标存储块的可用存储区间的前半部分,根据该目标坏页的页码判断该目标坏页是否存在于该目标存储块的可用存储区间的具体实现方式可以参见图2所描述的实施例中步骤202,其中提供了如何根据一个坏页的坏页编号来确定该坏页是否存在于目标存储块的可用存储区间的前半部分,虽然本实施例中的判断对应是目标坏页,但目标坏页也是该至少两个坏页中的任意一个坏页,因此,具体实现方式与步骤202中的如何根据一个坏页的坏页编号来确定该坏页是否存在于目标存储块的可用存储区间的前半部分的实现方式类似,此处不再赘述。In this embodiment, after acquiring the page number of the target bad page, the controller may determine whether the target bad page exists in the first half of the available storage interval of the target storage block according to the page number of the target bad page, and according to the target bad page To determine whether the target bad page exists in the available storage interval of the target storage block, please refer to step 202 in the embodiment described in FIG. 2, which provides how to determine the target page based on the bad page number of a bad page. Whether the bad page exists in the first half of the available storage interval of the target storage block. Although the judgment in this embodiment corresponds to the target bad page, the target bad page is also any one of the at least two bad pages. Therefore, specific The implementation manner is similar to how to determine whether a bad page exists in the first half of the available storage interval of the target storage block according to the bad page number of the bad page in step 202, and details are not described here.
704、控制器获取目标存储块的可用存储区间内该目标坏页的下一页的编号。704. The controller obtains the number of the next page of the target bad page in the available storage interval of the target storage block.
705、控制器更新该目标存储块的存储信息的起始页的第一起始页编号。705. The controller updates the first start page number of the start page of the storage information of the target storage block.
706、控制器以该好区中排序位置位于最上的一个页作为起始位置,写入至少一个页的随机数据,以形成隔离区。706. The controller writes at least one page of random data using the page with the highest sorting position in the good area as a starting position to form an isolation area.
本实施例中,步骤704至步骤706与图2所描述的实施例中步骤202至204类似,区别在于步骤202至204是根据一个坏页的坏页编号执行相应操作,本实施例中是根据目标坏页的坏页编号执行相应操作,此处不再赘述。In this embodiment, steps 704 to 706 are similar to steps 202 to 204 in the embodiment described in FIG. 2, the difference is that steps 202 to 204 perform corresponding operations according to a bad page number of a bad page, and in this embodiment are based on Perform the corresponding operation on the bad page number of the target bad page, which will not be repeated here.
707、控制器获取目标存储块的可用存储区间内该目标坏页的上一页的编号。707. The controller obtains the number of the previous page of the target bad page in the available storage interval of the target storage block.
708、控制器更新该目标存储块的存储信息的终止页的第一终止页编号。708. The controller updates the first termination page number of the termination page of the storage information of the target storage block.
709、控制器以用户数据区的下一页为起始位置,写入该至少一个页的随机数据。709. The controller writes the random data of the at least one page with the next page of the user data area as a starting position.
本实施例中,步骤707至步骤709与图4所描述的实施例中步骤402至404类似,区别在于步骤402至404是根据一个坏页的坏页编号执行相应操作,本实施例中是根据目标坏页的坏页编号执行相应操作,此处不再赘述。In this embodiment, steps 707 to 709 are similar to steps 402 to 404 in the embodiment described in FIG. 4, the difference is that steps 402 to 404 perform corresponding operations according to a bad page number of a bad page. In this embodiment, it is based on Perform the corresponding operation on the bad page number of the target bad page, which will not be repeated here.
710、控制器获取该目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号之间的差值。710. The controller obtains the difference between the first start page number and the first end page number of the start page of the available storage interval of the target storage block.
711、在该差值达到预设阈值的情况下,控制器将该目标存储块标记为不可用存储块。711. When the difference reaches a preset threshold, the controller marks the target memory block as an unusable memory block.
本实施例中,步骤810和步骤811与图2所描述的实施例中步骤205和206类似,此处不再赘述。In this embodiment, steps 810 and 811 are similar to steps 205 and 206 in the embodiment described in FIG. 2 and will not be repeated here.
712、控制器执行其他程序。712. The controller executes other programs.
本实施例中,控制器在获取与目标坏页对应的目标坏页位置后,在该目标坏页位置指示该目标坏页存在于该目标存储块的不可用存储区间的情况下,不获取该好区,且不更新目标存储块的存储区间信息。In this embodiment, after acquiring the target bad page position corresponding to the target bad page, the controller does not acquire the target bad page in the case that the target bad page exists in the unavailable storage section of the target storage block. Good area, and the storage interval information of the target storage block is not updated.
本实施例中,当控制器检测到目标存储块中存在坏页时,可以获取该坏页的编号,并获取控制器记录的目标存储块的起始页的编号和终止页的编号的方式来记录每个存储块的可用存储区间,若该坏页的编号不在该起始页的编号和终止页的编号之间,则确定该坏页发生在目标存储块的不可用存储区间内,因此,该坏页的存在不会对目标存储块的可用存储区间产生影响,从而控制器可以不获取该好区,并且可以不更新目标存储块的存储区间信息。本申请中,当坏页发生在目标存储块的不可用存储区间时,由于不会对目标存储块的可用存储区间产生影响,则不再执行重新划分可用存储区间的操作,避免了控制器处理资源的浪费,且降低了存储块管理的复杂度。In this embodiment, when the controller detects that there is a bad page in the target memory block, it can obtain the number of the bad page, and obtain the number of the start page and the end page of the target memory block recorded by the controller. Record the available storage interval of each memory block. If the number of the bad page is not between the number of the start page and the number of the end page, it is determined that the bad page occurs in the unusable storage interval of the target memory block. Therefore, The existence of the bad page does not affect the available storage interval of the target storage block, so that the controller may not acquire the good area, and may not update the storage interval information of the target storage block. In this application, when a bad page occurs in the unavailable storage interval of the target storage block, since it will not affect the available storage interval of the target storage block, the operation of re-dividing the available storage interval is no longer performed, avoiding controller processing The waste of resources, and reduces the complexity of storage block management.
应当理解,由于控制端检测到至少两个坏页,则控制端可以重复执行步骤702至812以逐页处理完该至少两个坏页。It should be understood that, since the control terminal detects at least two bad pages, the control terminal may repeatedly perform steps 702 to 812 to process the at least two bad pages page by page.
(2)控制器处理该至少两个坏页中的边缘坏页(2) The controller processes the marginal bad page among the at least two bad pages
具体参阅图8,本申请实施例中,存储块处理方法的另一个实施例可以包括:Referring specifically to FIG. 8, in the embodiment of the present application, another embodiment of the storage block processing method may include:
本实施例中,步骤801与图7所描述的实施例中步骤701类似,步骤803至811与图7所描述的实施例中步骤704至712类似,区别仅在于本实施例中是根据边缘坏页的坏页编号执行相应操作,图7所描述的实施例中是根据目标坏页的坏页编号执行相应操作,此处不再赘述。In this embodiment, step 801 is similar to step 701 in the embodiment described in FIG. 7, and steps 803 to 811 are similar to steps 704 to 712 in the embodiment described in FIG. 7, the only difference is that this embodiment is based on the bad edge The corresponding operation is performed on the bad page number of the page. In the embodiment described in FIG. 7, the corresponding operation is performed according to the bad page number of the target bad page, which will not be repeated here.
相比于图7所描述的实施例,本实施例还包括:Compared with the embodiment described in FIG. 7, this embodiment further includes:
802、控制器获取与边缘坏页对应的边缘坏页位置。802. The controller obtains the position of the edge bad page corresponding to the edge bad page.
本实施例中,控制器在获取到与该至少两个坏页一一对应的至少两个坏页位置后,由于该至少两个坏页位置中包含与该至少两个坏页一一对应的至少两个坏页编号,则控制器可以根据该至少两个坏页编号,确定边缘坏页,该边缘坏页为该至少两个坏页中排序位置位于最上或排序位置位于最下的一个坏页。In this embodiment, after the controller obtains at least two bad page positions corresponding to the at least two bad pages one by one, because the at least two bad page positions include one to one corresponding to the at least two bad pages At least two bad page numbers, the controller may determine an edge bad page according to the at least two bad page numbers, and the edge bad page is a bad position in which the sort position is at the top or the sort position is at the bottom in the at least two bad pages page.
作为一种情况下,在根据该至少两个坏页编号确定该至少两个坏页的排序位置均在该目标存储块的可用存储区间的前半部分的情况下,可以获取该至少两个坏页中排序位置位于最下的一个坏页的坏页位置作为边缘坏页位置,并进入步骤803。As a case, when it is determined according to the at least two bad page numbers that the sort positions of the at least two bad pages are all in the first half of the available storage interval of the target storage block, the at least two bad pages may be acquired The bad page position of the bad page with the middle sort position at the bottom is taken as the edge bad page position, and step 803 is entered.
作为另一种情况下,在根据该至少两个坏页编号确定该至少两个坏页的排序位置均在该目标存储块的可用存储区间的后半部分的情况下,可以获取该至少两个坏页中排序位置位于最上的一个坏页的坏页位置作为边缘坏页位置,并进入步骤806。As another case, when it is determined according to the at least two bad page numbers that the sort positions of the at least two bad pages are both in the second half of the available storage interval of the target storage block, the at least two The bad page position of the bad page with the sort position at the top of the bad page is taken as the edge bad page position, and step 806 is entered.
本实施例中,当该至少一个坏页中有至少两个坏页时,控制器可以获取该至少两个坏页中的边缘坏页,从而仅根据该边缘坏页对该目标存储块的可用存储区间进行划分,避免了逐页处理该至少两个坏页时的重复操作,提高了坏页处理的效率。In this embodiment, when there are at least two bad pages in the at least one bad page, the controller may obtain the edge bad pages in the at least two bad pages, so that only the edge bad pages are available to the target storage block The storage interval is divided to avoid repeated operations when processing the at least two bad pages page by page, thereby improving the efficiency of processing the bad pages.
图9是本申请实施例提供的控制器的一种结构示意图,该控制器应用于存储设备,该控制器应用于存储设备,该存储设备包含该控制器和存储器,该存储器包含多个存储块,该存储块包含多个页,该控制器中包含每个存储块的存储区间信息,该存储区间信息用于确定存储块的可用存储区间,该控制器包括:9 is a schematic structural diagram of a controller provided by an embodiment of the present application. The controller is applied to a storage device, and the controller is applied to a storage device. The storage device includes the controller and the memory, and the memory includes multiple storage blocks. The storage block contains multiple pages, and the controller contains storage interval information for each storage block. The storage interval information is used to determine the available storage interval of the storage block. The controller includes:
获取单元901,用于当检测到目标存储块中存在至少一个坏页时,获取与该至少一个坏页一一对应的至少一个坏页该坏页的位置;The obtaining unit 901 is configured to obtain the position of at least one bad page corresponding to the at least one bad page when it is detected that at least one bad page exists in the target storage block;
确定单元902,用于根据该至少一个坏页的位置,确定好区;其中,该好区为该目标存储块的可用存储区间中连续且不存在该坏页的最大存储区间;The determining unit 902 is configured to determine a good area according to the position of the at least one bad page; wherein, the good area is the largest storage area that is continuous among the available storage intervals of the target storage block and does not exist the bad page;
更新单元903,用于更新该目标存储块的存储区间信息,其中,更新后的该目标存储块的存储区间信息指示该目标存储块的可用存储区间为该好区。The updating unit 903 is configured to update the storage interval information of the target storage block, wherein the updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area.
本实施例中,控制器中各元件执行的流程与前述图2至图8所示实施例中控制器所执行的流程类似,此处不再赘述。In this embodiment, the process performed by each component in the controller is similar to the process performed by the controller in the foregoing embodiments shown in FIGS. 2 to 8, and details are not described herein again.
本实施例中,当目标存储块中出现坏页时,可以根据坏页的位置将存储块的目标存储块的可用存储区间进行划分,从而确定单元902将该目标存储块的可用存储区间中不包含该坏页的最大连续区间确定为好区,进而由更新单元903根据该好区更新该存储块的可用存储区间,避免了直接将该整个存储块标记为坏块,减缓了冗余块的消耗,延长了固态硬盘的使用寿命,而且,由于冗余块的消耗减少,也避免了写放大系数的增加,进一步延长了固态硬盘的使用寿命;此外,本申请还可以适用于其他包含存储块的存储设备,从而延长了存储设备的使用寿命。In this embodiment, when a bad page appears in the target storage block, the available storage interval of the target storage block of the storage block may be divided according to the position of the bad page, so that the determining unit 902 does not identify the available storage interval of the target storage block. The maximum continuous interval containing the bad page is determined as a good area, and then the update unit 903 updates the available storage interval of the storage block according to the good area, avoiding directly marking the entire storage block as a bad block, and slowing down the redundant block Consumption, prolongs the service life of the solid state drive, and because the consumption of redundant blocks is reduced, the increase of the write amplification factor is also avoided, and the service life of the solid state drive is further extended; in addition, the application can also be applied to other storage blocks Storage devices, thereby extending the life of storage devices.
有一种可能的实现方式中,该至少一个坏页为一个坏页;In a possible implementation manner, the at least one bad page is a bad page;
该确定单元902,具体用于:以该一个坏页的坏页位置作为分隔页的位置对该目标存储块的可用存储区间进行划分,以确定好区。The determining unit 902 is specifically configured to divide the available storage interval of the target storage block by using the position of the bad page of the one bad page as the position of the separation page to determine the good area.
有一种可能的实现方式中,该一个坏页的坏页位置包含该一个坏页的坏页编号,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的起始页的第一起始页编号,该一个坏页的坏页编号和该第一起始页编号分别用于确定该一个坏页和该目标存储块的可用存储区间的起始页在该目标存储块包含的多个页中的排序位置;In a possible implementation manner, the bad page position of the one bad page includes the bad page number of the one bad page, and the storage interval information of the target storage block includes the first starting page of the start page of the available storage interval of the target storage block Start page number, the bad page number of the one bad page and the first start page number are used to determine the multiple pages contained in the target memory block by the start page of the one bad page and the available storage interval of the target memory block Sort position in
该确定单元902,具体用于:The determination unit 902 is specifically used for:
在根据该一个坏页的坏页编号确定该一个坏页的排序位置在该目标存储块的可用存储区间的前半部分的情况下,获取该目标存储块的可用存储区间内该一个坏页的下一页的编号,以确定该一个坏页的下一页至该目标存储块的可用存储区间的终止页包含的多个页为该好区;In the case where the sort position of the one bad page is determined according to the bad page number of the one bad page in the first half of the available storage interval of the target storage block, the lower part of the one bad page in the available storage interval of the target storage block is acquired The number of one page to determine that the multiple pages contained in the next page of a bad page to the end page of the available storage interval of the target memory block are the good areas;
该更新单元903,具体用于:将该第一起始页编号更新为该一个坏页的下一页的编号。The updating unit 903 is specifically configured to: update the first starting page number to the number of the next page of the one bad page.
有一种可能的实现方式中,该一个坏页的坏页位置包含该一个坏页的坏页编号,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的终止页的第一终止页编号, 该一个坏页的坏页编号和该第一终止页编号分别用于确定该一个坏页和该目标存储块的的可用存储区间的终止页在该目标存储块包含的多个页中的排序位置;In a possible implementation manner, the bad page position of the one bad page includes the bad page number of the one bad page, and the storage interval information of the target storage block includes the first termination of the end page of the available storage interval of the target storage block The page number, the bad page number of the one bad page and the first end page number are respectively used to determine the end page of the available storage interval of the one bad page and the target memory block among the multiple pages included in the target memory block Sort position
该确定单元902,具体用于:The determination unit 902 is specifically used for:
在根据该一个坏页的坏页编号确定该一个坏页的排序位置在该目标存储块的可用存储区间的后半部分的情况下,获取该目标存储块的可用存储区间内该一个坏页的上一页的编号,以确定该目标存储块的可用存储区间的起始页至该一个坏页的上一页包含的多个页为该好区;When determining that the sort position of the one bad page is in the second half of the available storage interval of the target storage block according to the bad page number of the one bad page, obtain the The number of the previous page to determine that the multiple pages contained in the previous page of the available storage interval of the target memory block to the previous page of the one bad page are the good areas;
该更新单元903,具体用于:将该第一终止页编号更新为该一个坏页的上一页的编号。The updating unit 903 is specifically configured to: update the first termination page number to the previous page number of the one bad page.
有一种可能的实现方式中,该至少一个坏页中有至少两个坏页,该至少一个坏页位置中有与该至少两个坏页一一对应的至少两个坏页位置,该至少两个坏页位置中包含与目标坏页对应的目标坏页位置,该目标坏页为该至少两个坏页中的任一坏页;In a possible implementation manner, there are at least two bad pages in the at least one bad page, and at least two bad page positions in one-to-one correspondence with the at least two bad pages in the at least one bad page position, the at least two Each bad page position includes a target bad page position corresponding to the target bad page, and the target bad page is any of the at least two bad pages;
该确定单元902,具体用于:The determination unit 902 is specifically used for:
在根据该目标坏页位置确定该目标坏页存在于目标存储块的可用存储区间的情况下,以该目标坏页位置作为分隔页的位置对该目标存储块的可用存储区间进行划分,以确定好区。When it is determined that the target bad page exists in the available storage interval of the target storage block according to the target bad page location, the available storage interval of the target storage block is divided using the target bad page location as the position of the separation page to determine Good area.
有一种可能的实现方式中,该控制器还包括:In a possible implementation, the controller also includes:
设置单元904,用于在该好区内设置隔离区,以将该好区划分为隔离区和用户数据区,其中,该隔离区包含至少一个页的随机数据,位于该至少一个坏页和该用户数据区之间,该用户数据区用于存储有效数据。The setting unit 904 is configured to set an isolation area in the good area to divide the good area into an isolation area and a user data area, wherein the isolation area contains random data of at least one page, and is located on the at least one bad page and the Between user data areas, the user data area is used to store valid data.
有一种可能的实现方式中,该至少一个坏页位置包含与该至少一个坏页一一对应的至少一个坏页编号,该至少一个坏页编号用于确定该坏页在该目标存储块包含的多个页中的排序位置,In a possible implementation manner, the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block Sorting position in multiple pages,
该设置单元904,具体用于:The setting unit 904 is specifically used for:
在根据该至少一个坏页编号确定该至少一个坏页的排序位置在该目标存储块的可用存储区间的前半部分的情况下,以该好区中排序位置位于最上的一个页作为起始位置,写入该至少一个页的随机数据,以形成该隔离区。When it is determined according to the at least one bad page number that the sorting position of the at least one bad page is in the first half of the available storage interval of the target memory block, taking the topmost page in the good area as the starting position, Write at least one page of random data to form the isolated area.
有一种可能的实现方式中,该至少一个坏页位置包含与该至少一个坏页一一对应的至少一个坏页编号,该至少一个坏页编号用于确定该坏页在该目标存储块包含的多个页中的排序位置,In a possible implementation manner, the at least one bad page location includes at least one bad page number corresponding to the at least one bad page one by one, and the at least one bad page number is used to determine that the bad page is included in the target storage block Sorting position in multiple pages,
该设置单元904,具体用于:The setting unit 904 is specifically used for:
在根据该至少一个坏页编号确定该至少一个坏页的排序位置在该目标存储块的可用存储区间的后半部分的情况下,若写入的有效数据已占满该用户数据区,以该用户数据区的下一页为起始位置,写入该至少一个页的随机数据,以形成该隔离区。In the case where it is determined according to the at least one bad page number that the sorting position of the at least one bad page is in the second half of the available storage interval of the target memory block, if the written valid data has already occupied the user data area, use the The next page of the user data area is the starting position, and the random data of the at least one page is written to form the isolation area.
有一种可能的实现方式中,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的起始页的第一起始页编号,该好区包含的多个页中有该好区的起始页,该好区的起始页的第二起始页编号和该第一起始页编号分别用于确定该好区的起始页和该目标存储块的可用存储区间的起始页在该目标存储块包含的多个页中的排序位置;In a possible implementation manner, the storage interval information of the target storage block includes the first start page number of the start page of the available storage interval of the target storage block, and there are multiple pages in the good area that have the good area Start page, the second start page number and the first start page number of the start page of the good area are used to determine the start page of the good area and the start page of the available storage interval of the target memory block in The sort position in the multiple pages contained in the target storage block;
该获取单元901,还用于:The obtaining unit 901 is also used to:
在根据该第二起始页编号确定该好区的起始页存在于第一预设区间的情况下,获取第一预设编号,其中,该第一预设区间中包含多个页,该第一预设编号为该第一预设区间的下一页的编号;When it is determined that the start page of the good area exists in the first preset interval according to the second start page number, the first preset number is obtained, where the first preset interval includes multiple pages, the The first preset number is the number of the next page of the first preset interval;
该更新单元903,具体用于:将该第一起始页编号更新为该第一预设编号。The updating unit 903 is specifically configured to: update the first starting page number to the first preset number.
有一种可能的实现方式中,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的终止页的第一终止页编号,该好区包含的多个页中有该好区的终止页,该好区的终止页的第二终止页编号和该第一终止页编号分别用于确定该好区的终止页和该目标存储块的可用存储区间的终止页在该目标存储块包含的多个页中的排序位置;In a possible implementation manner, the storage interval information of the target storage block includes the first end page number of the end page of the available storage interval of the target storage block, and the multiple areas included in the good area have the end of the good area Page, the second end page number and the first end page number of the end page of the good area are used to determine the end page of the good area and the end page of the available storage interval of the target storage block included in the target storage block Sorting position in multiple pages;
该获取单元901,还用于:The obtaining unit 901 is also used to:
在根据该第二终止页编号确定该好区的终止页存在于第二预设区间的情况下,获取第二预设编号,其中,该第二预设区间中包含多个页,该第二预设编号为该第二预设区间的上一页的编号;When it is determined that the termination page of the good area exists in the second preset interval according to the second termination page number, a second preset number is obtained, where the second preset interval includes multiple pages, the second The preset number is the number of the previous page of the second preset interval;
该更新单元903,具体用于:将该第一终止页编号更新为该第二预设编号。The updating unit 903 is specifically configured to: update the first termination page number to the second preset number.
有一种可能的实现方式中,该目标存储块的存储区间信息包含该目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号;In a possible implementation manner, the storage interval information of the target storage block includes the first start page number of the start page of the available storage interval of the target storage block and the first end page number of the end page;
该获取单元901,还用于:获取该第一起始页编号和该第一终止页编号之间的差值;The acquiring unit 901 is further configured to: acquire the difference between the first start page number and the first end page number;
该控制器还包括:The controller also includes:
标记单元905,用于在该差值达到预设阈值的情况下,将该目标存储块标记为不可用存储块。The marking unit 905 is configured to mark the target storage block as an unusable storage block when the difference reaches a preset threshold.
本申请实施例还提供了一种存储设备,该存储设备包括控制器和存储器,该存储器包含存储块,该存储块包含多个页;An embodiment of the present application further provides a storage device, the storage device includes a controller and a memory, the memory includes a storage block, and the storage block includes multiple pages;
其中,该控制器用于执行如前述图2至图8所示实施例中描述的方法中控制器所执行的步骤,还用于生成指令;Wherein, the controller is used to execute the steps performed by the controller in the method described in the foregoing embodiments shown in FIG. 2 to FIG. 8, and is also used to generate instructions;
该存储器用于根据该指令存储数据。The memory is used to store data according to the instruction.
本实施例中,该存储设备可以为非嵌入式存储设备,也可以为嵌入式存储设备,应当理解,该存储设备具体的表现形式,应当根据实际情况灵活设定,此处不做限定。In this embodiment, the storage device may be a non-embedded storage device or an embedded storage device. It should be understood that the specific expression form of the storage device should be flexibly set according to actual conditions, and is not limited herein.
本申请实施例还提供了一种终端,如图1b所示,该终端包含接口、处理器和存储设备,该存储设备包括控制器和存储器,该存储器包含存储块,该存储块包含多个页;An embodiment of the present application further provides a terminal. As shown in FIG. 1b, the terminal includes an interface, a processor, and a storage device. The storage device includes a controller and a memory. The memory includes a storage block. The storage block includes multiple pages. ;
该处理器通过该接口将数据发送至该控制器;The processor sends data to the controller through the interface;
该控制器用于执行如前述图2至图8所示实施例中描述的方法中控制器所执行的步骤,还用于通过该接口接收该处理器发送的该数据,并生成指令;The controller is used to perform the steps performed by the controller in the method described in the foregoing embodiments shown in FIG. 2 to FIG. 8, and is also used to receive the data sent by the processor through the interface and generate instructions;
该存储器用于根据该指令存储该数据。The memory is used to store the data according to the instruction.
本申请实施例中还提供一种包含存储块管理指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如前述图2至图8所示实施例中描述的方法中控制器所执行的步骤。An embodiment of the present application also provides a computer program product containing storage block management instructions, which when executed on a computer, causes the computer to execute the method as described in the foregoing embodiments shown in FIGS. 2 to 8 by the controller A step of.
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有存 储块处理的指令,当其在计算机上运行时,使得计算机执行如前述图2至图8所示实施例中描述的方法中控制器所执行的步骤。An embodiment of the present application also provides a computer-readable storage medium, which stores instructions for processing a storage block, and when it runs on a computer, causes the computer to execute as shown in FIGS. 2 to 8 described above The steps performed by the controller in the method described in the embodiments.
本申请实施例中还提供一种芯片***,该芯片***包括处理器,用于支持网络设备实现上述方面中所涉及的功能,例如,例如发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片***还包括存储器,所述存储器,用于保存网络设备必要的程序指令和数据。该芯片***,可以由芯片构成,也可以包括芯片和其他分立器件。An embodiment of the present application further provides a chip system including a processor, which is used to support a network device to implement the functions involved in the above aspects, for example, for example, to send or process data and / or information involved in the above method . In a possible design, the chip system further includes a memory, which is used to store necessary program instructions and data of the network device. The chip system may be composed of chips, and may also include chips and other discrete devices.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本发明实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质、或者半导体介质,例如固态硬盘(solid state disk,SSD)等。The computer program product includes one or more computer instructions. When computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server, or data center via wire (e.g. Coaxial cable, optical fiber, digital subscriber line (digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center for transmission. The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device including a server, a data center, and the like integrated with one or more available media. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media, or semiconductor media, such as solid state disks (SSD).
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of the description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的***,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a division of logical functions. In actual implementation, there may be other divisions, for example, multiple units or components may be combined or integrated To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The above integrated unit can be implemented in the form of hardware or software function unit.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。 而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application may be essentially or part of the contribution to the existing technology or all or part of the technical solution may be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
Claims (26)
- 一种存储块处理方法,其特征在于,应用于控制器,其中,所述控制器应用于存储设备,所述存储设备包含所述控制器和存储器,所述存储器包含多个存储块,所述存储块包含多个页,所述控制器中包含每个存储块的存储区间信息,所述存储区间信息用于指示存储块的可用存储区间,所述方法包括:A storage block processing method is characterized in that it is applied to a controller, wherein the controller is applied to a storage device, the storage device includes the controller and a memory, and the memory includes a plurality of storage blocks, the The storage block includes a plurality of pages, and the controller includes storage interval information of each storage block. The storage interval information is used to indicate an available storage interval of the storage block. The method includes:当检测到目标存储块中存在至少一个坏页时,获取与所述至少一个坏页一一对应的至少一个坏页位置;When it is detected that at least one bad page exists in the target storage block, acquire at least one bad page position corresponding to the at least one bad page one-to-one;根据所述至少一个坏页位置,确定好区;其中,所述好区为所述目标存储块的可用存储区间中连续且不存在所述坏页的最大存储区间;A good area is determined according to the at least one bad page location; wherein, the good area is the largest storage area in the available storage interval of the target memory block that is continuous and does not have the bad page;更新所述目标存储块的存储区间信息,其中,更新后的所述目标存储块的存储区间信息指示所述目标存储块的可用存储区间为所述好区。Updating the storage interval information of the target storage block, wherein the updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area.
- 根据权利要求1所述的方法,其特征在于,所述至少一个坏页为一个坏页,所述根据所述至少一个坏页位置,确定好区,包括:The method according to claim 1, wherein the at least one bad page is a bad page, and the determining a good area according to the position of the at least one bad page includes:以所述一个坏页的坏页位置作为分隔页的位置对所述目标存储块的可用存储区间进行划分,以确定好区。Taking the position of the bad page of the one bad page as the position of the separation page, the available storage interval of the target storage block is divided to determine the good area.
- 根据权利要求2所述的方法,其特征在于,所述一个坏页的坏页位置包含所述一个坏页的坏页编号,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的起始页的第一起始页编号,所述一个坏页的坏页编号和所述第一起始页编号分别用于确定所述一个坏页和所述目标存储块的可用存储区间的起始页在所述目标存储块包含的多个页中的排序位置;The method according to claim 2, wherein the bad page position of the one bad page contains the bad page number of the one bad page, and the storage interval information of the target storage block contains the available of the target storage block The first start page number of the start page of the storage interval, the bad page number of the one bad page and the first start page number are used to determine the available storage interval of the one bad page and the target memory block, respectively The sort position of the start page in the multiple pages included in the target storage block;所述以所述一个坏页的坏页位置作为分隔页的位置对所述目标存储块的可用存储区间进行划分,以确定好区,包括:Said using the position of the bad page of the one bad page as the position of the separation page to divide the available storage interval of the target storage block to determine the good area, including:在根据所述一个坏页的坏页编号确定所述一个坏页的排序位置在所述目标存储块的可用存储区间的前半部分的情况下,获取所述目标存储块的可用存储区间内所述一个坏页的下一页的编号,以确定所述一个坏页的下一页至所述目标存储块的可用存储区间的终止页包含的多个页为所述好区;When it is determined that the sort position of the one bad page is in the first half of the available storage interval of the target storage block according to the bad page number of the one bad page, acquiring the The number of the next page of a bad page to determine that the plurality of pages included in the next page of the one bad page to the end page of the available storage interval of the target memory block are the good areas;所述更新所述目标存储块的存储区间信息,包括:The updating of the storage interval information of the target storage block includes:将所述第一起始页编号更新为所述一个坏页的下一页的编号。The first starting page number is updated to the number of the next page of the one bad page.
- 根据权利要求2所述的方法,其特征在于,所述一个坏页的坏页位置包含所述一个坏页的坏页编号,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的终止页的第一终止页编号,所述一个坏页的坏页编号和所述第一终止页编号分别用于确定所述一个坏页和所述目标存储块的的可用存储区间的终止页在所述目标存储块包含的多个页中的排序位置;The method according to claim 2, wherein the bad page position of the one bad page contains the bad page number of the one bad page, and the storage interval information of the target storage block contains the available of the target storage block The first end page number of the end page of the storage interval, the bad page number of the one bad page and the first end page number are respectively used to determine the available storage interval of the one bad page and the target memory block The sorting position of the termination page among the multiple pages included in the target storage block;所述以所述一个坏页的坏页位置作为分隔页的位置对所述目标存储块的可用存储区间进行划分,以确定好区,包括:Said using the position of the bad page of the one bad page as the position of the separation page to divide the available storage interval of the target storage block to determine the good area, including:在根据所述一个坏页的坏页编号确定所述一个坏页的排序位置在所述目标存储块的可用存储区间的后半部分的情况下,获取所述目标存储块的可用存储区间内所述一个坏页的 上一页的编号,以确定所述目标存储块的可用存储区间的起始页至所述一个坏页的上一页包含的多个页为所述好区;When it is determined that the sorting position of the one bad page is in the second half of the available storage interval of the target storage block according to the bad page number of the one bad page, the location of the available storage interval of the target storage block is acquired The number of the previous page of a bad page to determine that the multiple pages contained in the starting page of the available storage interval of the target memory block to the previous page of the one bad page are the good areas;所述更新所述目标存储块的存储区间信息,包括:The updating of the storage interval information of the target storage block includes:将所述第一终止页编号更新为所述一个坏页的上一页的编号。The first termination page number is updated to the number of the previous page of the one bad page.
- 根据权利要求1所述的方法,其特征在于,所述至少一个坏页中有至少两个坏页,所述至少一个坏页位置中有与所述至少两个坏页一一对应的至少两个坏页位置,所述至少两个坏页位置中包含与目标坏页对应的目标坏页位置,所述目标坏页为所述至少两个坏页中的任一坏页;The method according to claim 1, wherein there are at least two bad pages in the at least one bad page, and at least two bad pages corresponding to the at least two bad pages in the at least one bad page position Bad page positions, the at least two bad page positions include a target bad page position corresponding to the target bad page, and the target bad page is any bad page of the at least two bad pages;所述根据所述至少一个坏页位置,确定好区,包括:The determining a good area according to the at least one bad page position includes:在根据所述目标坏页位置确定所述目标坏页存在于目标存储块的可用存储区间的情况下,以所述目标坏页位置作为分隔页的位置对所述目标存储块的可用存储区间进行划分,以确定好区。When it is determined that the target bad page exists in the available storage interval of the target storage block according to the target bad page location, the available storage interval of the target storage block is performed using the target bad page location as the position of the separation page Divide to determine the good area.
- 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:在所述好区内设置隔离区,以将所述好区划分为隔离区和用户数据区,其中,所述隔离区包含至少一个页的随机数据,位于所述至少一个坏页和所述用户数据区之间,所述用户数据区用于存储有效数据。An isolation area is provided in the good area to divide the good area into an isolation area and a user data area, wherein the isolation area contains at least one page of random data and is located on the at least one bad page and the user Between data areas, the user data area is used to store valid data.
- 根据权利要求6所述的方法,其特征在于,所述至少一个坏页位置包含与所述至少一个坏页一一对应的至少一个坏页编号,所述至少一个坏页编号用于确定所述坏页在所述目标存储块包含的多个页中的排序位置,The method according to claim 6, wherein the at least one bad page position includes at least one bad page number corresponding to the at least one bad page, and the at least one bad page number is used to determine the The sort position of the bad pages in the multiple pages included in the target storage block,所述在所述好区内设置隔离区包括:The setting of the isolation zone in the good zone includes:在根据所述至少一个坏页编号确定所述至少一个坏页的排序位置在所述目标存储块的可用存储区间的前半部分的情况下,以所述好区中排序位置位于最上的一个页作为起始位置,写入所述至少一个页的随机数据,以形成所述隔离区。When it is determined that the sorting position of the at least one bad page is in the first half of the available storage interval of the target memory block according to the at least one bad page number, the page with the sorting position at the top in the good area is used as At the starting position, random data of the at least one page is written to form the isolation area.
- 根据权利要求6所述的方法,其特征在于,所述至少一个坏页位置包含与所述至少一个坏页一一对应的至少一个坏页编号,所述至少一个坏页编号用于确定所述坏页在所述目标存储块包含的多个页中的排序位置,The method according to claim 6, wherein the at least one bad page position includes at least one bad page number corresponding to the at least one bad page, and the at least one bad page number is used to determine the The sort position of the bad pages in the multiple pages included in the target storage block,所述在所述好区内设置隔离区包括:The setting of the isolation zone in the good zone includes:在根据所述至少一个坏页编号确定所述至少一个坏页的排序位置在所述目标存储块的可用存储区间的后半部分的情况下,若写入的有效数据已占满所述用户数据区,以所述用户数据区的下一页为起始位置,写入所述至少一个页的随机数据,以形成所述隔离区。When it is determined that the sorting position of the at least one bad page is in the second half of the available storage interval of the target storage block according to the at least one bad page number, if the written valid data has occupied the user data Area, starting with the next page of the user data area, writing random data of the at least one page to form the isolation area.
- 根据权利要求1-8任一项所述的方法,其特征在于,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的起始页的第一起始页编号,所述好区包含的多个页中有所述好区的起始页,所述好区的起始页的第二起始页编号和所述第一起始页编号分别用于确定所述好区的起始页和所述目标存储块的可用存储区间的起始页在所述目标存储块包含的多个页中的排序位置,所述方法还包括:The method according to any one of claims 1-8, wherein the storage interval information of the target storage block includes a first start page number of a start page of an available storage interval of the target storage block, the The plurality of pages included in the good area includes the start page of the good area, the second start page number and the first start page number of the start page of the good area are used to determine the The sort position of the start page and the start page of the available storage interval of the target storage block among the multiple pages included in the target storage block, the method further includes:在根据所述第二起始页编号确定所述好区的起始页存在于第一预设区间的情况下,获取第一预设编号,其中,所述第一预设区间中包含多个页,所述第一预设编号为所述第一 预设区间的下一页的编号;When it is determined that the start page of the good area exists in the first preset interval according to the second start page number, a first preset number is obtained, where the first preset interval includes multiple Page, the first preset number is the number of the next page of the first preset interval;所述更新所述目标存储块的存储区间信息,其中,更新后的所述目标存储块的存储区间信息确定所述目标存储块的可用存储区间为所述好区,包括:The updating the storage interval information of the target storage block, wherein the updated storage interval information of the target storage block determines that the available storage interval of the target storage block is the good area, including:将所述第一起始页编号更新为所述第一预设编号。Updating the first starting page number to the first preset number.
- 根据权利要求1-8任一项所述的方法,其特征在于,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的终止页的第一终止页编号,所述好区包含的多个页中有所述好区的终止页,所述好区的终止页的第二终止页编号和所述第一终止页编号分别用于确定所述好区的终止页和所述目标存储块的可用存储区间的终止页在所述目标存储块包含的多个页中的排序位置,所述方法还包括:The method according to any one of claims 1-8, wherein the storage interval information of the target storage block includes a first end page number of the end page of the available storage interval of the target storage block, the good Among the multiple pages included in the zone are the end pages of the good zone, the second end page number and the first end page number of the end page of the good zone are used to determine the end page and all of the good zone, respectively The sorting position of the end page of the available storage interval of the target storage block among the multiple pages included in the target storage block, the method further includes:在根据所述第二终止页编号确定所述好区的终止页存在于第二预设区间的情况下,获取第二预设编号,其中,所述第二预设区间中包含多个页,所述第二预设编号为所述第二预设区间的上一页的编号;When it is determined that the termination page of the good area exists in the second preset interval according to the second termination page number, obtain a second preset number, where the second preset interval includes multiple pages, The second preset number is the number of the previous page of the second preset interval;所述更新所述目标存储块的存储区间信息,其中,更新后的所述目标存储块的存储区间信息确定所述目标存储块的可用存储区间为所述好区,包括:The updating the storage interval information of the target storage block, wherein the updated storage interval information of the target storage block determines that the available storage interval of the target storage block is the good area, including:将所述第一终止页编号更新为所述第二预设编号。Updating the first termination page number to the second preset number.
- 根据权利要求1-10任一项所述的方法,其特征在于,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号,所述方法还包括:The method according to any one of claims 1-10, wherein the storage interval information of the target storage block includes a first start page number and an end page of the start page of the available storage interval of the target storage block Number of the first termination page, the method further includes:获取所述第一起始页编号和所述第一终止页编号之间的差值;Acquiring the difference between the first start page number and the first end page number;在所述差值达到预设阈值的情况下,将所述目标存储块标记为不可用存储块。When the difference reaches a preset threshold, the target memory block is marked as an unusable memory block.
- 一种控制器,其特征在于,所述控制器应用于存储设备,所述控制器应用于存储设备,所述存储设备包含所述控制器和存储器,所述存储器包含多个存储块,所述存储块包含多个页,所述控制器中包含每个存储块的存储区间信息,所述存储区间信息用于确定存储块的可用存储区间,所述控制器包括:A controller, characterized in that the controller is applied to a storage device, and the controller is applied to a storage device, the storage device includes the controller and a memory, and the memory includes a plurality of storage blocks, the The storage block includes multiple pages, and the controller includes storage interval information of each storage block. The storage interval information is used to determine an available storage interval of the storage block. The controller includes:获取单元,用于当检测到目标存储块中存在至少一个坏页时,获取与所述至少一个坏页一一对应的至少一个坏页所述坏页的位置;An obtaining unit, configured to obtain the position of the bad page of at least one bad page corresponding to the at least one bad page when it is detected that at least one bad page exists in the target storage block;确定单元,用于根据所述至少一个坏页的位置,确定好区;其中,所述好区为所述目标存储块的可用存储区间中连续且不存在所述坏页的最大存储区间;A determining unit, configured to determine a good area according to the position of the at least one bad page; wherein, the good area is a maximum storage area that is continuous among available storage intervals of the target storage block and does not exist the bad page;更新单元,用于更新所述目标存储块的存储区间信息,其中,更新后的所述目标存储块的存储区间信息指示所述目标存储块的可用存储区间为所述好区。The updating unit is configured to update the storage interval information of the target storage block, wherein the updated storage interval information of the target storage block indicates that the available storage interval of the target storage block is the good area.
- 根据权利要求12所述的控制器,其特征在于,所述至少一个坏页为一个坏页;The controller according to claim 12, wherein the at least one bad page is a bad page;所述确定单元,具体用于:以所述一个坏页的坏页位置作为分隔页的位置对所述目标存储块的可用存储区间进行划分,以确定好区。The determining unit is specifically configured to divide the available storage interval of the target storage block by using the position of the bad page of the one bad page as the position of the separation page to determine the good area.
- 根据权利要求13所述的控制器,其特征在于,所述一个坏页的坏页位置包含所述一个坏页的坏页编号,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的起始页的第一起始页编号,所述一个坏页的坏页编号和所述第一起始页编号分别用于确定所述一个坏页和所述目标存储块的可用存储区间的起始页在所述目标存储块包含的多 个页中的排序位置;The controller according to claim 13, wherein the bad page position of the one bad page includes the bad page number of the one bad page, and the storage interval information of the target memory block includes the The first starting page number of the starting page of the available storage interval, the bad page number of the one bad page and the first starting page number are used to determine the available storage interval of the one bad page and the target memory block, respectively The sort position of the starting page of the multiple pages included in the target storage block;所述确定单元,具体用于:The determining unit is specifically used for:在根据所述一个坏页的坏页编号确定所述一个坏页的排序位置在所述目标存储块的可用存储区间的前半部分的情况下,获取所述目标存储块的可用存储区间内所述一个坏页的下一页的编号,以确定所述一个坏页的下一页至所述目标存储块的可用存储区间的终止页包含的多个页为所述好区;When it is determined that the sort position of the one bad page is in the first half of the available storage interval of the target storage block according to the bad page number of the one bad page, acquiring the The number of the next page of a bad page to determine that the plurality of pages included in the next page of the one bad page to the end page of the available storage interval of the target memory block are the good areas;所述更新单元,具体用于:将所述第一起始页编号更新为所述一个坏页的下一页的编号。The updating unit is specifically configured to: update the first starting page number to the number of the next page of the one bad page.
- 根据权利要求13所述的控制器,其特征在于,所述一个坏页的坏页位置包含所述一个坏页的坏页编号,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的终止页的第一终止页编号,所述一个坏页的坏页编号和所述第一终止页编号分别用于确定所述一个坏页和所述目标存储块的的可用存储区间的终止页在所述目标存储块包含的多个页中的排序位置;The controller according to claim 13, wherein the bad page position of the one bad page includes the bad page number of the one bad page, and the storage interval information of the target memory block includes the The first end page number of the end page of the available storage interval, the bad page number of the one bad page and the first end page number are used to determine the available storage interval of the one bad page and the target memory block, respectively The sorting position of the termination page of the multiple pages included in the target storage block;所述确定单元,具体用于:The determining unit is specifically used for:在根据所述一个坏页的坏页编号确定所述一个坏页的排序位置在所述目标存储块的可用存储区间的后半部分的情况下,获取所述目标存储块的可用存储区间内所述一个坏页的上一页的编号,以确定所述目标存储块的可用存储区间的起始页至所述一个坏页的上一页包含的多个页为所述好区;When it is determined that the sorting position of the one bad page is in the second half of the available storage interval of the target storage block according to the bad page number of the one bad page, the location of the available storage interval of the target storage block is acquired The number of the previous page of a bad page to determine that the multiple pages contained in the starting page of the available storage interval of the target memory block to the previous page of the one bad page are the good areas;所述更新单元,具体用于:将所述第一终止页编号更新为所述一个坏页的上一页的编号。The updating unit is specifically configured to: update the first termination page number to the previous page number of the one bad page.
- 根据权利要求12所述的控制器,其特征在于,所述至少一个坏页中有至少两个坏页,所述至少一个坏页位置中有与所述至少两个坏页一一对应的至少两个坏页位置,所述至少两个坏页位置中包含与目标坏页对应的目标坏页位置,所述目标坏页为所述至少两个坏页中的任一坏页;The controller according to claim 12, wherein there are at least two bad pages in the at least one bad page, and at least one bad page position corresponds to at least one bad page in at least one bad page position. Two bad page positions, the at least two bad page positions include a target bad page position corresponding to the target bad page, and the target bad page is any bad page of the at least two bad pages;所述确定单元,具体用于:The determining unit is specifically used for:在根据所述目标坏页位置确定所述目标坏页存在于目标存储块的可用存储区间的情况下,以所述目标坏页位置作为分隔页的位置对所述目标存储块的可用存储区间进行划分,以确定好区。When it is determined that the target bad page exists in the available storage interval of the target storage block according to the target bad page location, the available storage interval of the target storage block is performed using the target bad page location as the position of the separation page Divide to determine the good area.
- 根据权利要求12-16任一项所述的控制器,其特征在于,所述控制器还包括:The controller according to any one of claims 12 to 16, wherein the controller further comprises:设置单元,用于在所述好区内设置隔离区,以将所述好区划分为隔离区和用户数据区,其中,所述隔离区包含至少一个页的随机数据,位于所述至少一个坏页和所述用户数据区之间,所述用户数据区用于存储有效数据。A setting unit, configured to set an isolation area in the good area to divide the good area into an isolation area and a user data area, wherein the isolation area contains at least one page of random data and is located in the at least one bad area Between the page and the user data area, the user data area is used to store valid data.
- 根据权利要求17所述的控制器,其特征在于,所述至少一个坏页位置包含与所述至少一个坏页一一对应的至少一个坏页编号,所述至少一个坏页编号用于确定所述坏页在所述目标存储块包含的多个页中的排序位置,The controller according to claim 17, wherein the at least one bad page position includes at least one bad page number corresponding to the at least one bad page, and the at least one bad page number is used to determine The sort position of the bad page in the multiple pages included in the target storage block,所述设置单元,具体用于:The setting unit is specifically used for:在根据所述至少一个坏页编号确定所述至少一个坏页的排序位置在所述目标存储块的 可用存储区间的前半部分的情况下,以所述好区中排序位置位于最上的一个页作为起始位置,写入所述至少一个页的随机数据,以形成所述隔离区。When it is determined that the sorting position of the at least one bad page is in the first half of the available storage interval of the target memory block according to the at least one bad page number, the page with the sorting position at the top in the good area is used as At the starting position, random data of the at least one page is written to form the isolation area.
- 根据权利要求17所述的控制器,其特征在于,所述至少一个坏页位置包含与所述至少一个坏页一一对应的至少一个坏页编号,所述至少一个坏页编号用于确定所述坏页在所述目标存储块包含的多个页中的排序位置,The controller according to claim 17, wherein the at least one bad page position includes at least one bad page number corresponding to the at least one bad page, and the at least one bad page number is used to determine The sort position of the bad page in the multiple pages included in the target storage block,所述设置单元,具体用于:The setting unit is specifically used for:在根据所述至少一个坏页编号确定所述至少一个坏页的排序位置在所述目标存储块的可用存储区间的后半部分的情况下,若写入的有效数据已占满所述用户数据区,以所述用户数据区的下一页为起始位置,写入所述至少一个页的随机数据,以形成所述隔离区。When it is determined that the sorting position of the at least one bad page is in the second half of the available storage interval of the target storage block according to the at least one bad page number, if the written valid data has occupied the user data Area, starting with the next page of the user data area, writing random data of the at least one page to form the isolation area.
- 根据权利要求12-19任一项所述的控制器,其特征在于,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的起始页的第一起始页编号,所述好区包含的多个页中有所述好区的起始页,所述好区的起始页的第二起始页编号和所述第一起始页编号分别用于确定所述好区的起始页和所述目标存储块的可用存储区间的起始页在所述目标存储块包含的多个页中的排序位置;The controller according to any one of claims 12 to 19, wherein the storage interval information of the target storage block includes a first start page number of the start page of the available storage interval of the target storage block, so Among the multiple pages included in the good area, there is a start page of the good area. The second start page number and the first start page number of the start page of the good area are used to determine the good area. The starting position of the start page of the target storage block and the start page of the available storage interval of the target storage block among the multiple pages included in the target storage block;所述获取单元,还用于:The obtaining unit is also used to:在根据所述第二起始页编号确定所述好区的起始页存在于第一预设区间的情况下,获取第一预设编号,其中,所述第一预设区间中包含多个页,所述第一预设编号为所述第一预设区间的下一页的编号;When it is determined that the start page of the good area exists in the first preset interval according to the second start page number, a first preset number is obtained, where the first preset interval includes multiple Page, the first preset number is the number of the next page of the first preset interval;所述更新单元,具体用于:将所述第一起始页编号更新为所述第一预设编号。The updating unit is specifically configured to: update the first starting page number to the first preset number.
- 根据权利要求12-19任一项所述的控制器,其特征在于,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的终止页的第一终止页编号,所述好区包含的多个页中有所述好区的终止页,所述好区的终止页的第二终止页编号和所述第一终止页编号分别用于确定所述好区的终止页和所述目标存储块的可用存储区间的终止页在所述目标存储块包含的多个页中的排序位置;The controller according to any one of claims 12 to 19, wherein the storage interval information of the target storage block includes a first end page number of the end page of the available storage interval of the target storage block, the Among the multiple pages included in the good area are the end pages of the good area. The second end page number and the first end page number of the end page of the good area are used to determine the end page and the end page of the good area, respectively. The sort position of the end page of the available storage interval of the target storage block among the multiple pages included in the target storage block;所述获取单元,还用于:The obtaining unit is also used to:在根据所述第二终止页编号确定所述好区的终止页存在于第二预设区间的情况下,获取第二预设编号,其中,所述第二预设区间中包含多个页,所述第二预设编号为所述第二预设区间的上一页的编号;When it is determined that the termination page of the good area exists in the second preset interval according to the second termination page number, obtain a second preset number, where the second preset interval includes multiple pages, The second preset number is the number of the previous page of the second preset interval;所述更新单元,具体用于:将所述第一终止页编号更新为所述第二预设编号。The updating unit is specifically configured to: update the first termination page number to the second preset number.
- 根据权利要求12-21任一项所述的控制器,其特征在于,所述目标存储块的存储区间信息包含所述目标存储块的可用存储区间的起始页的第一起始页编号和终止页的第一终止页编号;The controller according to any one of claims 12 to 21, wherein the storage interval information of the target storage block includes a first start page number and an end of the start page of the available storage interval of the target storage block The first end page number of the page;所述获取单元,还用于:获取所述第一起始页编号和所述第一终止页编号之间的差值;The obtaining unit is further configured to obtain the difference between the first start page number and the first end page number;所述控制器还包括:The controller also includes:标记单元,用于在所述差值达到预设阈值的情况下,将所述目标存储块标记为不可用存储块。The marking unit is configured to mark the target memory block as an unusable memory block when the difference reaches a preset threshold.
- 一种存储设备,其特征在于,所述存储设备包括控制器和存储器,所述存储器包 含存储块,所述存储块包含多个页;A storage device, characterized in that the storage device includes a controller and a memory, the memory includes a storage block, and the storage block includes a plurality of pages;其中,所述控制器用于执行如权利要求1-11中任意一项所述的存储块处理的方法,还用于生成指令;Wherein, the controller is used to execute the method for processing the storage block according to any one of claims 1-11, and is also used to generate instructions;所述存储器用于根据所述指令存储数据。The memory is used to store data according to the instruction.
- 一种终端,其特征在于,所述终端包含接口、处理器和存储设备,所述存储设备包括控制器和存储器,所述存储器包含存储块,所述存储块包含多个页;A terminal, characterized in that the terminal includes an interface, a processor, and a storage device, the storage device includes a controller and a memory, the memory includes a storage block, and the storage block includes multiple pages;所述处理器通过所述接口将数据发送至所述控制器;The processor sends data to the controller through the interface;所述控制器用于执行如权利要求1-11中任意一项所述的存储块处理的方法,还用于通过所述接口接收所述处理器发送的所述数据,并生成指令;The controller is used to execute the method for processing a storage block according to any one of claims 1-11, and is further used to receive the data sent by the processor through the interface and generate instructions;所述存储器用于根据所述指令存储所述数据。The memory is used to store the data according to the instruction.
- 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1-11中任意一项所述的存储块处理的方法。A computer program product containing instructions, characterized in that, when the computer program product runs on a computer, the computer is caused to perform the method for processing a storage block according to any one of claims 1-11.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有存储块处理的指令,当其在计算机上运行时,使得计算机执行上述权利要求1-11任一权利要求所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores instructions for processing a storage block, which when executed on a computer, causes the computer to execute any of the above claims 1-11 Described method.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201880098515.6A CN112805686B (en) | 2018-10-15 | 2018-10-15 | Storage block processing method and related equipment |
PCT/CN2018/110223 WO2020077489A1 (en) | 2018-10-15 | 2018-10-15 | Method for processing storage block, and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/110223 WO2020077489A1 (en) | 2018-10-15 | 2018-10-15 | Method for processing storage block, and related device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020077489A1 true WO2020077489A1 (en) | 2020-04-23 |
Family
ID=70282861
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/110223 WO2020077489A1 (en) | 2018-10-15 | 2018-10-15 | Method for processing storage block, and related device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112805686B (en) |
WO (1) | WO2020077489A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114063905B (en) * | 2021-10-13 | 2024-04-02 | 武汉光迅电子技术有限公司 | Log storage method, log storage device, storage equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102298543A (en) * | 2011-09-15 | 2011-12-28 | 成都市华为赛门铁克科技有限公司 | Memory management method and memory management device |
CN106681664A (en) * | 2016-12-29 | 2017-05-17 | 忆正科技(武汉)有限公司 | Management strategy used for prolonging service life of solid state disk |
CN106681936A (en) * | 2016-12-29 | 2017-05-17 | 记忆科技(深圳)有限公司 | Bad block management method for NANDFLASH |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8775901B2 (en) * | 2011-07-28 | 2014-07-08 | SanDisk Technologies, Inc. | Data recovery for defective word lines during programming of non-volatile memory arrays |
KR101797565B1 (en) * | 2011-08-22 | 2017-12-12 | 삼성전자 주식회사 | Memory device employing bad page management |
KR20130078973A (en) * | 2012-01-02 | 2013-07-10 | 삼성전자주식회사 | Method for managing bed storage space in memory device and storage device using method thereof |
CN102622306B (en) * | 2012-02-21 | 2014-11-26 | 中颖电子股份有限公司 | Bad block management method for storage device |
US9318168B2 (en) * | 2012-11-27 | 2016-04-19 | Samsung Electronics Co., Ltd. | Memory system for continuously mapping addresses of a memory module having defective locations |
NO2988221T3 (en) * | 2014-06-27 | 2018-01-06 | ||
US10593421B2 (en) * | 2015-12-01 | 2020-03-17 | Cnex Labs, Inc. | Method and apparatus for logically removing defective pages in non-volatile memory storage device |
KR20170131796A (en) * | 2016-05-20 | 2017-11-30 | 에스케이하이닉스 주식회사 | Memory system and operating method of memory system |
-
2018
- 2018-10-15 WO PCT/CN2018/110223 patent/WO2020077489A1/en active Application Filing
- 2018-10-15 CN CN201880098515.6A patent/CN112805686B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102298543A (en) * | 2011-09-15 | 2011-12-28 | 成都市华为赛门铁克科技有限公司 | Memory management method and memory management device |
CN106681664A (en) * | 2016-12-29 | 2017-05-17 | 忆正科技(武汉)有限公司 | Management strategy used for prolonging service life of solid state disk |
CN106681936A (en) * | 2016-12-29 | 2017-05-17 | 记忆科技(深圳)有限公司 | Bad block management method for NANDFLASH |
Also Published As
Publication number | Publication date |
---|---|
CN112805686B (en) | 2023-06-06 |
CN112805686A (en) | 2021-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10936394B2 (en) | Information processing device, external storage device, host device, relay device, control program, and control method of information processing device | |
CN106448737B (en) | Method and device for reading flash memory data and solid state drive | |
US10372619B2 (en) | Data backup method, data recovery method and storage controller | |
CN103635969B (en) | Apparatus including memory system controllers and related methods | |
TWI551991B (en) | Method and system for memory management and memory storage device thereof | |
US10621085B2 (en) | Storage system and system garbage collection method | |
US10635358B2 (en) | Memory management method and storage controller | |
US10990325B2 (en) | Write control method, associated data storage device and controller thereof | |
EP3229147A1 (en) | Transaction processing method, device and computer system | |
US10204003B2 (en) | Memory device and storage apparatus | |
US20160011930A1 (en) | Method for preventing read-disturb errors, memory control circuit unit and memory storage apparatus | |
CN113490922B (en) | Write amplification optimization method for solid state disk | |
TW201133240A (en) | System recovery method, and storage medium controller and storage system using the same | |
WO2020103468A1 (en) | Flash memory-based information garbage processing method, solid state disk, and storage device | |
WO2020077489A1 (en) | Method for processing storage block, and related device | |
CN106814968B (en) | Memory management method and system and memory storage device thereof | |
US11016689B2 (en) | Data storage system | |
TWI464585B (en) | Data storing method, and memory controller and memory storage apparatus using the same | |
CN104375945A (en) | Memory address administration method, memory controller and memory storage device | |
CN112578993A (en) | Method for processing programming error of multi-plane NVM and storage device | |
CN112579328A (en) | Method for processing programming error and storage device | |
EP4053705B1 (en) | Operating method of storage device | |
CN112802512B (en) | Memory controller and memory device initializing method | |
CN111414128A (en) | Memory management method, memory storage device and memory control circuit unit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18937190 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18937190 Country of ref document: EP Kind code of ref document: A1 |