A method, system, and device for storing and managing smart meter data

By dividing the storage units of EEPROM in the smart meter and managing the number of erasing times, the problem of the EEPROM storage area in the smart meter being damaged due to excessive read and write frequency is solved, extending the service life of the EEPROM and improving the stability and service life of the smart meter.

CN114253871BActive Publication Date: 2025-06-24JIANGSU TONGCHI POWER AUTOMATION
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111565441.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-06-24
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

The existing data storage methods of smart meters have not been scientifically managed, resulting in some storage areas in EEPROM being damaged due to excessive read and write frequency, affecting the service life of smart meters.

Method used

By dividing the EEPROM into multiple storage units and assigning management codes to each storage unit, the management code includes area number, partition number, number of erases, and available marks. The storage unit with the least number of erases and available times are selected for data writing according to the data type, and update the number of erases and available marks in the management encoding at each write.

Benefits of technology

Effectively manage the storage area of ​​EEPROM, avoid early damage to some areas due to excessive read and write frequency, extend the service life of the EEPROM, and thus improve the operating stability and service life of the smart meter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114253871B_ABST
    Figure CN114253871B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of power equipment, and particularly relates to a method, a system, and a device for storing and managing intelligent meter data. The method includes the following steps: S1: Divide the EEPROM of the intelligent meter into several storage units; and assign a management code to each storage unit. S2: Obtain the data writing instruction of the intelligent meter and determine the data type of the data required to be written in the data writing instruction. S3: The filter obtains the information of the management codes of each storage unit, and then filters out the target storage unit. S4: Write the data included in the data writing instruction into the target storage unit determined in the previous step. S5: Each time data is written, increment the number of erase / write cycles in the management code corresponding to the target storage unit where the data is written by 1, and then update the available flag. The present invention solves the problem that the existing method for storing and managing intelligent meter data is unscientific, resulting in excessive read / write frequencies in some storage areas of the EEPROM and premature scrapping of the intelligent meter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of power equipment, and particularly relates to a method, a system, and a device for storing and managing smart meter data. Background Art

[0002] A smart meter is a metering terminal for customer electricity consumption and an important integral part of the data acquisition link of a smart grid. The existing internal storage hardware of smart meters usually adopts a combination of RAM (Random Access Memory) and EEPROM (Electrically Erasable Programmable Read Only Memory). In the storage unit, the former is a high-speed memory whose data will be lost after power-off, and the latter is a non-volatile memory that can still store data normally after power-off. The former has a larger number of read / write times, while the latter has a relatively smaller number of read / write times.

[0003] During the use of a smart meter, the electricity consumption of the target user is counted by detecting the number of triggered pulses. Then, the measured electricity value is stored in the EEPROM of the smart meter to save the electricity consumption data of the user. During the actual operation of the electricity meter, the data stored in the EEPROM is diverse, including electricity consumption information, cost information, etc. The electricity data of the user alone includes total electricity, peak electricity, valley electricity, etc.

[0004] Traditional data storage methods do not optimize the storage location of data in the EEPROM for different data types. Although the theoretical erasable / writable times of the EEPROM can reach 100,000 times, when the read / write frequency of some local areas on the EEPROM is higher than that of other areas, it is easy to cause some areas in the EEPROM to reach the theoretical read / write times limit in advance. When some storage areas in the smart meter reach the erasure / write limit and are damaged, it may affect the normal operation of the smart meter, thereby affecting the service life of the smart meter. Summary of the Invention

[0005] In order to solve the problem that the data storage process of the existing smart meter is not scientifically managed, resulting in damage to some storage areas in the EEPROM due to excessive read / write frequency, leading to premature scrapping of the smart meter, the present invention provides a method, a system, and a device for storing and managing smart meter data.

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

[0007] A method for storing and managing smart meter data, the method comprising the following steps:

[0008] S1: Divide the EEPROM of the smart meter into several storage units; and assign a management code to each storage unit. The information contained in the management code includes area number, partition number, write-erase times, and availability flag. Among them, the area number represents different storage areas of the EEPROM, and each storage area corresponds to a specific data type. The partition number is the physical partition of the EEPROM within each storage area, and the positions of each storage unit in the EEPROM are located according to the area number and the partition number. The write-erase times represent the data write-erase times of the corresponding storage unit; the availability flag represents whether the corresponding storage unit can continue to perform data writing, and the availability flag is divided into available or unavailable.

