A data migration method and storage medium for an FTL-based intelligent Internet of Things meter

By dividing the data area and linked list area in the Nor Flash storage area of ​​the smart IoT table and using FTL for regular data migration, the problem of insufficient FTL function of the smart IoT table when storing and managing data is solved, and data security and storage life are improved.

CN115878595BActive Publication Date: 2025-06-27ANHUI ZENITH ELECTRICITY & ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310000320.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2025-06-27
Estimated Expiration
2042-11-01

AI Technical Summary

Technical Problem

When existing smart IoT tables store and manage large amounts of data, they lack effective FTL functions, which leads to inconvenience in use of Nor Flash and cannot scientifically manage data, affecting data security and storage life.

Method used

By dividing the data area and linked list area in the Nor Flash storage area, using FTL to perform data migration regularly, data exchange and management are performed according to storage life and data popularity, ensuring data is stored in the safest and stable storage area.

Benefits of technology

It improves the efficiency and storage life of Nor Flash, reduces the data read and write error rate, and enhances the data security and operation stability of smart IoT tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878595B_ABST
    Figure CN115878595B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of power equipment, and specifically relates to a data migration method and a computer-readable storage medium for an intelligent IoT meter based on FTL. The data migration method includes the following steps: dividing the storage area of Nor flash into two parts, namely a data area and a linked list area; using the number of erasure times in the linked list information to evaluate the remaining life of the storage unit, and the number of read times to judge the cold and hot degree of the data; retrieving the linked list information in the linked list area to obtain the number of erasure times or read times of all storage units; then sorting to obtain a remaining life queue or a data heat queue, and when the difference between the number of erasure times or read times of the two storage units at the head and tail of the remaining life queue or the data heat queue is greater than a preset threshold, exchanging the data stored in the two storage units and updating the corresponding linked list information in the linked list area. The present invention solves the problem that the prior art lacks FTL for IoT meters and the security of key data in intelligent IoT cannot be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent for invention with the application number CN202211352768.6, the application date of November 1, 2022, and the invention title: A storage management method and storage medium for an intelligent IoT meter based on FTL. Technical Field

[0002] The present invention belongs to the field of power equipment, and particularly relates to a data migration method and a computer-readable storage medium for an intelligent IoT meter based on FTL. Background Art

[0003] Currently, intelligent electricity meters have become the most important basic equipment for collecting user power data in the power grid. The latest IoT meters even have the functions of automatic networking and data interaction, and can store and upload various types of collected information. To store various types of collected data, read-only memories ROMs, such as EEPROMs, are commonly used in existing IoT meters. In recent years, with the development of the Internet of Things, the application of Nor flash has shown a significant increase.

[0004] Since electricity meters have expanded a large number of applications, such as load identification, energy consumption analysis, topology analysis, etc., the data stored in intelligent electricity meters is also increasing. Fragmented storage and edge computing are both inseparable from Nor flash. The release and popularization of the Object-Oriented Power Consumption Information Data Exchange Protocol (abbreviated as DL / T698.45) have posed new challenges to the storage of intelligent electricity meter data.

[0005] In order to scientifically manage the data stored in the memory and improve the service life of the memory, existing large-capacity storage devices such as HDDs and SSDs, as well as large computer systems, are all configured with FTL (Flash Translation Layer), that is, the flash translation layer. FTL is the connection relationship between the storage medium and the device master controller. After implementing FTL, the operating system only needs to operate on the logical address in the same way as before, and the conversion from the logical address to the physical address is completed by FTL. While performing the address conversion, FTL also takes into account the management of Flash. It not only needs to control the number of erase and write cycles of each Block on the memory, but also needs to manage the useless data on the memory.

