Automatic switching method and system of main and backup redundant mechanism of electric energy meter

By introducing a redundant architecture of primary and secondary control units into the electricity meter, a seamless hot backup takeover is achieved when the primary control module fails, solving the problem of metering data interruption in traditional electricity meters under fault conditions and ensuring the continuous availability and data integrity of the metering system.

CN120928676BActive Publication Date: 2026-02-10BEIJING TENGINEER AIOT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511460525.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2026-02-10
Estimated Expiration
2045-10-14

AI Technical Summary

Technical Problem

Traditional electricity meters cannot achieve seamless hot backup takeover in cases of main control chip failure, metering channel damage, or program crash, leading to interruption or errors in metering data. Furthermore, equipment failures require manual repair, which carries risks of response delays and irrecoverability.

Method used

It adopts a redundant architecture of primary and secondary control units, and realizes automatic switching between primary and secondary control units through key data synchronization, multi-dimensional abnormal status evaluation and fault status scoring. This ensures that the secondary control unit can take over metering and communication tasks immediately when the primary control unit fails, and has the ability to perform seamless hot backup.

Benefits of technology

It enables seamless hot backup takeover in the event of a main control module failure, ensuring the continuous availability and data integrity of the metering system and avoiding response delays and data interruptions caused by manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120928676B_ABST
    Figure CN120928676B_ABST
Patent Text Reader

Abstract

The application discloses an automatic switching method and system of a main and auxiliary redundant hot backup mechanism of an electric energy meter, which comprises the following steps: firstly, synchronizing the key data of a main control unit to an auxiliary control unit, ensuring that the auxiliary control has a complete operation takeover environment when the main control fails, and being able to instantly and accurately take over all metering and communication tasks; secondly, evaluating the abnormal state of the main control unit from multiple dimensions, and calculating the fault state score of the main control unit, so as to accurately detect whether the main control unit fails; and finally, automatically switching between the main control and the auxiliary control according to the fault state score of the main control unit, when the main control fails, is offline or has a serious abnormality, the auxiliary control can automatically inherit the communication identity of the main control, take over the metering task, and report a state change event to a concentrator or a master station, so as to ensure the continuous availability and data integrity of the metering system, and thus, the hot backup takeover and state continuity protection can be realized without sensing under the condition that the main control module fails.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity metering technology, and in particular to an automatic switching method and system for a primary and secondary redundant hot backup mechanism for electricity meters, as well as electronic equipment and a computer-readable storage medium. Background Technology

[0002] With the widespread deployment of smart grids, distributed energy resources, and multi-dimensional metering systems, electricity meters have evolved from traditional single-metering devices into composite terminals integrating communication, control, and monitoring functions. In scenarios such as industrial parks, medical institutions, and large commercial facilities, electricity meters serve as the sole metering basis for electricity trading and energy consumption accounting, making their continuity, accuracy, and fault tolerance particularly critical. However, traditional electricity meters typically employ a single metering control channel. Even with some data backup capabilities, issues such as main control chip failure, metering channel damage, flash memory anomalies, or program crashes can lead to interrupted or incorrect metering, preventing timely recording and reporting of user electricity consumption data, impacting settlement and supervision. Furthermore, equipment failures require manual replacement or repair, resulting in response delays and the risk of irreversibility. Additionally, they cannot distinguish between hard meter faults and temporary communication anomalies. As a feasible research direction, introducing a dual-core redundant architecture with a main control module and a backup module within the electricity meter can achieve primary and secondary redundancy hot backup. However, how to achieve seamless hot backup takeover and continuous status protection in the event of a main control module failure remains a key unresolved issue. Summary of the Invention

[0003] This invention provides an automatic switching method and system for a primary and secondary redundant hot backup mechanism for electricity meters, as well as a computer-readable storage medium that enables seamless hot backup takeover and continuous status protection in the event of a primary control module failure.

[0004] According to one aspect of the present invention, an automatic switching method for a primary / secondary redundancy hot backup mechanism in an electricity meter is provided, comprising the following:

[0005] The key data of the main control unit is synchronized to the secondary control unit. The energy meter is equipped with a main control unit and a secondary control unit, which share signal input to form a hot backup structure with main and secondary redundancy.

[0006] Obtain multi-dimensional abnormal state evaluation indicators of the main control unit and calculate the fault state score of the main control unit;

[0007] Based on the fault status score of the main control unit, automatic switching is performed between the main control unit and the secondary control unit.

