A storage architecture for electricity meter events

By adopting a flash memory-based event storage architecture for electricity meters and employing event recording blocks and CRC check blocks, the problems of reliability, efficiency, and space utilization in existing storage architectures are solved, achieving efficient and reliable event storage for electricity meters.

CN120803343BActive Publication Date: 2026-11-17SHENZHEN FRIENDCOM TECH DEV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510750654.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2026-11-17
Estimated Expiration
2045-06-06

AI Technical Summary

Technical Problem

Existing energy meter event storage architectures struggle to simultaneously achieve high reliability, high write efficiency, and high space utilization, thus failing to meet the storage requirements of energy meter events.

Method used

It adopts a Flash-based storage architecture and uses event log blocks as storage units, including event occurrence data blocks, event end data blocks, instantaneous event data blocks, event status identifier blocks, and CRC check blocks, to perform data verification and management and avoid EEPROM operations.

Benefits of technology

It improves the efficiency of Flash communication data transmission and writing, reduces Flash erase time, ensures storage reliability and space utilization, and meets the storage needs of electricity meter events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803343B_ABST
    Figure CN120803343B_ABST
Patent Text Reader

Abstract

This invention discloses a storage architecture for electricity meter events, relating to the field of electricity meter event technology. It solves the technical problem that existing electricity meter event storage architectures struggle to simultaneously achieve high reliability, high write efficiency, and high space utilization, making them unsuitable for the storage requirements of electricity meter events. This storage architecture is based on Flash memory for electricity meter event storage, including a Flash event storage area where event record blocks are used as storage units. Each event record block includes an event occurrence data block, an event end data block, a momentary event data block, an event status identifier block, and a CRC check block. The event occurrence data block, event end data block, and momentary event data block are shared data blocks. This invention uses only one type of Flash memory for electricity meter event storage and performs data verification to ensure the reliability and write efficiency of electricity meter event storage. Simultaneously, the storage architecture ensures high space utilization, effectively meeting the storage requirements of electricity meter events.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity meter event technology, and more particularly to a storage architecture for electricity meter events. Background Technology

[0002] In electricity meter reading systems, various factors such as different electricity usage environments, abnormal electricity operation, and electricity theft can trigger electricity meter events at the electricity consumption site. Electricity meter events typically have the following characteristics: event data includes data recorded at the start and end of the event; event data can be read, and even if the event is not yet over, the data at the start and end of the event must be retrieved according to certain rules; event data can be cleared, but after clearing, both the data at the start and end of the event must be cleared; event data is time-invariant, meaning that once a record is triggered, it cannot be changed. Currently, the methods for storing events on electricity meters are generally divided into general-purpose system-level storage and dedicated self-allocated storage. The former allocates and stores files under a file system, such as exFAT or littlefs, with the file system managing read and write operations to Flash or EEPROM; the latter manages read and write operations to Flash or EEPROM independently.

[0003] The technical challenge of dedicated self-allocation storage for electricity meter events lies in storage management. Existing dedicated self-allocation storage technologies can employ four storage schemes. ① For example... Figure 1 As shown, Flash storage without a parity event structure means the event structure has no parity. Sufficient space can be directly defined on the Flash for storage. Because events are sometimes immutable, there's no need to modify the already written event structure, avoiding the read-erase-write operation on the Flash. However, its reliability is extremely low; errors in the Flash cannot be corrected. ② As shown Figure 2 As shown, Flash storage with a check event structure has a check function. The check is calculated and written when an event occurs. When the event ends, the data from when the event occurred is read, and the data from when the event occurred is concatenated with the data from when the event occurred before recalculating the check. The Flash storage performs sector read of valid data → sector erase → rewriting of the event data and the original sector data together. However, the write efficiency is low. ③ As shown Figure 3As shown, the method of combining EEPROM and Flash (a commonly used approach in many products) implements this. The event structure includes verification. Before the event ends, it is defined as time-varying and stored in the EEPROM (which is generally used for storing time-varying parameters). After the event ends, it becomes time-invariant and is transferred from the EEPROM to the Flash. This effectively avoids the shortcomings of the two methods mentioned above. However, the write efficiency is not high enough (although it is more efficient than rewriting, the transfer operation is still inefficient due to the limited read / write speed of the EEPROM); the complexity of dual-memory operation in handling exceptions (communication interference, device failure, etc.) makes it difficult to guarantee reliability; and the EEPROM requires an additional space overhead of one record block per event. ④ As shown Figure 4 As shown, the Flash storage with a check event structure divides the sectors into four groups, each with two regions. One region stores the start data of the event, and the other stores the complete event data (after the event ends). Each sector stores four events. This avoids the write-over operation of scheme 2 and the dual-memory transfer operation of scheme 3. However, it suffers from low space utilization (fixed blocks mean that redundant space is occupied and cannot be used by other data).

