Memory and allocation method of flash memory blocks thereof

By allocating data to different types of flash blocks in small-capacity memory according to type, and using redundant filling technology, the space waste caused by limited resources of flash blocks is solved, and the stability and resource utilization of the system are improved.

CN119668523AActive Publication Date: 2025-03-21合肥康芯威存储技术有限公司
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202510163041.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-03-21
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

The resources of flash blocks in small-capacity memory are limited, resulting in the problem of wasting space when storing system data, mapping tables, firmware, etc.

Method used

The data invisible to the outside in the memory is divided into data that does not need to be updated and is not important, data that does not need to be updated and is important, and data that needs to be updated, and write them into the risk block and the health block respectively, using redundant filling technology to make full use of the flash block.

Benefits of technology

Effectively reduce the waste of risk blocks, improve the overall stability of the system, and reduce management complexity and resource waste through flexible use of flash blocks and simple data classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668523A_ABST
    Figure CN119668523A_ABST
Patent Text Reader

Abstract

The invention provides a memory and an allocation method of flash memory blocks thereof, and the memory comprises the flash memory blocks which are divided into healthy blocks and risk blocks; the main controller is used for dividing the data invisible to the outside in the memory into unimportant data which does not need to be updated, important data which does not need to be updated and data which needs to be updated according to types; wherein the main controller is used for writing the data which does not need to be updated and is not important into a certain risk block; the main controller is also used for writing the important data which does not need to be updated into a certain health block; and the main controller is also used for writing the data needing to be updated into another health block. According to the memory and the allocation method of the flash memory blocks, the flash memory blocks in the memory with small capacity can be fully utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage, and in particular to a memory and a method for allocating flash memory blocks thereof. Background Art

[0002] For small-capacity memories, since the number of flash memory blocks inside is small, the flash memory block resources are very precious. One more or one less flash memory block will have a greater impact on the life or performance of the memory. When allocating flash memory blocks, some flash memory blocks need to be used to store system data, mapping tables, firmware, etc., and other flash memory blocks need to be used to store user data. Since the flash memory blocks used to store system data, mapping tables, firmware, etc. may have the problem of space waste, for example, when the flash memory blocks used to store mapping tables store the mapping tables, the stored data may not be able to fill a page, which will lead to a waste of resources. Therefore, there is room for improvement. Summary of the invention

[0003] The object of the present invention is to provide a memory and a method for allocating flash memory blocks thereof, which can fully utilize the flash memory blocks inside a small-capacity memory.

[0004] In order to solve the above technical problems, the present invention is achieved through the following technical solutions: The present invention provides a memory, comprising: Flash blocks are divided into healthy blocks and risky blocks; and A main controller is used to classify the data in the memory that is not visible to the outside into data that does not need to be updated and is not important, data that does not need to be updated and is important, and data that needs to be updated; The main controller is used to write the unimportant data that does not need to be updated into a certain risk block; The main controller is also used to write the important data that does not need to be updated into a healthy block; The main controller is further configured to write the data that needs to be updated into another healthy block.

[0005] In one embodiment of the present invention, when the main controller writes the unimportant data that does not need to be updated into a certain risk block, when the certain risk block is not full, the remaining free positions of the certain risk block are filled in redundantly until the entire certain risk block is full; When the main controller writes the important data that does not need to be updated into a healthy block, if the healthy block is not full, the remaining free positions of the healthy block are redundantly filled until the entire healthy block is full.

[0006] In one embodiment of the present invention, when the main controller writes the important data that does not need to be updated into a healthy block, the main controller is further configured to select at least one healthy block to back up the important data that does not need to be updated.

[0007] In one embodiment of the present invention, the data that needs to be updated includes important data that needs to be updated and unimportant data that needs to be updated, and the main controller writes the important data that needs to be updated and the unimportant data that needs to be updated into different pages of the same healthy block.

[0008] In one embodiment of the present invention, when writing the important data that needs to be updated, the main controller is also used to write the unimportant data that needs to be updated on the next row on the page where the last row of the important data that needs to be updated is located after the writing is completed.

