Electric energy meter data freezing method and system based on special data container for decentralized freezing

By introducing a dedicated data container and bitmap mechanism into smart energy meters, the frozen data processing is decentralized, which solves the system lag problem during the freezing period and ensures data consistency and real-time response.

CN121764411BActive Publication Date: 2026-05-29QINGDAO ITECHENE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO ITECHENE TECH CO LTD
Filing Date
2026-03-03
Publication Date
2026-05-29

Smart Images

  • Figure CN121764411B_ABST
    Figure CN121764411B_ABST
Patent Text Reader

Abstract

The application discloses an electric energy meter data freezing method and system based on special data containers for dispersion freezing, and all data of required freezing data types in the special data containers are copied from a type of cache to the special data containers at a freezing moment; freezing type requirements at a current moment are inquired, and corresponding bit positions are set in a bitmap according to the freezing type requirements at the current moment; the bitmap is inquired according to the bit positions in a set period, if the bit position is set, corresponding freezing data of the freezing data types required by the freezing type corresponding to the bit position is extracted from the special data container, written into a non-volatile memory, and the bit position is reset; the bitmap inquiry is stopped after the Nth set period, the bitmap is emptied, and the next freezing moment is waited; N is the number of defined freezing type categories, and the time of the set period multiplied by N is less than a minimum freezing period. The application can avoid system lagging caused by writing a large amount of freezing data into the non-volatile memory at the freezing moment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electricity meter data freezing technology, specifically, it relates to a method and system for electricity meter data freezing based on decentralized freezing using a dedicated data container. Background Technology

[0002] As the core electricity metering device of the smart grid, smart meters undertake the crucial functions of accurate metering, data storage, and data interaction. To ensure the traceability and analytical value of electricity data, relevant standards and specifications require meters to implement multi-cycle and multi-type data freezing functions, including timed, minute, hourly, daily, monthly, yearly, settlement day, and custom interval freezing. These functions all require persistent storage of various electrical parameter data at the freezing moment in non-volatile memory (such as FLASH). In existing technologies, especially smart meters using a bare-metal architecture, the triggering and execution unit for all the above freezing tasks is often set to "minutes," meaning execution at 0 seconds. This design faces severe challenges in actual operation: due to overlapping points between different freezing events (for example, multiple freezing events such as minute, hourly, daily, monthly, and settlement day freezing may be triggered simultaneously at 00:00 on the first day of the month), the system will face a large number of data FLASH write operations in a very short time. When intensive write operations are performed continuously, the system is blocked for a long time during the concentrated writing period. The CPU will be unable to process any other tasks, resulting in a noticeable "lag" or "false freeze" phenomenon that can last for 5 seconds or even longer. During this period, data reading requests initiated via communication serial ports (such as RS-485, infrared, or carrier waves) will not receive a response, manifesting as communication timeouts or no response. At the same time, the LCD display data will stop refreshing, making it difficult to simultaneously ensure the real-time display of frozen data and the smooth response of the system. Especially when dealing with concurrent request scenarios of "reading data when a freeze has not occurred," it seriously affects the success rate of data acquisition and the real-time interactive performance of the device, becoming a significant technical defect in the design of smart meters.

[0003] The information disclosed in this background section is only intended to enhance the understanding of the background technology of this application, and therefore may include prior art that is not known to those skilled in the art. Summary of the Invention

[0004] This invention proposes a method and system for freezing electricity meter data in a distributed manner based on a dedicated data container, in order to solve the technical problem that existing electricity meters have overlapping freezing points, and face a large number of frozen data writing operations in a very short time, which causes the system to lag.

[0005] To achieve the above-mentioned invention / design objectives, the present invention adopts the following technical solution:

[0006] A method for freezing electricity meter data using a distributed freezing mechanism based on a dedicated data container, the method comprising:

[0007] At the time of freezing, all data of the required frozen data types in the dedicated data container are copied from the cache to the dedicated data container;

[0008] Query the freeze type requirements at the current moment, and set the corresponding bit in the bitmap according to the freeze type requirements at the current moment;

[0009] The bitmap is queried bit by bit in a set period. If a bit is set, the corresponding frozen data is extracted from the dedicated data container according to the frozen data type required by the frozen type corresponding to the bit and written into the non-volatile memory. The bit is then reset. After the Nth set period, the bitmap query is stopped and the bitmap is cleared, waiting for the next freezing time.

