Electric energy meter and hanging household meter data storage method of electricity consumption information acquisition terminal

By dividing storage blocks on the power meter and electricity consumption information acquisition terminal and using storage link variables to manage the storage space of the acquisition solution, the problem that devices without file management functions cannot effectively store data from multiple acquisition solutions is solved, and the rapid storage and query of data is achieved, and the efficiency of utilization of storage space is improved.

CN119576243APending Publication Date: 2025-03-07YANTAI DONGFANG WISDOM ELECTRIC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411853787.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Without the file management function, the power meter and electricity consumption information acquisition terminal cannot effectively store the household meter data of multiple different collection plans, and it is difficult to support data query.

Method used

By dividing the available storage space of the device into N storage blocks, and setting a plurality of storage link variables that correspond to each acquisition scheme one by one in the storage area, using these variables to record and link acquisition schemes to quickly store and index data.

Benefits of technology

In the condition that the system does not have file management functions, effective storage and query of data of various collection schemes is realized. When the collection scheme changes, storage blocks can be flexibly allocated as needed, and storage space can be used more effectively.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses a data storage method for an electric energy meter and a hanging household meter of an electricity utilization information acquisition terminal. The method comprises the following steps: firstly, dividing an available storage space of equipment into N storage blocks, then setting a plurality of storage link variables in one-to-one correspondence with acquisition schemes in a storage area outside the available storage space, recording whether the corresponding storage blocks are allocated to the acquisition schemes or not, the storage link variables including N bits in one-to-one correspondence with the storage blocks. And according to the storage link variables of all the started acquisition schemes, determining the storage blocks which are not allocated for allocation, wherein the storage blocks allocated by the same acquisition scheme are regarded as a continuous storage space to be operated by the system. According to the method, a basis is laid for rapid storage and indexing of data by storing the storage blocks occupied by the link variable records and the link acquisition scheme, so that storage and query of the user meter data are realized under the condition that the system does not have a file management function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power information acquisition technology, specifically relating to a data storage method for an electricity meter and an electricity consumption information acquisition terminal. Background Technology

[0002] Electricity meters and electricity consumption information collection terminals are end-point devices of the power grid. In order to better enable real-time monitoring and facilitate timely response of the power grid according to load needs, it is necessary to add the function of storing data from downstream user meters to electricity meters and electricity consumption information collection terminals.

[0003] However, electricity meters and electricity consumption information collection terminals mostly adopt cost-effective bare-metal microcontroller solutions. These products lack an operating system and cannot implement file-based storage. Furthermore, electricity meters and electricity consumption information collection terminals employ various data collection schemes, requiring the storage of data from multiple schemes simultaneously. Users also change the selected scheme based on actual needs, making it difficult to predict data volume and space usage in advance, thus preventing the use of fixed partitions for storage. Therefore, how to effectively store data from multiple different schemes and support future data retrieval without file management functionality is a pressing issue that needs to be addressed. Summary of the Invention

[0004] This invention proposes a method for storing user meter data connected to an electricity meter and an electricity consumption information collection terminal. Its purpose is to solve the problem of not being able to effectively store user meter data from various collection schemes when there is no file management function.

[0005] The technical solution of this invention is as follows: A method for storing data of user meters connected to an electricity meter and an electricity consumption information collection terminal, wherein the available storage space of the device is divided into N storage blocks; Multiple storage link variables are set in the storage area outside the available storage space, each corresponding to a different acquisition scheme. Each storage link variable contains N bits that correspond to a different storage block. For any bit, if the storage block corresponding to the bit is allocated to the acquisition scheme corresponding to the storage link variable, the bit is 1; otherwise, the bit is 0. When a certain acquisition scheme is selected to be enabled, the unallocated storage blocks are determined based on the storage link variables of all enabled acquisition schemes. At the same time, the space size required by the acquisition scheme is calculated based on the configuration of the acquisition scheme. Then, a storage block matching the space size is allocated from the unallocated storage blocks and assigned to the acquisition scheme. The storage blocks allocated by the same acquisition scheme are treated as a contiguous storage space and operated by the system.

[0006] As a further improvement to the data storage method of the downstream meter of the electricity meter and the electricity information collection terminal, the method for determining the unallocated storage blocks is as follows: perform a bitwise OR operation on the storage link variables corresponding to all enabled collection schemes, and the storage block corresponding to the bits that are 0 in the N bits of the operation result is the unallocated storage block.

[0007] As a further improvement to the data storage method of the downstream household meters of the aforementioned electricity meter and electricity consumption information collection terminal, the calculation method for the space required by the collection scheme is as follows: Suppose the number of household meters to be collected by the collection scheme is Num, the storage depth is Depth, and M types of data need to be stored. Let the data storage length of the m-th type be denoted as CSD_m. Then the required space size is Size=Depth*Num*(CSD_1+CSD_2+...+CSD_M).

