Flash memory management method, flash memory management equipment and computer readable storage medium

By dividing preset rules and managing time-sharing multiplexing rules for flash memory space, the problem of limited service life improvement in the existing technology is solved, and the longer life and higher reliability of flash memory is achieved.

CN119536633AActive Publication Date: 2025-02-28SHENZHEN FENDA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411431792.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-02-28
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

It is difficult for existing flash memory management technology to achieve comprehensive protection of flash memory, resulting in limited improvement in flash memory service life.

Method used

By dividing the flash memory space according to the preset rules, multiple areas to be used are obtained, and these areas are used according to the time-sharing multiplexing rules, recording the number of uses, and re-dividing the flash memory space when the preset value is reached to form a new area to be used.

Benefits of technology

A balanced number of usages in each area is achieved, avoiding premature failure of some areas due to excessive wear, thereby extending the overall life of flash memory and reducing the risk of data errors and loss due to wear.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536633A_ABST
    Figure CN119536633A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a flash memory management method, which comprises the following steps of: dividing a flash memory space according to a preset rule to obtain a plurality of first to-be-stored areas; using the plurality of first to-be-used areas according to a time division multiplexing rule; recording the use times corresponding to the plurality of first to-be-used areas; when the number of use times corresponding to the first to-be-used area reaches a preset value, dividing the flash memory space again to obtain a plurality of second to-be-used areas; and using the plurality of second to-be-used areas. According to the scheme, the use frequency of each region is balanced, so that early failure of some regions due to excessive wear is avoided, and the total service life of the flash memory is prolonged. And the flash memory space is re-divided, so that the risk of data error and loss caused by abrasion is reduced, and the data reliability is improved. The invention further provides flash memory management equipment corresponding to the flash memory management method. The flash memory management equipment has the beneficial effects corresponding to the flash memory management method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computers, and in particular, relates to a flash memory management method, a flash memory management device, and a computer-readable storage medium. Background Art

[0002] Flash memory, as a non-volatile memory, has been widely used in various electronic devices for persistent data storage due to its high density, low cost and ease of use. However, the service life of flash memory is not infinite, and the main challenge it faces is the limitation of erase and write times. Once a certain erase and write threshold is reached, flash memory may lose data or device function may fail.

[0003] To address this challenge, current technologies have adopted a variety of protection measures. Hardware protection solutions add additional monitoring and management circuits to the flash memory system to monitor and control the use of flash memory in real time, thereby preventing it from being damaged due to overuse. On the other hand, software protection solutions rely on complex algorithms to manage the use of flash memory, such as optimizing data write distribution through address mapping technology to achieve balanced writes to extend the overall service life of the flash memory.

[0004] Nevertheless, existing technologies still face many challenges in practical applications. Although hardware protection solutions are effective, they increase the cost and complexity of the equipment, causing inconvenience in production and use. Although software protection solutions are flexible, their algorithms are often highly complex and difficult to implement. More importantly, both hardware and software protection solutions can only protect flash memory to a certain extent, and it is difficult to achieve comprehensive protection for it, thus limiting the further improvement of the flash memory's service life. Summary of the invention

[0005] The purpose of the present invention is to provide a flash memory management method, aiming to solve the existing flash memory management problems. The flash memory management method provided by the present application includes:

[0006] Dividing the flash memory space according to a preset rule to obtain a plurality of first areas to be used;

[0007] Using the multiple first to-be-used areas according to a time-division multiplexing rule;

[0008] Recording the usage times respectively corresponding to the plurality of first to-be-used areas;

[0009] When the number of times the first area to be used is used reaches a preset value, the flash memory space is divided again to obtain a plurality of second areas to be used;

[0010] The positions of the plurality of second areas to be used are different from the positions of the plurality of first areas to be used;

[0011] The plurality of second to-be-used areas are used according to a time-division multiplexing rule.

[0012] According to the flash memory management method provided in the first aspect of the embodiment of the present application, optionally, after using the multiple second to-be-used areas according to the time-division multiplexing rule, the method further includes:

