Flash memory management method for edge computing equipment
By dividing data partitions in edge computing devices and performing heat and wear threshold calculations, the data migration strategy of flash blocks is optimized, and the problem of unbalanced access to flash blocks is solved, which extends device life and improves system stability and performance.
Patent Information
- Application Number
- CN202510636017.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Uneven access to flash blocks in edge computing devices leads to uneven wear, shortening service life, and lack of reasonable data migration priorities, affecting system performance and stability.
By dividing flash memory devices into different data partitions, using heat calculation, wear threshold calculation and migration priority calculation, the use of flash blocks is monitored, and data is migrated to underused flash blocks when the wear threshold is reached, ensuring priority migration of critical data and periodically backing up to external storage media.
It realizes the balanced use of flash memory blocks, extends service life, reduces the risk of data loss, improves system performance and stability, and reduces user waiting time.
Smart Images

Figure CN120371218A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software engineering, and particularly to a flash memory management method for edge computing devices. Background Art
[0002] Edge computing is a computing model whose main idea is to perform data processing and computing closer to the source of data generation, rather than transmitting all data to a remote cloud server for processing. Edge computing devices are hardware devices used in the edge computing model, usually located near the place where data is generated, to provide real-time and low-latency computing and services. Flash memory devices usually collect a segment of data, and after mapping processing from logical addresses to physical addresses, write the segment of data into the word lines of flash memory blocks.
[0003] Currently, when edge computing devices perform data caching, some flash memory blocks are frequently accessed and updated, while other flash memory blocks are less accessed. This unbalanced access pattern will accelerate the wear of some storage media, shorten their service life, and lack a reasonable data migration priority strategy, which easily leads to chaos in the migration of low-priority data and high-priority data, occupying too much system resources, and reducing the performance and stability of the edge computing device system. Summary of the Invention
[0004] The purpose of the present invention is to provide a flash memory management method for edge computing devices, which solves the problems raised in the above background art.
[0005] To achieve the above purpose, the present invention provides the following technical solutions: A flash memory management method for edge computing devices, including the following steps:
[0006] Step S1: Flash memory selection. According to the requirements of the edge computing device, select a flash memory device, and the flash memory device includes a solid-state drive, a USB flash drive, and an embedded flash memory.
[0007] Step S2: Device partitioning. After the flash memory device is selected, divide the flash memory device into different data partitions, and the data partitions include a system data partition, an application data partition, and a temporary data partition. According to the characteristics and access frequencies of the data, allocate the data to different partitions.
[0008] Step S3: Data compression. Select a compression algorithm according to the hardware capabilities of the edge computing device and use local data caching on the edge computing device.
[0009] Step S4: Wear management. Wear management includes heat calculation, wear threshold calculation, and migration priority calculation. The basic unit for the flash memory device to store data is the flash block. By monitoring the erase and write count data of the flash blocks in the flash memory device, and through heat calculation and wear threshold calculation, the wear threshold Y of the heat value Heat of the flash block is obtained. When the heat value Heat is greater than the wear threshold Y, the data is migrated to other underutilized flash blocks. Before data migration, the migration priority P of the data is obtained through migration priority calculation, and the data migration order is determined according to the migration priority P;
[0010] Step S5: Data backup. Monitor the performance parameters of the flash memory device in real time. The performance parameters include read / write speed and error rate. At the same time, regularly back up the data in the flash memory device to an external storage medium.
[0011] Optionally, in the wear management step, the heat calculation formula is as follows:
[0012]
[0013] Heat is the heat value of the flash block;
[0014] X i is the write count of the i-th flash block;
[0015] C i is the erase count of the i-th flash block;
[0016] α is the weight factor of X i and β is the weight factor of C i ;
[0017] RT i is the time length since the last access to the i-th flash block;
[0018] Z is a positive number to avoid the denominator being zero;
[0019] By calculating the heat value Heat of the flash block, the heat value Heat represents the frequency of the flash block being written and erased. In a numerical way, the factors affecting the state of the flash block are converted into the heat value Heat, which can facilitate the evaluation of the state of the flash block.
[0020] Optionally, in the wear management step, the wear threshold calculation formula is as follows:
[0021]
[0022] where Y is the wear threshold;
[0023] D maxi is the maximum durability of the i-th flash block;
[0024] Temp i is the current ambient temperature of the i-th flash memory block, Temp opt is the optimal operating temperature of the flash memory block;
[0025] Temp max is the highest ambient temperature of the flash memory block, Temp min is the lowest ambient temperature of the flash memory block;
[0026] A i is the usage time of the i-th flash memory block, Amax i is the maximum usage time of the i-th flash memory block;
[0027] γ is the temperature influence coefficient, δ is the aging influence coefficient, and the initial value of δ is 0.8;
[0028] When the heat value Heat of the flash memory block is greater than the wear threshold Y, the data is migrated to the flash memory block with a heat value Heat less than the wear threshold Y. When the heat value Heat is less than the wear threshold Y, the data is continuously transferred to the current flash memory block. By accurately calculating the wear threshold Y by introducing multiple factors, the utilization of flash memory resources can be optimized, data migration can be performed in a timely manner, the failure of the flash memory block caused by excessive wear can be avoided, and the replacement and repair costs can be saved.
[0029] Optionally, in the wear management step, the migration priority calculation formula is as follows:
[0030]
[0031] where P is the migration priority;
[0032] Y i -(X i +C i ) is the remaining life of the i-th flash memory block;
[0033] Y i is the wear threshold of the i-th flash memory block;
[0034] X i is the number of write operations of the i-th flash memory block;
[0035] C i is the number of erase operations of the i-th flash memory block;
[0036] Heat i is the heat value of the i-th flash memory block;
[0037] Heat max is the maximum heat value of all flash memory blocks;
[0038] is the dynamic adjustment factor, and its value range is between 0 and 1;
[0039] F i is the migration frequency of the i-th flash memory block;
[0040] D i is the importance of the data in the i-th flash memory block, D i ranges from 0 to 1;
[0041] When the migration priority of the flash memory block is high and it is frequently migrated, causing F i to increase, thereby reducing the value, reducing the subsequent migration priority of this flash memory block and slowing down the wear rate. When the value is less than 0.2, it indicates that the importance and migration frequency of the data in this flash memory block are relatively low. At this time, the influence of the aging influence coefficient δ on the wear threshold Y is reduced, and the aging influence coefficient δ changes. Specifically:
[0042] When the value is less than 0.2,
[0043] Optionally, in the device partitioning step, the system data partition includes the operating system, system configuration files, and system logs. The application data partition is used to store data generated by applications, including user information and work data. The temporary data partition is used to store temporary files and cached data.
[0044] Optionally, in the data compression step, the hardware capabilities of the edge computing device include CPU performance, RAM performance, storage performance, and power consumption and heat dissipation performance. Evaluate the model, main frequency, and core count indicators of the CPU to understand its capabilities in processing compression algorithms. The CPU performance directly affects the execution speed and efficiency of the compression algorithm.
[0045] Optionally, in the data backup step, the external storage medium uses cloud storage. Cloud storage has high scalability, can dynamically increase the storage space according to requirements, and data recovery is convenient. Data can be quickly restored through a network connection without physically contacting the storage device.
[0046] Optionally, in the data compression step, the local data cache uses the GuavaCache local buffering tool. The GuavaCache local buffering tool includes functions such as automatic loading, maximum number of cache items, timed expiration, and size-based eviction policy.
[0047] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0048] 1. The present invention calculates the heat value of a flash memory block through heat calculation, enabling the frequency of writing and erasing of the flash memory block to be known. Then, the wear threshold of the flash memory block is calculated through the wear threshold calculation and compared with the heat value of the flash memory block to determine whether data migration is required, so that each flash memory block can be used evenly, the wear rate can be slowed down, and the service life can be extended. Heat calculation provides a data basis for wear threshold determination, and the wear threshold is the key condition for triggering data migration. When data migration occurs, the migration priority is calculated to ensure that critical data is migrated first, reducing the working interruption time caused by data migration, reducing the risk of data loss or damage, optimizing resource allocation, and reducing user waiting time.
[0049] 2. The data in the migration priority calculation formula can also affect the data in the wear threshold calculation formula, thereby optimizing subsequent data processing. The three calculations interact with each other in the wear leveling algorithm, jointly improving the performance and stability of the edge computing device system. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0052] Embodiment, please refer to Figure 1 This embodiment provides a flash memory management method for an edge computing device, including the following steps:
[0053] Flash memory selection: Select a flash memory device according to the requirements of the edge computing device. The flash memory device includes a solid-state drive, a USB flash drive, and an embedded flash memory.
[0054] Device partitioning: Divide the flash memory device into different data partitions. The data partitions include a system data partition, an application data partition, and a temporary data partition for easy management and maintenance. According to the characteristics and access frequency of the data, the data is allocated to different partitions.
[0055] Data compression: Select a compression algorithm according to the hardware capabilities of the edge computing device. The compression algorithms include gzip, LZ4, or Brotli, and use local data caching on the edge computing device to reduce dependence on the remote server.
[0056] Wear management monitors the number of erase and write cycles and other usage data of flash memory blocks in a flash memory device to understand the usage of flash memory blocks. When the number of erase and write cycles of a flash memory block exceeds the wear threshold, a wear management algorithm is used to migrate data to other underutilized flash memory blocks. The wear management algorithm includes heat calculation, wear threshold calculation, and migration priority calculation;
[0057] Data backup monitors the performance parameters of the flash memory device in real time. The performance parameters include read and write speeds and error rates. All error events are recorded for subsequent analysis and problem troubleshooting. At the same time, the data in the flash memory device is regularly backed up to an external storage medium.
[0058] More specifically, in this embodiment: By dividing the flash memory device into different data partitions, a certain partition can be backed up, restored, or migrated independently without affecting the data of other partitions, making data management more flexible. By calculating the heat value of the flash memory block using the wear management algorithm, it is possible to know the frequency of writes and erases to the flash memory block. Then, the wear threshold of the flash memory block is calculated and compared with the heat value of the flash memory block to determine whether data migration is required. And the data is migrated to other underutilized flash memory blocks, so that each flash memory block can be used evenly, slowing down the wear rate and extending the service life. At the same time, when migrating data, by calculating the migration priority, it is ensured that critical data is migrated first, reducing the risk of data loss or damage. For application programs or services that rely on specific data, migrating this data first can restore their normal operation faster, reducing user waiting time and improving the performance and stability of the edge computing device system.
[0059] Further, in the wear management step, the heat calculation formula is as follows:
[0060]
[0061] Heat is the heat value of the flash memory block;
[0062] X i is the number of write cycles of the i-th flash memory block;
[0063] C i is the number of erase cycles of the i-th flash memory block;
[0064] α is the weight factor of X i and β is the weight factor of C i ;
[0065] RT i is the length of time since the i-th flash memory block was last accessed;
[0066] Z is a positive number to avoid a zero denominator;
[0067] By calculating the heat value of the flash memory block, where the heat value represents the frequency of writing and erasing of the flash memory block, and converting the factors affecting the state of the flash memory block into heat values in a numerical way, it is possible to facilitate the evaluation of the state of the flash memory block.
[0068] Specifically, by calculating the heat value Heat of the flash memory block, it is possible to identify which flash memory blocks are frequently updated and which are not frequently updated, thus facilitating the subsequent migration of data on the hot flash memory blocks to less frequently used flash memory blocks, thereby balancing the wear degree of each flash memory block and improving the overall service life of the flash memory.
[0069] Furthermore, in the wear management step, the wear threshold calculation formula is as follows:
[0070]
[0071] Where Y is the wear threshold;
[0072] D maxi is the maximum durability of the i-th flash memory block;
[0073] Temp i is the current ambient temperature of the i-th flash memory block, Temp opt is the optimal operating temperature of the flash memory block;
[0074] Temp max is the highest ambient temperature of the flash memory block, Temp min is the lowest ambient temperature of the flash memory block;
[0075] A i is the usage time of the i-th flash memory block, Amax i is the maximum usage time of the i-th flash memory block;
[0076] γ is the temperature influence coefficient, and δ is the aging influence coefficient;
[0077] When the heat value Heat of the flash memory block is greater than the wear threshold Y, the data is migrated to other underutilized flash memory blocks. When the heat value Heat is less than the wear threshold Y, the data is continuously transferred to the current flash memory block. By accurately calculating the wear threshold Y by introducing multiple factors, the utilization of flash memory resources can be optimized, data migration can be carried out in a timely manner, the failure of flash memory blocks caused by excessive wear can be avoided, and the replacement and repair costs can be saved.
[0078] Specifically, by setting the wear threshold Y, it is possible to ensure that each flash memory block in the storage device is evenly utilized before reaching the predetermined number of erase / write cycles, avoiding premature failure of some flash memory blocks due to overuse, thereby extending the life of the entire flash memory device. The wear threshold Y can be dynamically adjusted according to the actual usage of the storage device. When the flash memory block has a heavy load and frequent read / write operations, the wear threshold Y can be reduced to trigger data migration operations more frequently. When the load is light, the wear threshold Y can be increased to reduce data migration operations. In this method, the determination of the wear threshold Y is achieved through simple comparison and logical judgment, without the need for complex algorithms or data structures, which is easy to implement, reduces system conflicts in edge computing devices, and improves system stability.
[0079] Furthermore, in the wear management step, the migration priority calculation formula is as follows:
[0080]
[0081] Where P is the migration priority;
[0082] Y i -(X i +C i ) is the remaining life of the i-th flash memory block;
[0083] Y i is the wear threshold of the i-th flash memory block;
[0084] X i is the number of write cycles of the i-th flash memory block;
[0085] C i is the number of erase cycles of the i-th flash memory block;
[0086] Heat i is the heat value of the i-th flash memory block;
[0087] Heat max is the maximum heat value of all flash memory blocks;
[0088] is the dynamic adjustment factor, and its value range is between 0 and 1;
[0089] F i is the migration frequency of the i-th flash memory block;
[0090] D i is the importance of the data in the i-th flash memory block, D i has a value range between 0 and 1;
[0091] The importance of data can be judged by different data partitions. For example, the importance of data in the system data partition is set to 0.8, the importance of data in the application data partition is set to 0.6, and the importance of data in the temporary data partition is set to 0.4. It can also be set according to the frequency of writing and erasing of flash blocks and the heat value Heat.
[0092] When the migration priority of the flash block is high and it is frequently migrated, it causes F i to increase, thereby reducing the value, so that the migration priority of this flash block is reduced in the future, slowing down the wear rate. When the value is less than 0.2, it means that the importance and migration frequency of the data in this flash block are relatively low. At this time, the influence of reducing the aging influence coefficient δ on the wear threshold Y is reduced, and the aging influence coefficient δ changes. Specifically:
[0093] When the value is less than 0.2,
[0094] Specifically, by calculating the data migration priority P, it can ensure that the key data in the edge computing device is migrated first, such as the system data that ensures the stable operation of the device, reducing the work interruption time caused by data migration, and ensuring the continuity and stability of key work. By setting the migration priority P, it can migrate important and urgent data first, optimize resource allocation, reduce resource waste during migration, and reduce the risk of data loss or damage. For application programs or services that rely on specific data, migrating these data first can restore their normal operation faster, reduce user waiting time, reduce the impact on users, and improve user satisfaction.
[0095] Furthermore, in the device partitioning step, the system data partition includes the operating system, system configuration files, and system logs. The system data partition is usually designed to be read-only or have strict access control to prevent unauthorized modification or deletion;
[0096] The application data partition is used to store the data generated by the application program, including user information and work data. The data in this partition is the core of the application program's operation, and the application data partition is customized according to the needs of the application program;
[0097] The temporary data partition is used to store temporary files and cached data. The temporary data partition can significantly improve the system's response speed because temporary files can be read and written quickly. Since the importance of these data is relatively low, complex backup and recovery operations are usually not required. However, the temporary data partition needs to be cleaned regularly to free up storage space to avoid performance problems caused by insufficient space.
[0098] Specifically, by dividing the flash memory device into different data partitions, data can be dispersed onto different physical and logical storage devices, reducing the I / O load of a single device and improving data access speed. Through data partitioning, data management becomes more flexible, allowing for backup, restoration, or migration of a specific partition without affecting the data in other partitions. Through permission control, access to sensitive data partitions can be restricted, enhancing data security.
[0099] Furthermore, in the data compression step, the hardware capabilities of the edge computing device include CPU performance, RAM performance, storage performance, and power consumption and heat dissipation performance. Evaluate the model, main frequency, and core count of the CPU to understand its capabilities in processing compression algorithms. CPU performance directly affects the execution speed and efficiency of the compression algorithm.
[0100] Specifically, in the workload environment of edge computing devices, network bandwidth and latency can easily affect data transmission efficiency. When the network bandwidth is small or the latency is high, selecting an algorithm with a high compression rate can reduce the amount of data transmitted, thereby reducing network bandwidth requirements and latency. Therefore, when selecting a compression algorithm suitable for edge computing devices, it is necessary to comprehensively consider various factors such as the device's hardware capabilities, data characteristics, network bandwidth, and latency. By reasonably selecting and configuring the compression algorithm, the performance of edge computing devices can be improved, network bandwidth requirements can be reduced, and the user experience can be enhanced.
[0101] Furthermore, in the data backup step, cloud storage is used as the external storage medium. Cloud storage has high scalability, can dynamically increase storage space according to demand, and data restoration is convenient. Data can be quickly restored through a network connection without physical contact with the storage device.
[0102] Specifically, cloud storage supports an automatic backup function, which can back up data regularly according to the set strategy without manual intervention, greatly saving the user's time and effort. At the same time, data in cloud storage can be accessed through various devices, including mobile phones, computers, and tablets, enabling seamless synchronization and sharing of data and improving the convenience of data usage. Cloud storage provides a pay-as-you-go model, where users only need to pay according to the actual storage capacity used. Users do not need to purchase and maintain their own storage devices, nor do they need to worry about device aging and failure issues, thus reducing operation and maintenance costs.
[0103] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A flash memory management method for an edge computing device, characterized in that, It includes the following steps: Step S1: Flash memory selection. Select a flash memory device according to the requirements of the edge computing device. Step S2: Device partitioning. After the flash memory device is selected, divide the flash memory device into different data partitions, including a system data partition, an application data partition, and a temporary data partition. Allocate data to different partitions according to the characteristics and access frequencies of the data. Step S3: Data compression. Select a compression algorithm according to the hardware capabilities of the edge computing device and use local data caching on the edge computing device. Step S4: Wear management. Wear management includes heat calculation, wear threshold calculation, and migration priority calculation. The basic unit for storing data in the flash memory device is the flash memory block. By monitoring the erase and write count data of the flash memory blocks in the flash memory device, and through heat calculation and wear threshold calculation, obtain the wear threshold Y of the heat value Heat of the flash memory block. When the heat value Heat is greater than the wear threshold Y, migrate the data to other underutilized flash memory blocks. Before data migration, obtain the migration priority P of the data through migration priority calculation, and determine the data migration order according to the migration priority P. Step S5: Data backup. Real-time monitor the performance parameters of the flash memory device, including read and write speeds and error rates, and at the same time regularly back up the data in the flash memory device to an external storage medium.
2. The flash memory management method for an edge computing device according to claim 1, wherein: In the wear management step, the heat calculation process is as follows: Heat is the heat value of the flash memory block. X i is the number of write operations to the i-th flash memory block; C i is the number of erase cycles of the i-th flash memory block; α is the weight factor of X i and β is the weight factor of C i ; RT i is the length of time since the last access to the i-th flash memory block; Z is a positive number to avoid a zero denominator. By calculating the heat value Heat of the flash memory block, the heat value Heat represents the frequency of writing and erasing of the flash memory block. By numerical means, convert the factors affecting the state of the flash memory block into the heat value Heat, which can facilitate the evaluation of the state of the flash memory block.
3. The flash memory management method for the edge computing device according to claim 2, wherein: In the wear management step, the wear threshold calculation process is as follows: Where Y is the wear threshold. D maxi is the maximum endurance of the i-th flash memory block; Temp i is the current ambient temperature of the i-th flash memory block, Temp opt is the optimal operating temperature of the flash memory block; Temp max is the highest ambient temperature of the flash memory block, Temp min is the lowest ambient temperature of the flash memory block; A i is the usage time of the i-th flash memory block, Amax i is the maximum usage time of the i-th flash memory block; γ is the temperature influence coefficient, δ is the aging influence coefficient, and the initial value of δ is 0.
8. When the heat value Heat of the flash memory block is greater than the wear threshold Y, migrate the data to a flash memory block with a heat value Heat less than the wear threshold Y. When the heat value Heat is less than the wear threshold Y, continue to transfer the data to the current flash memory block. By accurately calculating the wear threshold Y by introducing multiple factors, the utilization of flash memory resources can be optimized, data migration can be carried out in a timely manner, avoiding the failure of flash memory blocks due to excessive wear, and saving replacement and repair costs.
4. The flash memory management method for an edge computing device according to claim 3, wherein: In the wear management step, the migration priority calculation process is as follows: Where P is the migration priority. Y i -(X i +C i ) is the remaining life of the i-th flash memory block; Y i is the wear threshold of the i-th flash memory block; X i is the number of write operations to the i-th flash memory block; C i is the number of erase cycles of the i-th flash memory block; Heat i is the heat value of the i-th flash memory block; Heat max is the maximum heat value of all flash memory blocks; is a dynamic adjustment factor, and its value range is between 0 and 1; F i is the migration frequency of the i-th flash memory block; D i is the importance of the data in the i-th flash memory block, D i ranges from 0 to 1; When the migration priority of the flash memory block is high and it is frequently migrated, causing F i to increase, thereby reducing the value, causing the migration priority of this flash memory block to decrease in subsequent migrations, slowing down the wear rate. When the value is less than 0.2, it indicates that the importance and migration frequency of the data in this flash memory block are relatively low. At this time, the influence of the aging influence coefficient δ on the wear threshold Y is reduced, and the aging influence coefficient δ changes. Specifically: When the value is less than 0.2, 5. The flash memory management method for an edge computing device according to claim 4, characterized in that: In the device partitioning step, the system data partition includes the operating system, system configuration files, and system logs. The application data partition is used to store data generated by application programs, including user information and work data. The temporary data partition is used to store temporary files and cached data.
6. The flash memory management method for an edge computing device according to claim 1, wherein: In the data compression step, the hardware capabilities of the edge computing device include CPU performance, RAM performance, storage performance, and power consumption and heat dissipation performance. Evaluate the model, main frequency, and core count indicators of the CPU to understand its ability to process compression algorithms. CPU performance directly affects the execution speed and efficiency of compression algorithms.
7. The flash memory management method for an edge computing device according to claim 1, characterized in that: In the data backup step, the external storage medium uses cloud storage. Cloud storage has high scalability, can dynamically increase the storage space according to requirements, and is convenient for data recovery. Data can be quickly restored through network connection without physically contacting the storage device.
8. The flash memory management method of the edge computing device according to claim 1, wherein: In the data compression step, GuavaCache local buffering tool is used for local data caching. The GuavaCache local buffering tool includes functions such as automatic loading, maximum number of cache items, timed expiration, and size-based eviction strategy.
Citation Information
Patent Citations
Optimization method of NAND Flash loss equalization
CN109684119A
NAND Flash main control chip in which a stage dynamic threshold loss equalization module is embedded
CN109712662A
Garbage recycling method, system and equipment applied to solid state disk and storage medium
CN117215481A
ZNS SSD garbage collection sensing method based on MLP
CN119473142A
Solid state disk bad block wear balancing method and system, medium and program product
CN119576246A