[0009] In one embodiment of the present invention, after power failure and power-on again, when the main controller confirms that the unimportant data to be updated exists on the next row of the page where the last row is located, the important data to be updated is complete; When the main controller confirms that the unimportant data that needs to be updated does not exist on the next row of the page where the last row is located, the content of the last row of the important data that needs to be updated is incomplete, and the incomplete content is rewritten until the unimportant data that needs to be updated exists on the next row of the page where the last row is located.

[0010] In one embodiment of the present invention, the main controller is used to write the data invisible to the outside into some healthy blocks, and then write the user data into other healthy blocks.

[0011] The present invention also provides a method for allocating flash memory blocks of a memory, comprising: Divide flash memory blocks into healthy blocks and risky blocks; The data in the memory which is not visible to the outside is divided into data which does not need to be updated and is not important, data which does not need to be updated and is important, and data which needs to be updated according to the type; Writing the unimportant data that does not need to be updated into a risk block; Writing the important data which does not need to be updated into a healthy block; The data that needs to be updated is written to another healthy block.

[0012] In one embodiment of the present invention, the data that needs to be updated includes important data that needs to be updated and unimportant data that needs to be updated. In the step of writing the data that needs to be updated to another healthy block, the important data that needs to be updated and the unimportant data that needs to be updated are written to different pages of the same healthy block.

[0013] In one embodiment of the present invention, the step of writing the important data that needs to be updated and the unimportant data that needs to be updated into different pages of the same healthy block includes: When writing the important data that needs to be updated, after writing is completed, on the page where the last row of the important data that needs to be updated is located, the unimportant data that needs to be updated is written on the next row; After power is turned off and then turned on again, determining whether the unimportant data that needs to be updated exists on the next row of the page where the last row is located; When the unimportant data that needs to be updated exists on the next line of the page where the last line is located, the important data that needs to be updated is complete; When the unimportant data that needs to be updated does not exist on the next row of the page where the last row is located, the content of the last row of the important data that needs to be updated is incomplete, and the incomplete content is rewritten until the unimportant data that needs to be updated exists on the next row of the page where the last row is located.

[0014] As described above, the present invention provides a memory and a method for allocating flash memory blocks thereof. By operating according to the flash memory blocks without strictly distinguishing the uses of the blocks, the flash memory blocks can be used more flexibly, each flash memory block can be more fully utilized, and the waste of risky blocks can be reduced. By simply classifying the data instead of strictly distinguishing them, the management complexity can be reduced. The system is easier to implement and maintain by simply classifying the data based on whether it is important or updated. By flexibly using each flash memory block, the waste of resources is effectively reduced. By optimizing the use of blocks, the system bottleneck caused by uneven resource allocation is reduced, thereby improving the overall stability of the system.

[0015] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0017] Figure 1is a schematic diagram of a memory in one embodiment of the present invention; Figure 2 A flowchart of a method for allocating flash memory blocks of a memory in one embodiment of the present invention; Figure 3 for Figure 2 Flowchart of step S40 in FIG.

[0018] In the figure: 100, main controller; 200, flash memory block; 210, healthy block; 220, risk block. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] In one embodiment, with the popularity of embedded systems and mobile devices, the requirements for storage technology are constantly increasing. As a non-volatile storage technology widely used in modern storage systems, NAND flash memory has been widely used in various electronic devices due to its advantages of high density and low cost. For existing small-capacity memories, the number of internal flash memory blocks is small. In the case of a limited number of flash memory blocks, some flash memory blocks need to be selected from the flash memory blocks as system blocks, table blocks, and code blocks.

[0021] The system block is only used to store configuration data, parameter settings, and other system-level information related to the storage system. The table block is only used to store mapping tables, data structures, or indexes. The code block is only used to store firmware code or read-only data.

[0022] Furthermore, during the use of the memory, different types of flash blocks may have different update frequencies. For example, the system block may be updated less frequently, while the table block may be updated frequently. This imbalance will cause the table block to be overused and the system block to be underused, affecting the overall life of the memory. At the same time, in the table block and the code block, when storing the mapping table or code, the page may not be completely filled. In order to avoid problems with these unused spaces, it may be necessary to fill them with invalid data (dummy), thereby wasting limited storage space. Furthermore, when updating the system block, if the system contains multiple registers (including read-only registers and readable and writable registers), the update operation may trigger the writing of the entire page, resulting in an additional write burden, thereby increasing the number of writes and the wear of the flash memory.