[0006] However, conventional small embedded devices and low-capacity memories do not have complex FTL functions, or only use drivers with simple address conversion functions. This poses a problem for the device to store and manage some complex data. For example, in the Internet of Things (IoT) meter using low-capacity Nor Flash, erasure must be performed before the "write" operation. The erasure range at one time depends on the chip characteristics and is generally not less than 4K bytes. However, due to the lack of an effective FTL function, Nor Flash is not convenient to use and cannot effectively manage the stored data. At the same time, intelligent IoT electricity meters record various events for the terminal or the master station to read. Some continuous events such as overvoltage, undervoltage, power failure, and phase break involve multiple data such as the event start time, event type, and event end time, and cannot be continuously stored. There may be time intersections when reading, which are not conducive to the management of meter events. In addition, with the continuous enrichment of the functions of IoT meters, the measurement information and event information will not only cause problems in data reading and writing errors, but also may affect the service life of Nor Flash due to different reading and writing frequencies and large differences in access frequencies of different data, posing a hidden danger to the long-term stable operation of the electricity meter.

[0007] Therefore, how to scientifically manage the data storage of intelligent IoT meters has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0008] To solve the problem that the prior art lacks FTL for IoT meters, the present invention provides a data migration method for an intelligent IoT meter based on FTL and a computer-readable storage medium.

[0009] The present invention is implemented by the following technical solutions:

[0010] A data migration method for an intelligent IoT meter based on FTL is used to periodically migrate the measurement information and event information stored in the Nor flash storage unit of the intelligent IoT meter, thereby improving the security of the key data stored in the intelligent IoT meter. The data migration method includes the following contents:

[0011] The storage area of Nor flash is divided into two parts: a data area and a linked list area. The storage units in the data area are used to store the data content of various types of information, and each storage unit corresponds to a physical address. The linked list area is used to store the address mapping table of each storage unit in the corresponding data area. The content of the linked list information in the address mapping table includes: logical address, number of erasures, number of reads, and valid flag.

[0012] FTL periodically performs data migration operations on the data in the Nor flash memory cells. The control instructions for data migration are triggered periodically according to a preset management cycle. When the data migration instruction is triggered, a round of data migration operations based on the storage life is executed. The process of the data migration operation based on the storage life is as follows:

[0013] First, retrieve the linked list information in the linked list area to obtain the erase counts of all memory cells. Then, sort all the memory cells in the data area according to the erase counts to obtain a remaining life queue. Next, sequentially determine whether the difference in the erase counts of the two memory cells at the head and tail of the remaining life queue is greater than a preset life threshold. If so, exchange the data stored in the two memory cells, update the corresponding linked list information in the linked list area, and remove the two memory cells after the data exchange from the remaining life queue. Finally, when the difference in the erase counts of the two memory cells at the head and tail of the remaining life queue is less than or equal to the preset life threshold, end the current round of data migration operations.

[0014] In the second solution provided by the present invention, a data migration method for an intelligent IoT meter based on FTL is used to periodically perform data migration on the measurement information and event information stored in the Nor flash memory cells of the intelligent IoT meter, thereby improving the security of the key data stored in the intelligent IoT meter. The data migration method includes the following:

[0015] Divide the storage area of the Nor flash into two parts: a data area and a linked list area. The memory cells in the data area are used to store the data content of various types of information, and each memory cell corresponds to a physical address. The linked list area is used to store the address mapping table of each memory cell in the corresponding data area. The content of the linked list information in the address mapping table includes: logical address, erase count, read count, and valid flag.

[0016] FTL periodically performs data migration operations on the data in the Nor flash memory cells. The control instructions for data migration are triggered periodically according to a preset management cycle. When the data migration instruction is triggered, a round of data migration operations based on the data heat is executed. The process of the data migration operation based on the data heat is as follows:

[0017] First, retrieve the linked list information in the linked list area to obtain the read counts of all storage units. Then, sort all the storage units in the data area according to the read counts to obtain a data heat queue. Next, sequentially determine whether the difference in the read counts of the two storage units at the head and tail of the data heat queue is greater than a preset heat threshold. If so, exchange the data stored in the two storage units, update the corresponding linked list information in the linked list area, and remove the two storage units after the data exchange from the data heat queue. Finally, when the difference in the read counts of the two storage units at the head and tail of the data heat queue is less than or equal to the preset heat threshold, end the data migration operation for the current round.