[0009] S2: Obtain the data writing instruction of the smart meter, and determine the data type of the data required to be written in the data writing instruction.

[0010] S3: Run a program of a filter in the RAM of the smart meter. The filter is used to obtain the information of the management code of each storage unit, then select the storage area corresponding to the data type of the written data, and screen out the storage unit with the least write-erase times and available as the target storage unit.

[0011] S4: Write the data contained in the data writing instruction into the target storage unit determined in the above step.

[0012] S5: Run a program of a coding manager in the RAM of the smart meter. The coding manager is used to add 1 to the write-erase times in the management code corresponding to the target storage unit of the written data each time data is written, and then determine whether the write-erase times reach the upper limit value. If so, set the availability flag in the management code to unavailable.

[0013] As a further improvement of the present invention, the screening process of the filter in step S3 is as follows:

[0014] S31: Obtain the management codes of all storage units in the storage area matching the data type of the currently written data.

[0015] S32: Obtain the values of the availability flags in each management code, and retain all management codes with the availability flag value in the available state.

[0016] S33: Sort all the management codes in the above step according to the value of the write-erase times, and retain all management codes with smaller write-erase times.

[0017] S34: Sort all the management codes in the above step according to the partition number to obtain a storage priority queue, and use the storage unit corresponding to the first management code in the storage priority queue as the target storage unit for the data to be written.

[0018] The principle of selecting storage units in the present invention is as follows: First, select the storage units in the storage area corresponding to the data type to be written this time, then select all the storage units in the available state among them, then select the storage unit with the best historical erase / write times from the available storage units, and finally select the remaining storage units in sequence.

[0019] In fact, according to the same screening method, not only can the target storage unit in each data storage process be determined, but also a target storage unit queue for each different type of data can be established, and the storage units in the target storage queue are sorted according to priority. Then, each storage unit in the queue is sequentially used for data storage in the subsequent storage process. By this method, the workload of the filter can be reduced, and thus the operating power consumption and service life of the smart meter device can be reduced.

[0020] In the present invention, in the initial state, the erase / write times in the management codes of each storage unit are all 0, the available flag is available, and the upper limit value of the erase / write times is a preset value; the upper limit value is less than the theoretical maximum erase / write times of the EEPROM.

[0021] The preset upper limit value of the erase / write times in the present invention is not the device erase / write upper limit of the EEPROM, but a preset value for the convenience of management in the present invention. When the erase / write times of all storage units reach this preset value, the management codes of all storage units can be re-initialized to prevent the management codes from being too bloated and the amount of data that the filter or the code manager needs to process from being too large and causing errors.

[0022] As a further improvement of the present invention, when the available flags of all storage units in all physical partitions corresponding to a certain area number are all unavailable; the code manager resets all the erase / write times in the management codes corresponding to the storage units in all physical partitions corresponding to the area code to zero, and at the same time resets all the available flags in the management codes to available.

[0023] As a further improvement of the present invention, in the EEPROM, the capacity sizes of different storage areas are determined according to the write frequencies and data amounts of different data types corresponding to the same storage area in the same period; the higher the write frequency of a certain type of data in the same period and the larger the amount of data written each time, the larger the capacity of the corresponding storage area.

[0024] As a further improvement of the present invention, the smart meter further includes a firmware storage area, and the program codes of the filter and the code manager are stored in the firmware storage area. When the electric energy meter runs for the first time, the program codes in the firmware storage area are written into the RAM for execution.

[0025] As a further improvement of the present invention, the smart meter further includes a coding storage unit, which is used to store the management codes after the update of all storage units in the EEPROM. The filter obtains the data in the coding storage unit for filtering before data writing. The coding manager updates the management codes in the coding storage unit after data writing.

[0026] The present invention also includes a storage management system for smart meter data. This storage management system writes the data generated during the operation of the smart meter into the EEPROM by using the storage management method of smart meter data as described above. The storage management system includes: a coding storage module, an instruction acquisition module, a filtering module, a data reading and writing module, and a coding management module.

[0027] The coding storage module stores the management codes corresponding to all storage units in the EEPROM. The information included in the management code of each storage unit includes an area number, a partition number, the number of erasure times, and an available flag. The area number represents different storage areas of the EEPROM, and each storage area corresponds to a specific data type. The partition number is the physical partition of the EEPROM in each storage area, and the positions of each storage unit in the EEPROM are located according to the area number and the partition number. The number of erasure times represents the number of data erasure times of the corresponding storage unit. The available flag represents whether the corresponding storage unit can continue to perform data writing, and the state of the available flag is divided into available or unavailable.