[0013] The second area to be used is regarded as the first area to be used, and the flash memory management method is re-executed starting from the step of using the multiple first areas to be used according to the time-division multiplexing rule.

[0014] According to the flash memory management method provided in the first aspect of the embodiment of the present application, optionally, after using the multiple first areas to be used according to the time-sharing multiplexing rule, the method also includes using the first areas to be used according to a priority scheduling mechanism.

[0015] According to the flash memory management method provided in the first aspect of the embodiment of the present application, optionally, before the flash memory space is divided according to a preset rule to obtain a plurality of first areas to be used, the method further includes:

[0016] Monitoring usage of the flash memory space;

[0017] When the usage of the flash memory space meets the preset condition, the step of dividing the flash memory space according to the preset rule to obtain a plurality of first areas to be used is triggered.

[0018] According to the flash memory management method provided by the first aspect of the embodiment of the present application, optionally, the plurality of first to-be-used areas include: a data backup area;

[0019] The method further includes: determining whether there is a flash memory damage situation;

[0020] If the flash memory is damaged, the data that meets the definition of important data is transferred to the data backup area.

[0021] According to the flash memory management method provided by the first aspect of the embodiment of the present application, optionally,

[0022] When the number of times the first area to be used is used reaches a preset value, the flash memory space is re-divided to obtain a plurality of second areas to be used, including:

[0023] When the usage count corresponding to any one of the first to-be-used areas reaches a preset value, the flash memory space is divided again, and the flash memory space involved in the division does not include the first to-be-used area whose usage count reaches the preset value, thereby obtaining a plurality of second to-be-used areas.

[0024] According to the flash memory management method provided by the first aspect of the embodiment of the present application, optionally,

[0025] When the number of times the first area to be used is used reaches a preset value, the flash memory space is re-divided to obtain a plurality of second areas to be used, including:

[0026] When the number of times each of the first to-be-used areas is used reaches a preset value, the flash memory space is divided again to obtain a plurality of second to-be-used areas.

[0027] A second aspect of an embodiment of the present application provides a flash memory management device, including:

[0028] A first partitioning unit, configured to partition the flash memory space according to a preset rule to obtain a plurality of first areas to be used;

[0029] A first using unit, configured to use the plurality of first to-be-used areas according to a time division multiplexing rule;

[0030] A recording unit, used to record the usage times respectively corresponding to the plurality of first to-be-used areas;

[0031] A second division unit is used to re-divide the flash memory space to obtain a plurality of second areas to be used when the number of times the first area to be used is used reaches a preset value, wherein the positions of the plurality of second areas to be used are different from those of the plurality of first areas to be used;

[0032] The second using unit is used to use the multiple second to-be-used areas according to a time division multiplexing rule.

[0033] Based on the flash memory management device provided in the second aspect of the embodiment of the present application, optionally, the device further includes:

[0034] The multiplexing unit is used to regard the second area to be used as the first area to be used, and re-execute the flash memory management method starting from the step of using the multiple first areas to be used according to the time-sharing multiplexing rule.

[0035] Based on the flash memory management device provided in the second aspect of the embodiment of the present application, optionally, the first using unit is also used to: use the first to-be-used area according to a priority scheduling mechanism.

[0036] Based on the flash memory management device provided in the second aspect of the embodiment of the present application, optionally, the device further includes: a monitoring unit, wherein the monitoring unit is used to:

[0037] Monitoring usage of the flash memory space;

[0038] When the usage of the flash memory space meets a preset condition, the first partitioning unit is triggered.

[0039] Based on the flash memory management device provided by the second aspect of the embodiment of the present application, optionally, the plurality of first to-be-used areas include: a data backup area;

[0040] The device further comprises: a damage monitoring unit, the damage monitoring unit being used to: determine whether there is a flash memory damage situation;

[0041] If the flash memory is damaged, the data that meets the definition of important data is transferred to the data backup area.

[0042] Based on the flash memory management device provided in the second aspect of the embodiment of the present application, optionally,