[0004] Due to the aforementioned problems with existing dedicated self-allocation storage technologies, there is an urgent need for a storage architecture for electricity meter events that adapts to the characteristics of electricity meter events and memory storage, and features high reliability (with verification, operating only on a single memory), high write efficiency (operating only on a single memory), and high space utilization (not using a file system, not adopting a transfer mode), in order to meet the storage requirements of electricity meter events. Summary of the Invention

[0005] The purpose of this invention is to provide a storage architecture for electricity meter events, thereby addressing the technical problem that existing electricity meter event storage architectures struggle to simultaneously achieve high reliability, high write efficiency, and high space utilization, making them unsuitable for the storage requirements of electricity meter events. The numerous technical effects of the preferred solutions among the many technical solutions provided by this invention are detailed below.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] The present invention provides a storage architecture for electricity meter events, which stores electricity meter events based on Flash memory, including a Flash event storage area, wherein the Flash event storage area uses event recording blocks as storage units; each event recording block includes an event occurrence data block, an event end data block, an instantaneous event data block, an event status identifier block, and a CRC check block, wherein the event occurrence data block, the event end data block, and the instantaneous event data block are common data blocks.

[0008] Preferably, when writing data to the event occurrence data block, the data at the time of the event is filled into the position where the event occurred, and the data at the end of the event is set to all FF as an event status identifier. Then, a two-byte CRC check code is calculated for the event occurrence data block and the event status identifier to obtain the first event occurrence check result and the second event occurrence check result.

[0009] Preferably, when the event end data block records data, the event is first read back, and the status of the event status is determined based on the verification judgment and the event status identifier to confirm whether it can end normally at this time.

[0010] Preferably, when recording data in the event end data block, the data indicating the end of the event is filled into the event end position, an event status identifier is written, and a two-byte CRC checksum is calculated for the event occurrence data block and the event status identifier respectively to obtain the first event end verification result and the second event end verification result.

[0011] Preferably, the instantaneous event data block is obtained by merging the event occurrence data block and the event end data block, and a two-byte CRC check code is calculated on the instantaneous event data block and the event status identifier respectively to obtain the first instantaneous event check result and the second instantaneous event check result.

[0012] Preferably, the CRC check block uses dual CRC32 check or dual CRC8 check.

[0013] Preferably, the event status identifier block uses two bits to identify different types of event data blocks.

[0014] Preferably, the event status flag bits of the event occurrence data block, the event end data block, and the instantaneous event data block are 0x02, 0x00, and 0x03, respectively.

[0015] Implementing one of the above-described technical solutions of the present invention has the following advantages or beneficial effects:

[0016] This invention eliminates the possibility of EEPROM operations. From a data writing perspective, Flash communication data transmission efficiency is at least twice that of EEPROM, while the write completion efficiency is the same for both. The page cache is twice as large, making the overall Flash data writing efficiency at least four times that of EEPROM. Similarly, from a data reading perspective, Flash also has an advantage in communication speed. Furthermore, eliminating the need for Flash erasure, which is typically slow (around 40ms), eliminates this wasted time, thus improving the storage efficiency of electricity meter events. Further, the storage architecture for electricity meter events in this invention consists of only three parts: no file system, no transfer, and no need for EEPROM or other caches. In any scenario, all data utilizes the available space effectively, with no unnecessary transfer cache space. This invention ensures the reliability and writing efficiency of electricity meter event storage, while also ensuring high space utilization, effectively meeting the storage needs of electricity meter events. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0018] Figure 1 This is a schematic diagram of a Flash storage architecture without a verification event structure in the existing technology;

[0019] Figure 2 This is a schematic diagram of the first Flash storage architecture with a verification event structure in the prior art;

[0020] Figure 3 This is a schematic diagram of a storage architecture combining EEPROM and Flash in existing technology;

[0021] Figure 4 This is a schematic diagram of the second type of Flash storage architecture with a verification event structure in the prior art;

[0022] Figure 5 This is a schematic diagram of the storage architecture for electricity meter events according to an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the present invention clearer, various exemplary embodiments described below will be referenced to the accompanying drawings, which form part of the exemplary embodiments, illustrating various exemplary embodiments that may be used to implement the present invention. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. It should be understood that they are merely examples of processes, methods, and apparatuses consistent with some aspects of the present invention disclosed as detailed in the appended claims, and other embodiments may be used, or structural and functional modifications may be made to the embodiments listed herein without departing from the scope and spirit of the present invention.