[0028] The instruction acquisition module is used to acquire the data storage instruction generated during the operation of the electric energy meter and parse the data to be stored and its corresponding data type included in the instruction.

[0029] The filtering module is used to obtain the management codes of all storage units in the corresponding storage area in the coding storage module according to the data type to be stored. Then, it selects the management code with the least number of erasure times and available, and uses the storage unit corresponding to this management code as the target storage unit for the data included in the data storage instruction.

[0030] The data reading and writing module is used to store the data to be stored included in the data storage instruction into the target storage unit screened by the filtering module.

[0031] The coding management module is used to, after each data writing is completed by the data reading and writing module, find the management code of the corresponding storage unit from the coding storage module, and increment the number of erasure times in the management code by 1; at the same time, it judges whether the number of erasure times reaches a preset upper limit value. If so, it sets the available flag in the management code to unavailable.

[0032] As a further improvement of the present invention, the encoding management module further includes an encoding reset sub-module, which is used to reset the number of erasure times in the management encoding corresponding to all storage units in a certain storage area to 0 when the available flags corresponding to all storage units in the area are set to unavailable, and at the same time reset the available flags to the available state.

[0033] The present invention also includes a storage management device for smart meter data, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps of the storage management method for smart meter data as described above.

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

[0035] The storage management method and system for smart electric energy meter data provided by the present invention can manage the storage areas of different data according to the data types generated during the operation of the smart meter, and store the data into different storage units by using the uniform storage method, so as to ensure that the erasure times of different storage areas in the EEPROM are consistent. Through this data storage management method, the service life of the EEPROM in the smart telegraph can be effectively improved, thereby improving the operation stability and service life of the smart meter. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flowchart of the steps of a storage management method for smart meter data in Embodiment 1 of the present invention.

[0037] Figure 2 It is a flowchart of the screening process of the filter in Embodiment 1 of the present invention.

[0038] Figure 3 It is a schematic diagram of the storage area distribution in the RAM and EEPROM in Embodiment 1 of the present invention.

[0039] Figure 4 It is a module schematic diagram of a storage management system for smart meter data provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[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] The storage management method provided in this embodiment optimizes the data storage process mainly through the following two aspects: First, classify the data that needs to be read and written during the entire operation cycle of the smart meter, and divide the data into high-density data and low-density data according to the data read-write frequency and data volume. High-density data refers to the data type with high read-write frequency and large data volume, and low-density data refers to the data type with relatively low read-write frequency and small data volume. And allocate different storage areas for data with different read-write frequencies. Second, optimize the data storage strategy for each storage area. Further divide the storage area into storage units, and when there is a data writing requirement, write the data into different storage units according to the principle of average read-write. Ensure that the erase-write frequency of each storage unit is roughly the same.

[0043] Specifically, as Figure 1 shown, a storage management method for smart meter data provided in this embodiment includes the following steps:

[0044] S1: Divide the EEPROM of the smart meter into several storage units; and assign a management code to each storage unit. The information included in the management code includes area number, partition number, erase-write times, and available flag. Among them, the area number represents different storage areas of the EEPROM, and each storage area corresponds to a specific data type. The partition number is the physical partition of the EEPROM in each storage area, and the position of each storage unit in the EEPROM can be located according to the area number and partition number. The erase-write times represent the data erase-write times of the corresponding storage unit; the available flag represents whether the corresponding storage unit can continue to perform data writing, and the flag can be divided into available or unavailable.

[0045] Among them, the form of the management code is shown in Table 1:

[0046] Table 1: Data form of the management code

[0047] Lx Nx M T / F

[0048] In the above table, Lx is the area number of the management code, which is used to distinguish the storage areas in the EEPROM that store different types of data.

[0049] Nx is the partition number, which is used to distinguish the physical partitions of the EEPROM in each storage area, and a specific storage unit in the EEPROM can be specifically located through this flag.

[0050] M is the data erase-write times corresponding to each storage unit.

[0051] T / F is the available flag for each storage unit; T indicates that the storage unit has not reached the maximum number of erase / write cycles and data can be erased and written; F indicates that the storage unit has reached the maximum number of erase / write cycles and data cannot be erased and written.