[0043] The second division unit is specifically used to: when the number of times any one of the first to-be-used areas is used reaches a preset value, the flash memory space is re-divided, and the flash memory space involved in the division does not include the first to-be-used area whose number of times reaches the preset value, to obtain multiple second to-be-used areas.

[0044] Based on the flash memory management device provided by the second aspect of the embodiment of the present application, optionally,

[0045] The second division unit is specifically configured to: when the number of times each of the first to-be-used areas is used reaches a preset value, re-dividing the flash memory space to obtain a plurality of second to-be-used areas.

[0046] A third aspect of an embodiment of the present application provides a flash memory management device, including:

[0047] CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply;

[0048] The memory is a short-term storage memory or a persistent storage memory;

[0049] The central processing unit is configured to communicate with the memory and execute instruction operations in the memory on the device to perform the method described in any one of the first aspects of the embodiments of the present application.

[0050] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute a method as described in any one of the first aspects of the embodiment of the present application.

[0051] A fifth aspect of the embodiments of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a method as described in any one of the first aspects of the embodiments of the present application.

[0052] It can be seen from the above technical scheme that the embodiment of the present application has the following advantages: The present application provides a flash memory management method, including: dividing the flash memory space according to a preset rule to obtain multiple first waiting areas; using the multiple first waiting areas according to the time-sharing multiplexing rule; recording the number of uses corresponding to the multiple first waiting areas; when the number of uses corresponding to the first waiting areas reaches a preset value, re-dividing the flash memory space to obtain multiple second waiting areas; the positions of the multiple second waiting areas are different from the multiple first waiting areas; using the multiple second waiting areas according to the time-sharing multiplexing rule. This solution balances the number of uses of each area, avoids premature failure of some areas due to excessive wear, and thus extends the overall life of the flash memory. And by re-dividing the flash memory space, the risk of data errors and losses caused by wear can be reduced, and the reliability of data can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work. It is understood that the drawings provided in this section are only used to better understand the present solution and do not constitute a limitation of the present application.

[0054] Figure 1 A flowchart of an embodiment of the flash memory management method provided in this application.

[0055] Figure 2 Another flowchart of an embodiment of the flash memory management method provided in the present application.

[0056] Figure 3 A structural diagram of an embodiment of a flash memory management device provided in this application.

[0057] Figure 4 Another structural schematic diagram of an embodiment of the flash memory management device provided in this application. DETAILED DESCRIPTION

[0058] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application are clearly and completely described below. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should belong to the scope of protection of the present application. At the same time, for the sake of clarity and simplicity, the description of well-known functions and structures is omitted in the following description.

[0059] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0060] Flash memory, as a non-volatile memory, has been widely used in various electronic devices for persistent data storage due to its high density, low cost and ease of use. However, the service life of flash memory is not infinite, and the main challenge it faces is the limitation of erase and write times. Once a certain erase and write threshold is reached, flash memory may lose data or device function may fail.

[0061] To address this challenge, current technologies have adopted a variety of protection measures. Hardware protection solutions add additional monitoring and management circuits to the flash memory system to monitor and control the use of flash memory in real time, thereby preventing it from being damaged due to overuse. On the other hand, software protection solutions rely on complex algorithms to manage the use of flash memory, such as optimizing data write distribution through address mapping technology to achieve balanced writes to extend the overall service life of the flash memory.

[0062] Nevertheless, existing technologies still face many challenges in practical applications. Although hardware protection solutions are effective, they increase the cost and complexity of the equipment, causing inconvenience in production and use. Although software protection solutions are flexible, their algorithms are often highly complex and difficult to implement. More importantly, both hardware and software protection solutions can only protect flash memory to a certain extent, and it is difficult to achieve comprehensive protection for it, thus limiting the further improvement of the flash memory's service life.

[0063] To solve the above problems, this application provides a new flash memory management method, please refer to Figure 1 , an embodiment of the flash memory management method provided in the present application includes: steps 101 to 105.

[0064] 101. Divide the flash memory space according to a preset rule to obtain a plurality of first to-be-used areas.