[0023] See also Figure 1 In one embodiment, in order to optimize the performance and life of a small-capacity memory, the present invention discloses a memory that can reallocate internal flash memory blocks 200 to fully utilize a limited number of flash memory blocks 200. The memory may include a main controller 100 and flash memory blocks 200.

[0024] In one embodiment, the main controller 100 may be a microcontroller unit (MCU). The main controller 100 may be used to perform specific control tasks, such as reading data, processing instructions from a host, etc. The processing core of the main controller 100 may be designed based on the RISC-V architecture to perform various control and computing tasks.

[0025] In one embodiment, a flash memory block 200 (Block) is the smallest erasable unit in a memory and is composed of multiple pages. The size of a flash memory block 200 is usually several MB (eg, 64 MB, 128 MB, etc.), including dozens to hundreds of pages.

[0026] In one embodiment, a page is the smallest write unit in a memory and is composed of multiple rows. The size of a page is usually several KB to several MB (for example, 4KB, 8KB, 16KB, etc.). Data read and write operations are performed in units of pages.

[0027] In one embodiment, a row is a part of a page and refers to a storage cell within a page. A page may be logically divided into multiple rows. Within a page, data can be organized and accessed by rows. At least one set of storage cells can be set on each row. A storage cell is the smallest storage unit of flash memory and is responsible for actually storing data. Each storage cell can store one or more bits (depending on the cell type, such as SLC, MLC, TLC, QLC). The storage cells within a page are physically arranged continuously.

[0028] See also Figure 1 In one embodiment, before the memory is used, the flash memory blocks 200 inside the memory need to be screened to divide them into healthy blocks 210 (Healthy Blocks) and risky blocks 220 (Weak Blocks).

[0029] The healthy block 210 refers to a flash memory block 200 that can pass a sorting flow without any error. The healthy block 210 has a relatively long lifespan and has no obvious defects or risk of premature death.

[0030] The risk block 220 refers to a flash memory block 200 that has some early defects as the number of erases increases, but can still be used. For example, the risk block 220 may be a flash memory block 200 with a high number of errors (bit errors) in the high-temperature read phase, or a flash memory block 200 with bad blocks on the same plane. The risk block 220 has a risk of premature death, has a short lifespan, and may fail in future erase operations.

[0031] In one embodiment, the screening process can be used to evaluate and classify the health of the flash memory blocks 200 to determine which flash memory blocks 200 are suitable for data storage and which flash memory blocks 200 have a risk of early failure. The screening process can detect the health status of the flash memory blocks 200 through a series of testing and evaluation steps.

[0032] When testing the health status of the flash memory block 200, it is necessary to initialize the memory, set up the main controller 100 and the test tool, and ensure that all tests can be performed in a stable environment. At the same time, the flash memory block 200 is selected for evaluation.

[0033] First, a read test can be performed on the flash memory block 200. The read test is used to detect the read stability and data integrity of the flash memory block 200. When reading data, data can be read from each flash memory block 200 and the integrity of the data can be verified. Check whether there are bit errors during the reading process. The bit error rate of each flash memory block 200 is calculated, that is, the number of bits that have errors during the reading process. If the bit error rate is higher than the set threshold, there may be a problem with the flash memory block 200.

[0034] Secondly, the flash memory block 200 can be subjected to an erase test. The erase test is used to evaluate the erasure capability and durability of the flash memory block 200. Multiple erase operations are performed on each flash memory block 200 to simulate the actual use situation. The erase operation usually involves clearing the data of the entire flash memory block 200. The data recovery after each erase is detected to ensure the stability of the erase operation. If a problem occurs during the erase operation, such as an erase failure or abnormal data recovery, the flash memory block 200 is marked as a risk block 220.

[0035] Furthermore, the flash memory block 200 may be subjected to bad block detection. Bad block detection is used to identify and mark flash memory blocks 200 that already have physical defects. Flash memory blocks 200 with bad blocks are identified through read and erase tests. Bad blocks usually exhibit abnormal behavior during the test, such as being unable to be erased or written stably. The number of bad blocks in each flash memory block 200 is recorded. If a flash memory block 200 has a large number of bad blocks, the flash memory block 200 is marked as a risk block 220.