[0008] Furthermore, the fault status score of the main control unit is calculated based on the following formula:

[0009] ;

[0010] Where S represents the fault status score of the main control unit, f i (E i ) represents the standardization function, which is used to map various abnormal state evaluation indicators to the interval [0,1]. w1, w2, w3, and w4 represent weighting coefficients. E1 represents the number of lost heartbeats, E2 represents the duration of power parameter freeze, E3 represents the number of communication response failures, and E4 represents the RTC time drift.

[0011] Furthermore, the following is included before calculating the fault status score of the main control unit:

[0012] The active power difference between the main control unit and the secondary control unit is statistically analyzed over multiple sampling periods to calculate the main-secondary power difference factor. When a preset condition is met, the main-secondary power difference factor is used as an abnormal state evaluation index. The preset condition is that the main-secondary power difference factor is greater than a preset threshold and the duration exceeds a preset duration, and no user-initiated load change is detected.

[0013] Furthermore, the power difference factor between the primary and secondary systems is calculated based on the following formula:

[0014] ;

[0015] in, This represents the power difference factor between the primary and secondary components, where N represents the sliding window period length. This represents the active power sampled by the main control unit at time i. This represents the active power sampled by the secondary control unit at time i.

[0016] Furthermore, when the fault status score of the main control unit is greater than or equal to the first preset threshold and less than the second preset threshold, the secondary control unit takes over the communication channel first and continues to evaluate the fault status score of the main control unit; when the fault status score of the main control unit is greater than or equal to the second preset threshold and the main-secondary power difference factor is greater than or equal to the preset threshold, the secondary control unit initiates full takeover.

[0017] Furthermore, after automatically switching from the main control unit to the secondary control unit, the following also applies:

[0018] Set the protection lockout time and control the main control unit to enter read-only monitoring mode. When the protection lockout time is reached, if the master station issues a control command to allow the main control unit to resume, the master-slave automatic switching will be restarted.

[0019] Furthermore, if the fault status score of the main control unit is greater than or equal to a preset threshold and the duration exceeds a preset time, the main control unit is determined to be faulty, and the system automatically switches to the secondary control unit.

[0020] In addition, the present invention also provides an automatic switching system for a primary and secondary redundancy hot backup mechanism for electricity meters, comprising:

[0021] The critical data synchronization module is used to synchronize critical data from the main control unit to the secondary control unit. The energy meter contains both a main control unit and a secondary control unit, which share signal input to form a hot backup structure with primary and secondary redundancy.

[0022] The main control fault assessment module is used to obtain multi-dimensional abnormal state evaluation indicators of the main control unit and calculate the fault state score of the main control unit.

[0023] The automatic switching control module is used to automatically switch between the main control unit and the secondary control unit based on the fault status score of the main control unit.

[0024] In addition, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method described above by calling the computer program stored in the memory.

[0025] In addition, the present invention provides a computer-readable storage medium for storing a computer program for automatically switching the primary and secondary redundancy hot backup mechanism of an electricity meter, wherein the computer program executes the steps of the method described above when running on a computer.

[0026] The present invention has the following beneficial effects:

[0027] The automatic switching method of the primary and secondary redundant hot backup mechanism for electricity meters of the present invention first synchronizes the key data of the primary control unit to the secondary control unit to ensure that the secondary control unit has a complete operating takeover environment in the event of a primary control unit failure, and can take over all metering and communication tasks in a timely and accurate manner. Then, the abnormal state of the primary control unit is evaluated from multiple dimensions to calculate the fault state score of the primary control unit, which can accurately detect whether the primary control unit has failed. Finally, the automatic switching between the primary and secondary control units is realized based on the fault state score of the primary control unit. When the primary control unit fails, goes offline, or is seriously abnormal, the secondary control unit can automatically inherit its communication identity, take over the metering tasks, and report the state change event to the concentrator or master station to ensure the continuous availability and data integrity of the metering system. Thus, it can realize seamless hot backup takeover and state continuity protection in the event of a primary control module failure.

[0028] In addition, the automatic switching system of the primary and secondary redundancy hot backup mechanism of the energy meter of the present invention also has the above-mentioned advantages.

[0029] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description

[0030] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0031] Figure 1 This is a flowchart illustrating the automatic switching method of the primary and secondary redundancy hot backup mechanism of the electricity meter according to a preferred embodiment of this application.

