Error handling method and device

By setting error flags in the non-volatile memory during the garbage collection process, the problem of unrecognizable data errors in the non-volatile memory is solved, the identification and processing of erroneous data is realized, and the data integration and reliability of the memory are improved. .

CN111367697BActive Publication Date: 2024-09-03GIGADEVICE SEMICON (BEIJING) INC
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN201811595605.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-25
Publication Date
2024-09-03
Estimated Expiration
2038-12-25

AI Technical Summary

Technical Problem

In the prior art, after garbage collection is performed on non-volatile memory, data errors that cannot be identified often occur.

Method used

When responding to the garbage collection command, the data movement operation is performed to move the valid data scattered in the non-volatile memory blocks to the preset blocks. When an error occurs in reading the page data in the block, an error flag is set and the data is moved. And the corresponding error mark is written to the new page of the default block, so that the erroneous Page data can be identified and processed when the data is read.

Benefits of technology

Through the use of error markers, erroneous Page data that occurs during garbage collection can be easily identified during data reading or other operations, avoiding data misprocessing due to reading errors and improving the data integration and reliability of the memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111367697B
    Figure CN111367697B
Patent Text Reader

Abstract

An embodiment of the present invention provides an error handling method and device, the method comprising receiving a garbage collection instruction; performing a data moving operation in response to the garbage collection instruction; wherein the data moving operation is: moving the scattered valid data in the block Block of the non-volatile memory to a preset Block; if a page Page data read error occurs in the Block during the data moving operation, setting an error mark for the Page data where the error occurs; writing the Page data where the error occurs and the corresponding error mark into a new Page of the preset Block. In the embodiment of the present invention, when it is necessary to read data or perform other operations in the preset Block, the Page data where the error occurs during garbage collection can be easily identified based on the error mark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of memory processing technology, and in particular to an error processing method and device. Background Art

[0002] With the development of various electronic devices and embedded systems, non-volatile memory devices are widely used in electronic products. Common non-volatile memories include NAND flash memories.

[0003] In the prior art, after garbage collection or other processing is performed on the non-volatile memory, data errors often occur and cannot be identified. Summary of the invention

[0004] In view of the above problems, an error handling method and device according to an embodiment of the present invention are proposed to solve the problem that data errors occur in a non-volatile memory and cannot be identified.

[0005] According to a first aspect of the present invention, there is provided an error handling method, which is applied to a non-volatile memory, and the method comprises:

[0006] Receive garbage collection instructions;

[0007] In response to the garbage collection instruction, a data moving operation is performed; wherein the data moving operation is: moving the valid data dispersed in the block Block of the non-volatile memory to a preset Block;

[0008] If a page data read error occurs in a block during the data migration operation, an error flag is set for the page data where the error occurs;

[0009] The Page data where the error occurs and the corresponding error mark are written into the new Page of the preset Block.

[0010] Preferably, it also includes:

[0011] The invalid data in the block Block of the non-volatile memory is erased.

[0012] Receive data reading instructions;

[0013] In response to the data read instruction, reading the data in the preset Block;

[0014] If Page data with an error flag set is detected during the reading process, the error flag is reported to the Host.

[0015] When receiving the invalidation instruction from the Host, the Page data with the error mark set is invalidated.

[0016] When receiving a valid instruction from the Host, the Page data with the error mark set is processed as valid data.

[0017] According to a second aspect of the present invention, there is provided an error handling device, which is applied to a non-volatile memory, and the device comprises:

[0018] A garbage collection instruction receiving module, used for receiving garbage collection instructions;

[0019] A data moving module, used for performing a data moving operation in response to the garbage collection instruction; wherein the data moving operation is: moving the dispersed valid data in the block Block of the non-volatile memory to a preset Block;

[0020] A marking module, used for setting an error mark for the page data where the error occurs if an error occurs in reading the page data in the block during the data migration operation;

[0021] The writing module is used to write the Page data where the error occurs and the corresponding error mark into the new Page of the preset Block.