[0036] Furthermore, a high temperature read test can be performed on the flash memory block 200. The high temperature read test is used to evaluate the performance and stability of the flash memory block 200 under high temperature conditions. The flash memory block 200 is placed in a high temperature environment (e.g., 70°C or higher) and then a data read test is performed. Data is read under high temperature conditions and whether bit errors occur is detected. If the number of error bits is high, the flash memory block 200 may be at risk of premature death.

[0037] Finally, according to the above test results, each flash memory block 200 can be classified. Flash memory blocks 200 can be classified into healthy blocks 210 and risky blocks 220. Among them, healthy blocks 210 refer to blocks that perform normally in all tests without obvious errors or defects. These healthy blocks 210 are suitable for normal data storage operations. Risky blocks 220 refer to blocks that have errors or abnormal conditions during the test process, such as high bit error rate, read errors at high temperature, and a large number of bad blocks. These risky blocks 220 are at risk of premature death and should be used with caution.

[0038] In one embodiment, the main controller 100 can classify the data in the memory that is not visible to the outside into data that does not need to be updated and data that needs to be updated according to their types.

[0039] In one embodiment, data that does not need to be updated refers to data that does not need to be updated after the card is initialized (CardInitialization) in the memory. Data that does not need to be updated can be further divided into data that does not need to be updated and is not important, and data that does not need to be updated and is important.

[0040] Furthermore, the data that does not need to be updated and is not important refers to data that is stored in the memory but does not change, and can tolerate loss or failure during the operation of the memory. For example, the data that does not need to be updated and is not important may include performance sorting results, production logs recorded during the card opening stage, and other data.

[0041] The performance ranking result can be expressed as sorting or classifying the flash memory blocks 200 in the memory during the card opening stage to optimize performance or management. The ranking result generated at this time is only used in the initialization stage and will not be updated by subsequent operations. The performance ranking result obtained during the initial test can be used to select the appropriate flash memory block 200 when the memory is started.

[0042] The production log recorded in the card opening stage can be expressed as some status information and operation logs recorded in the production process during the card opening stage. These records are used for subsequent fault diagnosis and quality tracking, but will not be updated during normal use. The production log can include production date, production batch number, test results, serial number, manufacturer information, etc. This information is set at the time of production and remains unchanged throughout the life cycle of the device.

[0043] Furthermore, important data that does not need to be updated refers to data that will not be modified during the operation of the memory, but is critical to the function and stability of the memory. Even if this data does not change during operation, it must still be reliably saved and maintained. For example, important data that does not need to be updated can include front-end (FE) and back-end (BE) setting parameters, firmware and other code (code bin) data.

[0044] Among them, the front-end and back-end setting parameters refer to the configuration parameters and setting values ​​of the memory, which will not be changed during the operation of the device, but are crucial to the normal operation and function of the memory.

[0045] Front-end setting parameters may include user configuration parameters, display parameters, and performance parameters. User configuration parameters refer to some parameters that users may need to set during the initialization or card activation phase of the storage device, such as the storage device usage mode, data protection options, etc. Display parameters refer to how storage device-related information is presented in the user interface. Performance parameters refer to user-defined parameters that affect storage device performance.

[0046] The back-end setting parameters may include block management and wear leveling parameters, data protection and error correction setting parameters, access control and security setting parameters, etc. Block management and wear leveling parameters refer to parameters used to manage the allocation, use and balance of the flash memory block 200 inside the memory. Data protection and error correction setting parameters can be used to ensure the integrity and reliability of the stored data. Access control and security setting parameters can be used to protect the data in the memory from unauthorized access.

[0047] Firmware and other code are responsible for controlling and managing the functionality of the hardware, providing basic system operations, and initializing the system when the device starts up.