[0032] Figure 2 This is another flowchart illustrating the automatic switching method of the primary and secondary redundancy hot backup mechanism of the electricity meter according to a preferred embodiment of this application;

[0033] Figure 3 This is a schematic diagram of the module structure of an automatic switching system for a primary and secondary redundant hot backup mechanism for electricity meters, according to another embodiment of this application. Detailed Implementation

[0034] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] Reference Figure 1 A preferred embodiment of this application provides an automatic switching method for a primary / secondary redundancy hot backup mechanism for electricity meters, including the following:

[0036] Step S1: Synchronize the key data of the main control unit to the secondary control unit. The energy meter is equipped with a main control unit and a secondary control unit, which share signal input to form a hot backup structure with main and secondary redundancy.

[0037] Step S2: Obtain multi-dimensional abnormal state evaluation indicators of the main control unit and calculate the fault state score of the main control unit;

[0038] Step S3: Based on the fault status score of the main control unit, automatically switch between the main control unit and the secondary control unit.

[0039] It is understood that the automatic switching method of the primary and secondary redundancy hot backup mechanism of the electricity meter in this embodiment first constructs a hot backup structure with primary and secondary redundancy function in the electricity meter, and synchronizes the key data of the primary control unit to the secondary control unit to ensure that the secondary control unit has a complete operating takeover environment when the primary control unit fails, and can take over all metering and communication tasks in a timely and accurate manner. Then, the abnormal state of the primary control unit is evaluated from multiple dimensions, and the fault status score of the primary control unit is calculated to accurately detect whether the primary control unit has failed. Finally, the automatic switching between the primary control unit and the secondary control unit is realized according to the fault status score of the primary control unit. When the primary control unit fails, goes offline or is seriously abnormal, the secondary control unit can automatically inherit its communication identity, take over the metering tasks, and report the status change event to the concentrator or master station to ensure the continuous availability and data integrity of the metering system. Thus, it can realize seamless hot backup takeover and status continuity protection in the event of primary control module failure.

[0040] In step S1, the present invention incorporates two independent processing control units within the energy meter: a main control unit and a secondary control unit. Both acquire synchronization signals through a unified voltage / current sampling input. The secondary control unit normally operates in a monitoring synchronization mode, not participating in actual data uploading or control tasks, but only recording key parameters in real time. The main control unit, on the other hand, operates in normal working mode, responsible for executing all metering and communication tasks. The main and secondary control units share a common analog sampling front-end, which includes a voltage signal input channel, a current signal input channel, an analog front-end isolation circuit (such as an isolation operational amplifier or differential converter), an A / D sampling path, or a shared sampling buffer. This allows for the synchronous transmission of the same energy signal to the main and secondary control units through analog isolation and multi-channel parallel sampling without adding additional voltage / current transformers, ensuring the physical equivalence of the data collected by both units. The main control unit includes a main MCU, a main metering chip, a communication module (such as carrier / NB / GPRS), an RTC real-time clock, energy metering logic, and a parameter storage unit. The secondary control unit is equipped with a secondary MCU, a secondary metering module, independent RAM, and an independent data buffer. It has metering functions equivalent to the main meter, but does not communicate externally or upload data by default. The two can be interconnected via SPI, UART, or an internal bus. The main meter periodically pushes key operating parameters, configuration data, and status indicators, while the secondary meter (i.e., the secondary control unit) continuously monitors the data from the main meter (i.e., the main control unit) and records its own sampled data and status copies for quick and seamless switching in case of main meter failure. In addition, the main / secondary control units can adopt one of the following structural forms: a single-board dual-core structure (e.g., two MCU control domains are deployed on the same PCB board to save space), a plug-in secondary meter module (the secondary meter is embedded in the main meter as a small slot module for easy replacement), or a dual-compartment integrated structure (the main and secondary compartments are separated in the physical housing, with good electrical isolation, suitable for industrial scenarios).