[0065] The flash memory space is divided according to the preset rules to obtain multiple first areas to be used. Specifically, the flash memory space can be divided into multiple blocks, and the size of each block can be set according to actual needs. For example, we can set the size of each block to 1GB. In the actual implementation process, the block setting rules are determined according to the actual situation. Before the space is divided, the flash memory device needs to be initialized, including clearing all data, checking the hardware status, and configuring necessary parameters. According to the preset rules, the size, number and protection mechanism of each block are determined. These rules should be based on comprehensive considerations of factors such as device performance, data storage requirements and application scenarios. In this process, it is necessary to ensure that each block can be effectively protected and meet the preset storage performance requirements. After the division is completed, the division results are verified to ensure that the size, number and protection mechanism of each block are in line with expectations. At the same time, the read and write performance needs to be tested to ensure that the divided flash memory device can meet the actual application needs. And record the location of each first area to be used in the flash memory space.

[0066] 102. Use the multiple first to-be-used areas according to a time-division multiplexing rule.

[0067] The multiple first areas to be used are used according to the time-sharing reuse rule. Flash memory time-sharing reuse means that different flash memory blocks will be allocated for data storage or reading operations in different time periods, and not all blocks are in a high-load state at the same time. This strategy aims to balance the read and write load of the flash memory and avoid premature wear of some blocks due to overuse, thereby ensuring that each flash memory block can be balanced and effectively protected during the product life cycle. The implementation of flash memory time-sharing reuse technology can not only significantly improve the overall service life of the flash memory, because it reduces local wear caused by frequent reading and writing; it can also effectively prevent the loss of important data, because the data is dispersed and stored in different blocks and different time periods, reducing the risk of comprehensive data loss due to a single block failure. In addition, this technology also helps to improve the efficiency and stability of data access, reduce waiting time and conflicts through intelligent scheduling, and provide users with a smoother data storage experience. Through this time-sharing reuse method, we can ensure that each flash memory block can be balanced and protected during the normal use cycle of the product, extending the overall service life of the flash memory. Specifically, when a certain area to be used is not fully used, no erasing operation is performed on the area, and the erasing operation is performed separately for each first area to be used.

[0068] 103. Record the usage times corresponding to the plurality of first to-be-used areas respectively.

[0069] Specifically, every time a flash memory block is used for data storage or reading, the system will automatically record this operation and update the usage counter of the block. In this way, we can grasp the usage frequency and status of each block in real time, providing an important basis for subsequent management and scheduling.

[0070] 104. Re-divide the flash memory space to obtain a plurality of second areas to be used.

[0071] Specifically, when the number of times the first area to be used is used reaches a preset value, the flash memory space is divided again to obtain a plurality of second areas to be used; the positions of the plurality of second areas to be used are different from the plurality of first areas to be used. When it is detected that the number of times the first area to be used (i.e., the initially allocated flash memory block) is used has reached our preset threshold, the system will re-divide the entire flash memory space in detail to generate a new set of second areas to be used. The core purpose of this re-division process is to balance the read and write loads of each block of the flash memory and effectively prevent certain blocks from being damaged prematurely due to excessive use by changing the physical storage location of the data. It is worth noting that the newly generated second areas to be used have significant differences in physical layout from the original first areas to be used. This position change is specially designed to achieve load balancing and extend the overall life of the flash memory. Through such adjustments, we can ensure that each flash memory block can be used more evenly, thereby improving the performance and stability of the entire flash memory system. In actual implementation, the newly divided second area to be used can be the same size as the first area to be used, but occupy 50% of the original first area to be used, that is, the second area to be used is composed of two halves of the first area to be used.

[0072] 105. Use the multiple second to-be-used areas according to a time-division multiplexing rule.

[0073] Specifically, when a new second area to be used is generated, these areas will be used efficiently and orderly according to the established time-sharing reuse rules. For the newly generated second area to be used, the time-sharing reuse rule continues to be used, and a reasonable usage time period is allocated to them according to the data read and write requirements, block characteristics, and overall system performance requirements. Through such a time-sharing reuse strategy, not only can the overall service life of the flash memory be further extended, but also the data read and write speed and storage efficiency can be significantly improved. Through the implementation of this strategy, it can ensure that flash memory resources are maximized, while providing users with more stable and efficient data storage services.