[0052] In the initial state, the number of erase / write cycles in the management code of each storage unit is 0, the available flag is T, and the upper limit value Mn of the number of erase / write cycles is a preset value; the upper limit value is less than the theoretical maximum number of erase / write cycles of the EEPROM.

[0053] S2: Obtain the data writing instruction of the smart meter and determine the data type of the data required to be written in the data writing instruction.

[0054] In this embodiment, the storage areas corresponding to different types of data in the EEPROM are set before the smart meter runs. Among them, the capacity of different storage areas is determined according to the writing frequency and data volume of the different data types corresponding to the storage areas in the same cycle; the higher the writing frequency of a certain type of data in the same cycle and the larger the data volume written each time, the larger the capacity of the corresponding storage area. This can ensure that the number of erase / write cycles of the storage units in each storage area is roughly uniform throughout the operation cycle of the smart meter.

[0055] S3: Run a program of a filter in the RAM of the smart meter. The filter is used to obtain the information of the management code of each storage unit, then select the storage area corresponding to the data type of the data to be written, and screen out the storage unit with the least number of erase / write cycles and available as the target storage unit.

[0056] As Figure 2 shown, the screening process of the filter in step S3 is as follows:

[0057] S31: Obtain the management codes of all storage units in the storage area matching the data type of the currently written data.

[0058] S32: Obtain the values of the available flags in each management code, and retain all management codes with the available flag value in the available state.

[0059] S33: Sort all the management codes in the previous step according to the value of the number of erase / write cycles, and retain all management codes with a smaller number of erase / write cycles.

[0060] S34: Sort all the management codes in the previous step according to the partition number to obtain a storage priority queue, and use the storage unit corresponding to the first management code in the storage priority queue as the target storage unit for the data to be written.

[0061] In this embodiment, the principle of selecting storage units is as follows: First, select the storage units in the storage area corresponding to the data type to be written this time. Then, select all the storage units in the available state among them. Next, select the storage unit with the best historical erase / write times from the available storage units. Finally, select the remaining storage units in sequence one by one.

[0062] In fact, according to the same screening method, not only can the target storage unit in each data storage process be determined, but also a target storage unit queue for each different type of data can be established. The storage units in the target storage queue are sorted according to the priority. Then, each storage unit in the queue is used in turn for data storage in the subsequent storage process. By this method, the workload of the filter can be reduced, and thus the operating power consumption and service life of the smart meter device can be reduced.

[0063] S4: Write the data included in the data write instruction into the target storage unit determined in the previous step.

[0064] S5: Run a program of a coding manager in the RAM of the smart meter. The coding manager is used to add 1 to the erase / write times in the management code corresponding to the target storage unit of the written data each time data is written, and then determine whether the erase / write times reach the upper limit value. If so, set the available flag in the management code to unavailable.

[0065] For example, when the upper limit of the erase / write times of each storage unit is set to 100 times, for the storage unit with the area number 3 and the partition number 105, its management code when it is erased / written for the 99th time is as shown in Table 2 below:

[0066] Table 2: Management code of a certain storage unit before update

[0067] L3 N105 99 T

[0068] After the storage unit continues to complete one data storage, the coding manager will update its management code, and the updated management code is shown in Table 3:

[0069] Table 2: Management code of a certain storage unit after update

[0070] L3 N105 100(Mn) F

[0071] Through the update of the management code, the available flag of this storage unit has now changed to unavailable, that is, when the next data is waiting to be written, the filter will not use this storage unit as the target storage unit.

[0072] In this embodiment, the upper limit value of the preset number of erasure and rewrite cycles is not the device erasure upper limit of the EEPROM, but a preset value for the convenience of management in this embodiment. When the number of erasure and rewrite cycles of all storage units reaches this preset value, the management codes of all storage units can be re-initialized to prevent the management codes from becoming too bloated and the amount of data that the filter or the code manager needs to process from being too large and causing errors.

[0073] When the available flags of all storage units in all physical partitions corresponding to a certain area number are all unavailable; the code manager resets to zero all the erasure and rewrite cycles in the management codes corresponding to all storage units in all physical partitions within the corresponding area code, and at the same time resets all the available flags in the management codes to available.

[0074] In addition, as Figure 3 shown, the smart meter in this embodiment further includes a firmware storage area, and the program codes of the filter and the code manager are stored in the firmware storage area. When the electricity meter runs for the first time, the program codes in the firmware storage area are written into the RAM for execution.