[0008] As a further improvement to the data storage method of the downstream household meters of the aforementioned electricity meter and electricity consumption information collection terminal: if a certain collection scheme is compatible with multiple types of household meters, then when setting the storage length of a certain type of data, the maximum value of the data storage length used by all types of household meters for that type of data is used as the storage length when calculating the space size.

[0009] As a further improvement to the data storage method of the downstream household meters of the aforementioned electricity meter and electricity consumption information collection terminal: all types of data of all household meters at the same freezing time under a collection scheme are regarded as one piece of frozen data; When storing data, the same frozen data must be stored in the same storage block and cannot be stored across blocks.

[0010] As a further improvement to the data storage method of the downstream meter of the electricity meter and the electricity consumption information collection terminal: a storage block contains multiple sectors; When writing a new piece of frozen data, the next sector of the sector being operated on is cleared first. Then, it is determined whether the remaining space in the current sector meets the space requirements of a piece of frozen data. If it does, the current sector is written. If not, the next sector is written. This ensures that data frozen at the same time is located in the same sector. In other words, frozen data is not allowed to be stored across sectors.

[0011] As a further improvement to the data storage method of the downstream meter of the electricity meter and the electricity information collection terminal: when querying, the location of the frozen data to be queried is calculated by taking the first frozen data as the starting point and writing new frozen data according to the logic, and then the data is read.

[0012] Compared with the prior art, the present invention has the following advantages: 1. This method stores the storage blocks occupied by the linked variable record and the linked acquisition scheme, and treats the occupied storage blocks as a contiguous storage space, laying the foundation for fast data storage and indexing, thereby realizing the storage and querying of user table data even when the system does not have file management functions.

[0013] 2. When the acquisition scheme changes (such as canceling or enabling certain acquisition schemes), the system can flexibly allocate the remaining storage blocks on demand to achieve continuous storage in the case of physical address jumps, thereby making more efficient use of storage space. Detailed Implementation

[0014] The technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0015] This embodiment uses a GQ256C FLASH meter (hereinafter referred to as the device) with a storage space of 32M. Of the 32M storage space, 8M is used for the device's own data storage, and 24M is used to store the collected household meter data.

[0016] The device can be configured with a maximum of 12 data acquisition schemes. Each scheme requires configuration of the range of meters to be acquired, the data types to be acquired for each meter, and the storage depth (i.e., the maximum number of freeze periods of data to be acquired). A single acquisition scheme can acquire only one type of data or multiple types. For example, acquisition scheme 1 can acquire voltage and current data from all meters, while scheme 2 can acquire energy data from some meters. Users (maintenance personnel) can choose the acquisition scheme as needed. Furthermore, different data types require different storage lengths. Clearly, different acquisition schemes will acquire different amounts of data per freeze period, resulting in different storage space requirements. Changes in the acquisition scheme will also lead to corresponding changes in storage space requirements.

[0017] This embodiment uses the following method for storing data from the electricity meter and the user meter connected to the electricity consumption information collection terminal: First, divide the device's available storage space into N storage blocks.

[0018] In this embodiment, the available storage space is 24M, and the size of a storage block can be set to 0.5M, resulting in a total of 48 storage blocks.