[0074] It can be seen from the above technical scheme that the embodiment of the present application has the following advantages: The present application provides a flash memory management method, including: dividing the flash memory space according to a preset rule to obtain multiple first waiting areas; using the multiple first waiting areas according to the time-sharing multiplexing rule; recording the number of uses corresponding to the multiple first waiting areas; when the number of uses corresponding to the first waiting areas reaches a preset value, re-dividing the flash memory space to obtain multiple second waiting areas; the positions of the multiple second waiting areas are different from the multiple first waiting areas; using the multiple second waiting areas according to the time-sharing multiplexing rule. This solution balances the number of uses of each area, avoids premature failure of some areas due to excessive wear, and thus extends the overall life of the flash memory. And by re-dividing the flash memory space, the risk of data errors and losses caused by wear can be reduced, and the reliability of data can be improved.

[0075] To facilitate the use of this method in actual processes, the present application also provides a more detailed embodiment that can be optionally implemented, please refer to Figure 2 Another embodiment of the flash memory management method provided in the present application includes: steps 201 to 210.

[0076] 201. Monitor usage of the flash memory space.

[0077] A flash memory protection module is added to the product, which can monitor the usage of the flash memory in real time. Once the usage of the flash memory exceeds a preset threshold, which is determined according to the product situation, such as 80% of the number of times the flash memory product is used, or the number of erases and writes reaches a fixed value, the flash memory time-sharing multiplexing technology and time and space multiplexing management algorithm will be automatically started to protect the flash memory from damage. When the usage of the flash memory space meets the preset conditions, the step of dividing the flash memory space according to the preset rules to obtain multiple first areas to be used is triggered.

[0078] 202. Divide the flash memory space according to a preset rule to obtain a plurality of first areas to be used.

[0079] Specifically, if the usage of the flash memory space reaches or exceeds the preset threshold, that is, meets the preset conditions, the flash memory space is divided according to the preset rules to obtain multiple first areas to be used. The multiple first areas to be used include: data backup area. The data backup area should be a relatively safe area. Specifically, the area with the least number of erase and write times can be determined as the data backup area. This step is the same as the above Figure 1 The corresponding step 101 in the embodiment is similar and will not be described in detail here.

[0080] 203. Determine whether the flash memory is damaged.

[0081] Determine whether there is flash memory damage. The system continuously monitors the status of the flash memory, including its read and write performance, error rate and other key indicators. Once these indicators are out of the normal range, or the system detects an abnormal data access pattern, the module will immediately determine whether there is a risk of flash memory damage. This step can detect potential problems in a timely manner. In the actual implementation process, steps 203 to 204 can be performed at any time during the execution of the method, and are not specifically limited here.

[0082] 204. Transfer the data that meets the definition of important data to the data backup area.

[0083] When the flash memory is damaged, the data that meets the definition of important data will be transferred to the data backup area. When the system determines that there is a risk of flash memory damage, the data backup process will be started immediately. This process will filter out key business data and user information based on the preset important data definition or identification, and transfer these data to the backup area. In this way, even if the flash memory is damaged, the normal use of the product can be quickly restored through the data in the backup area, ensuring the integrity of the data and the stable operation of the product.

[0084] 205. Use the multiple first to-be-used areas according to a time-division multiplexing rule.

[0085] 206. Use the first to-be-used area according to a priority scheduling mechanism.

[0086] Specifically, the usage rules for the first area to be used may include time-division multiplexing rules, a priority scheduling mechanism, and multiple other rules, including:

[0087] First, multiple first areas to be used are used according to the time-sharing multiplexing rule. This rule aims to avoid excessive use of flash memory through the reasonable allocation of time and space. Specifically, the Flash memory is divided into multiple logical blocks or partitions, and each block or partition is used by different tasks or applications in different time periods. Through time slice rotation or priority scheduling, this mechanism assigns different priorities to different first areas to be used based on multiple factors such as data access frequency, importance, and the current state of the flash area, thereby ensuring that the storage needs of critical data can be maximized when flash resources are limited. We ensure that each block or partition is occupied by only one task or application for a period of time, thereby effectively avoiding frequent erasure caused by multiple tasks writing to the same Flash at the same time. This time-sharing operation not only improves the utilization rate of flash memory, but also significantly extends its service life.

[0088] In terms of management strategy, a garbage collection mechanism is used to regularly clean up invalid data and fragments in the Flash, thereby freeing up storage space. At the same time, wear leveling technology is also used to migrate data between different logical blocks or partitions so that each area of ​​the Flash has a similar number of erase and write times. This technology not only extends the overall service life of the flash memory, but also improves its stability and reliability. In addition, this solution also implements a read-modify-write strategy, which reads the original data before writing data and only modifies the parts that need to be changed, thereby reducing unnecessary erase and write operations.

[0089] In terms of error detection and recovery, this solution uses ECC (Error Correction Code) or other verification mechanisms to detect and correct errors in Flash. At the same time, this solution also regularly scans the Flash memory to detect and repair potential error areas. When an unrecoverable error is detected, we will immediately take data backup and recovery measures to ensure data integrity and availability.

[0090] Finally, in terms of hot backup and fault tolerance design, this solution has designed a hot backup mechanism for critical data, storing data in multiple Flash memories at the same time. This mechanism improves data reliability and fault tolerance, and ensures data integrity and availability even if one of the Flash memories fails. These measures together constitute a complete system of flash memory management and protection strategies for this solution, ensuring stable operation of the product and data integrity.

[0091] 207. Record the usage times corresponding to the plurality of first to-be-used areas respectively.

[0092] 208. Re-divide the flash memory space to obtain a plurality of second areas to be used.

[0093] Specifically, there are two types of division rules, which can be selected and applied as needed, including:

[0094] (1) When the number of times any of the first areas to be used is used reaches a preset value, the flash memory space is divided again, and the flash memory space involved in the division does not include the first area to be used whose number of times has reached the preset value, thereby obtaining a plurality of second areas to be used. The flash memory space involved in the division does not include the first area to be used whose number of times has reached the preset value, thereby obtaining a plurality of second areas to be used. This rule is intended to protect areas that are already under a higher load from being damaged by excessive use. By redividing, we can distribute the load to other areas, while areas with a higher number of times of use do not participate in the division process, thereby extending the service life of the entire flash memory. It is worth noting that when the method is repeatedly executed according to step 210, the first area to be used that has been used a larger number of times to reach the preset value re-participates in the division process.

[0095] (2) When the number of times each of the first to-be-used areas has been used reaches a preset value, the flash memory space is re-divided to obtain a plurality of second to-be-used areas. This rule is applicable to the case where all areas are facing a high load. In this case, re-dividing can ensure that each area can obtain a relatively balanced load, thereby maintaining the overall performance and stability of the flash memory.

[0096] 209. Using the plurality of second areas to be used according to a time-division multiplexing rule

[0097] After the flash memory space is re-divided into multiple second waiting areas, the time-sharing multiplexing rule is used again to manage the use of these areas. This rule aims to avoid excessive use of flash memory space through reasonable allocation of time, thereby extending its service life. Specifically, this solution will allocate a specific time period for each second waiting area to ensure that the area is only occupied by one task or application during this time period. In this way, we can effectively disperse the write pressure and avoid frequent erasing of a single area, thereby protecting the flash memory from damage.

[0098] 210. Treat the second area to be used as the first area to be used, and re-execute the flash memory management method starting from the step of using the plurality of first areas to be used according to the time-division multiplexing rule.

[0099] In order to continue to protect the flash memory and optimize its use, it is necessary to regard these second areas to be used as new first areas to be used and re-execute the entire flash memory management method, that is, return to step 202 and re-execute the method.