[0041] In addition, key data from the main control unit is periodically synchronized to the secondary control unit, including sampled values, metering results, timestamps, and communication status. This ensures that the secondary control unit has a complete operational takeover environment in the event of a main control unit failure, enabling it to take over all metering and communication tasks immediately and accurately. The synchronized key data includes metering data, operational parameter data, and configuration and identity data. Metering data includes current active power, current reactive power, current apparent power, three-phase voltage, RMS current, total energy, time-of-use energy metering value, power factor, and frequency. Operational parameter data includes current communication configuration (such as meter address, communication protocol, key, and encryption parameters), alarm flags, event registers, local time, sampling clock alignment parameters, and load status. Configuration and identity data includes meter number, terminal code, assigned transformer area code, communication key (which can be encrypted and stored for transmission), and status identifiers (such as operation / maintenance mode switching). Synchronization can be achieved through a master controller actively pushing data while the slave controller passively confirms it. For example, the master controller packages the aforementioned key data into a register snapshot structure at each set synchronization cycle (e.g., every 1 second) and transmits it to the slave controller via interfaces such as SPI / I²C / UART / shared memory. The slave controller parses the snapshot structure and writes it into its own mirror register area. A timeout and retransmission mechanism for abnormal breakpoints are set during the synchronization process to prevent data asynchrony. Additionally, the slave controller can independently cache its locally sampled data as a backup. Furthermore, to ensure data consistency, a CRC16 checksum can be added to the synchronized data before transmission. The slave controller returns an acknowledgment signal after each successful synchronization. If packet loss exceeds a set threshold (e.g., 3 times), the slave controller automatically marks it as "untrustworthy" and temporarily disallows takeover until the status recovers or the master station intervenes. Optionally, to avoid overloading the master controller due to frequent synchronization, a differential synchronization mechanism can be set up. Full synchronization is only triggered when the change in key fields exceeds the threshold; otherwise, only status bits and heartbeat information are transmitted, reducing the burden on the master controller.

[0042] In addition, in step S2, the secondary control unit acquires multi-dimensional abnormal state evaluation indicators of the primary control unit. By fusing information from multiple sources, including heartbeat signal monitoring, communication anomaly detection, register update interrupts, and hardware self-test feedback, it calculates the fault state score of the primary control unit, enabling accurate detection of whether the primary control unit has malfunctioned. Specifically, the fault state score of the primary control unit is calculated based on the following formula:

[0043] ;