[0024] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," etc., indicate the orientation or positional relationship based on the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the referred element must have a specific orientation, or be constructed and operated in a specific orientation. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. The term "multiple" means two or more. The terms "connected" and "linked" should be interpreted broadly, for example, they can be fixed connections, detachable connections, integral connections, mechanical connections, electrical connections, communication connections, direct connections, indirect connections through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more of the related listed items. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0025] To illustrate the technical solution described in this invention, specific embodiments are described below, showing only the parts related to the embodiments of this invention.

[0026] Example:

[0027] like Figure 5 As shown, this invention provides a storage architecture for electricity meter events. It stores electricity meter events based on Flash memory, thus excluding EEPROM and fully utilizing the characteristic of Flash memory that it can only change from 1 to 0 during writing to design the event storage structure. The storage architecture of this invention includes a Flash event storage area, where event record blocks are used as storage units. Figure 5The diagram shows N event record blocks. Each event record block includes an event occurrence data block, an event end data block, a transient event data block (a transient event is an event that ends upon occurrence), an event status identifier block, and a CRC check block. The event occurrence data block, event end data block, and transient event data block are shared data blocks. This invention eliminates the possibility of operating an EEPROM. EEPROMs generally use the IIC protocol for communication, with a write speed typically between 200-400 kbit / s on electricity meters. The maximum write unit is a page of 64 bytes or 128 bytes, and the write completion time is approximately 5ms. Flash memory, on the other hand, generally uses the SPI protocol for communication, with a write speed typically reaching the Mbit / s level. The maximum write unit is a page of 256 bytes, and the write completion time is approximately 5ms. From a data writing perspective, Flash communication data transmission efficiency is at least twice that of EEPROM, while the write completion efficiency is the same for both. The page buffer is twice as large, making the overall data writing efficiency of Flash at least four times that of EEPROM. Similarly, from a data reading perspective, Flash memory also has advantages in communication speed. Furthermore, it eliminates the possibility of Flash erasure, as Flash sector erasure is generally slow (around 40ms). Writing without erasing Flash eliminates this invalid time, thus improving the storage efficiency of electricity meter events. Further, the storage architecture for electricity meter events in this invention consists of only three parts: no file system, no data transfer, and no need for EEPROM or other caches. In any scenario, all data utilizes the available space effectively, with no unnecessary space from transfer caches. Therefore, this invention uses only one type of Flash memory for electricity meter event storage and performs data verification to ensure the reliability and writing efficiency of electricity meter event storage. The storage architecture also ensures high space utilization, effectively meeting the storage needs of electricity meter events.

