A bad block processing method of a solid state disk, a solid state disk and a storage medium
By subdividing, marking, and managing bad blocks on solid-state drives, the problem of low resource utilization is solved, achieving more efficient resource utilization and data stability.
Patent Information
- Application Number
- CN202411796115.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-12-05
AI Technical Summary
In existing technologies, the bad block handling methods of solid-state drives (SSDs) result in low NAND flash resource utilization, and traditional methods of directly retiring or replacing them lead to resource waste.
By subdividing and marking the abnormal causes of bad blocks into two categories—those that render the entire block unusable and those that render the current page unusable—and recording bad page information, bad blocks can be managed in a fine-grained manner, avoiding direct retirement or replacement.
It improves the resource utilization of solid-state drives, avoids resource waste, and enhances data stability and security.
Smart Images

Figure CN119620953B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to, but is not limited to, the field of solid state disks, and in particular, to a bad block processing method for a solid state disk, a solid state disk, and a storage medium. BACKGROUND
[0002] With the continuous progress of electronic product technology, the demand for electronic storage products in various industries is increasing, especially the demand for faster and more convenient storage products. NAND FLASH has become the preferred storage medium for many electronic products due to its data non-volatility, low power consumption, small size, and no mechanical structure. Solid state disks (SSD) as a device using NAND FLASH as a storage medium have occupied an important position in the storage industry and have become the hottest part of the electronic industry in recent years.
[0003] However, NAND FLASH may have bad blocks during use (for example, due to differences in NAND FLASH manufacturing processes, different manufacturers cannot guarantee that each block is good when it leaves the factory, and there will be some blocks that have problems when they leave the factory, which we call original bad blocks; these original bad blocks will be automatically marked by the manufacturer when they leave the factory, and will not usually affect the normal use of the solid state disk. During use, due to programming, erasing, and reading operations, some new bad blocks may still appear), which can cause a variety of adverse consequences, such as reducing write speed, and even causing data accumulation to be unable to be stored in time, causing resource waste and deadlock, and thus causing data write errors. As can be seen, the management of these bad blocks is crucial to the data reliability and effectiveness of the solid state disk.
[0004] However, for the above bad blocks, the traditional bad block processing method is to use a simple and rough management method, which directly retires or replaces the entire block. However, with the improvement of the process, the capacity of a block has gradually increased from a few MB to tens of MB or even hundreds of MB. If the block is damaged a little, it will be directly retired or replaced, which will cause great waste of NAND FLASH resources, is not conducive to the deep use of NAND FLASH resources, and also affects the resource occupation of the cache.
[0005] Therefore, a new post-bad block management method is needed to more effectively utilize NAND FLASH resources and improve the resource utilization rate of the solid state disk. SUMMARY
[0006] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0007] The application provides a bad block processing method of a solid state disk, a solid state disk and a storage medium, which can effectively utilize resources of a NAND FLASH in depth and solve the problem of low resource utilization of a bad block processing method in the prior art.
[0008] An embodiment of the application provides a bad block processing method of a solid state disk, comprising: when an exception is found during data processing on a current page, marking a block where the current page is located according to an exception cause, to obtain marking information corresponding to the block where the current page is located; wherein the marking information generated according to different exception causes is different; during data processing on the solid state disk, using a corresponding block for data processing according to the marking information.
[0009] An embodiment of the application further provides a solid state disk, comprising: a memory and a processor; the memory is used for storing a program for bad block processing of a solid state disk; and the processor is used for reading the program for bad block processing of a solid state disk and executing the bad block processing method of a solid state disk according to any embodiment of the application.
[0010] An embodiment of the application further provides a non-transient computer readable storage medium, which stores a computer program, wherein the computer program can implement the bad block processing method of a solid state disk according to any embodiment of the application when executed by a processor.
[0011] Compared with the related art, the bad block processing method of a solid state disk, the solid state disk and the storage medium provided by the embodiments of the application mark a block where a current page is located according to an exception cause when an exception is found during data processing on the current page, to obtain marking information corresponding to the block where the current page is located, and the marking information generated according to different exception causes is different, so that during data processing on the solid state disk, the marking information can be used to distinguish what causes the data processing exception, and then a corresponding block is used for data processing. It can be seen that the scheme records various different reasons for causing the later bad block in the use process of the solid state disk in detail, so that the part that can be used can be continuously used when the block is not completely damaged, avoiding the operation of completely retiring or replacing the later bad block as in the traditional bad block processing scheme, and the resource utilization of the solid state disk is improved.
[0012] Other features and advantages of the application will be set forth in the following description, and in part will become apparent to those skilled in the art from the following description, or can be learned by practice of the application. Other advantages of the application will be realized and attained by the methods and solutions particularly pointed out in the written description and claims hereof. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings are included to provide a further understanding of the technical solutions of the present application, constitute a part of the specification and are used to explain the technical solutions of the present application together with the embodiments of the present application, and do not constitute a limitation on the technical solutions of the present application.
[0014] Figure 1 A flowchart of a bad block processing method of a solid state disk according to an embodiment of the present application;
[0015] Figure 2 A flowchart of a bad block processing method of a solid state disk according to an embodiment of the present application;
[0016] Figure 3 A schematic diagram of a solid state disk according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] The present application describes a plurality of embodiments, but the description is exemplary rather than limiting, and it is obvious to those skilled in the art that more embodiments and implementation schemes can be included within the scope of the embodiments described in the present application. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Unless specifically limited, any feature or element of any embodiment can be utilized with any other feature or element of any other embodiment, or can replace any other feature or element in any other embodiment.
[0018] The present application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features and elements disclosed in the present application can also be combined with any conventional features or elements to form unique inventive solutions. Any feature or element of any embodiment can also be combined with features or elements from other inventive solutions to form another unique inventive solution. Therefore, it should be understood that any feature shown and / or discussed in the present application can be implemented individually or in any appropriate combination. Therefore, the embodiments are not limited by other than according to the limitations made according to the appended claims and their equivalent replacements. In addition, various modifications and changes can be made within the scope of protection of the appended claims.
[0019] Furthermore, in describing representative embodiments, the specification can have presented the method and / or process as a particular sequence of steps. However, to the extent that the method or process depends on the particular order of steps, this description should not be construed as limiting upon the scope of claims to the particular order of steps. Other steps can be provided in other embodiments or in other sequences, as will be apparent to one of ordinary skill in the art upon a reading of the description. Therefore, the particular order of steps recited in the specification should not be interpreted as a limitation on the scope of claims. Furthermore, the claims should not be limited to the steps of the methods and / or processes recited in the specification, as one of ordinary skill in the art can be able to practice the claims without using all of the recited steps in the specific order recited in the specification.
[0020] NAND FLASH itself due to its design features, resulting in a NAND FLASH DIE chip consists of many blocks, each block is composed of several pages, in the process of use NAND FLASH erase life is limited, when used to a certain time or scene generated bad block of post-bad block. How to efficiently manage these generated post-bad block, is a solid-state disk application process to pay attention to a big problem.
[0021] To this end, an embodiment of the present application provides a bad block processing method of a solid-state disk, as shown in Figure 1 may include the following steps:
[0022] Step S110: when an exception is found in data processing of a current page, marking a block where the current page is located according to an exception cause, to obtain marking information corresponding to the block where the current page is located; wherein the marking information generated according to different exception causes is different;
[0023] Step S120: when data processing of the solid-state disk is performed, using a corresponding block for data processing according to the marking information.
[0024] The bad block processing method of the solid state disk in the embodiment, when an abnormality is found in data processing of a current page, marks a block where the current page is located according to an abnormality reason, obtains marking information corresponding to the block where the current page is located, and since the marking information generated by different abnormality reasons is different, when data processing of the solid state disk is performed, the marking information can be used to distinguish what abnormality reason causes the data processing abnormality, so that corresponding blocks are further used for data processing. The scheme does not use a simple and rough management method like the traditional bad block processing method, and the entire block is marked as a later bad block as long as an abnormality of a certain page in the bad block, but various different reasons for causing the later bad block in the use process of the solid state disk are finely recorded, so that when the block is not completely damaged, the part that can be used can be continuously used, avoiding the operation of directly retiring or replacing the entire later bad block like the traditional bad block processing scheme, and the resource utilization rate of the solid state disk is improved.
[0025] In an exemplary embodiment, the marking of the block where the current page is located according to the abnormality reason comprises:
[0026] When the abnormality reason is a reason for causing the entire block to be unusable, the block where the current page is located is marked as a first type bad block;
[0027] When the abnormality reason is a reason for causing the current page to be unusable, the block where the current page is located is marked as a second type bad block, and the number information of the current page is recorded.
[0028] The bad block processing method of the solid state disk of the embodiment divides the bad block causes into two categories: "causes leading to the entire block being unusable" and "causes leading to the current page being unusable", and when the bad block cause is "causes leading to the entire block being unusable", marks it as a first type of bad block, and when the bad block cause is "causes leading to the current page being unusable" (i.e. not causes leading to the entire block being unusable, but only some pages in the block being unusable), marks it as a second type of bad block, and records the bad page number information. In this way, in the subsequent use of the solid state disk, when data processing is performed on a block, if the block has corresponding marking information and is marked as a first type of bad block, it means that the entire block is damaged and cannot be used (all pages in the block cannot be used), at which time it can be directly skipped or a replacement strategy is used; if the block has corresponding marking information and is marked as a second type of bad block, it means that only some pages in the block are unusable, at which time the bad page information recorded in the corresponding marking information of the block can be used to determine whether the current page used for data processing is a bad page, and if it is a bad page, it can be skipped or a replacement strategy is used, and if it is not a bad page, it can be normally used; if the block does not have corresponding marking information, it means that the block is a normally usable block (all pages in the block can be normally used), and data processing is normally performed. It can be seen that the scheme of the embodiment continues to use the part of the block that can be used when the block is not completely damaged, avoiding the operation of completely retiring or replacing the late bad block as in the traditional bad block processing scheme, thereby improving the resource utilization rate of the solid state disk.
[0029] In an example of the embodiment, the causes leading to the entire block being unusable include at least: original bad block, erase instruction failure; and the causes leading to the current page being unusable include at least: write instruction failure, read instruction failure, and page error correction exceeding the solid state disk correction capability limit.
[0030] The bad block processing method of the solid state disk of the example further refines the bad block causes and records them in detail, so that in the subsequent use of the solid state disk to process data, the abnormal causes can be distinguished according to the identification information, thereby improving the data stability and security of the solid state disk. For example, a block with some damaged pages can be used reasonably, and if the data is very important, it can not be placed in the block with some damaged pages, but only non-important data can be placed in the block with some damaged pages.
[0031] In an example of the embodiment, the marking of the block where the current page is located according to the abnormal cause to obtain the marking information corresponding to the block where the current page is located includes:
[0032] After receiving feedback that the read command failed while processing data on the current page, the data is read using the error correction capability of the solid-state drive: if the error correction is successful, the cause of bad block in the block containing the page is marked as read command failure; if the error correction is unsuccessful, the cause of bad block in the block containing the page is marked as page fault, and the error correction exceeds the limit of the solid-state drive's error correction capability.
[0033] For example, the statement that page error correction exceeds the SSD's error correction capability limit means that the error bit flipping in the currently read page exceeds the SSD's error correction limit. Error correction can be achieved using RAID ECC (Redundant Array of Independent Disks with Error Correcting Code) technology.
[0034] This exemplary method for handling bad blocks in a solid-state drive uses different identifiers for "instruction-level error" bad blocks where "read instruction failed" and "data-level error" bad blocks where "page error correction exceeded the limit of the solid-state drive's error correction capability." This achieves fine-grained subdivision of error causes and lays a good foundation for better use of the marking information in the future.
[0035] In one exemplary embodiment, after obtaining the tag information corresponding to the block where the current page is located, the method further includes: storing the tag information in a tag storage cache area according to a preset structure;
[0036] The method further includes: during power-down initialization, storing the tag information into the tag storage area of the first valid block according to a preset tag storage address, wherein the first valid block is a valid block guaranteed by the hard disk manufacturer; and during power-on initialization, initializing the tag information stored in the tag storage area into the tag storage cache area.
[0037] In this embodiment of the solid-state drive bad block handling method, during power-on initialization, the marking information stored in the marking storage area is initialized to the marking storage cache area, which can improve the storage and reading efficiency of the marking information; during power-off initialization, the marking information is stored in the marking storage area of the first valid block according to the preset marking storage address, which can avoid the loss of marking information data.
[0038] In one example of this embodiment, the method may further include: when the first valid block is detected to be a bad block and is a first type of bad block, pointing the preset mark storage address to the storage area of another valid block, and using the storage area of the valid block as the mark storage area.
[0039] The solid state disk bad block processing method of the embodiment can better save the mark information and avoid loss of the mark information when the first valid block is detected as a bad block and a first type bad block.
[0040] In an exemplary embodiment, when the abnormal cause is a cause leading to the whole block being unusable, the preset structure comprises a bad block cause identifier and a bad block number; when the abnormal cause is a cause leading to the current page being unusable, the preset structure comprises a bad block cause identifier, a bad block number, a bad page number and bad page numbers; wherein the bad block cause identifier is used to distinguish whether the bad block is a first type bad block or a second type bad block.
[0041] In an exemplary embodiment, the data processing using the corresponding block according to the mark information comprises:
[0042] judging whether the current block used for data processing has corresponding mark information;
[0043] when it is confirmed that the current block has corresponding mark information, confirming the bad block type of the block according to the mark information corresponding to the block; when the block is a first type bad block, skipping the block and using a next predetermined block to perform data processing; when the block is a second type bad block, judging whether the number of the current page used for data processing is recorded in the mark information corresponding to the block, and when it is recorded, skipping the page and using a next predetermined page as the current page to perform data processing, and when it is not recorded, using the current page to perform data processing;
[0044] when it is confirmed that the current block does not have corresponding mark information, using the block to perform data processing.
[0045] wherein the next predetermined block refers to a next block in the data processing logic, and the next predetermined page refers to a next page in the data processing logic. For example, when a skip strategy is used for the bad block / bad page, the next predetermined block refers to a block which will perform data processing next in the data processing logic of the solid state disk, and the next predetermined page refers to a page which will perform data processing next in the data processing logic of the solid state disk; when a replacement strategy is used for the bad block / bad page, the next predetermined block refers to a block which replaces the block in the data processing logic of the solid state disk, and the next predetermined page refers to a page which replaces the page in the data processing logic of the solid state disk.
[0046] The solid state disk bad block processing method of the embodiment can be used to determine whether the current block for data processing has corresponding mark information, and if so, whether the mark information is marked as a first type of bad block or a second type of bad block. If the mark information is marked as the first type of bad block, it means that the entire block is damaged and cannot be used, and the block can be directly skipped or replaced. If the mark information is marked as the second type of bad block, it means that only part of the page is damaged and cannot be used, and the mark information in the mark information can be used to determine whether the page is a bad page. If it is a bad page, it can be skipped or replaced. If it is not a bad page, it can be normally used. If the mark information does not exist, the block can be normally used and data processing can be performed normally. Therefore, the mark information can be used to continue using the part of the block that can be used when the block is not completely damaged, avoiding the operation of completely retiring or replacing the block when a later bad block is encountered in the traditional bad block processing scheme, thereby improving the resource utilization rate of the solid state disk.
[0047] In addition, it should be noted that when a block / page is not marked, if a read instruction is abnormal, an error correction mechanism is used for error correction. When correct data is obtained through the error correction mechanism, the correct data is written to other correct blocks / pages, and the block / page is marked as "read instruction abnormal". In this case, the next time the data is read, the data is read from the correct block / page, and not from the block / page. When correct data cannot be obtained through the error correction mechanism, it is determined that the data is lost, and the block / page is marked as "page error correction exceeds the error correction capability limit of the solid state disk". In this case, the data is lost and cannot be read. Therefore, in the data processing process of the above embodiment, if it is found that a certain block is marked as "read instruction abnormal" or "page error correction exceeds the error correction capability limit of the solid state disk", the block can be directly skipped.
[0048] In the data processing of the embodiment, when reading data, "skipping the block and using the next predetermined block for data processing" or "skipping the page and using the next predetermined page as the current page for data processing" means reading other data in a block / page, rather than reading the same data in a block / page.
[0049] The following is a complete example of the solid state disk bad block processing method of the present application, which can include the following steps as shown in Figure 2
[0050] Step S210: When power is turned on and initialized, the mark information is read from the mark storage area according to the preset mark storage address, and the mark information is initialized to the mark storage buffer area.
[0051] For example, when the solid state disk divides a piece of RAM cache in its cache space for specific late bad block marking process in the process of data processing. Since BLOCK 0 is a certain valid block guaranteed by the NAND FLASH manufacturer, we can usually save the RAM cache information in BLOCK 0 of the NAND FLASH, of course, the present application does not limit this, when BLOCK 0 is abnormal, we can also save the RAM cache information in other valid blocks.
[0052] The present step S210 imports the marking information of the specific late bad block into the cache RAM after each power-on initialization, so that the information of each block in the cache can be used for comparison processing when the solid state disk is processing data each time. For example, if the block number to be operated and processed is not recorded in the cache marking information, the block is a good block and can be directly used for data processing, such as data reading and writing and various operations.
[0053] Step S220: When an abnormality is found in the process of data processing of a certain page, the block where the current page is located and the current page are marked according to the abnormality reason, and the marking information is stored in the marking storage cache area according to the preset structure. Among them, the marking of the block where the current page is located and the current page according to the abnormality reason includes:
[0054] When the abnormality reason is an original bad block, the block where the current page is located is marked as 01, and the number of the block where the current page is located is recorded;
[0055] When the abnormality reason is an erase instruction failure, the block where the current page is located is marked as 02, and the number of the block where the current page is located is recorded;
[0056] When the abnormality reason is a write instruction failure, the block where the current page is located is marked as 03, and the number of the block where the current page is located and the number of the current page are recorded, and the number of bad pages of the current block is updated (increased by 1); For example, the marking information of a "write instruction failure block" can be "TLV: 03 1010 0002 0040 0080", wherein 03 indicates "write instruction failure", 1010 indicates that the number of the block is 0X1010, 0002 indicates that there are 2 pages in the block that have write errors, which are 0X0040 page and 0X0080 page;
[0057] When the exception cause is a read instruction failure, the block in which the current page is located is marked as 04, and the number of the block in which the current page is located and the number of the current page are recorded, and the number of bad pages of the current block is updated (plus 1); for example, the marking information of a certain "block with read instruction failure" can be "TLV: 04 2020 0003 0022 0033 0044", wherein 04 represents "read instruction failure", 2020 represents that the number of the block is 0X2020, 0003 represents that there are 3 pages in the block that have read errors, which are 0X0022, 0X0033 and 0X0044 respectively;
[0058] When the exception cause is that page error correction exceeds the solid state disk correction capability limit, the block in which the current page is located is marked as 05, and the number of the block in which the current page is located and the number of the current page are recorded, and the number of bad pages of the current block is updated (plus 1); for example, the marking information of a certain "block with page error correction exceeding the solid state disk correction capability limit" can be "TLV: 05 050 0002 0066 0077", wherein 05 represents "page error correction exceeding the solid state disk correction capability limit", 0050 represents that the number of the block is 0X0050, 0002 represents that there are 2 pages in the block that have read errors exceeding the solid state disk correction capability limit, which are 0X0066 and 0X0077 respectively.
[0059] Step S230: When data processing is performed, the marking information is read from the marking storage buffer area, and data processing is performed according to the marking information. Wherein, the data processing according to the marking information comprises:
[0060] According to the code of the block in which the current page is located, the marking information of the current block is searched from the marking information;
[0061] When the marking information of the current block is not found, it indicates that the current block can be normally used, and the current block is directly used for data processing;
[0062] When the marking information of the current block is found, if the bad block reason identifier is 01 or 02, it indicates that all pages in the current block cannot be normally used, and the next block is directly skipped or replaced using a replacement strategy; if the bad block reason identifier is 03 or 04 or 05, it is continued to be confirmed whether the current page is a bad page according to the number of the current page, if the current page is a normal page, it is normally used, if the current page is a bad page, the next page is directly skipped or replaced using a replacement strategy;
[0063] Wherein, whether the current page is a bad page can be confirmed according to whether the number of the current page is stored in the bad page number of the current block, if it exists, the current page is a bad page; if it does not exist, the current page is a normal page.
[0064] It should be noted that the bad blocks caused by the original bad blocks and the erase instruction failure indicate that the blocks are seriously physically damaged, so the blocks are directly skipped or replaced; the bad blocks caused by the write instruction failure, the read instruction failure and the page error correction exceeding the error correction limit of the solid state disk only represent the current page write failure, read failure and error correction failure, and do not represent that other pages in the block also have the above problems, so the block in which the page is located is marked as a second type of bad block different from the original bad block and the bad block caused by the erase instruction failure, so that whether the entire block is damaged can be distinguished according to the marking type, so that the pages in the block that can be normally used are continued to be used, and the pages in the block that have problems are not used.
[0065] Step S240: When the power is off, the marking information of the marking storage buffer is stored in the marking storage area of the first valid block, and the first valid block is a block guaranteed by the hard disk manufacturer.
[0066] In summary, the concept of the management scheme of the bad block processing scheme of the embodiment is as follows: the type of each bad block is specifically classified (for example, the original bad block is marked as 01, the bad block caused by the erase instruction failure in normal use is marked as 02, the bad block caused by the write instruction failure in normal use is marked as 03, the bad block caused by the read instruction failure in normal use is marked as 04, and the bad block caused by the read exceeding the error correction limit of the solid state disk in normal use is marked as 05), so that all the later bad blocks are first classified and marked in detail, and then different specific treatments are performed according to different situations of each bad block, so that efficient resource utilization is realized.
[0067] An embodiment of the present application provides a solid state disk, as shown in the figure, comprising a memory and a processor. Figure 3 The memory is used for storing a program for bad block processing of the solid state disk.
[0068] The processor is used for reading the program for bad block processing of the solid state disk and executing the bad block processing method of the solid state disk according to any embodiment of the present application.
[0069] An embodiment of the present application further provides a non-transient computer readable storage medium, and the computer readable storage medium stores a computer program.
[0070] The computer program is executed by the processor to implement the bad block processing method of the solid state disk according to any embodiment of the present application.
[0071] In summary, the application realizes a bad block processing method of a solid state disk, a solid state disk and a storage medium, which can be applied to the post-stage bad block optimization management of a flash memory. The scheme further subdivides various different reasons for causing post-stage bad blocks in the use process of the solid state disk, and records the reasons in detail, so that the traditional bad block processing scheme can be completely avoided in the use process of the solid state disk, that is, the bad blocks are directly retired or replaced, thereby saving the NAND FLASH resources and avoiding the great resource waste of the NAND FLASH in the management of the post-stage bad blocks. Meanwhile, the scheme supports dynamic marking of each page of each post-stage bad block in the use process. In the use process of the solid state disk, only the following judgment needs to be performed on the current block to be operated, if the block is not in the subdivided post-stage bad block cache, the block is directly regarded as a good block and various operations are performed on the block; if the block is in the subdivided post-stage bad block cache, the block can be directly avoided to have the problem pages marked and other pages normally operated, thereby greatly improving the resource utilization and use efficiency, and improving the performance and reliability of the solid state disk.
[0072] Those skilled in the art can understand that all or some steps in the method disclosed above and the functional modules / units in the system and device can be implemented as software, firmware, hardware and appropriate combinations thereof. In the hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the components can be implemented as software executed by a processor such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit such as an application specific integrated circuit. Such software can be distributed on a computer readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those skilled in the art, the term "computer storage media" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those skilled in the art that communication media generally includes computer readable instructions, data structures, program modules or other data in modulated data signals such as carriers or other transmission mechanisms, and can include any information delivery medium.
[0073] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples, without contradiction.
[0074] Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and are not to be construed as limiting the present application, and the person skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A bad block handling method of a solid state disk, characterized by, The method comprises the following steps: When an exception is found in data processing of a current page, a block where the current page is located is marked according to an exception reason, and mark information corresponding to the block where the current page is located is obtained; wherein the mark information generated according to different exception reasons is different; When data processing is performed on the solid state disk, the mark information is used for data processing according to the mark information; The method further comprises the following steps: after the mark information corresponding to the block where the current page is located is obtained, the mark information is stored in a mark storage cache area according to a preset structure; and when power-on initialization is performed, the mark information is stored in a mark storage area of a first valid block according to a preset mark storage address, the first valid block being a valid block guaranteed by a hard disk manufacturer; and when power-off initialization is performed, the mark information stored in the mark storage area is initialized to the mark storage cache area. When the exception reason is a reason that causes the entire block to be unusable, the preset structure comprises a bad block reason identifier and a bad block number; when the exception reason is a reason that causes the current page to be unusable, the preset structure comprises the bad block reason identifier, the bad block number, a bad page number, and a bad page number; wherein the bad block reason identifier is used to distinguish whether the bad block is a first type bad block or a second type bad block; the reason that causes the entire block to be unusable at least comprises an original bad block and an erase instruction failure; and the reason that causes the current page to be unusable at least comprises a write instruction failure, a read instruction failure, and a page error correction exceeding a solid state disk correction capability limit. 2.The method of claim 1, wherein, The marking of the block where the current page is located according to the exception reason comprises the following steps: When the exception reason is a reason that causes the entire block to be unusable, the block where the current page is located is marked as a first type bad block; When the exception reason is a reason that causes the current page to be unusable, the block where the current page is located is marked as a second type bad block, and the number information of the current page is recorded. 3.The method of claim 2, wherein, The data processing using the corresponding block according to the mark information comprises the following steps: It is judged whether the current block used for data processing exists corresponding mark information; When it is confirmed that the current block exists corresponding mark information, the bad block type of the block is confirmed according to the mark information corresponding to the block: when the block is a first type bad block, the next predetermined block is used for data processing by skipping the block; when the block is a second type bad block, it is judged whether the number of the current page used for data processing is recorded in the mark information corresponding to the block: when the number is recorded, the next predetermined page is used as the current page for data processing by skipping the page; and when the number is not recorded, the current page is used for data processing; When it is confirmed that the current block does not exist corresponding mark information, the block is used for data processing. 4.The method of claim 2, wherein, The marking of the block where the current page is located according to the exception reason, and the obtaining of the mark information corresponding to the block where the current page is located, comprises the following steps: After receiving a feedback of a read instruction failure in data processing of the current page, data reading is performed by using a solid state disk correction capability: when correction is successful, the bad block reason identifier of the block where the page is located is set as the read instruction failure; and when correction is unsuccessful, the bad block reason identifier of the block where the page is located is set as a page error correction exceeding a solid state disk correction capability limit. 5.The method of claim 1, wherein, The method further comprises the following steps: When it is detected that the first valid block is a bad block and is a first type bad block, the preset mark storage address is pointed to a storage area of another valid block, and the storage area of the valid block is taken as the mark storage area.
6. A solid state drive, comprising: The memory and the processor are characterized in that: The memory is configured to store a program for bad block processing of the solid state disk. The processor is configured to read the program for bad block processing of the solid state disk and execute the method for bad block processing of the solid state disk according to any one of claims 1 to 5.
7. A non-transitory computer-readable storage medium storing a computer program, wherein, The computer program can implement the method for bad block processing of the solid state disk according to any one of claims 1 to 5 when being executed by the processor.
Citation Information
Patent Citations
A method for handle data block errors of a solid state hard disk
CN109460371A
Nand Flash data block classification method and system and use method
CN116185885A