[0044] Where S represents the fault status score of the main control unit, f i (E iThe function f represents the standardization function, used to map various abnormal state evaluation indicators to the interval [0,1]. w1, w2, w3, and w4 represent weighting coefficients, which are set empirically, with w1+w2+w3+w4=1. E1 represents the number of lost heartbeats, E2 represents the duration of power parameter freeze, E3 represents the number of communication response failures, and E4 represents the RTC time drift. Additionally, the standardization function f... i (E i A piecewise linear strategy can be adopted, for example, , , , .

[0045] Furthermore, in step S3, if the fault status score of the main control unit calculated in step S2 is greater than or equal to a preset threshold and the duration exceeds a preset time, the main control unit is determined to be faulty, and the system automatically switches to the secondary control unit. Otherwise, no switch is performed; the main control unit continues to operate, while the secondary control unit continues to monitor. Additionally, the entire switchover process includes event reporting and local log retention. After taking over, the secondary control unit immediately sends a "main / secondary switchover event" frame to the concentrator or main station, along with a fault score, a status snapshot summary, and a takeover timestamp, ensuring that the upper-level system is traceable, auditable, and schedulable. Both the master and slave controllers have local log buffers to record critical status change events (such as heartbeat loss, communication anomalies, and master-slave switchover events). Each log entry includes a timestamp, event type, master / slave status, voltage, current, and other summary data. Logs are written cyclically, automatically overwriting the oldest record to save storage space. Once a master-slave role switch occurs, the slave controller will send a "master-slave switchover event" message to the concentrator or master station after completing its identity activation. This is used by the backend system to identify the source of the fault, record the switchover time and cause, and ensure that subsequent system analysis and auditing have a basis. Furthermore, during the switchover process, the slave controller must ensure that the synchronization error between its local clock and the master controller is within a controllable range. It needs to periodically align using the timestamp reported by the master controller and perform local time synchronization before the switchover to ensure data timing consistency. If the local RTC deviation is too large (e.g., >1s), time correction logic is triggered.

[0046] Optionally, to improve the accuracy and resilience of hot backup switching of the main / secondary control unit, and to address the problem of "misjudged main control unit abnormality" caused by sudden changes in power user load, equipment fluctuations, or short-term interference, the following should be included before calculating the fault status score of the main control unit:

[0047] The active power difference between the main control unit and the secondary control unit is statistically analyzed over multiple sampling periods to calculate the main-secondary power difference factor. When a preset condition is met, the main-secondary power difference factor is used as an abnormal state evaluation index. The preset condition is that the main-secondary power difference factor is greater than a preset threshold and the duration exceeds a preset duration, and no user-initiated load change is detected.

[0048] Specifically, based on the continuous monitoring of the main control unit's status by the secondary control unit, when the main control unit experiences communication anomalies, CRC errors, or heartbeat terminal issues, a "main-secondary power difference curve" is constructed. By performing statistical fluctuation analysis on the active power differences between the main and secondary control units over multiple recent sampling periods, the main-secondary power difference factor is calculated based on the following formula:

[0049] ;

[0050] in, This represents the power difference factor between the primary and secondary components, where N represents the sliding window period length. This represents the active power sampled by the main control unit at time i. This represents the active power sampled by the secondary control unit at time i.

[0051] If the power difference factor between the main and auxiliary components Greater than the preset threshold (For example, a value of 5% of rated power), and the duration exceeds a preset time (which can be set to 3 seconds), and no user-initiated load change is detected, i.e., no change in the load time or timestamp at the back end of the meter is detected, then the primary / secondary power difference factor is activated as an abnormal state evaluation indicator and included in the fault state score calculation of the primary control unit; otherwise, the primary / secondary power difference factor is not used as an abnormal state evaluation indicator in the fault state score calculation of the primary control unit. Furthermore, when the primary / secondary power difference factor is included as an abnormal state evaluation indicator in the fault state score calculation of the primary control unit, the calculation formula is: E5 represents the power difference factor between the primary and secondary components, and the corresponding normalization function can be selected. The value of its weight coefficient w5 is the same as or similar to that of w3. In addition, at this time, it is necessary to redetermine the values ​​of the five weight coefficients w1, w2, w3, w4, and w5, for example, by re-determining them through normalization.

[0052] It is understandable that when no user-initiated load change is detected, the power difference between the main and secondary controllers should be small. If the power difference between the main and secondary controllers is large and lasts for more than a preset duration, it means that the main controller may have failed. Otherwise, it is considered to be a short-term interference. Therefore, by introducing a main-secondary power difference factor, this invention can effectively reduce the risk of false triggering of hot backup switching due to short-term interference, and enhance the robustness and accuracy of the secondary controller in judging the failure of the main controller.

[0053] At this point, when the fault status score of the main control unit is greater than or equal to the first preset threshold and less than the second preset threshold, the secondary control unit first takes over the communication channel, keeping the table number, communication parameters, and security key unchanged, and restores the data upload function through the independent port, and continues to evaluate the fault status score of the main control unit, that is, continues to execute step S2; when the fault status score of the main control unit is greater than or equal to the second preset threshold and the main-secondary power difference factor is greater than or equal to a preset threshold (this preset threshold is greater than the aforementioned preset threshold)... When the rated power is 8%, the secondary control unit initiates full takeover, loads the most recent synchronization register snapshot, reactivates the metering logic and RTC clock, and completes the seamless migration of the metering task. In addition, to ensure data consistency, before taking over the metering task, the secondary control unit aligns the current sampled value with the last state of the primary control unit. When the deviation between the two exceeds 5%, a filtering transition algorithm is automatically activated to smoothly enter the running state.

[0054] It is understandable that once a fault is detected in the main controller, the secondary controller needs to immediately execute the takeover process. This typically requires completing the following actions within a very short time (usually 200ms): register state loading, RTC time locking, communication channel initialization, and reporting time frames, to ensure the continuous availability and data integrity of the metering system. The conventional takeover method in this field is a one-step takeover, where the secondary controller simultaneously takes over both the communication and metering channels. However, as a widely used end-side device, the energy meter typically uses relatively inexpensive electronic components due to cost considerations. The secondary controller's MCU processing power is limited, making it difficult to simultaneously take over communication and metering tasks within such a short time. This can easily lead to takeover failures, making it difficult to guarantee the continuous availability and data integrity of the metering system. This invention employs a step-by-step takeover mechanism. When the fault status score of the main controller exceeds a lower preset threshold, the secondary controller first takes over the communication channel to ensure timely data upload and the continuous availability of the metering system. It continues to monitor the abnormal status of the main controller. When the fault status score of the main controller exceeds a higher preset threshold and the main-secondary power difference factor increases to a larger preset threshold (meaning the main-secondary power difference continues to increase), the secondary controller then takes over the metering channel to ensure the accuracy of data metering. Compared to the existing one-step takeover mechanism, this invention prioritizes the continuous availability and data integrity of the metering system. The first step is to take over the communication task, with metering accuracy as a secondary consideration. The second step is to take over the metering task, ensuring the continuous availability and data integrity of the metering system, thereby guaranteeing uninterrupted power metering.

[0055] Optionally, after the secondary control unit takes over the communication channel, if the fault status score of the primary control unit is not greater than or equal to the second preset threshold, or the primary-secondary power difference factor is not greater than or equal to the preset threshold, the primary control unit may continue to perform the metering task, or the secondary control unit may take over the metering task.

[0056] Optional, such as Figure 2 As shown, when automatically switching from the main control unit to the secondary control unit, the automatic switching method of the primary and secondary redundancy hot backup mechanism of the energy meter also includes the following:

[0057] Step S4: Set the protection lockout time and control the main control unit to enter the read-only monitoring state. When the protection lockout time is reached, if the master station issues a control command to allow the main control unit to recover, the master-slave automatic switching will be restarted.

[0058] Specifically, to prevent the main control unit from being counter-controlled after a erroneous recovery, this invention sets a protection lockout time, with a default value of 30 minutes. During the lockout period, the main control unit enters a read-only listening state and can only perform self-tests. It does not have the authority to take over again. After the protection lockout time has expired, if the main station issues a control command that allows the main control unit to recover, the automatic switching between the main and secondary units will be restarted, that is, the main control unit will work while the secondary control unit listens.

[0059] In addition, such as Figure 3 As shown, another embodiment of the present invention also provides an automatic switching system for a primary / secondary redundancy hot backup mechanism for electricity meters, preferably employing the automatic switching method for the primary / secondary redundancy hot backup mechanism for electricity meters as described above, comprising:

[0060] The critical data synchronization module is used to synchronize critical data from the main control unit to the secondary control unit. The energy meter contains both a main control unit and a secondary control unit, which share signal input to form a hot backup structure with primary and secondary redundancy.

[0061] The main control fault assessment module is used to obtain multi-dimensional abnormal state evaluation indicators of the main control unit and calculate the fault state score of the main control unit.

[0062] The automatic switching control module is used to automatically switch between the main control unit and the secondary control unit based on the fault status score of the main control unit.

[0063] It is understood that the automatic switching system of the primary and secondary redundancy hot backup mechanism of the electricity meter in this embodiment first constructs a hot backup structure with primary and secondary redundancy functions in the electricity meter, and synchronizes the key data of the primary control unit to the secondary control unit to ensure that the secondary control unit has a complete operating takeover environment when the primary control unit fails, and can take over all metering and communication tasks in a timely and accurate manner. Then, the abnormal state of the primary control unit is evaluated from multiple dimensions, and the fault status score of the primary control unit is calculated to accurately detect whether the primary control unit has failed. Finally, the automatic switching between the primary control unit and the secondary control unit is realized according to the fault status score of the primary control unit. When the primary control unit fails, goes offline or is seriously abnormal, the secondary control unit can automatically inherit its communication identity, take over the metering tasks, and report the status change event to the concentrator or master station to ensure the continuous availability and data integrity of the metering system. Thus, it can realize seamless hot backup takeover and status continuity protection in the event of primary control module failure.

[0064] In addition, the automatic switching system of the primary and secondary redundancy hot backup mechanism of the energy meter also includes:

[0065] The protection lockout module is used to set the protection lockout time and control the main control unit to enter a read-only monitoring state. When the protection lockout time is reached, if the master station issues a control command to allow the main control unit to resume, the master-slave automatic switching will be restarted.

[0066] In addition, another embodiment of the present invention provides an electronic device including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method described above by calling the computer program stored in the memory.

[0067] In addition, another embodiment of the present invention provides a computer-readable storage medium for storing a computer program for automatically switching the primary and secondary redundancy hot backup mechanism of an electricity meter, wherein the computer program executes the steps of the method described above when running on a computer.

[0068] Common computer-readable storage media include: floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs, any other optical media, punch cards, paper tape, any other physical media with perforated patterns, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash erasable programmable read-only memory (FLASH-EPROM), any other memory chips or cartridges, or any other media readable by a computer. Instructions may further be transmitted or received by a transmission medium. The term transmission medium can include any tangible or intangible medium used to store, encode, or carry instructions for execution by a machine, and includes digital or analog carrier communication signals or intangible media that facilitate communication of such instructions. Transmission media include coaxial cables, copper wires, and optical fibers, which contain conductors for transmitting a bus of computer data signals.

[0069] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0070] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0071] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0072] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0073] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0074] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