[0100] It can be seen from the above technical scheme that the embodiment of the present application has the following advantages: The present application provides a flash memory management method, including: dividing the flash memory space according to a preset rule to obtain multiple first waiting areas; using the multiple first waiting areas according to the time-sharing multiplexing rule; recording the number of uses corresponding to the multiple first waiting areas; when the number of uses corresponding to the first waiting areas reaches a preset value, re-dividing the flash memory space to obtain multiple second waiting areas; the positions of the multiple second waiting areas are different from the multiple first waiting areas; using the multiple second waiting areas according to the time-sharing multiplexing rule. This solution balances the number of uses of each area, avoids premature failure of some areas due to excessive wear, and thus extends the overall life of the flash memory. And by re-dividing the flash memory space, the risk of data errors and losses caused by wear can be reduced, and the reliability of data can be improved.

[0101] The above content describes the flash memory management method provided by the present application. To support the implementation of the above embodiment, the present application also provides a flash memory management device. Figure 3 , an embodiment of the flash memory management device provided by the present application includes:

[0102] A first partitioning unit 301 is used to partition the flash memory space according to a preset rule to obtain a plurality of first areas to be used;

[0103] A first using unit 302, configured to use the plurality of first to-be-used areas according to a time division multiplexing rule;

[0104] A recording unit 303, configured to record the usage times respectively corresponding to the plurality of first to-be-used areas;

[0105] The second division unit 304 is configured to re-divide the flash memory space to obtain a plurality of second areas to be used when the number of times the first area to be used is used reaches a preset value, wherein the positions of the plurality of second areas to be used are different from those of the plurality of first areas to be used;

[0106] The second using unit 305 is used to use the multiple second to-be-used areas according to a time division multiplexing rule.

[0107] In this embodiment, the process executed by each unit in the flash memory management device is the same as the above Figure 1 The method flow described in the corresponding embodiment is similar and will not be repeated here.

[0108] Optionally, the device further includes:

[0109] The multiplexing unit is used to regard the second area to be used as the first area to be used, and re-execute the flash memory management method starting from the step of using the multiple first areas to be used according to the time-sharing multiplexing rule.

[0110] Optionally, the first using unit is further used to: use the first to-be-used area according to a priority scheduling mechanism.

[0111] Optionally, the device further includes: a monitoring unit, wherein the monitoring unit is configured to:

[0112] Monitoring usage of the flash memory space;

[0113] When the usage of the flash memory space meets a preset condition, the first partitioning unit is triggered.

[0114] Optionally, the plurality of first areas to be used include: a data backup area;

[0115] The device further comprises: a damage monitoring unit, the damage monitoring unit being used to: determine whether there is a flash memory damage situation;

[0116] If the flash memory is damaged, the data that meets the definition of important data is transferred to the data backup area.

[0117] Optionally, the second division unit is specifically used to: when the number of uses corresponding to any one of the first to-be-used areas reaches a preset value, re-dividing the flash memory space, and the flash memory space involved in the division does not include the first to-be-used area whose number of uses reaches the preset value, to obtain multiple second to-be-used areas.

[0118] Optionally, the second division unit is specifically configured to: when the number of times each of the first to-be-used areas has been used reaches a preset value, re-dividing the flash memory space to obtain a plurality of second to-be-used areas.

[0119] Figure 4 It is a structural diagram of a flash memory management device provided in an embodiment of the present application. The flash memory management device 400 may include one or more central processing units (CPU) 401 and a memory 405. The memory 405 stores one or more application programs or data.

[0120] In this embodiment, the specific functional module division in the central processing unit 401 can be the same as the above Figure 3 The functional module division method of each unit described in is similar and will not be repeated here.

[0121] The memory 405 may be a volatile storage or a persistent storage. The program stored in the memory 405 may include one or more modules, each of which may include a series of instruction operations in the flash memory management device. Furthermore, the central processor 401 may be configured to communicate with the memory 405 and execute a series of instruction operations in the memory 405 on the flash memory management device 400.

[0122] The flash management device 400 may also include one or more power supplies 402, one or more wired or wireless network interfaces 403, one or more input and output interfaces 404, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0123] The CPU 401 can execute the aforementioned Figure 1 or Figure 2 The operations performed by the flash memory management method in the illustrated embodiment will not be described in detail here.