[0028] As an optional implementation, when writing data to the event occurrence data block, the data at the time of the event is filled into the position where the event occurred (i.e., Figure 5 In the event (XX), the data at the end of the event is set to all FF as the event status identifier. Since the data at the end of the event is not touched, the data at the end of the event is still all FF. Then, a two-byte CRC check code is calculated for the event occurrence data block and the event status identifier to obtain the first event occurrence check result (i.e., the high 16 bits XXXX) and the second event occurrence check result (i.e., the low 16 bits are all F, and each bit of Flash is 1, indicating that data can be written arbitrarily).

[0029] As an optional implementation, when recording data in the event end data block, an event readback is first performed, and the status is checked based on the verification judgment and the event status identifier to confirm whether the event can end normally. If it cannot end normally, exception handling is performed; otherwise, normal handling is performed. When recording data in the event end data block, the data indicating the end of the event is filled into the position where the event ends (i.e., Figure 5 In the data block where YY is active, XX remains unchanged. Since each bit in the Flash memory is 1 at this time, data can be written freely without error. An event status flag (in this embodiment, hexadecimal 0x00, meaning the first bit is 0 and the 0th bit is also 0) is written. A two-byte CRC checksum is calculated for both the event occurrence data block and the event status flag to obtain the first event end check result (the high 16 bits are cleared to 0; since each bit in the low 16 bits of the Flash memory is 1 at this time, data can be written freely without error) and the second event end check result (i.e.,...). Figure 5 The lower 16 bits of the CRC checksum (YYYY) are used. To ensure the time invariance of the data, the higher 16 bits of the CRC checksum and the event identifier are all 0. No matter what exception occurs in the program that causes the same area to be rewritten, a certain known error will occur, and the corresponding exception handling can be performed. This ensures uniqueness and reliability.

[0030] As an optional implementation, the instantaneous event data block is obtained by merging the event occurrence data block and the event end data block, thus eliminating the need for additional space. The instantaneous event data block is designed for specific application scenarios, improving the breadth of event recording on the energy meter. The first instantaneous event verification result is obtained by calculating a two-byte CRC checksum on both the instantaneous event data block and the event status identifier. Figure 5 0000 in the middle), the second instantaneous event verification result ( Figure 5 (ZZZZ in the original text). If it is necessary to read event log data, the storage status of the current event can be determined based on the flag bit, while also having a verification function to ensure the validity of the data, facilitating event data processing. In addition, if a block in the instantaneous event log is overwritten by the blocks in the first two scenarios, an error will occur, but because the event status flag is unique (i.e., there is no possibility of Flash directly writing 1 from bits that are 0 in the first two scenarios), reliability is guaranteed.

[0031] As an optional implementation, the CRC check block uses either dual CRC32 or dual CRC8 checksums. Using dual-byte CRC16 checksums results in a repetition probability of 1 / 65536. An optimization to improve fault tolerance is to use dual CRC32 instead of the 4-byte dual CRC16 checksum, but this may reduce computation speed, resulting in lower write efficiency. Similarly, using dual CRC8 checksums can bring higher write efficiency and smaller space requirements, but fault tolerance will be reduced, given the repetition probability of 1 / 256. The dual CRC32 and dual CRC8 checksum methods can be selected according to actual needs, improving the adaptability of this invention.

[0032] As an optional implementation, a combination of the identifier byte and the check code can be used, with CRC8 used when an event occurs and CRC16 used after the event ends, thus enjoying further optimization of space and efficiency. Of course, using dual CRC8 is the most economical, but it will result in a high repetition rate. CRC8 and CRC16 strike a good balance between space, efficiency and check repetition rate.

[0033] As an optional implementation, since the data is time-invariant when the event occurs, it is not necessary to repeat the operation of the data block at the beginning of the event when the event ends. Therefore, the writing of this part of the data can be skipped, which further improves the writing efficiency. Furthermore, due to the uniqueness of the checksum, the abnormal program can still be effectively detected.

[0034] As an optional implementation, the event status flag block uses two bits to identify different types of event data blocks. The two bits, 0 and 1, can achieve four combinations: 00, 01, 10, and 11. Thus, the event status flag bit uses two bits of 0 and 1 to achieve uniqueness for different event scenarios. The event status flag bits for the event occurrence data block, event end data block, and instantaneous event data block are 0x02 (corresponding to binary 10), 0x00 (corresponding to binary 00), and 0x03 (corresponding to binary 11), respectively. Of course, other combinations of binary 0 and 1 can also be used as needed to distinguish different event status flag bits.

[0035] The embodiment is merely a specific example and does not indicate that this is the only way to implement the present invention.

[0036] The above description is merely a preferred embodiment of the present invention. Those skilled in the art will understand that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the present invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.

Claims

1. A storage architecture for electricity meter events, characterized in that, The method for storing electricity meter events based on Flash memory includes a Flash event storage area, where event recording blocks are used as storage units. Each event recording block includes an event occurrence data block, an event end data block, a momentary event data block, an event status identifier block, and a CRC check block. The event occurrence data block, event end data block, and momentary event data block are shared data blocks. When writing data to the event occurrence data block, the data at the time of the event occurrence is filled into the event occurrence position, and the data at the end of the event is set to all FF as the event status identifier. A two-byte CRC check code is calculated for the event occurrence data block and the event status identifier to obtain a first event occurrence check result and a second event occurrence check result. When recording data to the event end data block, an event readback is performed first, and the status is checked based on the check and the event status identifier to confirm whether the event can end normally.

2. The storage architecture for electricity meter events according to claim 1, characterized in that, When recording data in the event end data block, the data indicating the end of the event is filled into the event end position, the event status identifier is written, and a two-byte CRC check code is calculated for the event occurrence data block and the event status identifier respectively to obtain the first event end verification result and the second event end verification result.

3. The storage architecture for electricity meter events according to claim 1, characterized in that, The instantaneous event data block is obtained by merging the event occurrence data block and the event end data block. A two-byte CRC check code is calculated on the instantaneous event data block and the event status identifier to obtain the first instantaneous event check result and the second instantaneous event check result.

4. The storage architecture for electricity meter events according to claim 1, characterized in that, The CRC check block uses either dual CRC32 check or dual CRC8 check.

5. The storage architecture for electricity meter events according to claim 1, characterized in that, The event status identifier block uses two bits to identify different types of event data blocks.

6. The storage architecture for electricity meter events according to claim 5, characterized in that, The event status flag bits for the event occurrence data block, event end data block, and instantaneous event data block are 0x02, 0x00, and 0x03, respectively.

Citation Information

Patent Citations

  • Voltage event recording method and device of dual-core intelligent electric meter and dual-core intelligent electric meter

    CN113009407A

  • Method and device for storing total cumulative occurrence time of events of electric energy meter and medium

    CN116679891A

  • Electricity meter metering management method and device, electricity meter and storage medium

    CN118885328A