[0075] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An automatic switching method for a primary / secondary redundancy hot backup mechanism in an electricity meter, characterized in that, Includes the following: The key data of the main control unit is synchronized to the secondary control unit. The energy meter is equipped with a main control unit and a secondary control unit, which share signal input to form a hot backup structure with main and secondary redundancy. Obtain multi-dimensional abnormal state evaluation indicators of the main control unit and calculate the fault state score of the main control unit; Based on the fault status score of the main control unit, automatic switching is performed between the main control unit and the secondary control unit; The following should be included before calculating the fault status score of the main control unit: The active power difference between the main control unit and the auxiliary control unit is statistically analyzed over multiple sampling periods to calculate the main-auxiliary power difference factor. When a preset condition is met, the main-auxiliary power difference factor is used as an abnormal state evaluation index. The preset condition is that the main-auxiliary power difference factor is greater than 5% of the rated power and lasts for more than 3 seconds, and no user-initiated load jump is detected, i.e. no change in the load time or timestamp of the back end of the meter is detected.

2. The automatic switching method for the primary and secondary redundant hot backup mechanism of the energy meter as described in claim 1, characterized in that, The fault status score of the main control unit is calculated based on the following formula: ; in, S This indicates the fault status score of the main control unit. f i ( E i ) represents a standardization function used to map various abnormal state evaluation indicators to the interval [0,1]. w 1. w 2. w 3. w 4 represents the weighting coefficient. E 1 indicates the number of heartbeats lost. E 2 indicates the duration of the power parameter freeze. E 3 indicates the number of communication response failures. E 4 indicates the RTC time drift.