[0018] In the third solution provided by the present invention, a data migration method for an FTL-based intelligent IoT meter is used to periodically migrate the measurement information and event information stored in the Nor flash storage unit of the intelligent IoT meter, thereby improving the security of the key data stored in the intelligent IoT meter. The data migration method includes the following content:

[0019] Divide the storage area of Nor flash into two parts: a data area and a linked list area. The storage units in the data area are used to store the data content of various types of information, and each storage unit corresponds to a physical address. The linked list area is used to store the address mapping table of each storage unit in the corresponding data area. The content of the linked list information in the address mapping table includes: logical address, number of erasures, number of reads, and valid flag.

[0020] FTL periodically performs data migration operations on the data in the Nor flash storage unit; the control instructions for data migration are triggered periodically according to a preset management cycle. When the data migration instruction is triggered, a round of enhanced data migration operation combining storage life and data heat is executed. The process of the enhanced data migration operation combining storage life and data heat is as follows:

[0021] (1) Retrieve the linked list information in the linked list area to obtain the read counts and erase-write counts of all storage units.

[0022] (2) Use several storage units with the largest read counts as quasi-migration storage units; use the storage units in the quasi-migration storage units whose erase-write counts exceed the preset risk value as migration storage units.

[0023] (3) Use several storage units with the smallest read counts as storage units to be migrated in; and form an alternative migration queue in the order of increasing erase-write counts.

[0024] (4) Determine whether the number of migration storage units is greater than the number of storage units in the alternative migration queue: If so, take several storage units with the second smallest number of read times as the storage units to be migrated; and arrange them at the end of the alternative migration queue in ascending order of the number of erase times; until the number of migration storage units is not greater than the number of storage units in the alternative migration queue.

[0025] (5) Exchange the data in the migration storage units with the data stored in the storage units in the alternative migration queue, and update the linked list information corresponding to the linked list area.

[0026] In the foregoing three different data migration schemes of the present invention, the valid flag in the linked list information is used to determine whether the storage units in the corresponding data area are valid; when the logical address of the corresponding storage unit exists in the linked list area, the valid flag is updated to the "valid" state; when the logical address of the corresponding storage unit in the linked list area is deleted, the valid flag is updated to the "invalid" state. At the same time, the number of erase times in the linked list information is used to evaluate the remaining life of the storage unit, and the more the parameter times of the storage unit, the lower the remaining life. The number of read times in the linked list information is used to judge the cold and hot degree of the data, and the more the read times, the higher the current data heat. Furthermore, the data stored in the storage units is regularly migrated and managed according to the life of the storage unit and the cold and hot degree of the data.

[0027] The present invention also includes a storage management method for an intelligent IoT meter based on FTL, which is used to manage the reading, writing, and storage processes of metering information and event information in Nor flash storage units. The intelligent IoT meter regularly performs data migration operations on the storage units by using the data migration method of the intelligent IoT meter based on FTL as described above. When the intelligent IoT meter triggers a data migration instruction, it can separately perform data migration operations on the storage units by using the foregoing three different data migration schemes. Or the intelligent IoT meter first performs a round of data migration operation and a second round of data migration operation on the storage units by using the data migration methods of the intelligent IoT meter based on FTL in Scheme 1 and Scheme 2; and then performs a third round of data migration operation on the storage units by using the data migration method of the intelligent IoT meter based on FTL in Scheme 3.

[0028] The present invention also includes a computer-readable storage medium, on which a computer program is stored, characterized in that: when the computer program is executed by a processor, the steps of the data migration method of the intelligent IoT meter based on FTL as described above are implemented.

[0029] The technical solution provided by the present invention has the following beneficial effects:

[0030] The present invention divides the Nor flash into two parts: a linked list area and a data area, and distinguishes the cold and hot degrees of data and the erasure degree of blocks through linked list information, so as to dynamically manage the storage space of the Nor flash. Compared with the traditional method, the partitioning method proposed by the present invention can improve the utilization efficiency of the Nor flash. At the same time, this method has greatly improved in terms of wear leveling, erasure frequency, and flexibility, with low resource occupancy, convenient and efficient data access, and improved the utilization efficiency of the flash, increasing the service life of the intelligent IoT meter.