[0075] The smart meter further includes a code storage unit, which is used to store the updated management codes of all storage units in the EEPROM. The filter obtains the data in the code storage unit for screening before data writing. The code manager updates the management codes in the code storage unit after data writing.

[0076] Embodiment 2

[0077] This embodiment provides a storage management system for smart meter data. The storage management system writes the data generated during the operation of the smart meter into the EEPROM by using the storage management method of the smart meter data in Embodiment 1. As Figure 4 shown, the storage management system includes: a code storage module, an instruction acquisition module, a screening module, a data reading and writing module, and a code management module.

[0078] The code storage module stores the management codes corresponding to all storage units in the EEPROM. The information included in the management code of each storage unit includes an area number, a partition number, an erasure and rewrite cycle count, and an available flag. The area number represents different storage areas of the EEPROM, and each storage area corresponds to a specific data type. The partition number is the physical partition of the EEPROM within each storage area, and the positions of each storage unit in the EEPROM are located according to the area number and the partition number. The erasure and rewrite cycle count represents the number of data erasures and rewrites of the corresponding storage unit. The available flag represents whether the corresponding storage unit can continue to perform data writing, and the status of the available flag is divided into available or unavailable.

[0079] The instruction acquisition module is used to acquire the data storage instructions generated during the operation of the electricity meter, and parse out the data to be stored and its corresponding data type included in the instructions.

[0080] The screening module is used to obtain the management codes of all storage units in the corresponding storage area in the encoding storage module according to the data type to be stored. Then, select the management code with the least number of erasure times and available, and use the storage unit corresponding to the management code as the target storage unit for the data included in the data storage instruction.

[0081] The data reading and writing module is used to store the data to be stored included in the data storage instruction into the target storage unit screened by the screening module.

[0082] The encoding management module is used to, after the data writing is completed by the data reading and writing module each time, find the management code of the corresponding storage unit from the encoding storage module, and increment the erasure times in the management code by 1; at the same time, determine whether the erasure times reach the preset upper limit value, and if so, set the available flag in the management code to unavailable.

[0083] As a further improvement of the present invention, the encoding management module further includes an encoding reset sub-module, which is used to reset the erasure times of the management codes of all storage units in the area to 0 and reset the available flag to the available state when the available flags corresponding to all storage units in a certain storage area are set to unavailable.

[0084] Embodiment 3

[0085] The present invention further includes a storage management device for smart meter data, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps of the aforementioned smart meter data storage management method.

[0086] The computer device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers) that can execute programs. The computer device in this embodiment at least includes, but is not limited to, a memory and a processor that can communicate with each other through a system bus.