[0010] Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

[0011] As described above, the method for freezing electricity meter data based on a dedicated data container involves reading the associated object table of the freezing type corresponding to the bit if the bit is set. The associated object table stores the alias corresponding to the data type of the freezing type required for that freezing type. The dedicated data container includes at least one protocol alias supported by a power protocol corresponding to the data type of the freezing type. If the alias in the associated object table is equal to the alias in the data container, the corresponding data is extracted from the dedicated data container.

[0012] As described above, the method for freezing electricity meter data based on a dedicated data container involves copying all the data of the required frozen data types from a cache to the dedicated data container. If a certain frozen data type is not supported in a certain power protocol, the corresponding protocol alias field supported by the power protocol will have a fixed value and the format will be the same as other alias fields.

[0013] The energy meter data freezing method based on a dedicated data container, as described above, involves querying the current freezing type requirement and setting the corresponding bit in the bitmap according to that requirement.

[0014] Query the current freeze type requirements in ascending order according to the defined freeze type order, and set the corresponding bits in the bitmap in ascending order according to the current freeze type requirements.

[0015] As described above, the energy meter data freezing method based on a dedicated data container for distributed freezing receives a read frozen data instruction before the frozen data is written to the non-volatile memory. The bitmap is queried, and if the corresponding bit is 1, the corresponding frozen data is directly extracted from the dedicated data container; otherwise, the corresponding frozen data is extracted from the non-volatile memory.

[0016] A data freezing system for electricity meters based on decentralized freezing using a dedicated data container, the system comprising:

[0017] A dedicated data container, configured to store data of all frozen data types;

[0018] Bitmap, consisting of several bits;

[0019] Non-volatile memory, configured to store frozen data corresponding to frozen data types;

[0020] The controller is configured to, at the freeze time, copy all data of the required frozen data types from a type of cache to the dedicated data container; query the freeze type requirements at the current time, and set the corresponding bit in the bitmap according to the freeze type requirements at the current time; query the bitmap sequentially by bit at a set period; if a bit is set, extract the corresponding frozen data from the dedicated data container according to the frozen data type required by the freeze type corresponding to the bit, write it to non-volatile memory, and reset the bit; stop bitmap querying after the Nth set period, and clear the bitmap at the same time, waiting for the next freeze time;

[0021] Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

[0022] The energy meter data freezing system based on a dedicated data container for decentralized freezing, as described above, includes:

[0023] The associated object table is configured to store aliases corresponding to the frozen data types required for this freeze type;

[0024] A dedicated data container, including at least one protocol alias supported by the power protocol corresponding to the frozen data type;

[0025] The controller is configured to read the associated object table of the frozen type corresponding to the bit if the bit is set, and extract the corresponding data from the dedicated data container if the alias in the associated object table is equal to the alias in the data container.

[0026] As described above, in the energy meter data freezing system based on a dedicated data container for distributed freezing, the controller is configured to copy all data of the required frozen data types from a cache to the dedicated data container. If a certain frozen data type is not supported in a certain power protocol, the corresponding power protocol-supported protocol alias field has a fixed value and the format is the same as other alias fields.

[0027] As described above, in the energy meter data freezing system based on a dedicated data container for distributed freezing, the controller is configured to query the current freezing type requirements in ascending order according to the defined freezing type order, and set the corresponding bits in the bitmap in ascending order according to the current freezing type requirements.

[0028] As described above, in the energy meter data freezing system based on a dedicated data container for distributed freezing, the controller is configured to receive a command to read frozen data before the frozen data is written to the non-volatile memory, query the bitmap, and if the corresponding bit is set, directly extract the corresponding frozen data from the dedicated data container; otherwise, extract the corresponding frozen data from the non-volatile memory.