[0031] The data migration solution provided by the present invention can regularly migrate data according to the data heat and the storage life of different storage units, ensuring that critical data can be stored in the safest and most stable storage area of the memory, thereby effectively guaranteeing the security of the data and reducing the error rate during the data reading and writing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, and do not constitute a limitation to the present invention. In the drawings:

[0033] Figure 1 It is a flowchart of the data writing process in a storage management method of an intelligent IoT meter based on FTL provided in Embodiment 1 of the present invention.

[0034] Figure 2 It is a flowchart of the data erasure process in a storage management method of an intelligent IoT meter based on FTL provided in Embodiment 1 of the present invention.

[0035] Figure 3 It is a flowchart of the data reading process in a storage management method of an intelligent IoT meter based on FTL provided in Embodiment 1 of the present invention.

[0036] Figure 4 It is a flowchart of the data deletion process in a storage management method of an intelligent IoT meter based on FTL provided in Embodiment 1 of the present invention.

[0037] Figure 5 It is a flowchart of the data migration operation based on the remaining life in a storage management method of an intelligent IoT meter based on FTL provided in Embodiment 1 of the present invention.

[0038] Figure 6 It is a flowchart of the data migration operation based on the data heat in a storage management method of an intelligent IoT meter based on FTL provided in Embodiment 1 of the present invention.

[0039] Figure 7Flowchart for enhancing data migration operation in a storage management method of an FTL-based intelligent IoT meter provided in Embodiment 1 of the present invention. Detailed implementation manners

[0040] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0041] Embodiment 1

[0042] This embodiment provides a storage management method for an FTL-based intelligent IoT meter, which is used to manage the reading, writing and storage processes of measurement information and event information in a Nor flash storage unit. Among them, the measurement information refers to the power data such as voltage, current, demand, active power, and reactive power of the current node obtained by the measurement core of the electric energy meter. The event information refers to the fault states such as overvoltage, undervoltage, voltage loss, power failure, phase break, current loss, current break, overcurrent, power reverse, and voltage reverse phase sequence corresponding to the current node that can be detected by the electric energy meter, or event record data such as zero clearing event, closing event, tripping event, programming event, etc.

[0043] Specifically, the storage management method for the FTL-based intelligent IoT meter provided in this embodiment includes the following content:

[0044] The storage area of the Nor flash is divided into two parts: a data area and a linked list area. The storage units in the data area are used to store the data content of various types of information, and each storage unit corresponds to a physical address. The linked list area is used to store the address mapping table of each storage unit in the corresponding data area; the content of the linked list information in the address mapping table includes: logical address, number of erasure times, number of read times, and valid flag. Specifically as shown in the following table.

[0045] Table 1: Data format of the address mapping table in the linked list area

[0046]

[0047] Among them, in the technical solution provided in this embodiment, the valid flag in the linked list information is used to determine whether the storage unit in the corresponding data area is valid; when the logical address of the corresponding storage unit exists in the linked list area, the valid flag is updated to the "valid" state; when the logical address of the corresponding storage unit in the linked list area is deleted, the valid flag is updated to the "invalid" state. Based on the data content divided and recorded in the data area and the linked list area, the storage management method provided in this embodiment generally includes five parts: data writing, data erasure, data reading, data deletion, and data migration.

[0048] I. Data writing

[0049] In the FTL provided in this embodiment, the strategy for data write management is as Figure 1 shown, including the following processes:

[0050] Query the linked list area address mapping table to check if there is a free storage unit: if there is, select the free storage unit; otherwise, select a storage unit that can be erased for an erase operation to generate a new free storage unit; and use the selected free storage unit as the storage unit to be written.

