Method for processing abnormal data in flash memory, electronic device and storage medium
By recording and backup abnormal power loss information in flash memory, and avoiding the operation of the abnormal position when meeting the conditions, the problem of decreased data operation rate after flash memory abnormality is solved, and data operation efficiency is improved.
Patent Information
- Application Number
- CN202411154853.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-08-21
AI Technical Summary
After the flash memory is abnormally powered down and powered up again, if data operations are performed on damaged pages in the flash memory, the data operation rate will be significantly reduced, because error correction is required and time is wasted.
When the flash memory is abnormal and re -power, the power loss information of the open data block is obtained, including the position and block number of the abnormality of the page. Write this information into two logistics blocks of each other. When meeting the target conditions, obtain an abnormal power loss information and perform the target operation in a way to avoid the abnormal position.
By avoiding the operation range of the pages recorded in the abnormal power loss information, the problem operation rate of the target operation rate caused by the operation of the abnormal position in the open data block of the flash memory is avoided.
Smart Images

Figure CN118672820B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data storage, and in particular relates to a method for processing abnormal data in a flash memory, an electronic device and a storage medium. Background Art
[0002] Normally, when a flash memory is powered off abnormally during use, some pages in a data block in the flash memory may be damaged. These damaged pages include not only the pages in the data block that are being written to when the power is off abnormally, but also the pages near the pages that are being written to. Figure 1 As shown in the figure, when an abnormal power failure occurs when performing a data write operation on a data block of the flash memory, for example, when an abnormal power failure occurs when data is written to Page n+3 of the data block, at least two pages (such as Page n+1 and Page n+3) may be damaged. After the flash memory is powered on, the data from Page n+1 to Page n+3 cannot be used anymore, and Page n+4 to Page n+m need to be filled with dummy data to ensure that the data written next time will not be wrong. The space from Page n+1 to Page n+m should not be used. Because the data in this space may be abnormal, if it is read, the SSD program will enter the error correction process, wasting a lot of time, causing some programs that need to be completed quickly to have performance degradation, such as scanning inspection, which requires a quick scan of the specified pages of all data blocks. If such a page damaged by power failure is read, it will take a lot of time to correct the error, resulting in the failure to complete the scan within the specified time.
[0003] It can be seen that after the flash memory loses power abnormally and is powered on again, if the data operation on the flash memory involves operations on these damaged pages in the data block, then since the data on these damaged pages may be abnormal, once these abnormal data are read, they will be automatically corrected, resulting in a significant decrease in the data operation rate of the flash memory. Summary of the invention
[0004] The embodiments of the present application provide a method for processing abnormal data in a flash memory, an electronic device, and a storage medium disclosed in the present application, which can solve the problem in the related art that the data operation rate is significantly reduced due to data operations on damaged pages in the flash memory.
[0005] In a first aspect, an embodiment of the present application provides a method for processing abnormal data in a flash memory, the method comprising:
[0006] When the flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is acquired, the abnormal power-off information including a position range where an abnormality occurs on a page in the open data block and a block number of the open data block;
[0007] Writing the abnormal power failure information into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block are backed up for each other;
[0008] When the target condition is met, the abnormal power failure information is obtained; the abnormal power failure information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block;
[0009] A target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information.
[0010] In a second aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0011] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed, the steps of the method described in the first aspect are implemented.
[0012] In a fourth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0013] In an embodiment of the present application, when a flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is obtained, the abnormal power-off information including a position range of a page in the open data block where an abnormality occurs and a block number of the open data block; the abnormal power-off information is written into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other; when a target condition is met, the abnormal power-off information is obtained; the abnormal power-off information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block; and a target operation is performed on the open data block in a manner that avoids the position range contained in the abnormal power-off information. In this way, abnormal power-off information including the position range where the abnormality occurs in the pages in the open data block is written into the first log block and the second log block in the flash memory, so that the first log block and the second log block back up each other; when the target conditions are met, the abnormal power-off information is obtained, and the target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information, thereby avoiding performing the target operation on the position range where the abnormality occurs in the pages in the open data block recorded in the abnormal power-off information, thereby avoiding the problem of a significant decrease in the target operation rate due to performing the target operation on the position range where the abnormality occurs in the open data block of the flash memory. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is an open data block storage structure diagram provided in an embodiment of the present application.
[0015] Figure 2 It is a flowchart of a method for processing abnormal data in a flash memory provided by an embodiment of the present application.
[0016] Figure 3 It is a flowchart of an example process of writing the abnormal power failure information into the first log block and the second log block in the flash memory in a method for processing abnormal data of the flash memory provided by an embodiment of the present application.
[0017] Figure 4-1 It is a flowchart of a method for processing abnormal data in a flash memory provided by an embodiment of the present application.
[0018] Figure 4-2 This is an open data block storage structure diagram provided in an embodiment of the present application.
[0019] Figure 4-3 This is a first log block storage structure diagram provided in an embodiment of the present application.
[0020] Figure 4-4It is a schematic diagram of writing abnormal power failure information of an open data block stored in a log block into the last undamaged page in the open data block in an embodiment of the present application.
[0021] Figure 5 It is a structural block diagram of a device for processing abnormal data in a flash memory provided by an embodiment of the present application.
[0022] Figure 6 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0025] Flash memory is a non-volatile storage device. A solid state drive (SSD) is a hard drive that uses flash memory as a storage medium. Typically, flash memory such as solid state drives (SSDs) are not protected by capacitors. When an abnormal power failure (unsafe power failure) occurs while writing data to the flash memory, data on certain pages of the data block in the flash memory will be lost. Taking SSD as an example, its main storage medium is NAND flash (NAND flash), and NAND flash will experience data loss when there is an abnormal power failure. Not only will the page be damaged during the power failure, but the previous page or nearby pages will also lose data due to physical connections.
[0026] In an embodiment of the present application, when a flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is obtained, the abnormal power-off information including a position range of a page in the open data block where an abnormality occurs and a block number of the open data block; the abnormal power-off information is written into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other; when a target condition is met, the abnormal power-off information is obtained; the abnormal power-off information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block; and a target operation is performed on the open data block in a manner that avoids the position range contained in the abnormal power-off information. In this way, abnormal power-off information including the position range where the abnormality occurs in the pages in the open data block is written into the first log block and the second log block in the flash memory, so that the first log block and the second log block back up each other; when the target conditions are met, the abnormal power-off information is obtained, and the target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information, so as to avoid performing the target operation on the position range where the abnormality occurs in the pages in the open data block recorded in the abnormal power-off information, thereby avoiding the problem of a significant decrease in the target operation rate due to performing the target operation on the position range where the abnormality occurs in the open data block of the flash memory.
[0027] In addition, the embodiment of the present application sets two log record blocks to back up each other, rather than setting only one log record block. If only one log record block (for example, the first log record block) is set to record abnormal power failure information, when the abnormal power failure information is written into the first log block in the flash memory, if the flash memory has an abnormal power failure, it will cause the first log block to fail to write the abnormal power failure information, so that the abnormal power failure information is lost. In the embodiment of the present application, the abnormal power failure information can be written into the first log block and the second log block in the flash memory, and the first log block and the second log block are two different log blocks in the flash memory, so that the first log block and the second log block are backed up for each other. When the target condition is met, the abnormal power failure information can be obtained based on the target log block, and the target log block is at least one of the first log block and the second log block, so that the abnormal power failure information is saved in a way that the first log block and the second log block are backed up for each other, so as to avoid the loss of abnormal power failure information. Among them, the target log block can be the one with the larger block number in the first log block and the second log block, for example, the block number of the first log block is 100, and the block number of the second log block is 200. Then, the target log block can be the second log block.
[0028] In addition, in order to avoid the situation that when writing abnormal power-off information into the first log block in the flash memory, the flash memory fails to write the abnormal power-off information into the first log block due to abnormal power-off, which affects the writing of the abnormal power-off information into the second log block in the flash memory, in the present application, when the flash memory fails to write the abnormal power-off information of the open data block into the first log block in the flash memory, when the flash memory is powered on again, the abnormal power-off record before the current power-off can be read from the second log block, and the abnormal power-off information of the current power-off of the open data block can be obtained by checking the open data block; the first log block is erased, and re-recorded on the first log block based on the abnormal power-off information obtained and the abnormal power-off record obtained from the second log block; the obtained abnormal power-off information is written into the second log block. In this way, even if the flash memory fails to write the abnormal power-off information of the open data block into the first log block in the flash memory, the first log block can be rebuilt based on the abnormal power-off record obtained from the second log block after powering on again, and the content of the first log block and the content of the second log block can be ensured to be synchronized.
[0029] It should be noted that the open data block in the embodiment of the present application may be a block for storing user data normally, and the log block in the embodiment of the present application may be a block for recording log information specifically.
[0030] It should be understood that all methods for processing abnormal flash memory data provided in the embodiments of the present application can be executed by an electronic device. The electronic device may include a terminal device, such as a computer. The electronic device may execute the method for processing abnormal flash memory data on a flash memory (such as a NAND flash) by calling a master control program in the flash memory. The embodiments of the present application do not limit the specific hardware deployment environment. The flash memory in the embodiments of the present application may be an SSD.
[0031] In the following, in conjunction with the accompanying drawings, all methods for processing abnormal flash memory data provided by the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0032] See also Figure 2 , Figure 2 A flowchart of a method for processing abnormal flash memory data provided by an embodiment of the present application is shown in FIG. Figure 2 As shown, the method comprises the following steps:
[0033] Step 210: when the flash memory is powered off abnormally and then powered on again, abnormal power-off information of open data blocks in the flash memory is obtained, the abnormal power-off information including the position range of the page in the open data block where the abnormality occurs and the block number of the open data block.
[0034] In the embodiment of the present application, the open data block may be a data block dedicated to storing data. When the flash memory is powered off abnormally and then powered on again, the abnormal power-off information of the open data block in the flash memory may be obtained, and the abnormal power-off information may include the position range of the page in the open data block where the abnormality occurs, such as the position range of the page in the open data block where data is damaged due to the abnormal power-off.
[0035] In an embodiment of the present application, the abnormal power-off information may include the position range of the pages in the open data block where the abnormality occurs (i.e., the page abnormal position range of the open data block where the abnormality occurs) and the block number of the open data block where the abnormality occurs. The abnormal power-off information may also include at least one of the time when the abnormality occurs, the chronological order of writing of all open data blocks, and the number of abnormal power-off times.
[0036] Step 220: Write the abnormal power failure information into the first log block and the second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other.
[0037] In the embodiment of the present application, the first log block and the second log block can both be data blocks in the flash memory for storing log information, such as data blocks storing abnormal power failure information of the open data block. In the process of writing the abnormal power failure information into the first log block and the second log block in the flash memory, the abnormal power failure information can be first written into the first log block, and then into the second log block.
[0038] In an embodiment of the present application, if no power failure occurs during the process of writing the abnormal power failure information into the first log block in the flash memory, the abnormal power failure information can be directly written into the second log block after the abnormal power failure information is written into the first log block. If a power failure occurs during the process of writing the abnormal power failure information into the first log block in the flash memory, the abnormal power failure record before the current power failure can be obtained from the second log block after the flash memory is powered on, the first log block can be erased (for example, all data on the first log block can be erased), and the abnormal power failure record obtained from the second log block can be recorded on the first log block. In addition, the abnormal power failure information of the current power failure of the open data block can be obtained by checking the open data block; the abnormal power failure information obtained based on the abnormal power failure information and the abnormal power failure record obtained from the second log block can be re-recorded on the first log block, so that the second log block can be rebuilt, and the content of the second log block can be synchronized with the content of the first log block.
[0039] In an embodiment of the present application, after writing the abnormal power-off information into the first log block and the second log block in the flash memory, at least one of the first log block and the second log block can be determined as a target log block, the abnormal power-off information of the open data block is read from the target log block, and the abnormal power-off information is placed in the target page of the open data block. The target page can be the last undamaged page in the open data block. For example, if the last page in the open data block is not damaged, then the last page in the open data block can be used as the target page. If the last page in the open data block is damaged, then it can be determined whether the second-to-last page of the open data block is damaged. If the second-to-last page is not damaged, the second-to-last page in the open data block can be used as the target page; if the second-to-last page is damaged, then it can be determined whether the third-to-last page of the open data block is damaged. If the third-to-last page is not damaged, the third-to-last page in the open data block can be used as the target page. By analogy, the last undamaged page in the open data block can be used as the target page.
[0040] Step 230: When the target condition is met, abnormal power failure information is obtained; the abnormal power failure information is obtained based on the target log block, and the target log block is at least one of the first log block and the second log block.
[0041] In an embodiment of the present application, the target condition may include: performing a garbage collection operation on an open data block, or performing a scanning operation on an open data block. Specifically, when performing a garbage collection operation on an open data block or performing a scanning operation on an open data block, abnormal power failure information is obtained.
[0042] In an embodiment of the present application, when the target condition is met, abnormal power-off information can be obtained based on the target log block. Specifically, after the abnormal power-off information is written into the first log block and the second log block in the flash memory, when the target condition is met, at least one of the first log block and the second log block can be used as the target log block, and the abnormal power-off information can be obtained from the target log block. For example, when the target condition is met, the abnormal power-off information can be obtained from the first log block, and the abnormal power-off information can also be obtained from the second log block. In one embodiment, the target log block can be the log block in the first log block and the second log block that performs the operation of writing the abnormal power-off information last in the time dimension. Specifically, according to the order of writing operations of all data blocks in the flash memory, it can be determined on which log block of the first log block and the second log block the operation of writing abnormal power failure information is last performed, and the log block on which the operation of writing abnormal power failure information is last performed is used as the target log block, and the abnormal power failure information is obtained from the target log block. For example, according to the order of writing operations of all data blocks in the flash memory, it is determined that the log block on which the operation of writing abnormal power failure information is last performed is the first log block, and the first log block is used as the target log block, and the abnormal power failure information is obtained from the target log block. In the embodiment of the present application, the block number can reflect the order of writing, so the target log block can be the one with the larger block number of the first log block and the second log block, for example, the block number of the first log block is 100, and the block number of the second log block is 200. Then, the target log block can be the second log block.
[0043] In the embodiment of the present application, step 230 may include: if the target condition is met, if the open data block is not yet full, the abnormal power failure information of the open data block may be read from the target log block. In addition, as discussed above, if the abnormal power failure information has been placed in the target page of the open data block earlier, then step 230 may include: if the target condition is met, if the open data block is full, the abnormal power failure information of the open data block may be read from the target page of the open data block.
[0044] Step 240: Execute the target operation on the open data block in a manner avoiding the location range included in the abnormal power failure information.
[0045] Specifically, after obtaining the abnormal power off information, the locations where abnormalities occur due to abnormal power off can be avoided based on the location range of the pages in the open data blocks in the abnormal power off information, and target operations, such as data write operations, data read operations, etc., can be performed on the locations in the open data blocks where no abnormalities occur.
[0046] In an embodiment of the present application, when a flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is obtained, the abnormal power-off information including a position range where a page in the open data block has an abnormality; the abnormal power-off information is written into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other; when a target condition is met, the abnormal power-off information is obtained; the abnormal power-off information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block; and a target operation is performed on the open data block in a manner that avoids the position range contained in the abnormal power-off information. In this way, abnormal power-off information including the position range where the abnormality occurs in the pages in the open data block is written into the first log block and the second log block in the flash memory, so that the first log block and the second log block back up each other; when the target conditions are met, the abnormal power-off information is obtained, and the target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information, so as to avoid performing the target operation on the position range where the abnormality occurs in the pages in the open data block recorded in the abnormal power-off information, thereby avoiding the problem of a significant decrease in the target operation rate due to performing the target operation on the position range where the abnormality occurs in the open data block of the flash memory.
[0047] In one embodiment of the present application, if the open data block has not been fully written, then when the flash memory is powered off abnormally and then powered on again, the abnormal power-off information of the open data block in the flash memory is written into the first log block and the second log block, and at least one of the first log block and the second log block is determined as the target log block. When the target condition is met, when it is detected that the open data block has not been fully written, the abnormal power-off information of the open data block can be read from the target log block. The target log block can be the log block of the first log block and the second log block that last performs the operation of writing the abnormal power-off information in the time dimension. Since the block number can reflect the order of writing, the target log block can be the one with the larger block number of the first log block and the second log block.
[0048] In an embodiment of the present application, after the abnormal power failure information is written into the first log block and the second log block in the flash memory, if it is detected that the open data block meets the preset conditions, the abnormal power failure information can be written into the target page in the open data block in the flash memory, and the target page can be the last undamaged page in the open data block. For example, during the write operation, when it is detected that there is only the last undamaged page left in the open data block, the abnormal power failure information obtained from the target log block can be written into the last undamaged page in the open data block in the flash memory. Accordingly, if the open data block is full when the target conditions are met, the abnormal power failure information of the open data block can be read from the target page of the open data block.
[0049] In one embodiment of the present application, the abnormal power-off information may also include at least one of the abnormal occurrence time, the sequential writing order of all open data blocks, and the number of abnormal power-offs. The abnormal occurrence time may be the time when an abnormal power-off occurs when an operation is performed on any data block in the flash memory, such as the time when an abnormal power-off occurs when writing data to an open data block; the sequential writing order of all open data blocks may be represented by the number (such as the SN number) of the write operation in the flash memory, and this number may be a global number, that is, a unique number that is universal in all blocks of the entire flash memory. This number (such as the SN number) may represent the order in which the pages (Page) of multiple blocks (blocks) of the same flash memory perform write operations, and is used to distinguish the data sequence of different blocks when powering on again. For example, data is first written to data block A, then data is written to data block C, and finally data is written to data block B, then the SN number of the write operation of the data written to data block A is 1, the SN number of the write operation of the data written to data block C is 2, and the SN number of the write operation of the data written to data block B is 3.
[0050] See also Figure 3 , Figure 3 A flowchart of an exemplary process of writing abnormal power failure information into a first log block and a second log block in the flash memory in a method for processing abnormal data in a flash memory provided by an embodiment of the present application, such as Figure 3 As shown, the example process includes the following:
[0051] Step 310: If a power outage occurs during the process of writing abnormal power outage information into the first log block in the flash memory, obtain the abnormal power outage record before the power outage from the second log block after the flash memory is powered on; the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other.
[0052] Before step 310, the following process may be performed: when the flash memory is powered off abnormally and then powered on again, abnormal power-off information of open data blocks in the flash memory is obtained, the abnormal power-off information including the position range of the page in the open data block where the abnormality occurs.
[0053] In an embodiment of the present application, if a power failure occurs during the process of writing the abnormal power failure information generated by the open data block into the first log block in the flash memory, the abnormal power failure record before the power failure can be obtained from the second log block after the flash memory is powered on. The abnormal power failure record before the power failure can be an abnormal power failure record that is located before the power failure in time. The abnormal power failure record may include the position range of the page in the first log block where the abnormality occurs, and may also include at least one of the block number of the abnormal power failure, the time when the abnormality occurs, the order in which all data blocks are written in sequence, and the number of abnormal power failures. The block number of the abnormal power failure may be the number of the open data block, the number of the first log block, or the number of the second log block.
[0054] Step 320: Obtain abnormal power-off information of the current power-off of the open data block by checking the open data block.
[0055] Step 330: performing an erase operation on the first log block, and re-recording on the first log block based on the abnormal power failure information of the current power failure obtained and the abnormal power failure record obtained from the second log block.
[0056] In an embodiment of the present application, after the abnormal power-off record of the first log block before the power-off is obtained from the second log block after the flash memory is powered on, the first log block can be erased, for example, the page damaged by the abnormal power-off of the flash memory in the first log block can be erased, or the entire first log block can be erased as a whole; and the abnormal power-off record obtained from the second log block is recorded on the first log block. Specifically, after the first log block is erased, the abnormality of the open data block is re-recorded in the first log block according to the abnormal power-off record obtained from the second log block. For example, after the page damaged by the abnormal power-off of the flash memory in the first log block is erased, the abnormal power-off record is restored in the first log block in sequence in the first log block according to the order of writing of all data blocks in the abnormal power-off record in the erased page of the first log block. In addition, the abnormal power-off information of the current power-off of the open data block can be obtained by checking the open data block, and the abnormal power-off information obtained and the abnormal power-off record obtained from the second log block are re-recorded on the first log block. In this way, it can be ensured that the content of the first log block is synchronized with the content of the second log block.
[0057] Step 340: Write the acquired abnormal power-off information into the second log block in the flash memory.
[0058] In the embodiment of the present application, after the abnormal power failure information is written into the first log block in the flash memory, the abnormal power failure information may be written into the second log block in the flash memory.
[0059] In an embodiment of the present application, in the event that an abnormal power failure occurs in the flash memory while the abnormal power failure information of the open data block is being written into the first log block in the flash memory, when power is restored, the abnormal power failure record before the current power failure is read from the second log block, the first log block is erased, and a record is made on the first log block based on the abnormal power failure record obtained from the second log block, so that even if an abnormal power failure occurs in the flash memory while the abnormal power failure information of the open data block is being written into the first log block in the flash memory, the abnormal power failure information can be written into the first log block in the flash memory after power is restored based on the abnormal power failure record obtained from the second log block.
[0060] See also Figure 4-1 , Figure 4-1 A flowchart of a method for processing abnormal flash memory data provided by an embodiment of the present application is shown in FIG. Figure 4-1 As shown, the method comprises the following steps:
[0061] Step 410: when the flash memory is powered off abnormally and then powered on again, abnormal power-off information of open data blocks in the flash memory is obtained, the abnormal power-off information including the position range of the page in the open data block where the abnormality occurs and the block number of the open data block where the abnormality occurs.
[0062] In the embodiment of the present application, the open data block may be a data block dedicated to storing data, and a flash memory may include multiple open data blocks. When the flash memory is powered off abnormally and then powered on again, the abnormal power-off information of the open data blocks in the flash memory may be obtained. The abnormal power-off information may include the location range of the pages in the open data blocks where the abnormality occurs, such as the location range of the pages in the open data blocks where data is damaged due to the abnormal power-off. For example, Figure 4-2 As shown, in the process of writing data to the open data block A in the flash memory, when performing the data writing operation on Page n+2 numbered 1115 in the open data block A, the flash memory has an abnormal power failure. At this time, not only the data of Page n+2 in the open data block A is damaged, but also the data of the page (e.g., Page n) near Page n+2 in the open data block A may be damaged. Therefore, the abnormal power failure information of the open data block A in the flash memory can be obtained. The abnormal power failure information may include the position information of Page n to Page n+2 where the abnormality occurs in the open data block A (e.g., numbered 1113 to numbered 1115), to indicate that the position of Page n to Page n+2 in the open data block A is abnormal and should not be accessed again. In addition, all pages after the position of Page n+2 in the open data block A can be written with dummy data to prevent errors in the next data write.
[0063] In an embodiment of the present application, the abnormal power failure information may include the location range of the page in the open data block where the abnormality occurs and the block number of the abnormal power failure. The abnormal power failure information may also include at least one of the time when the abnormality occurred, the order in which all open data blocks are written, and the number of abnormal power failures.
[0064] In an embodiment of the present application, when the flash memory is powered off abnormally and then powered on again, abnormal power off information of open data blocks in the flash memory can also be obtained. The abnormal power off information may include the location range where the page in the open data block has an abnormality.
[0065] Step 420: If a power outage occurs during the process of writing abnormal power outage information into the first log block in the flash memory, obtain the abnormal power outage record before the power outage from the second log block after the flash memory is powered on; the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other.
[0066] In the embodiment of the present application, the abnormal power failure information can be written into the first log block in the flash memory based on the order of writing all the data blocks included in the abnormal power failure information, so that the abnormal power failure information of the open data block is stored before writing data to the open data block next time. For example, when the flash memory has an abnormal power failure when writing data to Page n+2 numbered 1115 in the open data block A, if Figure 4-3 As shown, the abnormal power failure information of the acquired open data block A can be written into Page n+1 of the first log block B according to the writing order, and the page number is 1116.
[0067] In the embodiment of the present application, both the first log block and the second log block may include a single-level cell (SLC). If a power failure occurs during the process of writing the abnormal power failure information generated by the open data block into the first log block in the flash memory, the abnormal power failure record before the power failure can be obtained from the second log block after the flash memory is powered on. The abnormal power failure record before the power failure can be an abnormal power failure record that is located before the power failure in time. The abnormal power failure record may include the position range of the page in the first log block where the abnormality occurs and the block number of the open data block with the abnormal power failure, and may also include at least one of the abnormal occurrence time, the order of writing all data blocks in sequence, and the number of abnormal power failures. For example, if a power failure occurs during the process of writing the abnormal power failure information generated by the open data block A into Page n+1 in the first log block B in the flash memory, resulting in data from Page n to Page n+1 in the first log block B being damaged, the first log block may be erased, and re-recorded on the first log block based on the abnormal power failure information of the current power failure obtained and the abnormal power failure record obtained from the second log block.
[0068] Step 430: Obtain abnormal power-off information of the current power-off of the open data block by checking the open data block.
[0069] Step 440: performing an erase operation on the first log block, and re-recording on the first log block based on the abnormal power failure information of the current power failure obtained and the abnormal power failure record obtained from the second log block.
[0070] In an embodiment of the present application, after the abnormal power-off record of the first log block before the current power-off is obtained from the second log block after the flash memory is powered on, the first log block can be erased, for example, the page damaged by the abnormal power-off of the flash memory in the first log block can be erased, or the entire first log block can be erased as a whole; and the abnormal power-off record obtained from the second log block is recorded on the first log block. Specifically, after the first log block is erased, the abnormality of the open data block is re-recorded in the first log block according to the abnormal power-off record obtained from the second log block. For example, after all the data of the first log block is erased, the abnormal power-off record is restored in the first log block in sequence according to the order of writing all the data blocks in the abnormal power-off record. In addition, the abnormal power-off information of the current power-off of the open data block can be obtained by checking the open data block, and the abnormal power-off information obtained and the abnormal power-off record obtained from the second log block are re-recorded on the first log block. In this way, the content of the first log block can be ensured to be synchronized with the content of the second log block.
[0071] In the embodiment of the present application, after the abnormal power failure information generated by the open data block is written into the first log block in the flash memory, step 450 may be executed.
[0072] Step 450: Write the abnormal power-off information into the second log block in the flash memory.
[0073] In the embodiment of the present application, after the abnormal power failure information is written into the first log block in the flash memory, the abnormal power failure information may be written into the second log block in the flash memory.
[0074] Step 460: If it is detected that the open data block meets the preset condition, the abnormal power failure information may be written into the target page in the open data block in the flash memory.
[0075] In an embodiment of the present application, the target page may be the last undamaged page in an open data block. For example, when it is detected that only the last undamaged page is left in the open data block, the abnormal power failure information may be written to the target page in the open data block in the flash memory. Specifically, when writing to the target page in the open data block, at least one of the first log block and the second log block may be determined as the target log block, and the abnormal power failure information of the open data block may be read from the target log block, and the abnormal power failure information may be placed in the target page (for example, the last undamaged page) of the open data block, and the abnormal power failure information in the first log block and the second log block may be deleted accordingly. Figure 4-4 As shown, Figure 4-4 The figure shows three blocks in the flash memory, namely, the open data block, the first log block, and the second log block. Each square in the block represents a page, and the figure shows the last eight pages in the block by way of example. When the flash memory is powered off abnormally and then powered on again, the abnormal power-off information of the open data block in the flash memory is obtained and written into the first log block and the second log block. In this way, the first log block and the second log block can back up each other and both save the abnormal power-off information of the open data block (such as Figure 4-4 When only the last undamaged page is left in the open data block, the abnormal power failure information can be written into the last undamaged page in the open data block. Figure 4-4 As shown by the arrow in the middle, the abnormal power failure information of the open data block stored in the first log block can be written to the last undamaged page in the open data block. In this way, the last undamaged page in the open data block stores the abnormal power failure information of the open data block (such as Figure 4-4 Afterwards, the abnormal power-off information stored in the first log block and the second log block may be deleted.
[0076] If the open data blocks have not been fully written, then when the flash memory experiences an abnormal power failure and is powered on again, the abnormal power failure information of the open data blocks in the flash memory is obtained and written into the first log block and the second log block, and at least one of the first log block and the second log block is determined as the target log block, so that the abnormal power failure information of the open data blocks caused by the abnormal power failure can be completely preserved during the life cycle of the flash memory.
[0077] Step 470: When the target condition is met, abnormal power failure information is obtained; the abnormal power failure information is obtained based on the target log block, and the target log block is at least one of the first log block and the second log block.
[0078] In an embodiment of the present application, the target condition may include: performing a garbage collection operation on an open data block, or performing a scanning operation on the open data block. Specifically, when performing a garbage collection operation on an open data block or performing a scanning operation on an open data block, abnormal power failure information is obtained.
[0079] In the embodiment of the present application, if the target condition is met, if the open data block is not yet full, the abnormal power failure information of the open data block can be read from the target log block. Correspondingly, if the target condition is met, if the open data block is full, the abnormal power failure information of the open data block can be read from the target page of the open data block.
[0080] Step 480: Execute the target operation on the open data block in a manner avoiding the location range included in the abnormal power failure information.
[0081] Specifically, after obtaining the abnormal power off information, the locations where abnormalities occur due to abnormal power off can be avoided based on the location range of the pages in the open data blocks in the abnormal power off information, and target operations, such as data write operations, data read operations, etc., can be performed on the locations in the open data blocks where no abnormalities occur.
[0082] In an embodiment of the present application, when a flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is obtained, the abnormal power-off information including a position range where a page in the open data block has an abnormality; the abnormal power-off information is written into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other; when a target condition is met, the abnormal power-off information is obtained; the abnormal power-off information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block; and a target operation is performed on the open data block in a manner that avoids the position range contained in the abnormal power-off information. In this way, abnormal power-off information including the position range where the abnormality occurs in the pages in the open data block is written into the first log block and the second log block in the flash memory, so that the first log block and the second log block back up each other; when the target condition is met, the abnormal power-off information is obtained and acquired based on the target log block of at least one of the first log block and the second log block, and the target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information, so as to avoid performing the target operation on the position range where the abnormality occurs in the pages in the open data block recorded in the abnormal power-off information, thereby avoiding the problem of a significant decrease in the target operation rate due to performing the target operation on the position range where the abnormality occurs in the open data block of the flash memory.
[0083] In order to better understand the method for processing abnormal flash memory data provided in the embodiment of the present application, further explanation is given below. It should be understood that the discussion below is only exemplary.
[0084] When an abnormal power failure occurs while performing a data write operation in a data block of the flash memory, not only will the data of the page being written in the data block (for example, Page n+2) be damaged, but also the data of the pages within a certain range near the page being written in the data block (for example, Page n) will be damaged. In an embodiment of the present application, if it is user data (for example, data recorded in the open data block described above), all data after the earliest damaged data caused by the power failure can be discarded (as permitted by the protocol), and the locations of these damages are recorded. If it is log data (for example, information recorded in the first log block or the second log block described above), only the data that cannot be saved due to the power failure will be lost, and the data written before the abnormal power failure will be guaranteed not to be lost through mutual backup between the first log block and the second log block, thus forming a complete logic of data protection.
[0085] The method for processing abnormal data of a flash memory provided by an embodiment of the present application can ensure that the page (Page) damaged by abnormal power failure is recorded and no longer read. The abnormal power failure information of open block A (i.e., the open data block mentioned above) is written to log block B (such as the first log block mentioned above) and log block C (such as the second log block mentioned above) in sequence, so that log block B and log block C are backed up for each other; then when open block A is written to the last Page, the abnormal power failure information of open block A is read from log block B or log block C, and written to the last Page of open block A. When the flash memory is powered on again to read open block A, the abnormal power failure information is read from the last Page of open block A (when open block A is full) or from log block B / C (when open block A is not full), so that the Page of open block A damaged when the flash memory is powered off abnormally is no longer read, which can avoid the reconstruction timeout caused by data damage when the flash memory is powered on again.
[0086] Specifically, when an abnormal power failure occurs during a write operation on a page of open block A, a position range is generated when power is restored, and pages within this position range cannot be accessed any more. For example, as shown in Table 1 below, when an abnormal power failure occurs during a write operation on Page n+3 of open block A, when power is restored, Page n+1 to Page n+3 of open block A cannot be accessed any more.
[0087] Table 1
[0088]
[0089] Among them, SN can represent the order in which write operations are performed on pages of multiple blocks in the same flash memory, and is used to distinguish the data sequence of different blocks when power is restarted.
[0090] When the power is turned on again, the space between Page n+1 and Page n+m of open block A can no longer be read, so an abnormal power failure message is generated. Before open block A continues to write any data from Page n+m+1, the abnormal power failure message of open block A (the location range from Page n+1 to Page n+m) needs to be stored.
[0091] Therefore, the abnormal power failure information of open block A is written into log block B. For example, as shown in Table 2 below, the abnormal power failure information of open block A can be written into Page n+3 of log block B.
[0092] Table 2
[0093]
[0094] In particular, all abnormal power failure information of open block A may not exceed one Page. If the number of power failures is very large and causes all abnormal power failure information of open block A to exceed one Page, all Pages following the Page damaged by the last abnormal power failure of open block A may be filled with dummy data and no longer used.
[0095] If the flash memory loses power abnormally when writing the abnormal power failure information of open block A to Page n+3 of log block B, and Page n+2 of log block B is damaged, when the power is turned on again, not only the abnormal power failure information indicating that Page n+1 and Page n+3 of openblock A cannot be written is lost, but also the location information of the last time openblock A cannot be written may be lost, so there may be a problem, and the related technology can only rescan open block A.
[0096] When writing the abnormal power failure information of open block A into log block B, if there is no power failure, the abnormal power failure information is written into log block C. For example, as shown in Table 3 below, the abnormal power failure information is written into Page n+3 of log block C.
[0097] Table 3
[0098]
[0099] If a power failure occurs when writing the abnormal power failure information of open block A to log block B, the record before the power failure (such as the abnormal power failure record mentioned above) can be read from log block C, and then logblock B is erased to restore the abnormal power failure record before the power failure, and then the abnormal power failure information of open block A is written to logblock B. This ensures that when writing the abnormal power failure information of open block A to log block B, even if an abnormal power failure occurs, no data will be lost.
[0100] Similarly, if a power outage occurs while writing the abnormal power-off information of open block A to log block C, the records before the power outage (such as the abnormal power-off records mentioned above) can be read from log block B. After power-on, logblock C can be erased and recorded again without causing any data loss.
[0101] When open block A is written to the last page, read the abnormal power failure information from log block B or logblock C, and write the abnormal power failure information to the last page of open block A. If power failure occurs at this time, follow the above steps. If power failure does not occur, clear the abnormal power failure information in log block B and log block C.
[0102] When open block A needs to be garbage collected or scanned, the abnormal power failure information of open block A can be read from the last page of open block A (when open block A is full) or log block B / C (when open block A is not full), and the location damaged by power failure can be avoided according to the abnormal power failure information.
[0103] The method for processing abnormal data in a flash memory provided in the embodiment of the present application can also be used to save correct data during a power outage to avoid a reconstruction timeout due to data corruption during power-on.
[0104] In the embodiment of the present application, log block B and log block C may both include a single level cell (SLC). In addition, one abnormal power failure information may actually exceed one page, and one log block may contain abnormal power failure information of multiple open blocks, but the number of open blocks may generally not exceed 10. Log block B and logblock C only record the abnormal power failure information of open block A. When an open block is written to the last page, the abnormal power failure information of the open block is placed on the last page of the open block itself. If the last page is damaged, it needs to be placed on an undamaged page in advance.
[0105] Figure 5 5 is a structural block diagram of a device 500 for processing abnormal flash memory data provided by an embodiment of the present application. Figure 5 The device 500 for processing abnormal flash memory data provided by the embodiment of the present application includes:
[0106] The acquisition module 510 is used to acquire abnormal power-off information of an open data block in the flash memory when the flash memory is abnormally powered off and then powered on again, wherein the abnormal power-off information includes a position range where an abnormality occurs on a page in the open data block and a block number of the open data block;
[0107] A writing module 520, configured to write the abnormal power-off information into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block are backed up for each other;
[0108] The acquisition module 510 is further configured to acquire the abnormal power failure information when a target condition is met; the abnormal power failure information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block;
[0109] The execution module 530 is configured to execute a target operation on the open data block in a manner avoiding the position range included in the abnormal power failure information.
[0110] In an embodiment of the present application, when a flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is obtained, the abnormal power-off information including a position range of a page in the open data block where an abnormality occurs and a block number of the open data block; the abnormal power-off information is written into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block back up each other; when a target condition is met, the abnormal power-off information is obtained; the abnormal power-off information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block; and a target operation is performed on the open data block in a manner that avoids the position range contained in the abnormal power-off information. In this way, abnormal power-off information including the position range where the abnormality occurs in the pages in the open data block is written into the first log block and the second log block in the flash memory, so that the first log block and the second log block back up each other; when the target condition is met, the abnormal power-off information is obtained and acquired based on the target log block of at least one of the first log block and the second log block, and the target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information, so as to avoid performing the target operation on the position range where the abnormality occurs in the pages in the open data block recorded in the abnormal power-off information, thereby avoiding the problem of a significant decrease in the target operation rate due to performing the target operation on the position range where the abnormality occurs in the open data block of the flash memory.
[0111] In one embodiment of the present application, during the process of writing the abnormal power-off information into the first log block and the second log block in the flash memory, if a power-off occurs during the process of writing the abnormal power-off information into the first log block in the flash memory, the acquisition module 510 is further used to acquire the abnormal power-off record before the current power-off from the second log block after the flash memory is powered on; acquire the abnormal power-off information of the current power-off of the open data block by checking the open data block; the writing module 520 is specifically used to perform an erasing operation on the first log block, and re-record on the first log block based on the acquired abnormal power-off information and the abnormal power-off record acquired from the second log block; and write the acquired abnormal power-off information into the second log block.
[0112] In one embodiment of the present application, in the process of acquiring the abnormal power off information when the target condition is met, the acquisition module 510 is specifically used to read the abnormal power off information of the open data block from the target log block if the open data block has not been filled when the target condition is met.
[0113] In one embodiment of the present application, after writing the abnormal power failure information into the first log block and the second log block in the flash memory, the write module 520 is also used to read the abnormal power failure information of the open data block from the target log block when writing to the target page in the open data block, and place the abnormal power failure information in the target page of the open data block.
[0114] In one embodiment of the present application, the target page is the last undamaged page in the open data block; in the process of obtaining the abnormal power-off information when the target condition is met, the acquisition module 510 is specifically used to read the abnormal power-off information of the open data block from the target page of the open data block if the open data block is full when the target condition is met.
[0115] In one embodiment of the present application, the target condition includes: performing a garbage collection operation on the open data block, or performing a scanning operation on the open data block.
[0116] In one embodiment of the present application, the abnormal power failure information further includes: at least one of the abnormal occurrence time, the sequential writing order of all open data blocks, and the abnormal power failure times.
[0117] like Figure 6As shown, the embodiment of the present application also provides an electronic device 600, which can be various types of computers, etc. The electronic device 600 includes: a processor 610 and a memory 620, and the memory 620 stores a program or instruction, and the program or instruction is executed by the processor 610 to implement the steps of any method described above. For example, when the program is executed by the processor 610, the following process is implemented: when the flash memory is abnormally powered off and powered on again, the abnormal power-off information of the open data block in the flash memory is obtained, and the abnormal power-off information includes the position range of the page in the open data block where the abnormality occurs and the block number of the open data block; the abnormal power-off information is written into the first log block and the second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block are backed up by each other; when the target condition is met, the abnormal power-off information is obtained; the abnormal power-off information is obtained based on the target log block, and the target log block is at least one of the first log block and the second log block; the target operation is performed on the open data block in a manner that avoids the position range contained in the abnormal power-off information. In this way, abnormal power-off information including the position range where the abnormality occurs in the pages in the open data block is written into the first log block and the second log block in the flash memory, so that the first log block and the second log block back up each other; when the target condition is met, the abnormal power-off information is obtained and acquired based on the target log block of at least one of the first log block and the second log block, and the target operation is performed on the open data block in a manner avoiding the position range included in the abnormal power-off information, so as to avoid performing the target operation on the position range where the abnormality occurs in the pages in the open data block recorded in the abnormal power-off information, thereby avoiding the problem of a significant decrease in the target operation rate due to performing the target operation on the position range where the abnormality occurs in the open data block of the flash memory.
[0118] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method for processing flash memory abnormal data provided in any of the above embodiments are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0119] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0120] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0121] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0122] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0124] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for processing abnormal data in a flash memory, characterized in that: include: When the flash memory is powered off abnormally and then powered on again, abnormal power-off information of an open data block in the flash memory is acquired, the abnormal power-off information including a position range where an abnormality occurs on a page in the open data block and a block number of the open data block; Writing the abnormal power failure information into a first log block and a second log block in the flash memory; wherein the first log block and the second log block are two different log blocks in the flash memory, and the first log block and the second log block are backed up for each other; When the target condition is met, the abnormal power failure information is obtained; the abnormal power failure information is obtained based on a target log block, and the target log block is at least one of the first log block and the second log block; performing a target operation on the open data block in a manner avoiding the position range included in the abnormal power failure information; The step of writing the abnormal power-off information into the first log block and the second log block in the flash memory includes: If a power failure occurs during the process of writing the abnormal power failure information into the first log block in the flash memory, obtaining the abnormal power failure record before the current power failure from the second log block after the flash memory is powered on; Acquire abnormal power-off information of the current power-off of the open data block by checking the open data block; Performing an erasing operation on the first log block, and re-recording on the first log block based on the acquired abnormal power failure information and the abnormal power failure record acquired from the second log block; The acquired abnormal power failure information is written into the second log block.
2. The method according to claim 1, characterized in that The obtaining of the abnormal power-off information when the target condition is met includes: In the case where the target condition is met, if the open data block has not been fully written, the abnormal power-off information of the open data block is read from the target log block.
3. The method according to claim 1, characterized in that After writing the abnormal power-off information into the first log block and the second log block in the flash memory, the method further includes: When writing to the target page in the open data block, the abnormal power failure information of the open data block is read from the target log block, and the abnormal power failure information is placed in the target page of the open data block.
4. The method according to claim 3, characterized in that The target page is the last undamaged page in the open data block; The obtaining of the abnormal power-off information when the target condition is met includes: In the case where the target condition is met, if the open data block is full, the abnormal power-off information of the open data block is read from the target page of the open data block.
5. The method according to any one of claims 1 to 4, characterized in that: The target condition includes: performing a garbage collection operation on the open data block, or performing a scanning operation on the open data block.
6. The method according to any one of claims 1 to 4, characterized in that: The abnormal power failure information further includes at least one of: abnormal occurrence time, a sequential writing order of all open data blocks, and abnormal power failure times.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium, characterized in that: The medium stores a program or an instruction, and when the program or the instruction is executed, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Mapping block delay processing method and device based on abnormal power failure and computer equipment
CN117215832A