[0124] An embodiment of the present application also provides a computer storage medium, which is used to store computer software instructions used for the above-mentioned flash memory management device, including a program designed for executing the flash memory management method.

[0125] The flash memory management method can be as described above Figure 1 or Figure 2 The flash memory management method described in .

[0126] The present application also provides a computer program product, which includes computer software instructions, which can be loaded by a processor to implement the above Figure 1 Figure 2 The process of any flash memory management method.

[0127] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the equivalent transformation of the circuit, the division of the unit, is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A flash memory management method, characterized in that: include: Dividing the flash memory space according to a preset rule to obtain a plurality of first areas to be used; Using the multiple first to-be-used areas according to a time-division multiplexing rule; Recording the usage times respectively corresponding to the plurality of first to-be-used areas; When the number of times the first area to be used is used reaches a preset value, the flash memory space is divided again to obtain a plurality of second areas to be used; The positions of the plurality of second areas to be used are different from the positions of the plurality of first areas to be used; The plurality of second to-be-used areas are used according to a time-division multiplexing rule.

2. The flash memory management method according to claim 1, characterized in that: After the plurality of second to-be-used areas are used according to the time-division multiplexing rule, the method further includes: The second area to be used is regarded as the first area to be used, and the flash memory management method is re-executed starting from the step of using the multiple first areas to be used according to the time-division multiplexing rule.

3. The flash memory management method according to claim 1, characterized in that: After using the multiple first areas to be used according to the time division multiplexing rule, the method further includes using the first areas to be used according to a priority scheduling mechanism.

4. The flash memory management method according to claim 1, characterized in that: Before dividing the flash memory space according to a preset rule to obtain a plurality of first areas to be used, the method further includes: Monitoring usage of the flash memory space; When the usage of the flash memory space meets the preset condition, the step of dividing the flash memory space according to the preset rule to obtain a plurality of first areas to be used is triggered.

5. The flash memory management method according to claim 1, characterized in that: The plurality of first to-be-used areas include: a data backup area; The method further includes: determining whether there is a flash memory damage situation; If the flash memory is damaged, the data that meets the definition of important data is transferred to the data backup area.

6. The flash memory management method according to claim 1, characterized in that: When the number of times the first area to be used is used reaches a preset value, the flash memory space is re-divided to obtain a plurality of second areas to be used, including: When the usage count corresponding to any one of the first to-be-used areas reaches a preset value, the flash memory space is divided again, and the flash memory space involved in the division does not include the first to-be-used area whose usage count reaches the preset value, thereby obtaining a plurality of second to-be-used areas.

7. The flash memory management method according to claim 1, characterized in that: When the number of times the first area to be used is used reaches a preset value, the flash memory space is re-divided to obtain a plurality of second areas to be used, including: When the number of times each of the first to-be-used areas is used reaches a preset value, the flash memory space is divided again to obtain a plurality of second to-be-used areas.

8. A flash memory management device, characterized in that: include: A first partitioning unit, configured to partition the flash memory space according to a preset rule to obtain a plurality of first areas to be used; A first using unit, configured to use the plurality of first to-be-used areas according to a time division multiplexing rule; A recording unit, used to record the usage times respectively corresponding to the plurality of first to-be-used areas; A second division unit is used to re-divide the flash memory space to obtain a plurality of second areas to be used when the number of times the first area to be used is used reaches a preset value, wherein the positions of the plurality of second areas to be used are different from those of the plurality of first areas to be used; The second using unit is used to use the multiple second to-be-used areas according to a time division multiplexing rule.

9. A flash memory management device, characterized in that: include: CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply; The memory is a transient storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory, and execute instructions in the memory on the device to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • NOR flash memory and repair method thereof

    CN105489246A

  • Time slot resource selecting method and device

    CN105991207A

  • Self-adaption method for read-write service in solid state disk

    CN117687570A

  • Data access method, storage controller and storage device

    WO2022252063A1