[0048] In one embodiment, since the data that does not need to be updated and is not important can be tolerated to be lost or failed during the operation of the memory, in order to save the resources of the healthy block 210, the data that does not need to be updated and is not important can be written into a certain risk block 220. Since there may be multiple risk blocks 220, at least one risk block 220 can be selected to back up the data that does not need to be updated and is not important. Of course, since there may be no risk block 220 in the memory, the flash memory blocks 200 inside it are all healthy blocks 210. Therefore, after the healthy blocks 210 are sorted, the healthy block 210 with the worst performance can be selected to write the data that does not need to be updated and is not important into the healthy block 210.

[0049] Furthermore, when writing unimportant data that does not need to be updated into a risk block 220 or a healthy block 210 with the worst performance, the entire risk block 220 or healthy block 210 may not be filled due to the small amount of unimportant data that does not need to be updated. Therefore, in order to improve the security of the risk block 220 or the healthy block 210, the remaining free positions in the block need to be filled redundantly until the entire block is filled.

[0050] Specifically, redundant filling is a data storage technology in which multiple copies of data or additional check information are added to the original data. The purpose of this is to improve the reliability of the data. If the original data is damaged, the redundant information can be used to recover or detect errors. For data that does not need to be updated and is not important, the main controller 100 will increase its security by adding redundant information. In this way, even if the data is damaged in some way, it is possible to recover it through the redundant information.

[0051] The redundant filling process will continue until the entire risk block 220 or healthy block 210 allocated to these data is completely filled, thereby ensuring that each part of the risk block 220 or healthy block 210 has corresponding redundant information, thereby further improving the data recovery capability.

[0052] In one embodiment, since the important data that does not need to be updated is crucial to the function and stability of the memory, the important data that does not need to be updated needs to be written into a healthy block 210. At the same time, in order to improve data security, at least one healthy block 210 can be selected to back up the important data that does not need to be updated.

[0053] Furthermore, when writing important data that does not need to be updated into a healthy block 210, since the amount of important data that does not need to be updated is small, it may not be possible to fill up the entire healthy block 210. Therefore, in order to improve the security of the healthy block 210, it is necessary to fill in the remaining free positions in the block redundantly until the entire block is filled.

[0054] In one embodiment, the data that needs to be updated refers to the data that needs to be updated in the usage scenario of the memory after the card is opened. The data that needs to be updated can be further divided into data that needs to be updated and is not important, and data that needs to be updated and is important.

[0055] Furthermore, important data that needs to be updated refers to data that is frequently updated during the use of the memory, and its accuracy is critical to the function of the system and the integrity of user data. The loss or error of such data will directly affect the reliability of the system or the user experience. For example, important data that needs to be updated may include mapping tables, block management tables, readable and writable register parameters, Flash Translation Layer (FTL) variables, etc.

[0056] Among them, the mapping table refers to a table for storing the mapping relationship between the physical memory and the logical address of the flash memory block 200. In the memory, the mapping table is used to track the location of the data and ensure the accuracy of the read and write operations. The block management table is used to manage the status of each flash memory block 200 in the memory, including used and idle flash memory blocks 200. The readable and writable register parameters refer to the register parameters of the front-end interface, which are related to the configuration and control of the memory. The accuracy of these parameters directly affects the operation of the memory. FTL is a layer in the main controller 100, which is responsible for the conversion of logical addresses to physical addresses. Recording FTL-related variables is necessary to ensure data consistency and system stability.

[0057] Furthermore, the data that needs to be updated but is not important refers to the data that is frequently updated in the memory, but its accuracy has little impact on the core function of the memory, and occasional loss will not have a significant impact on the memory. For example, the data that needs to be updated but is not important may include the number of reads of each block, the number of erases of each block, the operating temperature of each block, etc.

[0058] Among them, the number of reads of each block can be used to record the number of times each flash memory block 200 is read, which helps to perform performance analysis or fault diagnosis, but does not directly affect the correctness of the data. The number of erases of each block can be used to track the number of erase operations of each flash memory block 200, which is used to estimate the life of the memory. Although this data helps to monitor the health of the memory, it will not have serious consequences for the system if it is lost. The operating temperature of each block can be used to record the temperature of the storage block during operation, which helps to analyze the working environment of the memory, but the loss of this information will not affect the basic functions of the memory.