3. The automatic switching method for the primary and secondary redundant hot backup mechanism of the energy meter as described in claim 1, characterized in that, The power difference factor between the primary and secondary components is calculated based on the following formula: ; in, This represents the power difference factor between the primary and secondary components, where N represents the sliding window period length. express i The active power sampled by the main control unit at any given time. express i The active power sampled by the secondary control unit at any given time.

4. The automatic switching method for the primary and secondary redundant hot backup mechanism of the energy meter as described in claim 1, characterized in that, When the fault status score of the main control unit is greater than or equal to the first preset threshold and less than the second preset threshold, the secondary control unit takes over the communication channel first and continues to evaluate the fault status score of the main control unit; when the fault status score of the main control unit is greater than or equal to the second preset threshold and the main-secondary power difference factor is greater than or equal to 8% of the rated power, the secondary control unit initiates full takeover.

5. The automatic switching method for the primary and secondary redundant hot backup mechanism of the energy meter as described in claim 1, characterized in that, After automatically switching from the main control unit to the secondary control unit, the following content is also included: Set the protection lockout time and control the main control unit to enter read-only monitoring mode. When the protection lockout time is reached, if the master station issues a control command to allow the main control unit to resume, the master-slave automatic switching will be restarted.

6. The automatic switching method for the primary and secondary redundant hot backup mechanism of the electricity meter as described in claim 1, characterized in that, If the fault status score of the main control unit is greater than or equal to the preset threshold and the duration exceeds the preset time, the main control unit is determined to be faulty, and the operation is automatically switched to the secondary control unit.

7. An automatic switching system for a primary / secondary redundancy hot backup mechanism of an electricity meter, comprising the automatic switching method for the primary / secondary redundancy hot backup mechanism of an electricity meter as described in any one of claims 1 to 6, characterized in that, include: The critical data synchronization module is used to synchronize critical data from the main control unit to the secondary control unit. The energy meter contains both a main control unit and a secondary control unit, which share signal input to form a hot backup structure with primary and secondary redundancy. The main control fault assessment module is used to obtain multi-dimensional abnormal state evaluation indicators of the main control unit and calculate the fault state score of the main control unit. The automatic switching control module is used to automatically switch between the main control unit and the secondary control unit based on the fault status score of the main control unit.

8. An electronic device, characterized in that, The method includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method as described in any one of claims 1 to 6 by calling the computer program stored in the memory.

9. A computer-readable storage medium for storing a computer program for automatically switching between primary and secondary redundant hot backup mechanisms in electricity meters, characterized in that, The computer program, when run on a computer, performs the steps of the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Redundancy computer control system

    CN116880151A