[0087] In this embodiment, the memory (i.e., the readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of the computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of the computer device, such as the plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the computer device. Of course, the memory may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the memory is generally used to store the operating system installed on the computer device and various application software, etc. In addition, the memory may also be used to temporarily store various data that have been output or will be output.

[0088] In some embodiments, the processor may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor is generally used to control the overall operation of the computer device. In this embodiment, the processor is used to run the program code stored in the memory or process data to implement the processing process of the intelligent meter data storage management method in Embodiment 1, so as to keep the number of erasing and writing times of each area of the EEPROM in the intelligent meter consistent and improve the service life of the intelligent meter.

[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 method for storing and managing smart meter data, characterized in that, It includes the following steps: S1: Divide the EEPROM of the smart meter into several storage units; and assign a management code to each storage unit; the information contained in the management code includes area number, partition number, number of erasure and write cycles, and available flag; The area number represents different storage areas of the EEPROM, and each storage area corresponds to a specific data type; the partition number is the physical partition of the EEPROM within each storage area, and the positions of each storage unit in the EEPROM are located according to the area number and the partition number; the number of erasure and write cycles represents the number of data erasure and write cycles of the corresponding storage unit; the available flag represents whether the corresponding storage unit can continue to perform data writing, and the status of the flag can be divided into available or unavailable; In the EEPROM, the capacity of different storage areas is determined according to the writing frequency and data volume of different data types corresponding to the storage areas in the same cycle; the higher the writing frequency of a certain type of data in the same cycle and the larger the amount of data written each time, the larger the capacity of the corresponding storage area; S2: Obtain the data writing instruction of the smart meter and determine the data type of the data required to be written in the data writing instruction; S3: Run a program of a filter in the RAM of the smart meter. The filter is used to obtain the information of the management code of each storage unit, then select the storage area corresponding to the data type of the written data, and screen out the storage unit with the least number of erasure and write cycles and available as the target storage unit; S4: Write the data contained in the data writing instruction into the target storage unit determined in the previous step; S5: Run a program of a code manager in the RAM of the smart meter. The code manager is used to add 1 to the number of erasure and write cycles in the management code corresponding to the target storage unit of the written data each time data is written, and then determine whether the number of erasure and write cycles reaches the upper limit value. If so, set the available flag in the management code to unavailable; When the available flags of all storage units in all physical partitions corresponding to a certain area number are all unavailable; the code manager resets all the numbers of erasure and write cycles in the management codes corresponding to all storage units in all physical partitions corresponding to the area code to zero, and at the same time reset all the available flags in the management codes to available.

2. The storage management method for smart meter data according to claim 1, characterized in that: The screening process of the filter in step S3 is as follows: S31: Obtain the management codes of all storage units in the storage area matching the data type of the currently written data; S32: Obtain the values of the available flags in each management code, and retain all management codes with the available flag value in the available state; S33: Sort all the management codes in the previous step according to the value of the number of erasure and write cycles, and retain all management codes with a smaller number of erasure and write cycles; S34: Sort all the management codes in the previous step according to the partition number to obtain a storage priority queue, and use the storage unit corresponding to the first management code in the storage priority queue as the target storage unit for the data to be written.

3. The storage management method for smart meter data according to claim 2, characterized in that: In the initial state, the number of erasure and write cycles in the management code of each storage unit is 0, the available flag is available, and the upper limit value of the number of erasure and write cycles is a preset value, and the upper limit value is less than the theoretical maximum number of erasure and write cycles of the EEPROM.

4. The storage management method for smart meter data according to claim 1, wherein: The smart meter further includes a firmware storage area, and the program codes of the filter and the encoding manager are stored in the firmware storage area; when the electricity meter runs for the first time, the program codes in the firmware storage area are written into the RAM for execution.

5. The storage management method for smart meter data according to claim 1, characterized in that: The smart meter further includes an encoding storage unit, and the encoding storage unit is used to store the updated management codes of all storage units in the EEPROM; the filter obtains the data in the encoding storage unit for filtering before data writing; the encoding manager updates the management codes in the encoding storage unit after data writing.

6. An intelligent electric meter data storage and management system, characterized in that: The storage management system adopts the storage management method for smart meter data as described in any one of claims 1-5, and writes the data generated during the operation of the smart meter into the EEPROM; The storage management system includes: An encoding storage module, which stores the management codes corresponding to all storage units in the EEPROM. The information included in the management code of each storage unit includes an area number, a partition number, the number of erasure and write cycles, and an available flag; the area number represents different storage areas of the EEPROM, and each storage area corresponds to a specific data type; the partition number is the physical partition of the EEPROM in each storage area, and the positions of each storage unit in the EEPROM are located according to the area number and the partition number; the number of erasure and write cycles represents the number of data erasure and write cycles of the corresponding storage unit; the available flag represents whether the corresponding storage unit can continue to perform data writing, and the status of the available flag is divided into available or unavailable; An instruction acquisition module, which is used to acquire the data storage instruction generated during the operation of the electricity meter, and parse out the data to be stored and its corresponding data type included in the instruction; A screening module, which is used to obtain the management codes of all storage units in the corresponding storage area in the encoding storage module according to the data type to be stored; then select the management code with the least number of erasure and write cycles and available, and use the storage unit corresponding to the management code as the target storage unit for the data included in the data storage instruction; A data reading and writing module, which is used to store the data to be stored included in the data storage instruction into the target storage unit screened by the screening module; and An encoding management module, which is used to, after each data writing is completed by the data reading and writing module, find the management code of the corresponding storage unit from the encoding storage module, and add 1 to the number of erasure and write cycles in the management code; at the same time, judge whether the number of erasure and write cycles reaches the preset upper limit value, and if so, set the available flag in the management code to unavailable.

7. The storage management system for smart meter data according to claim 6, wherein: The encoding management module further includes an encoding reset sub-module, which is used to reset the number of erasure times in the management encodings corresponding to all storage units in a certain storage area to 0 when the available flags corresponding to all storage units in a certain storage area are set to unavailable, and at the same time reset the available flags to the available state.

8. A storage management device for smart meter data, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the steps of the method for storing and managing smart meter data described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Storage block abnormal wear processing method and device, electronic equipment and storage medium

    CN112162934A