[0029] Compared with the prior art, the advantages and positive effects of the present invention are as follows: A method for freezing electricity meter data based on distributed freezing using a dedicated data container: At the freezing moment, all data of the required frozen data types in the dedicated data container are copied from a type of cache to the dedicated data container; the current freezing type requirement is queried, and the corresponding bit is set in the bitmap according to the current freezing type requirement; the bitmap is queried sequentially bit by bit at a set period; if a bit is set, the corresponding frozen data is extracted from the dedicated data container according to the frozen data type required by the corresponding bit, written to non-volatile memory, and the bit is reset; after the Nth set period, the bitmap query is stopped, and the bitmap is cleared, waiting for the next freezing moment; where N is the number of defined freezing type types, and the set period time × N < minimum freezing period. This invention constructs a dedicated data container to store data of all frozen data types. At the moment of freezing, only one data copy operation is performed, updating the data in a cache to the dedicated data container as the original data for all frozen data, ensuring data consistency. Bitmaps are used to mark the required freezing types, and time-sharing freezing data writing is performed according to the bitmaps. The frozen data corresponding to the required freezing type is read from the dedicated data container in a time-sharing manner and written to non-volatile memory, avoiding system lag caused by writing a large amount of frozen data to non-volatile memory at the moment of freezing.

[0030] This invention relates to a distributed freezing system for electricity meter data based on a dedicated data container. The system includes: a dedicated data container, a bitmap, a non-volatile memory, and a controller. The dedicated data container is configured to store data of all types of frozen data. The bitmap includes several bits. The non-volatile memory is configured to store the frozen data corresponding to the frozen data types. The controller is configured to, at the freezing time, copy all required frozen data types from a cache to the dedicated data container. It queries the current freezing type requirement and sets the corresponding bit in the bitmap accordingly. It queries the bitmap bit-by-bit at a set period. If a bit is set, it extracts the corresponding frozen data from the dedicated data container according to the required frozen data type, writes it to the non-volatile memory, and resets the bit. After the Nth set period, it stops querying the bitmap, clears the bitmap, and waits for the next freezing time. Here, N is the number of defined freezing types, and the set period time × N < the minimum freezing period. This invention constructs a dedicated data container to store data of all frozen data types. At the moment of freezing, only one data copy operation is performed, updating the data in a cache to the dedicated data container as the original data for all frozen data, ensuring data consistency. Bitmaps are used to mark the required freezing types, and time-sharing freezing data writing is performed according to the bitmaps. The frozen data corresponding to the required freezing type is read from the dedicated data container in a time-sharing manner and written to non-volatile memory, avoiding system lag caused by writing a large amount of frozen data to non-volatile memory at the moment of freezing.

[0031] Other features and advantages of the present invention will become clearer after reading the detailed embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

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

[0033] Figure 1 This is a flowchart of a specific embodiment of the electricity meter data freezing method of the present invention.

[0034] Figure 2 This is a flowchart of the electricity meter data reading and response process according to a specific embodiment of the present invention. Detailed Implementation

[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0036] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0037] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances. In the description of embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0038] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0039] In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0040] This embodiment describes a method and system for achieving efficient and reliable freezing of multi-cycle and multi-type data in a resource-constrained embedded environment of an energy meter, while ensuring the system's real-time response capability.

[0041] This embodiment is a method for freezing electricity meter data from a single source based on a dedicated data container, which can solve the following technical problems:

[0042] 1. The problem of electricity meters freezing for N seconds due to various types of freezing when crossing days, months, or years;

[0043] 2. The issue of inconsistent power data for different types of freezing;

[0044] 3. When the screen freezes, it causes communication to become unresponsive and the display to freeze and not refresh.

[0045] The core technology for solving the above technical problems lies in transforming the centralized pressure of writing frozen data into a smooth, distributed, asynchronous processing flow through a strategy of "snapshotting" the electrical parameters required for freezing into a dedicated data container and "distributing freezing tasks." At the freezing moment (e.g., 0 seconds), the system quickly copies the electrical parameter data required for freezing from a cache updated every second and stores it in the dedicated data container. It also sets the corresponding bitmap flag of the defined freezing class (a bit of the corresponding class being set to 1 indicates that this type has been frozen but not written to non-volatile memory—external flash memory (FLASH)), completing the freezing logic and achieving the goal of freezing data from the same source. This operation is performed only in RAM, at an extremely fast speed (microseconds), decoupling data acquisition from physical writing. This avoids the continuous latency and system waiting caused by directly operating FLASH, completing the freezing operation seamlessly and resolving the issues of communication freezes, display pauses, and screen refresh failures during this process.

[0046] To efficiently manage the frozen state, a 32-bit (4-byte) "frozen but not written bitmap flag" is used, which can solve the problem of concurrent state management and copying response for up to 32 frozen types.

[0047] A method for freezing electricity meter data based on decentralized freezing using a dedicated data container includes:

[0048] At the time of freezing, all data of the required frozen data types in the dedicated data container are copied from the cache to the dedicated data container;

[0049] Query the freeze type requirements at the current moment, and set the corresponding bit in the bitmap according to the freeze type requirements at the current moment;

[0050] The bitmap is queried bit by bit in a set period. If a bit is set, the corresponding frozen data is extracted from the dedicated data container according to the frozen data type required by the frozen type corresponding to the bit, written to non-volatile memory, and the bit is reset. After the Nth set period, the bitmap query is stopped and the bitmap is cleared, waiting for the next freezing time.

[0051] Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

[0052] Establish a frozen data structure mapping table:

[0053] The dedicated data container includes a frozen data structure mapping table, which includes at least one protocol alias supported by the power protocol corresponding to the frozen data type.

[0054] In some embodiments, a static structure table is constructed using protocol DI (an alias for protocols supported by DL / T645 and DL / T698) and frozen data types as key dimensions. Each table entry corresponds to a storage format of a frozen data type under a specific protocol.

[0055] When copying all the required frozen data types from a cache to a dedicated data container, if a certain frozen data type is not supported in a certain power protocol, the corresponding power protocol-supported protocol alias field will have a fixed value and the format will be the same as other alias fields.

[0056] If a certain frozen data type is not supported in a certain protocol, the corresponding protocol DI (protocol alias) field is marked as 0xFFFFFFFF to maintain structural consistency and query efficiency. The mapping table is shown in Table 1.

[0057] Table 1 is the mapping table.

[0058]

[0059] All the data types required for freezing in a dedicated data container include: voltage, current, power, power factor, active power, reactive power, current demand, etc.

[0060] Real-time data container pre-storage mechanism:

[0061] Pre-store real-time data in a dedicated data container:

[0062] At the freeze time, all data of the required frozen data types in the dedicated data container are copied from a cache to the dedicated data container.

[0063] In some embodiments, the freeze time is the minute change time of the current clock (typically 0 seconds).

[0064] At the moment of instantaneous freezing, all data of the required frozen data types (voltage, current, power, power factor, active power, reactive power, current demand, etc.) in the dedicated data container are copied from a type of cache to the dedicated data container to ensure that all types of frozen data have consistency and accessibility at the same time.

[0065] Because one type of cache needs to handle display refreshes, it typically refreshes every second or 500ms. During multiple consecutive freezes, this type of cache will be refreshed multiple times. If data is retrieved directly from this type of cache during a freeze, the same type of data will have different values ​​in different freezes. This situation is considered a failure of the freeze function. A dedicated data container, however, only performs data synchronization once at the minute change or trigger time of the current clock, avoiding the above problems and ensuring data consistency.

[0066] Bitmap-based frozen task scheduling method and time-sharing write mechanism:

[0067] Query the freeze type requirements at the current moment, and set the corresponding bits in the bitmap according to the freeze type requirements at the current moment; query the freeze type requirements at the current moment in ascending order according to the defined freeze type order, and set the corresponding bits in the bitmap in ascending order according to the freeze type requirements at the current moment.

[0068] The bitmap is queried bit by bit at a set period. If a bit is set, the corresponding frozen data is extracted from the dedicated data container according to the frozen data type required by the frozen type corresponding to the bit, written to non-volatile memory, and the bit is reset. Further, if a bit is set, the association object table of the frozen type corresponding to the bit is read. The association object table stores the alias corresponding to the frozen data type required by the frozen type. The dedicated data container includes at least one protocol alias supported by the power protocol corresponding to the frozen data type. If the alias in the association object table is equal to the alias in the data container, the corresponding data is extracted from the dedicated data container.

[0069] After the Nth set period, the bitmap query stops and the bitmap is cleared, waiting for the next freeze time;

[0070] Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

[0071] In some embodiments, at the minute change time of the current clock (generally at 0 seconds), the freeze type requirements within that minute are queried in ascending order according to the defined freeze type order, and the corresponding bits are set to 1 in ascending order in the bitmap according to the freeze type requirements of the current minute.