[0059] In one embodiment, since the data to be updated is critical to the function and stability of the memory, the data to be updated needs to be written into the healthy block 210. At the same time, the amount of data that needs to be updated and is not important is less than that of data that needs to be updated and is important. Therefore, in order to save the number of healthy blocks 210 used, the data that needs to be updated and is not important and the data that needs to be updated and is important can be written into different pages of the same healthy block 210.

[0060] In one embodiment, since the data that needs to be updated and is important in the memory is crucial, any error will affect the core function of the memory. Therefore, it is necessary to ensure that these data are written into the memory accurately. In this embodiment, the reliability of the data that needs to be updated and is important can be ensured by adding an additional data protection mechanism. For example, the data that needs to be updated and is important can be associated with the data that needs to be updated and is not important, ensuring that even if the data that needs to be updated and is not important has an error under certain circumstances, the data that needs to be updated and is important can still be protected.

[0061] Specifically, after writing important data that needs to be updated into a healthy block 210 , the main controller 100 may immediately write unimportant data that needs to be updated into the next row of the page where the important data that needs to be updated is located, thereby increasing data protection.

[0062] In one embodiment, after writing important data that needs to be updated to some pages of a healthy block 210, unimportant data that needs to be updated can be written to other pages of the healthy block 210. After the data is written, the memory may need to be powered off and then powered on again to complete the initialization operation.

[0063] In one embodiment, after power failure and power-on again, the main controller 100 can use firmware to verify whether the unimportant data that needs to be updated on the next row of the page where the last row of important data that needs to be updated is located exists on the page where the last row of important data that needs to be updated is located.

[0064] Further, when the main controller 100 confirms that there is unimportant data that needs to be updated on the next line of the page where the last line is located, it can be indicated that the important data that needs to be updated is complete. When the main controller 100 confirms that there is no unimportant data that needs to be updated on the next line of the page where the last line is located, it can be indicated that the last line of the important data that needs to be updated is incomplete. At this time, the important data that needs to be updated may have at least one line of data that has not been written into the healthy block 210, and then it needs to be rewritten, and the incomplete content is rewritten until there is unimportant data that needs to be updated on the next line of the page where the last line is located.

[0065] In one embodiment, after writing the data invisible to the outside to some healthy blocks 210 , the main controller 100 may store the user data in other healthy blocks 210 . The main controller 100 may write the user data to other healthy blocks 210 .

[0066] It can be seen that in the above scheme, by operating according to the flash memory block without strictly distinguishing the purpose of the block, the flash memory block can be used more flexibly, each flash memory block can be more fully utilized, and the waste of risky blocks can be reduced. By simply classifying the data instead of strictly distinguishing it, the management complexity can be reduced. The simple classification based only on whether the data is important and whether it is updated makes the system easier to implement and maintain. By flexibly using each flash memory block, the waste of resources is effectively reduced. By optimizing the use of blocks, the system bottleneck caused by uneven resource allocation is reduced, thereby improving the overall stability of the system.

[0067] See also Figure 2 The present invention also provides a method for allocating flash memory blocks of a memory, which can be applied to the above-mentioned memory to manage and allocate the flash memory blocks 200 inside the memory. The allocation method may include the following steps: Step S10, dividing the flash memory blocks into healthy blocks and risky blocks, and dividing the data in the memory that is not visible to the outside into data that does not need to be updated and is not important, data that does not need to be updated and is important, and data that needs to be updated according to type; Step S20: writing the unimportant data that does not need to be updated into a risk block; Step S30, writing the important data that does not need to be updated into a healthy block; Step S40: Write the data to be updated to another healthy block.

[0068] See also Figure 3 In one embodiment of the present invention, when executing step S40, specifically, step S40 may include the following steps: Step S41, when writing important data that needs to be updated, after writing is completed, write the unimportant data that needs to be updated on the next line on the page where the last line of important data that needs to be updated is located; Step S42: after power is turned off and then on again, determine whether there is any unimportant data that needs to be updated on the next row of the page where the last row is located; Step S43: when there is unimportant data that needs to be updated on the next line of the page where the last line is located, it means that the important data that needs to be updated is complete; Step S44: When there is no unimportant data that needs to be updated on the next line of the page where the last line is located, it means that the content of the last line of important data that needs to be updated is incomplete, and the incomplete content is updated again until there is unimportant data that needs to be updated on the next line of the page where the last line is located.