[0019] Then, multiple storage link variables, each corresponding to a different acquisition scheme, are set in a storage area outside the available storage space (such as in EEPROM or the CPU's internal ROM). Each storage link variable contains N bits, each corresponding to a different storage block. For any given bit, if the storage block corresponding to that bit is allocated to the acquisition scheme corresponding to that storage link variable, then that bit is 1; otherwise, it is 0.

[0020] When a specific acquisition scheme is selected, the system determines the unallocated storage blocks based on the storage link variables of all enabled acquisition schemes. Simultaneously, it calculates the required space size for that acquisition scheme based on its configuration. Then, it allocates storage blocks matching this required space size from the unallocated storage blocks to the acquisition scheme. Storage blocks allocated to the same acquisition scheme are treated as a contiguous storage space and operated on by the system.

[0021] Specifically, the method for determining unallocated storage blocks is as follows: perform a bitwise OR operation on the storage link variables corresponding to all enabled acquisition schemes, and the storage blocks corresponding to the bits that are 0 among the N bits of the operation result are the unallocated storage blocks.

[0022] Specifically, the space required by the data collection scheme is calculated as follows: Suppose the number of user tables to be collected by the data collection scheme is Num, the storage depth is Depth, and M types of data need to be stored. Let the data storage length of the m-th type be CSD_m. Then the required space is Size = Depth * Num * (CSD_1 + CSD_2 + ... + CSD_M).

[0023] Furthermore, if a data acquisition scheme is compatible with multiple user tables of different specifications, then when setting the storage length for a certain type of data, the maximum storage length used by all user tables of that type will be used as the storage length when calculating the computational space size. This means that even if some user tables have shorter data items, the storage space will still be allocated based on the length of the longest data item to ensure compatibility. For example, if the acquisition scheme supports both tables 645 and 698, and the data length of a certain type in table 698 is greater than that in table 645, then the length of table 698 should be used as the storage length for calculation, and the offset should also be based on this length during storage and retrieval.

[0024] All data types from all user tables at the same freeze time under a data collection scheme are considered as one frozen data entry.

[0025] During storage, the same frozen data must be stored in the same storage block and must not be stored across blocks. At the same time, it should be ensured that each piece of frozen data is complete. Data read after power failure and power restoration, as well as data read through multiple interactive frame readings, should be integrated into the same piece of frozen data for storage.

[0026] A storage block contains multiple sectors. When writing new frozen data, the next sector of the currently operated sector is cleared first. Then, it is determined whether the remaining space in the current sector meets the space requirements of a frozen data entry. If it does, the current sector is written; otherwise, the data is written to the next sector. This ensures that data frozen at the same time is located in the same sector, meaning that frozen data is not allowed to be stored across sectors.

[0027] During the query, the system first searches backward from the sector currently being operated on. The first frozen data found is the first of all frozen data currently saved, and the last frozen data in the sector currently being operated on is the last of all frozen data currently saved. Then, starting from the first frozen data, the system calculates the location of the frozen data to be queried according to the logic of writing new frozen data, and then reads it.

[0028] Data queries typically employ a binary search approach. This involves narrowing the search range by comparing the freezing time of the middle record within the current search scope with the time being queried, until the desired frozen data is found. Here, we assume we want to query a record located halfway between the first and last frozen record. Given the data length and storage space, it's easy to calculate which record this is. Then, following the logic of writing new frozen data, we calculate the sectors to be written to sequentially from the position of the first frozen record until reaching this particular frozen record, and finally, read from that position.

[0029] It should be noted that, as will be apparent to those skilled in the art, the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics thereof. The scope of the present invention is defined by the claims rather than the foregoing description.

Claims

1. A method for storing household meter data of an electric energy meter and an electric energy information collection terminal, characterized in that: Divide the available storage space of the device into N storage blocks; A plurality of storage link variables corresponding to each acquisition scheme are set in a storage area outside the available storage space, wherein the storage link variable contains N bits corresponding to the storage blocks; for any bit, if the storage block corresponding to the bit is allocated to the acquisition scheme corresponding to the storage link variable, the bit is 1, otherwise the bit is 0; When a certain acquisition scheme is selected for activation, the storage blocks that have not yet been allocated are determined based on the storage link variables of all enabled acquisition schemes, and the space size required for the acquisition scheme is calculated based on the configuration of the acquisition scheme. Then, storage blocks that match the space size are divided from the storage blocks that have not yet been allocated and allocated to the acquisition scheme. The storage blocks allocated by the same acquisition scheme are regarded as a continuous storage space and operated by the system.

2. The method for storing household meter data of an electric energy meter and an electric energy information collection terminal as claimed in claim 1, characterized in that: The method of determining the storage block that has not been allocated is: performing a bitwise OR operation on the storage link variables corresponding to all enabled acquisition schemes, and the storage block corresponding to the bit that is 0 among the N bits of the operation result is the storage block that has not been allocated.

3. The method for storing household meter data of an electric energy meter and an electric energy information collection terminal as claimed in claim 1, characterized in that: The calculation method for the space size required by the collection plan is: suppose the number of user tables to be collected by the collection plan is Num, the storage depth is Depth, M types of data need to be stored, and the data storage length of the mth type is recorded as CSD_m, then the required space size is Size=Depth*Num*(CSD_1+CSD_2+...+CSD_M).

4. The method for storing household meter data of an electric energy meter and an electric energy information collection terminal as claimed in claim 3, characterized in that: If a certain collection solution is compatible with multiple specifications of user tables, when setting the storage length of a certain type of data, the maximum value of the data storage length used by all specifications of user tables corresponding to this type of data is used as the storage length for calculating the space size.

5. The method for storing household meter data of an electric energy meter and an electric energy information collection terminal as claimed in any one of claims 1 to 4, characterized in that: All types of data of all household tables at the same freezing time under one collection plan are regarded as one frozen data; When storing, the same frozen data must be stored in the same storage block and cannot be stored across blocks.

6. The method for storing household meter data of an electric energy meter and an electric energy information collection terminal as claimed in any one of claims 1 to 4, characterized in that: A storage block contains multiple sectors; When writing a new frozen data, first clear the next sector of the currently operated sector, and then determine whether the remaining space in the current sector meets the space occupation requirement of a frozen data. If it does, continue writing to the current sector, otherwise, write to the next sector to ensure that data with the same frozen time are located in the same sector, that is, frozen data is not allowed to be stored across sectors.

7. The method for storing household meter data of an electric energy meter and an electric energy information collection terminal as claimed in claim 6, characterized in that: When querying, take the first frozen data as the starting point, calculate the location of a frozen data to be queried according to the logic of writing new frozen data, and then read it.

Citation Information

Cited By

  • Electric energy meter data freezing method based on time sequence

    CN121742753A