[0022] Preferably, it also includes:

[0023] The erasing module is used to erase invalid data in the block Block of the non-volatile memory.

[0024] A data reading instruction receiving module, used for receiving a data reading instruction;

[0025] A reading module, configured to read the data in the preset Block in response to the data reading instruction;

[0026] The reporting module is used to report the error mark to the Host if Page data with an error mark is detected during the reading process.

[0027] The invalidation module is used to invalidate the Page data with an error mark set upon receiving an invalidation instruction from the Host.

[0028] The valid module is used to process the Page data with the error mark as valid data when receiving a valid instruction from the Host.

[0029] In an embodiment of the present invention, when performing a data movement operation in response to a garbage collection instruction, if a page data read error occurs in a Block, an error mark will be set for the Page data where the error occurred, and the Page data where the error occurred and the corresponding error mark will be written to a new Page of the preset Block. Then, when it is necessary to read data or perform other operations in the preset Block, the Page data where the error occurred during garbage collection can be easily identified based on the error mark.

[0030] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0032] Figure 1 is a flow chart of an error handling method provided by an embodiment of the present invention;

[0033] Figure 2 is a specific flow chart of an error handling method provided by an embodiment of the present invention;

[0034] Figure 3 is a block diagram of an error handling device provided by an embodiment of the present invention;

[0035] Figure 4 It is a specific block diagram of an error handling device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, are only part of the embodiments of the present invention, not all of the embodiments, and are not used to limit the present invention.

[0037] Reference Figure 1 , a flow chart of an error handling method is shown, applied to non-volatile memory.

[0038] In the embodiment of the present invention, the inventor has found through extensive research that NandFlash Read Error may occur when the FTL (Flash translation layer) performs internal data transfer operations. NandFlash Read Error refers to an uncorrectable error that occurs when the FTL reads NandFlash data. Under normal circumstances, when the FTL performs internal data transfer operations, it does not detect whether the read Page data is erroneous, so the erroneous data is directly moved to a good block without any error record, making it impossible to identify the erroneous data.

[0039] In view of this discovery, in an embodiment of the present invention, when performing a data movement operation in response to a garbage collection instruction, if a page data read error occurs in a Block, an error mark will be set for the Page data where the error occurred, and the Page data where the error occurred and the corresponding error mark will be written to a new Page of the preset Block. Then, when it is necessary to read data or perform other operations in the preset Block, the Page data where the error occurred during garbage collection can be easily identified based on the error mark.

[0040] The method may specifically include the following steps:

[0041] Step 101: Receive a garbage collection instruction.

[0042] In the embodiment of the present invention, considering that with the use of non-volatile memory, some scattered storage and invalid data will fragment the storage space, resulting in the storage space of the non-volatile memory cannot be well utilized, therefore, it may be necessary to organize the storage space of the non-volatile memory through garbage collection.

[0043] In a specific application, receiving a garbage collection instruction may indicate that garbage collection is required. During garbage collection, invalid data in a block of a non-volatile memory may be erased, and scattered valid data may be moved to a preset block, which may be a good block with continuous storage space.

[0044] Step 102: In response to the garbage collection instruction, perform a data moving operation; wherein the data moving operation is: moving the valid data dispersed in the block Block of the non-volatile memory to a preset Block.

[0045] In the embodiment of the present invention, as described above, in response to a garbage collection instruction, the FTL may perform a data migration operation to migrate the valid data dispersed in the block Block of the non-volatile memory to a preset Block.

[0046] Step 103: If a page data read error occurs in a block during the data migration operation, an error flag is set for the page data where the error occurs.

[0047] In an embodiment of the present invention, if a page data read error occurs in a block during a data migration operation, an error mark will be set for the page data where the error occurs. For example, if the maximum number of bits that the FTL can read is 24 bits, and a certain page data contains 25 bits, only 24 bits can be read during reading, and a read error occurs. Therefore, an error mark can be set for the page data where the error occurs. In a specific application, the mark can be stored in the metadata space for self-management in the non-volatile memory to avoid excessive occupation of the user-operable storage space.

