An edge computing device flash memory management method
By partitioning data in edge computing devices and calculating heat and wear thresholds, the use of flash memory blocks is optimized, solving the wear problem caused by uneven access and achieving balanced utilization of flash memory resources and improved system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2026-03-17
AI Technical Summary
Uneven access patterns of flash memory blocks in edge computing devices lead to uneven wear and tear, shortening lifespan, and the lack of effective data migration prioritization strategies affects system performance and stability.
By dividing flash memory devices into different data partitions and combining heat calculation, wear threshold calculation, and migration priority calculation, balanced data migration and backup are achieved, optimizing resource utilization.
It extends the lifespan of flash memory blocks, reduces the risk of data loss or corruption, improves system performance and stability, and reduces user waiting time.
Smart Images

Figure CN120371218B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software engineering technology, specifically to a flash memory management method for edge computing devices. Background Technology
[0002] Edge computing is a computing model that prioritizes data processing and computation closer to the data source, rather than transmitting all data to remote cloud servers. Edge computing devices are the hardware used in this model, typically located near the data generation point to provide real-time, low-latency computing and services. Flash memory devices usually collect a segment of data, map it from logical addresses to physical addresses, and then write that data into the word lines of a flash memory block.
[0003] Currently, when edge computing devices cache data, some flash memory blocks are frequently accessed and updated, while other flash memory blocks are accessed less frequently. This unbalanced access pattern accelerates the wear and tear of some storage media, shortens their lifespan, and lacks a reasonable data migration priority strategy, which can easily lead to confusion in the migration of low-priority data and high-priority data, consuming too many system resources and reducing the performance and stability of the edge computing device system. Summary of the Invention
[0004] The purpose of this invention is to provide a flash memory management method for edge computing devices, which solves the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a flash memory management method for edge computing devices, comprising the following steps:
[0006] Step S1: Flash Memory Selection. Select the flash memory device according to the needs of the edge computing device. Flash memory devices include solid-state drives, USB flash drives, and embedded flash memory.
[0007] Step S2: Device partitioning. After selecting the flash memory device, the flash memory device is divided into different data partitions, including system data partition, application data partition, and temporary data partition. The data is allocated to different partitions according to the characteristics and access frequency of the data.
[0008] Step S3: Data compression. Select a compression algorithm based on 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 storing data in a flash memory device is a flash block. By monitoring the number of erases and writes of flash blocks in the flash memory device, and by calculating the heat value Heat and wear threshold, the wear threshold Y 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 by calculating the migration priority, 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, including read / write speed and error rate. At the same time, back up the data in the flash memory device to external storage media periodically.
[0011] Optionally, in the wear management step, the heat calculation formula is as follows:
[0012]
[0013] Heat is the thermal value of the flash memory block;
[0014] X i It represents the number of writes to the i-th flash memory block;
[0015] C i It represents the number of erases for the i-th flash memory block;
[0016] α is X i The weighting factor, β is C i Weighting factors;
[0017] RT i It is the length of time 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 of flash memory blocks, which represents the frequency at which flash memory blocks are written to and erased, the factors affecting the state of flash memory blocks are converted into heat values through numerical methods, making it easier to evaluate the state of flash memory blocks.
[0020] Optionally, in the wear management step, the wear threshold is calculated using the following formula:
[0021]
[0022] Where Y is the wear threshold;
[0023] D maxi It is the maximum endurance of the i-th flash memory block;
[0024] Temp i Temp is the current ambient temperature of the i-th flash memory block. opt This is the optimal operating temperature for flash memory blocks;
[0025] Temp max It is the highest ambient temperature of the flash memory block, Temp. min This is the lowest ambient temperature of the flash memory block;
[0026] A i It is the usage time of the i-th flash memory block, Amax i It 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 of a flash memory block is greater than the wear threshold Y, the data is migrated to a flash memory block with a heat value less than the wear threshold Y. When the heat value is less than the wear threshold Y, the data continues to be transferred to the current flash memory block. By introducing multiple factors to accurately calculate the wear threshold Y, the utilization of flash memory resources can be optimized, data migration can be performed in a timely manner, and flash memory block failure due to excessive wear can be avoided, saving replacement and repair costs.
[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 ) represents the remaining lifetime of the i-th flash memory block;
[0033] Y i It is the wear threshold of i flash memory blocks;
[0034] X i It represents the number of writes to the i-th flash memory block;
[0035] C i It represents the number of erases for the i-th flash memory block;
[0036] Heat i It is the heat value of the i-th flash memory block;
[0037] Heat max It is the maximum heat value of all flash memory blocks;
[0038] It is a dynamic adjustment factor, with a value range between 0 and 1;
[0039] F i It is the migration frequency of the i-th flash memory block;
[0040] D i The importance of the data in the i-th flash memory block, D i The value ranges from 0 to 1;
[0041] When flash memory blocks have a high migration priority and are frequently migrated, F i Increase, thereby decrease The value of makes the flash memory block less priority for subsequent migration, slowing down the wear rate. When the value is less than 0.2, it indicates that the data in the flash memory block is of low importance and has a low migration frequency. In this case, the influence of the aging effect coefficient δ on the wear threshold Y is reduced, and the aging effect coefficient δ changes, specifically as follows:
[0042] when 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; and the temporary data partition is used to store temporary files and cached data.
[0044] Optionally, the hardware capabilities of the edge computing device in the data compression step include CPU performance, RAM performance, storage performance, and power consumption and heat dissipation performance. The model, clock speed, and number of cores of the CPU are evaluated to understand its ability to process compression algorithms. CPU performance directly affects the execution speed and efficiency of compression algorithms.
[0045] Optionally, cloud storage is used as the external storage medium in the data backup step. Cloud storage has high scalability, can dynamically increase storage space according to needs, and data recovery is convenient. Data can be quickly recovered through network connection without physical contact with the storage device.
[0046] Optionally, the local data caching in the data compression step uses the GuavaCache local caching tool, which includes functions such as automatic loading, maximum number of cached 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] I. This invention calculates the heat value of a flash memory block using heat calculation, which reveals the frequency of writing and erasing of that block. Then, it calculates the wear threshold of the flash memory block using a wear threshold calculation, comparing it with the heat value to determine whether data migration is necessary. This ensures balanced use of each flash memory block, slows wear, and extends its lifespan. Heat calculation provides the data basis for wear threshold determination, and the wear threshold is the key condition for triggering data migration. During data migration, migration priority is calculated to ensure that critical data is migrated first, reducing downtime caused by data migration, lowering the risk of data loss or corruption, optimizing resource allocation, and reducing user waiting time.
[0049] Second, 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 influence each other in the wear leveling algorithm, jointly improving the performance and stability of the edge computing device system. Attached Figure Description
[0050] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] For examples, please refer to Figure 1 This embodiment provides a flash memory management method for edge computing devices, including the following steps:
[0053] Flash memory selection: Select flash memory devices based on the needs of edge computing devices. Flash memory devices include solid-state drives, USB flash drives, and embedded flash memory.
[0054] Device partitioning divides the flash memory device into different data partitions, including system data partitions, application data partitions, and temporary data partitions, to facilitate management and maintenance. Data is allocated to different partitions according to its characteristics and access frequency.
[0055] Data compression involves selecting compression algorithms based on the hardware capabilities of the edge computing device. These algorithms include gzip, LZ4, or Brotli, and local data caching is used on the edge computing device to reduce reliance on remote servers.
[0056] Wear management monitors the number of erases and writes of flash memory blocks in flash memory devices and other usage data to understand the usage of flash memory blocks. When the number of erases and writes of a flash memory block exceeds the wear threshold, the wear management algorithm is used to migrate the data to other underutilized flash memory blocks. The wear management algorithm includes heat calculation, wear threshold calculation and migration priority calculation.
[0057] Data backup includes real-time monitoring of flash memory device performance parameters, such as read / write speed and error rate, recording all error events for subsequent analysis and troubleshooting, and periodically backing up data from the flash memory device to external storage media.
[0058] More specifically, in this embodiment: by dividing the flash memory device into different data partitions, a partition can be backed up, restored, or migrated independently without affecting the data in other partitions, making data management more flexible. By calculating the heat value of the flash memory block through a wear management algorithm, the frequency of writing and erasing of the flash memory block can be determined. 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 necessary. The data is then migrated to other underutilized flash memory blocks, so that the flash memory blocks can be used in a balanced way, slowing down the wear rate and extending the lifespan. At the same time, by calculating the migration priority during data migration, critical data is ensured to be migrated first, reducing the risk of data loss or corruption. For applications or services that rely on specific data, prioritizing the migration of this data can restore their normal operation more quickly, reduce user waiting time, and improve the performance and stability of the edge computing device system.
[0059] Furthermore, in the wear management process, the heat calculation formula is as follows:
[0060]
[0061] Heat is the thermal value of the flash memory block;
[0062] X i It represents the number of writes to the i-th flash memory block;
[0063] C i It represents the number of erases for the i-th flash memory block;
[0064] α is X i The weighting factor, β is C i Weighting factors;
[0065] RT i It is the length of time since the last access to the i-th flash block;
[0066] Z is a positive number to avoid the denominator being zero;
[0067] By calculating the heat value of flash memory blocks, which represents the frequency at which flash memory blocks are written to and erased, the factors affecting the state of flash memory blocks are converted into heat values in a numerical way, making it easier to evaluate the state of flash memory blocks.
[0068] Specifically, by calculating the heat value of flash memory blocks, it is possible to identify which flash memory blocks are frequently updated and which are not frequently updated. This makes it easier to migrate data from the hot flash memory blocks to the less frequently used flash memory blocks, thereby balancing the wear and tear of each flash memory block and improving the overall lifespan of the flash memory.
[0069] Furthermore, in the wear management process, the wear threshold is calculated using the following formula:
[0070]
[0071] Where Y is the wear threshold;
[0072] D maxi It is the maximum endurance of the i-th flash memory block;
[0073] Temp i Temp is the current ambient temperature of the i-th flash memory block. opt This is the optimal operating temperature for flash memory blocks;
[0074] Temp max It is the highest ambient temperature of the flash memory block, Temp. min This is the lowest ambient temperature of the flash memory block;
[0075] A i It is the usage time of the i-th flash memory block, Amax i It 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 of a flash memory block exceeds the wear threshold Y, data is migrated to other underutilized flash memory blocks. When the heat value is less than the wear threshold Y, data continues to be transferred to the current flash memory block. By introducing multiple factors to accurately calculate the wear threshold Y, the utilization of flash memory resources can be optimized, data migration can be performed in a timely manner, flash memory block failure due to excessive wear can be avoided, and replacement and repair costs can be saved.
[0078] Specifically, by setting a wear threshold Y, it can be ensured that each flash memory block in the storage device is used evenly before reaching a predetermined number of erase and write cycles, avoiding premature failure of some flash memory blocks due to overuse, thereby extending the lifespan 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 load is heavy and frequent read and write operations are performed, the wear threshold Y can be reduced to trigger data migration more frequently, while when the load is light, the wear threshold Y can be increased to reduce data migration operations. Furthermore, the wear threshold Y determination in this method is achieved through simple comparison and logical judgment, without the need for complex algorithms or data structures, making it easy to implement, reducing system conflicts in edge computing devices, and improving system stability.
[0079] Furthermore, in the wear management process, the migration priority calculation formula is as follows:
[0080]
[0081] Where P is the migration priority;
[0082] Y i -(X i +C i ) represents the remaining lifetime of the i-th flash memory block;
[0083] Y i It is the wear threshold of i flash memory blocks;
[0084] X i It represents the number of writes to the i-th flash memory block;
[0085] C i It represents the number of erases for the i-th flash memory block;
[0086] Heat i It is the heat value of the i-th flash memory block;
[0087] Heat max It is the maximum heat value of all flash memory blocks;
[0088] It is a dynamic adjustment factor, with a value range between 0 and 1;
[0089] F i It is the migration frequency of the i-th flash memory block;
[0090] D i The importance of the data in the i-th flash memory block, D i The value ranges from 0 to 1;
[0091] The importance of data can be determined by different data partitions. For example, the importance of data in the system data partition can be set to 0.8, the importance of data in the application data partition can be set to 0.6, and the importance of data in the temporary data partition can be set to 0.4. It can also be set by the frequency of flash memory blocks being written to and erased and the heat value.
[0092] When flash memory blocks have a high migration priority and are frequently migrated, F i Increase, thereby decrease The value of makes the flash memory block less priority for subsequent migration, slowing down the wear rate. When the value is less than 0.2, it indicates that the data in the flash memory block is of low importance and has a low migration frequency. In this case, the influence of the aging effect coefficient δ on the wear threshold Y is reduced, and the aging effect coefficient δ changes, specifically as follows:
[0093] when When the value is less than 0.2,
[0094] Specifically, by calculating the data migration priority P, it can be ensured that critical data in edge computing devices are migrated first, such as system data that ensures stable operation of the devices, reducing downtime caused by data migration, and ensuring the continuity and stability of critical tasks. By setting the migration priority P, important and urgent data can be migrated first, optimizing resource allocation, reducing resource waste during the migration process, and reducing the risk of data loss or corruption. For applications or services that rely on specific data, prioritizing the migration of this data can help them resume normal operation more quickly, reduce user waiting time, minimize the impact on users, and improve user satisfaction.
[0095] Furthermore, the system data partition in the device partitioning process includes the operating system, system configuration files, and system logs. The system data partition is usually designed to be read-only or has strict access control to prevent unauthorized modification or deletion.
[0096] The application data partition is used to store data generated by the application, including user information and work data. This partition data is the core of the application's operation, and the application data partition is customized according to the application's needs.
[0097] Temporary data partitions are used to store temporary files and cached data. Temporary data partitions can significantly improve system response speed because temporary files can be read and written quickly. Since this data is of low importance, complex backup and recovery operations are usually not required. However, temporary data partitions need to be cleaned up regularly to free up storage space to avoid performance problems caused by insufficient space.
[0098] Specifically, by dividing flash memory devices into different data partitions, data can be distributed across different physical and logical storage devices, reducing the I / O load on individual devices, improving data access speed, and making data management more flexible. Data partitioning allows for backup, recovery, or migration of a particular partition without affecting data in other partitions. Access control can restrict access to sensitive data partitions, improving data security.
[0099] Furthermore, the hardware capabilities of edge computing devices in the data compression process include CPU performance, RAM performance, storage performance, and power consumption and heat dissipation performance. The model, clock speed, and number of cores of the CPU are evaluated to understand its ability to process compression algorithms. CPU performance directly affects the execution speed and efficiency of compression algorithms.
[0100] Specifically, in the workload environment of edge computing devices, network bandwidth and latency can easily affect data transmission efficiency. When network bandwidth is low or latency is high, choosing an algorithm with a high compression ratio 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 factors such as the device's hardware capabilities, data characteristics, network bandwidth, and latency. By reasonably selecting and configuring compression algorithms, the performance of edge computing devices can be improved, network bandwidth requirements can be reduced, and user experience can be enhanced.
[0101] Furthermore, cloud storage is used as the external storage medium in the data backup process. Cloud storage is highly scalable, allowing storage space to be dynamically increased as needed. Data recovery is convenient, as data can be quickly recovered via network connection without the need for physical contact with the storage device.
[0102] Specifically, cloud storage supports automatic backup, which can back up data regularly according to set policies without manual intervention. This greatly saves users' time and energy. At the same time, data in cloud storage can be accessed through various devices, including mobile phones, computers and tablets, to achieve seamless data synchronization and sharing, improving the convenience of data use. Cloud storage offers 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 equipment aging or failure, thereby reducing operation and maintenance costs.
[0103] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An edge computing device flash memory management method, characterized in that, Comprise the following steps: Step S1: flash selection, according to the edge computing device demand, select flash device; Step S2: device partition, after the flash device selection, the flash device is divided into different data partition, data partition includes system data partition, application data partition, temporary data partition, according to the characteristics and access frequency of data, the data is allocated to different partition; Step S3: data compression, according to the hardware capability of edge computing device selection compression algorithm, and using local data cache on edge computing device; Step S4: wear management, wear management includes heat calculation, wear threshold calculation and migration priority calculation, the basic unit of flash device storage data is flash block, through monitoring the erase and write times data of flash block in flash device, and through heat calculation and wear threshold calculation, the heat value Heat and wear threshold Y of flash block are obtained, when the heat value Heat is greater than the wear threshold Y, the data is migrated to other not fully used flash block, before data migration, the migration priority P of data is obtained through migration priority calculation, and the data migration order is determined according to the migration priority P; Step S5: data backup, real-time monitoring the performance parameters of flash device, performance parameters include read-write speed and error rate, at the same time, the data in flash device is backed up to external storage medium regularly; In the wear management step, the heat calculation process is as follows: ; Heat is the heat value of flash block; is the number of writes to the ith flash block; is the number of erasures of the i-th flash memory block; is a weight factor, is a weight factor, is a weight factor, is a weight factor; is the length of time since the last access of the i-th flash memory block; Z is a positive number, to avoid the denominator being zero; Through the calculation of the heat value Heat of flash block, the heat value Heat represents the frequency of writing and erasing flash block, through the numerical way, the factors affecting the state of flash block are converted into heat value Heat, which can facilitate the evaluation of the state of flash block; In the wear management step, the wear threshold calculation process is as follows: ; Wherein Y is the wear threshold; is the maximum endurance of the i-th flash block; is the current ambient temperature of the i-th flash memory block, is the optimal operating temperature of the flash memory block; is the highest ambient temperature of the flash memory block, is the lowest ambient temperature of the flash memory block; is the usage time of the i-th flash memory block, is the maximum usage time of the i-th flash memory block; is a temperature influence coefficient, is an aging influence coefficient, with an initial value of 0.8; When the heat value Heat of flash block is greater than the wear threshold Y, the data is migrated to the flash block with heat value Heat less than the wear threshold Y, when the heat value Heat is less than the wear threshold Y, continue to transmit data to the current flash block, by introducing a variety of factors to accurately calculate the wear threshold Y, the utilization of flash resources can be optimized, timely data migration can be carried out, to avoid the failure of flash block due to excessive wear, saving replacement and repair cost.
2. The edge computing device flash management method of claim 1, wherein: In the wear management step, the migration priority calculation process is as follows: ; Wherein P is the migration priority; is the remaining lifetime of the i-th flash memory block; is a wear threshold for i flash blocks; is the number of writes to the ith flash block; is the number of erasures of the i-th flash memory block; is the hotness value of the ith flash block; is the maximum hotness value of all flash blocks; is a dynamic adjustment factor, taking a value in the range of 0 to 1 ; is the migration frequency of the i-th flash memory block; is the importance of data in the i-th flash block, ranging from 0 to 1; When the migration priority of the flash memory block is high and it is frequently migrated, the value of the aging impact coefficient is increased, thereby reducing the value of the wear threshold Y, so that the priority of the flash memory block is reduced in subsequent migration, slowing down the wear speed, when the value of the aging impact coefficient is reduced, thereby increasing the value of the wear threshold Y, so that the priority of the flash memory block is increased in subsequent migration, speeding up the wear speed, when the value of the aging impact coefficient is reduced, thereby increasing the value of the wear threshold Y, so that the priority of the flash memory block is increased in subsequent migration, speeding up the wear speed, when the value is less than 0.2, indicating that the importance of the data in the flash memory block and the migration frequency are low, at this time the aging impact coefficient is reduced to reduce the impact on the wear threshold Y, and the aging impact coefficient is changed, specifically: When Values less than 0.2, .
3. The edge computing device flash management method of claim 2, wherein: In the system data partition step, the system data partition includes operating system, system configuration file and system log, the application data partition is used for storing the data generated by application program, including user information and working data, the temporary data partition is used for storing temporary file and cache data.
4. The edge computing device flash management method of claim 1, wherein: In the data compression step, the hardware capability of edge computing device includes CPU performance, memory performance, storage performance and power dissipation performance, the model, frequency and core number of CPU are evaluated to understand its ability in processing compression algorithm, and the CPU performance directly affects the execution speed and efficiency of compression algorithm.
5. The edge computing device flash management method of claim 1, wherein: The external storage medium in the data backup step adopts cloud storage, which has high scalability, can dynamically increase storage space according to requirements, is convenient for data recovery, and can quickly recover data through network connection without physical contact with the storage device.
6. The edge computing device flash management method of claim 1, wherein: The local data cache in the data compression step adopts a GuavaCache local buffering tool, which includes automatic loading, maximum cache item number, timing expiration, and size-based elimination strategy functions.
Citation Information
Patent Citations
Solid state disk bad block wear balancing method and system, medium and program product
CN119576246A