[0051] When writing data, first determine the type of the data being written: (1) When the data being written is the start time of metering or event information, directly write the content of the relevant data in the storage unit to be written; at the same time, write the logical address in the linked list area and update the corresponding valid flag. (2) When the data being written is the end time of event information, read the start time and data of the corresponding event and cache them in the RAM; then store the event end time and data in the RAM; finally, write the event record data in the RAM to the original storage unit at one time, while writing the logical address in the linked list area and updating the corresponding valid flag.

[0052] In the technical solution provided in this embodiment, according to the characteristics of different data types collected and recorded by the electric energy meter, a data write mechanism is designed so that instantaneous metering data can be accurately recorded, and for... And the RAM cache is combined with the Nor flash storage unit, so that the time-consuming event information can be continuously written according to the event category, avoiding errors caused by recording different data in different storage units with a far physical address interval in the same event information.

[0053] II. Data Erasure

[0054] To effectively utilize the data storage unit, the storage management method provided in this embodiment will erase part of the area in the memory when necessary; to provide sufficient free storage units for storing new data.

[0055] Specifically, in the storage management method provided in this embodiment, the FTL manages the erase operation of the storage unit according to the valid flag and the erase count in the linked list area. The strategy for storage unit erase management is as Figure 2 shown, including the following content:

[0056] After the storage unit erase management instruction is triggered, first, query the linked list information to obtain all the storage units in the data area that are in a non-free state and have a valid flag of "invalid", use them as erasable storage units, and read the erase counts of all erasable storage units.

[0057] Then, the average number of erasure times of all erasable storage units is calculated, and the request time of the instruction that triggers the erase management instruction for the idle storage unit is obtained; the storage units in the non-idle state whose erase times are less than the average and meet the request time are taken as storage units to be erased.

[0058] Finally, all data in the storage unit to be erased in the data area are cleared; and the linked list information in the corresponding linked list area is updated, including: adding 1 to the erase count and resetting the read count to 0.

[0059] The state that triggers the storage unit erasure management instruction is: newly added metering information or event information to be written, and no storage unit in the data area is in an idle state; or a periodic instruction for erasure management of the memory is received.

[0060] This embodiment provides a data erasure strategy that makes scientific decisions based on the number of erasures and valid marks, which not only ensures the security of stored data and avoids data loss without reason, but also greatly improves the wear leveling, erasure frequency, and flexibility of the memory, thereby increasing the service life of the smart IoT meter.

[0061] 3. Data reading

[0062] Like conventional FTL, the storage management method provided in this embodiment has a management strategy for data read operations as follows: Figure 3 As shown, the process includes the following:

[0063] First, the logical address of the target data in the linked list area is obtained; then the storage unit corresponding to the data area is searched according to the logical address; then the data content in the storage unit is read, and the number of reads in the linked list information of the current storage unit in the linked list area is increased by 1.

[0064] 4. Data Deletion

[0065] In this embodiment, the management strategy of FTL for data deletion operation is as follows: Figure 4 As shown, the process includes the following:

[0066] After receiving any data deletion instruction, first query the logical address information stored in the linked list area; then search for the corresponding storage unit in the data area according to the logical address; then delete the data content stored in the corresponding storage unit; finally, delete the logical address corresponding to the storage unit in the linked list area, update the valid mark to "invalid", and reset the number of reads to 0.

[0067] In the solution of this embodiment, the sources of the data deletion instructions received by the receiver include: (1) The data deletion instructions generated by the data management center according to manual instructions and sent by the upper-level acquisition terminal of the Internet of Things electricity meter. (2) The data deletion instructions automatically generated locally by the intelligent IoT meter when any measurement information or event information reaches the preset maximum storage time limit. In this embodiment, a differentiated maximum storage time limit is specifically set for each stored information according to different data types and uses. When a piece of data reaches the maximum storage time limit, it means that the data no longer has any value for utilization and does not need to be stored continuously. At this time, even if no new data is generated and no idle storage unit needs to be allocated, the FTL can choose to actively delete this data.

[0068] V. Data Migration