[0048] Step 104: Write the Page data where the error occurs and the corresponding error mark into the new Page of the preset Block.

[0049] In the embodiment of the present invention, because the FTL does not have the authority to discard data when used for data migration, even if an error occurs when reading data, the Page data where the error occurs and the corresponding error mark need to be written into a new Page of the preset Block, so that when other modules process the Page data, the erroneous Page data can be identified.

[0050] As a preferred embodiment of the present invention, refer to Figure 2 , the method further comprises:

[0051] Step 105: Receive a data read instruction.

[0052] Step 106: In response to the data read instruction, read the data in the preset Block.

[0053] Step 107: If Page data with an error flag set is detected during the reading process, the error flag is reported to the Host.

[0054] Step 108: When receiving the invalidation instruction from the Host, the Page data with the error mark set is invalidated.

[0055] Step 109: When receiving a valid instruction from the Host, the Page data with the error mark set is processed as valid data.

[0056] In an embodiment of the present invention, after receiving a data read instruction, the FTL can read the Page data in a preset Block. If the Page data with an error mark is detected during the fetching process, the error mark is reported to the Host, and the Host is used to determine whether the Page data corresponding to the error mark is invalid or processed as valid data according to the actual application. In an actual application, assuming that the Page data corresponding to the error mark is only a small part of a certain video data segment, and processing it as valid data will not affect the video, a valid instruction can be issued, and when receiving a valid instruction from the Host, the Page data with the error mark is processed as valid data; the Host can also determine that the Page data corresponding to the error mark is invalid, and a void instruction can be issued. When receiving a void instruction from the Host, the Page data with the error mark is invalidated.

[0057] To sum up, in the embodiments of the present invention, when performing data movement operations in response to garbage collection instructions, if a page data read error occurs in a Block, an error mark will be set for the Page data where the error occurred, and the Page data where the error occurred and the corresponding error mark will be written to a new Page of the preset Block. Then, when it is necessary to read data or perform other operations in the preset Block, the Page data where the error occurred during garbage collection can be easily identified based on the error mark.

[0058] It should be noted that, for the above method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present invention.

[0059] Reference Figure 3 , shows a block diagram of an error handling device, applied to a non-volatile memory, the device comprising:

[0060] A garbage collection instruction receiving module 210, used to receive a garbage collection instruction;

[0061] The data moving module 220 is used to perform a data moving operation in response to the garbage collection instruction; wherein the data moving operation is: moving the valid data dispersed in the block Block of the non-volatile memory to a preset Block;

[0062] A marking module 230, configured to set an error mark for the page data where the error occurs if an error occurs in reading the page data in the block during the data migration operation;

[0063] The writing module 240 is used to write the Page data where the error occurs and the corresponding error mark into the new Page of the preset Block.

[0064] Preferably, refer to Figure 4 ,exist Figure 3 On the basis of

[0065] The erasing module 250 is used to erase invalid data in the block Block of the non-volatile memory.

[0066] A data reading instruction receiving module 260, used for receiving a data reading instruction;

[0067] A reading module 270, configured to read the data in the preset Block in response to the data reading instruction;

[0068] The reporting module 280 is configured to report the error flag to the Host if Page data with an error flag is detected during the reading process.

[0069] The invalidation module 290 is used to invalidate the Page data with an error mark set upon receiving an invalidation instruction from the Host.

[0070] The valid module 300 is used to process the Page data with the error mark as valid data when receiving a valid instruction from the Host.

[0071] To sum up, in the embodiments of the present invention, when performing data movement operations in response to garbage collection instructions, if a page data read error occurs in a Block, an error mark will be set for the Page data where the error occurred, and the Page data where the error occurred and the corresponding error mark will be written to a new Page of the preset Block. Then, when it is necessary to read data or perform other operations in the preset Block, the Page data where the error occurred during garbage collection can be easily identified based on the error mark.