[0072] Starting from the next second (when the current clock's seconds change), the bitmap is queried once every second, starting from the smallest bit and moving up. If a bit is 1, the alias in the associated object table for this freeze type is compared with the alias in the mapping table. If the aliases are equal, the corresponding data is extracted from the dedicated data container, and a FLASH write operation is performed. If the data is successfully written, the bit is cleared to 0. After N+1 seconds (where N is the number of defined freeze types, as shown in Table 2, taking 13 freeze types as an example), the bitmap rotation stops, and the bitmap is cleared, waiting for the next freeze task.

[0073] Table 2 is a table of defined freeze types.

[0074]

[0075] like Figure 1 As shown, the method for freezing electricity meter data in a decentralized manner based on a dedicated data container includes the following steps:

[0076] S1, Begin.

[0077] S2. The electricity meter acquires real-time data and stores it in a type of cache.

[0078] S3. Determine if the minute has changed or if a freeze has been triggered. If yes, proceed to step S4; otherwise, proceed to step S2.

[0079] S4. Copy all the required frozen data types from a cache to a dedicated data container.

[0080] S5. Query the freeze type requirement at the current moment, and set the corresponding bit in the bitmap according to the freeze type requirement at the current moment.

[0081] In some embodiments, if the current freeze type requirement is timed freeze or hourly freeze, then 0x00 and 0x04 in the bitmap are 1, and the rest are 0.

[0082] S6. Determine if the change occurred within seconds. If yes, proceed to step S7; otherwise, proceed to step S3.

[0083] S7. Search the bitmap sequentially, and exit the search immediately when a bit is set to 1.

[0084] S8. Read the alias from the associated object table based on the data type of the frozen object required by the queried frozen type.

[0085] S9. Read the data corresponding to the alias in the data container as frozen data.

[0086] S10. Write the entire frozen data into non-volatile memory.

[0087] S11. In a bitmap, the corresponding bit for this type of freeze is cleared to zero.

[0088] S12, if the change in seconds is greater than N+1, proceed to step S7; if so, proceed to step S3.

[0089] Freeze read response data source indication strategy:

[0090] Before the frozen data is written to the non-volatile memory, a read frozen data instruction is received. The bitmap is queried. If the corresponding bit is 1, the corresponding frozen data is directly extracted from the dedicated data container. Otherwise, the corresponding frozen data is extracted from the non-volatile memory.

[0091] If a command to read the "previous" frozen data is received before the frozen data is actually written to the FLASH, the system first checks the "frozen but not written bitmap". If the corresponding bit is 1, it indicates that the latest frozen data has not yet been written to the FLASH. At this time, the data is directly extracted from the dedicated data container, framed, and returned, thereby ensuring the real-time nature of the data response and reducing communication delays caused by write blocking.

[0092] like Figure 2 As shown, the electricity meter data reading and response process includes the following steps:

[0093] S1, External Copying Process.

[0094] S2, Copy the data from the last frozen data.

[0095] S3. Query this type of frozen bit based on the copied data DI.

[0096] S4. Determine if the current BIT is 1. If yes, proceed to step S5; otherwise, proceed to step S6.

[0097] S5. Extract the corresponding frozen data from the dedicated data container and frame it according to the response requirements. Proceed to step S7.

[0098] S6. Query the corresponding frozen data from FLASH and frame it according to the reply requirements.

[0099] S7, sent via the communication port.

[0100] S8, Complete.

[0101] This embodiment achieves centralized caching of frozen data by constructing a standardized data container, and uses a bitmap setting and time-sharing writing mechanism to achieve orderly writing of frozen data. It realizes container + bitmap method task scheduling and data status indication + distributed writing, and combines non-written status query to ensure the real-time performance of data reading.

[0102] This embodiment discretizes and sequentially executes centralized write tasks, avoiding instantaneous FLASH overload. The status bitmap directly indicates whether the latest version of the data resides in the container (memory) or the external flash memory. During the frozen data writing process to FLASH, a real-time response method for external read requests ensures that even during peak write periods, read operations can obtain the latest data without being blocked by write operations, guaranteeing real-time communication.

[0103] This embodiment also proposes a data freezing system for electricity meters based on a dedicated data container for decentralized freezing. The freezing system includes:

[0104] A dedicated data container, configured to store data of all frozen data types;

[0105] Bitmap, consisting of several bits;

[0106] Non-volatile memory, configured to store frozen data corresponding to frozen data types;

[0107] The controller is configured to, at the freeze time, copy all data of the required frozen data types from a type of cache to the dedicated data container; query the freeze type requirements at the current time, and set the corresponding bit in the bitmap according to the freeze type requirements at the current time; query the bitmap sequentially bit by bit at a set period; if a bit is set, extract the corresponding frozen data from the dedicated data container according to the freeze type required by the corresponding bit, write it to non-volatile memory, and reset the bit; stop bitmap querying after the Nth set period, and clear the bitmap at the same time, waiting for the next freeze time;

[0108] Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

[0109] In some embodiments, the system further includes:

[0110] The associated object table is configured to store aliases corresponding to the frozen data types required for this freeze type;

[0111] A dedicated data container, including at least one protocol alias supported by the power protocol corresponding to the frozen data type;

[0112] The controller is configured to read the associated object table of the frozen type corresponding to the bit if the bit is set, and extract the corresponding data from the dedicated data container if the alias in the associated object table is equal to the alias in the data container.

[0113] In some embodiments, when the controller is configured to copy data of all frozen data types required in a dedicated data container from a type of cache to the dedicated data container, if a certain frozen data type is not supported in a certain power protocol, then the protocol alias field supported by the corresponding power protocol is a fixed value and the format is the same as the format of other alias fields.

[0114] In some embodiments, the controller is configured to query the current freeze type requirements in ascending order according to the defined freeze type order, and set the corresponding bits in the bitmap in ascending order according to the current freeze type requirements.

[0115] In some embodiments, the controller is configured to receive a read frozen data instruction before the frozen data is written to non-volatile memory, query the bitmap, and if the corresponding bit is set, directly extract the corresponding frozen data from the dedicated data container; otherwise, extract the corresponding frozen data from the non-volatile memory.

[0116] This embodiment provides a complete technical solution from data preparation, task scheduling, read response to storage optimization, aiming to fundamentally solve the "freezing and freezing" problem. Key points and beneficial effects are as follows:

[0117] 1. Application of container technology: Use a second-level cache to store the sum of data types that require freezing, and update the data at the switching trigger time or every minute at 0 seconds.

[0118] A dedicated container for the second-level cache is built to ensure data consistency: the system performs a high-speed data copy operation only once, updating the entire "snapshot" of the data in the first-level cache to the second-level cache as the original data for all frozen data, thus ensuring data consistency.

[0119] 2. Application of frozen type bitmap: By using bitmap to sequentially set the corresponding frozen type, it can indicate scattered freezing and also indicate the data source when copying the previous data before the data is "solidified". It is both the "commander" of the task and the "barometer" of the status, realizing the scheduling of tasks and the tracking of status.

[0120] Using bitmap flags to achieve instant completion of multiple freeze types: After the system completes the data snapshot of the secondary cache dedicated container, it can mark the logical state of all freeze types to be executed in RAM as "freeze complete" in a very short time (microseconds).

[0121] 3. Distributed Freeze Data Writing: Distribute the freeze type in 1-second intervals, write one type of freeze data every 1 second, and set the corresponding bitmap of this type to 0 after writing.

[0122] Implement time-sharing data freezing to decouple data acquisition and writing: For several seconds after 0 seconds (when freezing is triggered), the system reads data from a unified container in a time-sharing manner for various types of frozen storage. This avoids directly writing large amounts of data to FLASH at 0 seconds, completing the frozen data writing seamlessly.

[0123] 4. Compress the time stamps (year, month, day, hour, minute, second, millisecond, etc., totaling 10 bytes) to 4 bytes: reduce the amount of data written. This compressed storage format for timestamp information in data records significantly reduces the total amount of data written in a single freeze operation, lowers the write time and space occupied by the FLASH memory, and improves overall operational efficiency.

[0124] Data compression technology is used to shorten storage and response latency: key timestamp information such as freeze time and maximum demand occurrence time are compressed and stored in 4-byte format, which significantly reduces the amount of data written to FLASH during a single freeze, further improves write speed, and reduces system load.

[0125] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions claimed by the present invention.

Claims

1. A method for freezing electricity meter data based on decentralized freezing using a dedicated data container, characterized in that, The method includes: At the time of freezing, all data of the required frozen data types in the dedicated data container are copied from a type of cache to the dedicated data container, which includes aliases corresponding to the frozen data types; Query the freeze type requirements at the current moment, and set the corresponding bit in the bitmap according to the freeze type requirements at the current moment; The bitmap is queried bit by bit in a set period. If a bit is set, the associated object table of the frozen type corresponding to the bit is read. The associated object table stores the aliases corresponding to the frozen data types required for that frozen type. If the aliases in the associated object table are equal to the aliases in the data container, the corresponding frozen data is extracted from the dedicated data container and written to the non-volatile memory. The bit is then reset. After the Nth set period, the bitmap query is stopped, and the bitmap is cleared to wait for the next freezing time. Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

2. The method for freezing electricity meter data based on a dedicated data container for decentralized freezing according to claim 1, characterized in that, The dedicated data container includes at least one protocol alias supported by the power protocol corresponding to the frozen data type.

3. The method for freezing electricity meter data based on a dedicated data container for decentralized freezing according to claim 1, characterized in that, When copying all the required frozen data types from a cache to a dedicated data container, if a certain frozen data type is not supported in a certain power protocol, the corresponding power protocol-supported protocol alias field will have a fixed value and the format will be the same as other alias fields.

4. The method for freezing electricity meter data based on a dedicated data container for decentralized freezing according to claim 1, characterized in that, The method for querying the freeze type requirement at the current moment and setting the corresponding bit in the bitmap according to the freeze type requirement at the current moment is as follows: Query the current freeze type requirements in ascending order according to the defined freeze type order, and set the corresponding bits in the bitmap in ascending order according to the current freeze type requirements.

5. The method for freezing electricity meter data based on a dedicated data container for decentralized freezing according to any one of claims 1-4, characterized in that, Before the frozen data is written to the non-volatile memory, a read frozen data instruction is received. The bitmap is queried. If the corresponding bit is 1, the corresponding frozen data is directly extracted from the dedicated data container. Otherwise, the corresponding frozen data is extracted from the non-volatile memory.

6. A data freezing system for electricity meters based on decentralized freezing using a dedicated data container, characterized in that, The system includes: A dedicated data container is configured to store data of all frozen data types, and the dedicated data container includes aliases corresponding to the frozen data types; The associated object table is configured to store aliases corresponding to the frozen data types required for this freeze type; the bitmap includes several bits. Non-volatile memory, configured to store frozen data corresponding to frozen data types; The controller is configured to, at the freeze time, copy all data of the required frozen data types from a type of cache to the dedicated data container; query the freeze type requirements at the current time, and set the corresponding bit in the bitmap according to the freeze type requirements at the current time; query the bitmap sequentially by bit at a set period; if the bit is set, read the association object table of the frozen type corresponding to the bit; if the alias in the association object table is equal to the alias in the data container, extract the corresponding frozen data from the dedicated data container, write it to non-volatile memory, and reset the bit; stop bitmap querying after the Nth set period, and clear the bitmap at the same time, waiting for the next freeze time; Where N is the number of types of freezes that have been defined, and the set period time × N < minimum freeze period.

7. The electricity meter data freezing system based on a dedicated data container for decentralized freezing according to claim 6, characterized in that, The dedicated data container includes at least one protocol alias supported by the power protocol corresponding to the frozen data type.

8. The electricity meter data freezing system based on a dedicated data container for decentralized freezing according to claim 6, characterized in that, When the controller is configured to copy all the data of the frozen data types required in the dedicated data container from a type of cache to the dedicated data container, if a certain frozen data type is not supported in a certain power protocol, then the protocol alias field supported by the corresponding power protocol will have a fixed value and the format will be the same as the format of other alias fields.

9. The energy meter data freezing system based on a dedicated data container for decentralized freezing according to claim 6, characterized in that, The controller is configured to query the current freeze type requirements in ascending order according to the defined freeze type order, and set the corresponding bits in the bitmap in ascending order according to the current freeze type requirements.

10. The energy meter data freezing system based on a dedicated data container for decentralized freezing according to any one of claims 6-9, characterized in that, The controller is configured to receive a read frozen data instruction before the frozen data is written to the non-volatile memory, query the bitmap, and if the corresponding bit is set, directly extract the corresponding frozen data from the dedicated data container; otherwise, extract the corresponding frozen data from the non-volatile memory.

Citation Information

Patent Citations

  • Bitmap-based electric energy meter frozen data query method and device

    CN117931862A

  • Autonomous verification method for frozen data storage function of intelligent electric energy meter

    CN120578347A

  • Method of using flash memory for storing metering data

    US20050036387A1