[0069] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A memory, characterized in that: include: Flash blocks are divided into healthy blocks and risky blocks; as well as A main controller is used to classify the data in the memory that is not visible to the outside into data that does not need to be updated and is not important, data that does not need to be updated and is important, and data that needs to be updated; The main controller is used to write the unimportant data that does not need to be updated into a certain risk block; The main controller is also used to write the important data that does not need to be updated into a healthy block; The main controller is further configured to write the data that needs to be updated into another healthy block.

2. The memory according to claim 1, characterized in that: When the main controller writes the unimportant data that does not need to be updated into a certain risk block, when the certain risk block is not full, redundantly fill the remaining free positions of the certain risk block until the entire certain risk block is full; When the main controller writes the important data that does not need to be updated into a healthy block, if the healthy block is not full, the remaining free positions of the healthy block are redundantly filled until the entire healthy block is full.

3. The memory according to claim 1, characterized in that: When the main controller writes the important data that does not need to be updated into a healthy block, the main controller is further configured to select at least one healthy block to back up the important data that does not need to be updated.

4. The memory according to claim 1, characterized in that: The data that needs to be updated includes important data that needs to be updated and unimportant data that needs to be updated. The main controller writes the important data that needs to be updated and the unimportant data that needs to be updated into different pages of the same healthy block.

5. The memory according to claim 4, characterized in that: When writing the important data that needs to be updated, the main controller is also used to write the unimportant data that needs to be updated on the next line on the page where the last line of the important data that needs to be updated is located after writing is completed.

6. The memory according to claim 5, characterized in that: After power failure and power-on again, when the main controller confirms that the unimportant data to be updated exists on the next row of the page where the last row is located, the important data to be updated is complete; When the main controller confirms that the unimportant data that needs to be updated does not exist on the next row of the page where the last row is located, the content of the last row of the important data that needs to be updated is incomplete, and the incomplete content is rewritten until the unimportant data that needs to be updated exists on the next row of the page where the last row is located.

7. The memory according to claim 1, characterized in that: The main controller is used to write the data invisible to the outside into some healthy blocks, and then write the user data into other healthy blocks.

8. A method for allocating flash memory blocks of a memory, characterized in that: include: Divide flash memory blocks into healthy blocks and risky blocks; The data in the memory which is not visible to the outside is divided into data which does not need to be updated and is not important, data which does not need to be updated and is important, and data which needs to be updated according to the type; Writing the unimportant data that does not need to be updated into a risk block; Writing the important data which does not need to be updated into a healthy block; The data that needs to be updated is written to another healthy block.

9. The method for allocating flash memory blocks of a memory according to claim 8, characterized in that: The data that needs to be updated includes important data that needs to be updated and unimportant data that needs to be updated. In the step of writing the data that needs to be updated to another healthy block, the important data that needs to be updated and the unimportant data that needs to be updated are written to different pages of the same healthy block.

10. The method for allocating flash memory blocks of a memory according to claim 9, characterized in that: The step of writing the important data that needs to be updated and the unimportant data that needs to be updated into different pages of the same healthy block includes: When writing the important data that needs to be updated, after writing is completed, on the page where the last row of the important data that needs to be updated is located, the unimportant data that needs to be updated is written on the next row; After power is turned off and then turned on again, determining whether the unimportant data that needs to be updated exists on the next row of the page where the last row is located; When the unimportant data that needs to be updated exists on the next line of the page where the last line is located, the important data that needs to be updated is complete; When the unimportant data that needs to be updated does not exist on the next row of the page where the last row is located, the content of the last row of the important data that needs to be updated is incomplete, and the incomplete content is rewritten until the unimportant data that needs to be updated exists on the next row of the page where the last row is located.

Citation Information

Patent Citations

  • Data storage method, device and flash memory chip based on flash memory

    CN107220185A

  • Non-volatile memory with selective interleaved coding based on block reliability

    CN112579339A

  • Method, system and apparatus for flash memory durability management

    CN116635835A

  • Dynamic wear leveling method and system for flash memory

    CN118538275A

  • Health monitoring method and device of memory, electronic equipment and storage medium

    CN119226011A