[0072] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0073] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0074] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0075] In a typical configuration, the computer device includes one or more processors (CPU), input / output interfaces, network interfaces and memory. Memory may include non-permanent memory in computer-readable media, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium. Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0076] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable error handling terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable error handling terminal device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0077] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable error handling terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0078] These computer program instructions can also be loaded onto a computer or other programmable error processing terminal device so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0079] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0080] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0081] The above is a detailed introduction to an error handling method and an error handling device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An error handling method, characterized in that: Applied to non-volatile memory, the method comprises: Receive garbage collection instructions; In response to the garbage collection instruction, a data moving operation is performed; wherein the data moving operation is: moving the dispersed valid data in the block Block of the non-volatile memory to a preset Block; the preset Block has a continuous storage space; If a page data read error occurs in a block during the data migration operation, an error flag is set for the page data where the error occurs; Writing the Page data where the error occurs and the corresponding error mark into the new Page of the preset Block; After writing the erroneous Page data and the corresponding error mark into the new Page of the preset Block, the method further includes: Receive data reading instructions; In response to the data read instruction, reading the data in the preset Block; If Page data with an error mark is detected during the reading process, the error mark is reported to the Host; the Host is used to determine whether the Page data corresponding to the error mark is invalid or processed as valid data according to the actual application; The determining, based on actual application, whether to invalidate or process the Page data corresponding to the error mark as valid data includes: If the Page data corresponding to the error mark is part of the overall data and is processed as the valid data without affecting the overall data, the Host issues a valid instruction; If the Page data corresponding to the error mark is processed as the valid data, which affects the overall data, the Host issues a cancel instruction; After reporting the error mark to the Host, the method further includes: In case of receiving a cancellation instruction from the Host, the Page data with the error mark set is cancelled; When receiving a valid instruction from the Host, the Page data with the error mark set is processed as valid data.

2. The method according to claim 1, characterized in that Also includes: The invalid data in the block Block of the non-volatile memory is erased.

3. An error handling device, characterized in that: Applied to non-volatile memory, the device comprises: A garbage collection instruction receiving module, used for receiving garbage collection instructions; A data moving module, used for performing a data moving operation in response to the garbage collection instruction; wherein the data moving operation is: moving the dispersed valid data in the block Block of the non-volatile memory to a preset Block; the preset Block has a continuous storage space; A marking module, used for setting an error mark for the page data where the error occurs if an error occurs in reading the page data in the block during the data migration operation; A writing module, used for writing the Page data where the error occurs and the corresponding error mark into a new Page of the preset Block; The device also includes: A data reading instruction receiving module, used for receiving a data reading instruction; A reading module, configured to read the data in the preset Block in response to the data reading instruction; A reporting module, configured to report the error mark to the Host if Page data with an error mark is detected during the reading process; the Host is configured to determine whether the Page data corresponding to the error mark is invalid or processed as valid data according to actual applications; The determining, based on actual application, whether to invalidate or process the Page data corresponding to the error mark as valid data includes: If the Page data corresponding to the error mark is part of the overall data and is processed as the valid data without affecting the overall data, the Host issues a valid instruction; If the Page data corresponding to the error mark is processed as the valid data, which affects the overall data, the Host issues a cancel instruction; A cancellation module, configured to cancel the Page data with an error mark set upon receiving a cancellation instruction from the Host; The valid module is used to process the Page data with the error mark as valid data when receiving a valid instruction from the Host.

4. The device according to claim 3, characterized in that Also includes: The erasing module is used to erase invalid data in the block Block of the non-volatile memory.

Citation Information

Patent Citations

  • Data collection method used for remote wireless meter reading system

    CN101458868A

  • Control circuit and storage system and method for identifying error data in flash memory

    CN101944386A

  • Solid-state drive junk recovery method

    CN106649132A

  • Bad block management method for NANDFLASH

    CN106681936A

  • Garbage collection optimization method for flash

    CN107301132A