[0069] In the technical solution provided in this embodiment, the number of erasure times in the linked list information is used to evaluate the remaining life of the storage unit. The more the parameter times of the storage unit, the lower the remaining life. The number of read times in the linked list information is used to judge the cold and hot degree of the data. The more the read times, the higher the current data heat. Furthermore, the data stored in the storage unit is regularly migrated and managed according to the life of the storage unit and the cold and hot degree of the data.

[0070] In the storage management method of this embodiment, the management strategy of the FTL for data migration operations includes various different methods. The control instructions for data migration are regularly triggered according to the preset management cycle. When the data migration instruction is triggered, the corresponding data migration operation is executed. The data migration methods provided in this embodiment include: (1) Data migration operation based on storage life. (2) Data migration operation based on data heat. (3) Enhanced data migration operation combining storage life and data heat.

[0071] Specifically, the data migration operation process based on storage life is as Figure 5 shown and includes the following steps:

[0072] First, retrieve the linked list information in the linked list area to obtain the number of erasure times of all storage units. Then, sort all the storage units in the data area according to the number of erasure times to obtain a remaining life queue. Next, sequentially judge whether the difference between the number of erasure times of the two storage units at the head and tail of the remaining life queue is greater than a preset life threshold. If so, exchange the data stored in the two storage units, update the corresponding linked list information in the linked list area, and remove the two storage units after data exchange from the remaining life queue. Finally, when the difference between the number of erasure times of the two storage units at the head and tail of the remaining life queue is less than or equal to the preset life threshold, end the current round of data migration operation.

[0073] The data migration operation process based on data heat is as Figure 6 shown and includes the following steps:

[0074] First, retrieve the linked list information in the linked list area to obtain the read counts of all storage units. Then, sort all the storage units in the data area according to the read counts to obtain a data heat queue. Next, sequentially determine whether the difference in the read counts of the two storage units at the head and tail of the data heat queue is greater than a preset heat threshold. If so, exchange the data stored in the two storage units, update the corresponding linked list information in the linked list area, and remove the two storage units after the data exchange from the data heat queue. Finally, when the difference in the read counts of the two storage units at the head and tail of the remaining life queue is less than or equal to the preset heat threshold, end the data migration operation for the current round.

[0075] Finally, the process of enhancing the data migration operation is as Figure 7 shown and includes the following steps.

[0076] (1) Retrieve the linked list information in the linked list area to obtain the read counts and erase-write counts of all storage units.

[0077] (2) Take several storage units with the largest read counts as quasi-migration storage units; take the storage units among the quasi-migration storage units whose erase-write counts exceed the preset risk value as migration storage units.

[0078] (3) Take several storage units with the smallest read counts as storage units to be migrated in; and form an alternative migration queue in ascending order of the erase-write counts.

[0079] (4) Determine whether the number of migration storage units is greater than the number of storage units in the alternative migration queue: If so, take several storage units with the second smallest read counts as storage units to be migrated in; and arrange them in ascending order of the erase-write counts at the end of the alternative migration queue; until the number of migration storage units is not greater than the number of storage units in the alternative migration queue.

[0080] (5) Exchange the data in the migration storage units with the data content stored in the storage units in the alternative migration queue, and update the corresponding linked list information in the linked list area.

[0081] It should be noted that in the same device, one of the three different data migration strategies can be selected as needed, or multiple different data migration strategies can be combined to improve the management effect of different types of data.

[0082] The special data migration strategy provided in this embodiment can scientifically allocate different types of data recorded in storage units, enabling key data with higher reading heat to be more concentratedly stored in storage units with low-frequency erasure, ensuring the security of key data, and laying a foundation for improving the data security and operation stability of intelligent IoT meters. There are three data migration methods in this embodiment. In the same device, corresponding triggering methods can be set according to specific migration frequencies as needed, and any one of the migration methods can be executed regularly to ensure the security of key data. At the same time, the three different data migration methods provided in this embodiment can be applied simultaneously in the same data migration cycle and can be implemented in one or more of various different combinations.

[0083] The technical solution provided in this embodiment scientifically manages all data processing processes (including data writing, data erasing, data reading, data deleting, and data migration) in the Nor flash memory of the electric energy meter according to the characteristics of the data recorded in the electric energy meter. It ensures the security of the stored data and the operation stability of the intelligent IoT meter. In other embodiments, the relevant management strategies for data writing, data erasing, data reading, data deleting, and data migration in this embodiment can be implemented as a whole or separately according to needs. For example, in some devices, the data writing method provided in this embodiment can be adopted, while traditional management methods are still used for other work contents. These all fall within the protection scope of this case. The storage management method provided in this case can be implemented in the form of software or a hardware device containing software, and the differences in different implementation methods should not limit the technology of the storage management method claimed in this case itself.

[0084] Embodiment 2

[0085] The present invention further includes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the storage management method of the FTL-based intelligent IoT meter as in Embodiment 1 are implemented.

[0086] It should be noted that: The essence of the storage management method provided in Embodiment 1 is a logic for managing the working mode of the Norflash of the electric energy meter, and it can be implemented in the form of underlying code integrated on the memory during application. For example, corresponding software or programs can be directly integrated into the FTL of the memory of the IoT meter.

[0087] The storage management method in Embodiment 1 can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in Embodiment 1 of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a single-chip microcomputer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Versatile Disc (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD), USB flash drive, memory card), etc.

[0088] In particular, the readable storage medium provided in this embodiment is a specific product solution for implementing the management method in Embodiment 1. That is, the storage management method of the intelligent IoT meter based on FTL provided in Embodiment 1 is integrated into a large number of existing IoT meters in the form of an external driver. The logic for implementing the storage management method in Embodiment 1 is written into corresponding program code, and then the corresponding program code is stored in the form of a readable medium. When the readable storage medium is installed on the IoT meter, the readable storage medium is equivalent to a driver, and the data storage and data reading / writing permissions of the IoT meter are controlled by the corresponding driver, and the process of the storage management method in Embodiment 1 is executed.

[0089] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data migration method for an intelligent IoT meter based on FTL, which is used to periodically migrate the metering information and event information stored in the Nor flash storage unit of the intelligent IoT meter, thereby improving the security of the key data stored in the intelligent IoT meter; characterized in that, The data migration method includes the following content: Divide the storage area of the Nor flash into two parts: a data area and a linked list area; the storage units in the data area are used to store the data content of various types of information, and each storage unit corresponds to a physical address; The linked list area is used to store the address mapping table of each storage unit in the corresponding data area; The content of the linked list information in the address mapping table includes: logical address, number of erasure times, number of read times, and valid flag; The FTL performs data migration operations on the data in the Nor flash storage unit regularly; the control instructions for the data migration are triggered regularly according to a preset management cycle. When the data migration instruction is triggered, an enhanced data migration operation that combines storage life and data heat is executed. The process of the enhanced data migration operation that combines storage life and data heat is as follows: (1) Retrieve the linked list information in the linked list area to obtain the number of read times and the number of erase-write times of all storage units; (2) Use several storage units with the largest number of read times as quasi-migration storage units; use the storage units in the quasi-migration storage units whose number of erase-write times exceeds the preset risk value as migration storage units; (3) Use several storage units with the smallest number of read times as storage units to be migrated into; and form an alternative migration queue in the order of increasing number of erase-write times; (4) Judge whether the number of the migration storage units is greater than the number of storage units in the alternative migration queue: if so, use several storage units with the second smallest number of read times as storage units to be migrated into; and arrange them in the order of increasing number of erase-write times at the end of the alternative migration queue; until the number of the migration storage units is not greater than the number of storage units in the alternative migration queue; (5) Exchange the data in the migration storage units with the data content stored in the storage units in the alternative migration queue, and update the corresponding linked list information in the linked list area.

2. The data migration method of the intelligent IoT meter based on FTL according to claim 1, characterized in that: The valid flag in the linked list information is used to judge whether the storage unit in the corresponding data area is valid; when the logical address of the corresponding storage unit exists in the linked list area, the valid flag is updated to the "valid" state; when the logical address of the corresponding storage unit in the linked list area is deleted, the valid flag is updated to the "invalid" state.

3. The data migration method of the FTL-based intelligent IoT meter according to claim 2, characterized in that: Use the number of erasure times in the linked list information to evaluate the remaining life of the storage unit. The more the number of parameter times of the storage unit, the lower the remaining life; use the number of read times in the linked list information to judge the cold and hot degree of the data. The more the number of read times, the higher the current data heat; and then regularly perform migration management on the data stored in the storage unit according to the life of the storage unit and the cold and hot degree of the data.

4. A storage management method for an intelligent IoT meter based on FTL, which is used to manage the reading, writing, and storage processes of metering information and event information in Nor flash storage units; characterized in that, The intelligent IoT table regularly performs data migration operations on the storage unit by using the data migration method of the intelligent IoT table based on FTL as described in claim 1.

5. A storage management method for an intelligent IoT meter based on FTL, which is used to manage the reading, writing, and storage processes of metering information and event information in Nor flash storage units; characterized in that, When the intelligent IoT table triggers a data migration instruction, it first performs a round of data migration operation and a second round of data migration operation on the storage unit; then uses the data migration method of the intelligent IoT table based on FTL as described in claim 1 to perform a third round of data migration operation on the storage unit; The method of the first round of data migration operation is as follows: Divide the storage area of the Nor flash into two parts: a data area and a linked list area; the storage units in the data area are used to store the data content of various types of information, and each storage unit corresponds to a physical address; The linked list area is used to store the address mapping table of each storage unit in the corresponding data area; The content of the linked list information in the address mapping table includes: logical address, number of erasures, number of reads, and valid flag; The FTL periodically performs data migration operations on the data in the Nor flash storage units; the control instructions for the data migration are triggered periodically according to a preset management cycle. When the data migration instruction is triggered, a round of data migration operations based on the storage life is executed; the process of the data migration operation based on the storage life is as follows: First, retrieve the linked list information in the linked list area to obtain the number of erasures of all storage units; then sort all the storage units in the data area according to the number of erasures to obtain a remaining life queue. Next, sequentially determine whether the difference in the number of erasures between the two storage units at the head and tail of the remaining life queue is greater than a preset life threshold. If so, exchange the data stored in the two storage units, update the corresponding linked list information in the linked list area, and remove the two storage units after the data exchange from the remaining life queue; finally, when the difference in the number of erasures between the two storage units at the head and tail of the remaining life queue is less than or equal to the preset life threshold, end the current round of data migration operations; The method of the second-round data migration operation is as follows: Divide the storage area of the Nor flash into two parts: a data area and a linked list area; the storage units in the data area are used to store the data content of various types of information, and each storage unit corresponds to a physical address; the linked list area is used to store the address mapping table of each storage unit in the corresponding data area; the content of the linked list information in the address mapping table includes: logical address, number of erasures, number of reads, and valid flag; The FTL periodically performs data migration operations on the data in the Nor flash storage units; the control instructions for the data migration are triggered periodically according to a preset management cycle. When the data migration instruction is triggered, a round of data migration operations based on the data heat is executed; the process of the data migration operation based on the data heat is as follows: First, retrieve the linked list information in the linked list area to obtain the number of reads of all storage units; then sort all the storage units in the data area according to the number of reads to obtain a data heat queue. Next, sequentially determine whether the difference in the number of reads between the two storage units at the head and tail of the data heat queue is greater than a preset heat threshold. If so, exchange the data stored in the two storage units, update the corresponding linked list information in the linked list area, and remove the two storage units after the data exchange from the data heat queue; finally, when the difference in the number of reads between the two storage units at the head and tail of the data heat queue is less than or equal to the preset heat threshold, end the current round of data migration operations.

6. A computer-readable storage medium, on which a computer program is stored, characterized in that: When the computer program is executed by the processor, it implements the steps of the data migration method of the intelligent IoT table based on FTL as described in claim 1.

Citation Information

Patent Citations

  • Solid state disk wear balancing method and device

    CN111414138A