Dual-computer redundancy control method and system based on negotiation mechanism and data recovery strategy

By adopting a dual-computer redundant control method based on negotiation mechanism and data repair strategy in the power system, the problem of loss of power data in the event of failure or abnormal situations is solved, and the dual-computer redundant acquisition and data recovery of power data is realized, improving data integrity and system reliability.

CN119853288APending Publication Date: 2025-04-18SHIJIAZHUANG KE ELECTRIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510016567.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In power systems, power data is easily lost when equipment failure or communication is abnormal, resulting in the power consumption information collection system being unable to obtain complete power data, affecting the normal operation and management of the power system.

Method used

A dual-machine redundancy control method based on a negotiation mechanism and a data repair strategy is adopted. Two electrical energy remote terminals are set as a dual-machine redundancy control system to monitor the communication status of the host, and a switching command is generated when communication is abnormal, instructing the backup machine to take over the meter reading rights of the communication faulty meter, and recover data through the curve repair strategy.

Benefits of technology

The redundant acquisition of power data is realized for dual-computer power data, which improves the integrity and reliability of power data, avoids data loss caused by failures, and improves the operating efficiency and management level of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853288A_ABST
    Figure CN119853288A_ABST
Patent Text Reader

Abstract

The invention provides a dual-computer redundancy control method and system based on a negotiation mechanism and a data recovery strategy, and relates to the technical field of power grids. According to the invention, two electric energy remote terminals are set as a dual-computer redundancy control system. The communication state of the host is monitored, when the host communication is abnormal, a first switching instruction is generated based on the abnormal type of the host and the communication fault ammeter, the standby is instructed to take over the meter reading right of the communication fault ammeter, meter reading of the standby is achieved when the host fails, data loss caused by the failure is avoided, and therefore dual-computer redundancy collection of electric quantity data is achieved; the integrity of electric quantity data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric power grid, and in particular to a dual-machine redundant control method and system based on a negotiation mechanism and a data repair strategy. Background Art

[0002] In today's power supply and management system, the intelligence and informationization of the power system have become an indispensable and important part. The core of this trend lies in the accurate and efficient collection and processing of power consumption information, among which the collection of meter power is the cornerstone of the entire power consumption information management. With the advancement of technology, smart meters have gradually become popular. They can not only record users' power consumption in real time, but also have remote communication capabilities, which makes it possible to realize remote monitoring and management of power systems.

[0003] In the process of intelligentization of power systems, the power consumption information collection system plays a vital role. By integrating advanced communication technology, data processing technology and information technology, the system can realize the real-time collection, transmission, storage and analysis of massive power consumption data. The realization of this process is inseparable from the close cooperation between smart meters and electric energy remote terminals. As the direct source of power users' power consumption information, the accuracy and integrity of the data of smart meters are directly related to the operating efficiency and management level of the power system. The electric energy remote terminal serves as a bridge between the smart meter and the power consumption information collection system, responsible for summarizing the power information collected by the meter and transmitting it to the system center, thereby realizing comprehensive monitoring of the power consumption of the entire power system.

[0004] However, in actual applications, this process of power collection and transmission is not perfect. At present, the power system generally adopts the method of connecting the electric energy remote terminal to the smart meter and the power consumption information collection system to realize the collection and transmission of power information. Although this method has improved the automation of power information collection to a certain extent, the integrity of power information is difficult to guarantee in the case of equipment failure or communication abnormality. Specifically, when the electric energy remote terminal fails, the meter fails, or the communication line is interrupted, the power information may be lost due to the inability to transmit in time, resulting in the inability of the power consumption information collection system to obtain complete power data.

[0005] The loss of electricity data will not only affect the normal operation and management of the power system, but may also cause unnecessary economic losses to power users. For example, in the process of electricity bill settlement, if the electricity data is incomplete, it may lead to inaccurate electricity bill calculation, which in turn leads to disputes between users and power companies. In addition, the lack of electricity data may also affect advanced applications such as load forecasting, energy scheduling and optimization of the power system, thereby reducing the overall operating efficiency and reliability of the power system. Therefore, how to ensure that electricity information can still be fully and accurately collected and transmitted in the event of equipment failure or communication anomaly has become a key issue that needs to be solved in the current process of intelligent power system. Summary of the invention

[0006] The present invention provides a dual-machine redundant control method and system based on a negotiation mechanism and a data repair strategy, which can realize dual-machine redundant collection of electric quantity data and improve the integrity of the electric quantity data.

[0007] In the first aspect, the present invention provides a dual-machine redundant control method based on a negotiation mechanism and a data repair strategy, which is applied to an electric power collection system. The electric power collection system includes two redundant electric power remote terminals and a plurality of electric meters connected to the electric power remote terminals. The control method includes: if the first electric power remote terminal is a host, the host monitors the communication status of the host; wherein the first electric power remote terminal is any electric power remote terminal; if the communication status of the host is a communication abnormality, the abnormal type of the host and the communication fault electric meter are determined; the abnormal types include meter failure, electric power remote terminal failure and communication line failure; based on the abnormal type, a first switching instruction is generated, and the first switching instruction is used to instruct the second electric power remote terminal to take over the meter reading right of the communication fault electric meter.

[0008] In a possible implementation, the control method also includes: if the first electric energy remote terminal is a backup machine, the backup machine monitors the communication line between the host machine and the backup machine; if the communication status of the host machine is monitored to be abnormal, a request to take over instruction is sent to the host machine; if a request to take over response from the host machine is received, based on the request to take over response, the operation instruction of the backup machine is determined, and the request to take over response includes confirmation of takeover or refusal to take over; if no request to take over response from the host machine is received, the operation instruction of the backup machine is determined to be a second switching instruction, and the second switching instruction is to take over the meter reading rights of multiple meters.

[0009] In one possible implementation, based on the request to take over response, the operation instruction of the standby machine is determined, including: if the request to take over response is to confirm take over, then the operation instruction of the standby machine is determined to be the second switching instruction; if the request to take over response is to refuse to take over, the node with abnormal host communication is monitored, and timing is started to obtain the timing duration; if the timing duration is greater than the set duration, and there is no data transmission at the node with abnormal host communication within the timing duration, then the operation instruction of the standby machine is determined to be the third switching instruction, and the third switching instruction is to take over the meter reading rights of the electric meter related to the node with abnormal host communication.

[0010] In a possible implementation, the control method further includes: if the communication state of the host is converted from abnormal communication to normal communication, the host detects whether the stored data is missing; if the host detects that the data is missing, the target meter and target time period corresponding to the missing data are determined; based on the target meter and time period corresponding to the missing data, a data recovery instruction is generated; the data recovery instruction is sent to the standby machine; the data recovery response sent by the standby machine is received, and the data recovery response includes that the standby machine has no corresponding data, or the electric quantity data of the target meter within the target time period; if the data recovery response includes the electric quantity data of the target meter within the target time period, the data is recovered based on the data recovery response and the stored data of the host, and the recovered electric quantity data is stored. If the data recovery response is that the standby machine has no corresponding data, the electric quantity data of the host is repaired based on the curve repair strategy, and the repaired electric quantity data is stored.

[0011] In a possible implementation, the power data of the host is repaired based on a curve repair strategy, including: dividing the power data in the historical period before the fault moment to obtain multi-day metering data; dividing the daily metering data into time intervals to obtain metering data for multiple time intervals in each day; calculating the average growth rate of power in each time interval based on the metering data for multiple time intervals in each day; calculating the power growth value of each time interval during the fault period based on the total fault duration, the increased power during the fault period, and the average growth rate of power in each time interval; invalidating the valid bits of the data for each time interval during the fault period; repairing the power data of the host based on the power growth value of each time interval during the fault period and the valid bits of the data for each time interval to obtain the repaired power data.

[0012] In a possible implementation, the control method also includes: making a rationality judgment on the storage data of the host or the backup machine to obtain a judgment result; if the judgment result is that the data is reasonable, setting the check bit of the stored data to the reasonable data; if the judgment result is that the data is unreasonable, determining the check bit of the storage data of the host and the backup machine based on the abnormal data and the storage data of the host and the backup machine.

[0013] In one possible implementation, a rationality judgment is performed on the storage data of the host or standby machine to obtain a judgment result, including: dividing the stored data into time intervals to obtain power data of multiple time intervals; calculating the power increment value and the average growth rate of the power increment value in each time interval; determining the expected growth rate based on the average growth rate of the power increment value; if the power increment value in a certain time interval is negative, the power data in the time interval is determined to be abnormal data; if the average growth rate in a certain time interval is greater than N times the expected growth rate, the power data in the time interval is determined to be abnormal data; if there is no abnormal data in the stored data, the judgment result is determined to be that the data is reasonable; if there is no abnormal data in the stored data, the judgment result is determined to be that the data is unreasonable, and a judgment result is generated based on the abnormal data and the time interval corresponding to the abnormal data.

[0014] In one possible implementation, based on the abnormal data and the storage data of the host and the standby machine, the check bits of the storage data of the host and the standby machine are determined, including: based on the abnormal time interval corresponding to the abnormal data, determining the first data of the abnormal time interval in the host data and the second data corresponding to the abnormal time interval in the standby machine data; comparing whether the first data and the second data are consistent; if the first data and the second data are consistent, determining that the measurement data of the abnormal time interval is normal data; if the first data and the second data are inconsistent, comparing the reasonable probabilities of the first data and the second data; and determining the measurement data with a high reasonable probability as normal data.

[0015] In a possible implementation, the control method further includes: judging the integrity and rationality of the metering data of the target meter; if the metering data of the target meter is complete and reasonable, sending the metering data of the target meter to the power information collection system.

[0016] In the second aspect, an embodiment of the present invention provides a dual-machine redundant control device based on a negotiation mechanism and a data repair strategy, the device comprising: a communication module and a processing module, the communication module being used to monitor the communication status of the host; the processing module being used to determine the abnormality type of the host and the communication fault meter if the communication status of the host is a communication abnormality; the abnormality types include meter failure, electric energy remote terminal failure and communication line failure; based on the abnormality type, a first switching instruction is generated, the first switching instruction is used to instruct the second electric energy remote terminal to take over the meter reading right of the communication fault meter.

[0017] In the third aspect, an embodiment of the present invention provides a dual-machine redundant control system based on a negotiation mechanism and a data repair strategy, comprising two redundantly arranged electric energy remote terminals, and a plurality of electric meters connected to the electric energy remote terminals; the electric energy remote terminals include an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, the processor is used to call and run the computer program stored in the memory to execute the steps of the method described in the first aspect and any possible implementation method of the first aspect.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the steps of the method described in the first aspect and any possible implementation method of the first aspect are implemented.

[0019] The present invention provides a dual-machine redundant control method and system based on a negotiation mechanism and a data repair strategy. The present invention uses two electric energy remote terminals to set up a dual-machine redundant control system. The communication status of the host is monitored. When the host communication is abnormal, based on the abnormal type of the host and the communication fault electric meter, a first switching instruction is generated to instruct the standby machine to take over the meter reading right of the communication fault electric meter, so that the standby machine can read the meter when the host fails, avoiding data loss caused by the failure, thereby realizing dual-machine redundant collection of electric quantity data and improving the integrity of the electric quantity data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0021] Figure 1 This is a schematic diagram of the architecture of a currently existing power collection system;

[0022] Figure 2 It is a schematic diagram of the architecture of a dual-channel dual-machine redundant system provided by an embodiment of the present invention;

[0023] Figure 3 It is a schematic diagram of a fault handling process of a dual-channel dual-machine redundant system provided by an embodiment of the present invention;

[0024] Figure 4 It is a schematic diagram of the architecture of a single-channel dual-machine redundant system provided by an embodiment of the present invention;

[0025] Figure 5It is a schematic diagram of a fault handling process of a single-channel dual-machine redundant system provided by an embodiment of the present invention;

[0026] Figure 6 It is a flow chart of a dual-machine redundancy control method based on a negotiation mechanism and a data repair strategy provided by an embodiment of the present invention;

[0027] Figure 7 This is a schematic diagram of a dual-machine redundant master-slave negotiation mechanism provided by an embodiment of the present invention;

[0028] Figure 8 This is a schematic diagram of a flow chart of rationality determination of electric quantity data provided by an embodiment of the present invention;

[0029] Fig. 9 It is a structural schematic diagram of a dual-machine redundant control device based on a negotiation mechanism and a data repair strategy provided by an embodiment of the present invention;

[0030] Fig.10 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0032] In the description of the present invention, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" and "plurality" refer to two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.

[0033] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.

[0034] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include other steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.

[0035] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will be described through specific embodiments in conjunction with the accompanying drawings of the present invention.

[0036] As described in the background technology, Figure 1 As shown in the figure, most of the electric energy remote terminals for current power system data collection and transmission only have the function of single collection, which cannot meet the technical requirements of "redundant configuration, mutual hot standby". When the equipment communication fails, data will be lost, and the data integrity of the electric energy curve cannot be guaranteed. A small number of manufacturers can realize the master-slave machine switching, but the master-slave switching requires the dispatch staff to manually issue instructions, which wastes a lot of manpower; and the manual master-slave switching has poor timeliness. If the failure cannot be discovered and switched to the standby machine in time, some data may also be lost.

[0037] In order to solve the above technical problems, the present invention proposes a "master-standby machine negotiation meter reading mechanism" to realize fault monitoring and automatic switching between the master and standby machines, without the need for manual supervision. If it is applied and promoted, it can greatly save labor costs. In addition, the "curve repair strategy" proposed in the present invention, if the meter failure causes data loss, after the fault is restored, the data during the fault period before the fault is restored can be simulated and repaired, so that the electric energy curve at the master station is more coherent, which has certain positive significance for the load analysis at the master station.

[0038] In the embodiment of the present invention, the host and the hot standby host establish a connection through Ethernet TCP. With a dedicated communication protocol, the clock synchronization and data synchronization of the main and standby collectors can be realized. The data types include bottom data, incremental data, call data, frozen data and events, etc., and the transmission and feedback of dual-machine switching matching commands are supported. The dedicated protocol is divided into two parts, the server end and the client end. The main and standby collectors have both the server end and the client end to realize automatic communication and passive response between the two parties.

[0039] like Figure 2 As shown, the embodiment of the present invention provides a dual-channel dual-machine redundant system. In the dual-channel dual-machine redundant system, the main and standby collectors use different 485 channels respectively, and both collectors have meter reading rights, and can independently collect meter data.

[0040] based on Figure 2The dual-channel dual-machine redundant system shown in Figure 3 As shown, assuming that the system supports load curve recording, the various types of faults in the system are as follows.

[0041] Communication line failure: If a single RS485 communication line fails, data from a certain host is lost. The load curve data of the meter on the faulty line on the host is synchronously read from the hot standby host through a dedicated communication protocol until the line failure is restored; other meters on the host with normal communication are still collected normally through RS485. If a dual RS485 line failure causes data loss on two hosts, the two hosts will each collect the data lost during the failure through different RS485 buses after the failure is restored.

[0042] Electricity meter failure: If the electricity meter itself fails and data is missing, the load curve data in the electricity meter is incomplete. Both hosts cannot collect curve data, and they cannot collect additional data. The "curve repair strategy" needs to be executed to restore the load curve data.

[0043] Electric energy remote terminal failure: If a host loses power / failure and causes data loss, after the failed host is restored, the hot standby host will synchronously read the missing data through a dedicated communication protocol. If both hosts fail, after the failure is restored, the two hosts will each collect the data lost during the failure through different RS485 buses.

[0044] Assuming that the system does not support load curve recording, the various faults of the system are as follows: The two machines collect the real-time data of the electric meter through a 485 and store the replacement load curve regularly.

[0045] Communication line failure: If the data of a meter in a host is missing due to a RS485 communication line failure, the timed storage data of the meter will be read synchronously from the hot standby host through a dedicated communication protocol until the line failure is restored; other meters with normal communication on the host will still collect data normally through RS485. If the data of two hosts is missing due to a dual-channel RS485 line failure, the "curve recovery strategy" will be executed to repair the curve data after the failure is restored to ensure the continuity of the curve data.

[0046] Meter failure: If the meter fails and data is missing, both hosts cannot collect data and cannot collect data again. You need to execute the "curve repair strategy" to restore the curve data.

[0047] Electric energy remote terminal failure: If a host loses power / failure and causes data loss, after the failed host is restored, the missing data is synchronously read on the hot standby host through a dedicated communication protocol. If both hosts fail, the "curve recovery strategy" is executed after the failure is restored to repair the curve data and ensure the continuity of the curve data.

[0048] like Figure 4 As shown, the embodiment of the present invention provides a single-channel dual-machine redundant system. If there is only one 485 channel on site, when it is connected to the collector, the two hosts are connected to all 485 buses in parallel, and the "master-standby negotiation meter reading mechanism" determines which device has the meter reading authority.

[0049] based on Figure 4 The single-channel dual-machine redundant system shown in Figure 5 As shown, assuming that the system meter has only one communication interface and supports load curve recording, the various faults of the system are as follows.

[0050] Communication line failure: If the RS485 communication line fails and data is lost, both hosts will be unable to collect data. After the communication line is restored, the master and standby will negotiate, the master will collect the load curve data, and the standby will read the meter data from the master through a dedicated communication protocol.

[0051] Meter failure: If the meter fails and data is missing, the load curve data in the meter is incomplete. Both hosts cannot collect the curve data, and cannot collect it again. The "curve repair strategy" needs to be executed to restore the load curve data.

[0052] Failure of remote terminal for electric energy: If one host fails, the “master-slave negotiation meter reading mechanism” will be used to switch to the hot standby host to collect data on the meter load curve. After the host is restored, the load curve data during the failure period will be synchronously read on the hot standby host through a dedicated communication protocol. If both hosts fail at the same time and data is missing, the master-slave negotiation will be carried out after the failure is restored, and the host will collect the load curve data, and the standby will read the meter data from the host through a dedicated communication protocol.

[0053] Assume that the system meter has only one communication interface and does not support load curve recording. If one host fails, the "master-standby negotiation meter reading mechanism" is used to switch to the hot standby host for data collection and transfer of the real-time data of the meter. After the host is restored, the transfer data during the failure period is synchronously read on the hot standby host through a dedicated communication protocol. Data loss caused by communication line failure, meter failure or simultaneous failure of two hosts means that both hosts cannot collect data. It is necessary to execute the "curve repair strategy" to restore the curve data.

[0054] based on Figure 2 and Figure 3 The dual-machine redundant system shown in Figure 6 and Figure 7 As shown, the embodiment of the present invention provides a dual-machine redundancy control method based on a negotiation mechanism and a data repair strategy. The method includes steps S101-S105.

[0055] S101. If the first electric energy remote terminal is a host, the host monitors the communication status of the host.

[0056] Among them, the first electric energy remote terminal is any electric energy remote terminal.

[0057] S102: If the communication status of the host is abnormal, determine the abnormality type of the host and the communication fault meter.

[0058] In the embodiment of the present application, the abnormal types include meter failure, electric energy remote terminal failure and communication line failure.

[0059] S103: Generate a first switching instruction based on the abnormal type of the host and the communication fault electric meter.

[0060] In the embodiment of the present application, the first switching instruction is used to instruct the second electric energy remote terminal to take over the meter reading right of the communication fault electric meter.

[0061] The present invention provides a dual-machine redundant control method based on a negotiation mechanism and a data repair strategy, which is set as a dual-machine redundant control system through two electric energy remote terminals. The communication status of the host is monitored, and when the host communication is abnormal, based on the abnormal type of the host and the communication fault electric meter, a first switching instruction is generated to instruct the standby machine to take over the meter reading right of the communication fault electric meter, so as to realize the standby machine meter reading when the host fails, avoid data loss caused by the failure, thereby realizing dual-machine redundant collection of electric quantity data and improving the integrity of electric quantity data.

[0062] Optional, such as Figure 7 As shown, the dual-machine redundancy control method based on the negotiation mechanism and the data repair strategy provided by the embodiment of the present invention further includes steps S201-S204.

[0063] S201. If the first electric energy remote terminal is a backup machine, the backup machine monitors the communication line between the host machine and the backup machine.

[0064] S202: If the communication status of the host is monitored to be abnormal, a takeover request instruction is sent to the host.

[0065] S203: If a takeover request response is received from the host, an operation instruction of the standby machine is determined based on the takeover request response.

[0066] In some embodiments, the request for takeover response includes confirming the takeover or denying the takeover.

[0067] As a possible implementation manner, step S203 may be specifically implemented as steps S2031 - S2032 .

[0068] S2031: If the response to the takeover request is a takeover confirmation, determine that the operation instruction of the standby machine is a second switching instruction.

[0069] S2032: If the response to the takeover request is a takeover refusal, execute steps A1-A2.

[0070] A1. Monitor the node with abnormal host communication and start timing to obtain the timing duration;

[0071] A2. If the timing duration is greater than the set duration, and the node with abnormal host communication has no data transmission within the timing duration, it is determined that the operation instruction of the standby machine is the third switching instruction.

[0072] In some embodiments, the third switching instruction is to take over the meter reading rights of the electric meter related to the node with abnormal communication with the host.

[0073] S204: If no takeover response is received from the host, determine that the operation instruction of the standby machine is a second switching instruction.

[0074] In some embodiments, the second switching instruction is to take over the meter reading rights of multiple electricity meters.

[0075] It should be noted that the host and standby machines are equipped with a meter reading right identification for each electric energy meter. The meaning of this identification is: whether the electric energy meter data is allowed to be directly collected, represented by 1 and 0: 1 means collecting data directly from the electric energy meter; 0 means not reading from the electric energy meter, but reading data from another host through the communication line between the two hosts.

[0076] When the host detects that a 485 bus has a communication interruption, it immediately sends a command to the hot standby host, which collects the data of the electric energy meter. At this time, the host switches the corresponding flag to 0. The hot standby host switches the flag to 1. At the same time, the hot standby host always monitors the 485 bus with the flag 0. When it finds that there is no communication process on the bus within the agreed time, it negotiates with the host to decide whether to actively switch the meter reading right.

[0077] In this way, the embodiment of the present invention can switch the meter reading right through the host machine and the backup machine, thereby ensuring the reliability of the double-click redundant system and thus ensuring the integrity of the electricity data.

[0078] Optionally, the dual-machine redundancy control method based on the negotiation mechanism and the data repair strategy provided in the embodiment of the present invention further includes steps S301-S307.

[0079] S301. If the communication status of the host changes from abnormal communication to normal communication, the host detects whether the stored data is missing.

[0080] S302: If the host detects that data is missing, determine the target electricity meter and target time period corresponding to the missing data.

[0081] S303: Generate a data recovery instruction based on the target electric meter and time period corresponding to the missing data.

[0082] S304: Send a data recovery instruction to the backup machine.

[0083] S305: Receive a data recovery response sent by the standby machine.

[0084] In some embodiments, the data recovery response includes that the standby machine has no corresponding data, or the power data of the target electric meter within the target time period.

[0085] S306: If the data recovery response includes the power data of the target electric meter within the target time period, data recovery is performed based on the data recovery response and the storage data of the host, and the recovered power data is stored.

[0086] S307: If the data recovery response is that the standby machine has no corresponding data, the power data of the host machine is repaired based on the curve repair strategy, and the repaired power data is stored.

[0087] Exemplarily, step S307 may be specifically implemented as steps B1-B6.

[0088] B1. Divide the electricity data in the historical period before the fault time to obtain multi-day metering data.

[0089] B2. Divide the daily measurement data into time intervals to obtain measurement data for multiple time intervals in each day.

[0090] B3. Based on the metering data of multiple time intervals in a day, calculate the average growth rate of electricity in each time interval.

[0091] B4. Calculate the power increase value for each time interval during the fault period based on the total fault duration, the power increase during the fault period, and the average power increase rate for each time interval.

[0092] B5. Set the valid bits of the data in each time interval during the fault period to invalid.

[0093] B6. Based on the power growth value in each time interval during the fault period and the valid bits of data in each time interval, the power data of the host is repaired to obtain the repaired power data.

[0094] For example, the embodiment of the present invention can divide 24 hours a day into 96 time intervals. If the meter base code changes during the fault period, the average growth rate of each time interval is calculated based on the data of the week before the fault:

[0095]

[0096] Among them, x nis the average growth rate in the nth time interval.

[0097] According to the total fault time and the total value of the base code growth, calculate the base code growth value of each time interval respectively:

[0098]

[0099] Among them, y n is the base code growth value of the nth time interval, that is, the power growth value, x n is the average growth rate of the nth time interval. The total value of the base code growth during the fault period is the difference between the power of the meter after the fault and the power of the meter at the fault point.

[0100] In this way, according to the calculated base code growth value of each interval, the 96-point curve data during the fault period is filled, and the valid data position is invalid, indicating that this data is simulated repair data. This makes the invalid data curve more coherent and the display effect better.

[0101] The embodiment of the present invention may adopt a curve repair strategy to repair the missing data during the fault period by simulating data, thereby facilitating the analysis and processing of the electric quantity data.

[0102] Optional, such as Figure 8 As shown, the dual-machine redundancy control method based on the negotiation mechanism and the data repair strategy provided by the embodiment of the present invention further includes steps S401-S403.

[0103] S401: Perform a rationality judgment on the storage data of the master or backup machine to obtain a judgment result.

[0104] Exemplarily, step S401 may be specifically implemented as steps C1-C7.

[0105] C1. Divide the stored data into time intervals to obtain power data in multiple time intervals;

[0106] C2. Calculate the incremental value of electricity in each time interval and the average growth rate of the incremental value of electricity;

[0107] C3. Determine the expected growth rate based on the average growth rate of the incremental value of electricity;

[0108] C4. If the incremental value of the power in a certain time interval is negative, the power data in the time interval is determined to be abnormal data;

[0109] C5. If the average growth rate of a certain time interval is greater than N times the expected growth rate, the power data of the time interval is determined to be abnormal data;

[0110] C6. If there is no abnormal data in the stored data, the judgment result is determined to be that the data is reasonable;

[0111] C7. If the stored data does not contain abnormal data, the judgment result is determined to be unreasonable data, and a judgment result is generated based on the abnormal data and the time interval corresponding to the abnormal data.

[0112] S402: If the judgment result is that the data is reasonable, the check bit of the stored data is set to indicate that the data is reasonable.

[0113] S403: If the judgment result is that the data is unreasonable, the check bits of the storage data of the master and the backup are determined based on the abnormal data and the storage data of the master and the backup.

[0114] Exemplarily, step S403 may be specifically implemented as steps D1-D6.

[0115] D1. Based on the abnormal time interval corresponding to the abnormal data, determine first data of the abnormal time interval in the host data and second data corresponding to the abnormal time interval in the standby data.

[0116] D2. Compare the first data and the second data to see whether they are consistent.

[0117] D3. If the first data and the second data are consistent, the measurement data in the abnormal time interval is determined to be normal data.

[0118] D4. If the first data and the second data are inconsistent, compare the reasonable probabilities of the first data and the second data; determine the measurement data with a high reasonable probability as normal data.

[0119] In this way, each host has an independent rationality judgment program to traverse the data stored in the database to enhance data reliability. If a sudden change in the bottom code value is found (such as the bottom code is reversed, the bottom code grows abnormally, etc.), the data of this time point and this meter are synchronously read in the hot standby host for comparison. If the two data are inconsistent, the more reasonable data is taken as the effective value. This makes the power data more reasonable and avoids data errors.

[0120] Optionally, the dual-machine redundancy control method based on the negotiation mechanism and the data repair strategy provided in the embodiment of the present invention further includes steps S501-S502.

[0121] S501. Determine the integrity and rationality of the metering data of the target electric meter.

[0122] S502: If the metering data of the target electric meter is complete and reasonable, the metering data of the target electric meter is sent to the electric quantity information collection system.

[0123] In this way, the embodiment of the present invention can send complete and reasonable power data to the power information collection system, which is convenient for analyzing and processing the load power.

[0124] The embodiments of the present invention can improve the data stability of the electric energy metering automation system. The master-slave redundant configuration can continuously collect data to ensure the integrity of the data when a single host or some communication modules fail. It can effectively avoid the loss of important data caused by the equipment. Based on the master-slave negotiation meter reading mechanism, the master-slave switching can be automatically realized in the event of a failure without manual supervision. It can save a lot of manpower in the power dispatching center. For data that cannot be recovered, the embodiments of the present invention can adopt a curve simulation repair strategy to generate a simulation curve and mark the valid bits of the data. It can avoid a sudden increase in data after data recovery, make invalid data more coherent, and improve the display effect.

[0125] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0126] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.

[0127] Fig. 9 The schematic diagram of the structure of a dual-machine redundant control device based on a negotiation mechanism and a data repair strategy provided by an embodiment of the present invention is shown. The control device 600 includes a communication module 601 and a processing module 602 .

[0128] The communication module 601 is used to monitor the communication status of the host.

[0129] Processing module 602 is used to determine the abnormality type of the host and the communication fault meter if the communication status of the host is communication abnormality; the abnormality types include meter failure, electric energy remote terminal failure and communication line failure; based on the abnormality type, generate a first switching instruction, the first switching instruction is used to instruct the second electric energy remote terminal to take over the meter reading right of the communication fault meter.

[0130] Fig.10 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Fig.10 As shown, the electronic device 700 includes: a processor 701, a memory 702, and a computer program 703 stored in the memory 702 and executable on the processor 701. When the processor 701 executes the computer program 703, the steps in the above-mentioned method embodiments are implemented, for example Figure 6 Alternatively, when the processor 701 executes the computer program 703, the functions of the modules / units in the above-mentioned device embodiments are implemented, for example, Fig. 9 The functions of the communication module 601 and the processing module 602 are shown.

[0131] Exemplarily, the computer program 703 may be divided into one or more modules / units, which are stored in the memory 702 and executed by the processor 701 to implement the present invention. The one or more modules / units may be capable of implementing a particular Figure 3 A series of computer program instruction segments with certain functions, which are used to describe the execution process of the computer program 703 in the electronic device 700. For example, the computer program 703 can be divided into Fig. 9 A communication module 601 and a processing module 602 are shown.

[0132] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0133] The memory 702 may be an internal storage unit of the electronic device 700, such as a hard disk or memory of the electronic device 700. The memory 702 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 700. Further, the memory 702 may also include both an internal storage unit of the electronic device 700 and an external storage device. The memory 702 is used to store the computer program and other programs and data required by the terminal. The memory 702 may also be used to temporarily store data that has been output or is to be output.

[0134] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A dual-machine redundancy control method based on negotiation mechanism and data repair strategy, characterized in that: Applied to an electric power collection system, the electric power collection system includes two redundant electric energy remote terminals and a plurality of electric meters connected to the electric energy remote terminals, the control method includes: If the first electric energy remote terminal is a host, the host monitors the communication status of the host; wherein the first electric energy remote terminal is any electric energy remote terminal; If the communication status of the host is abnormal, determine the abnormal type of the host and the communication fault meter; the abnormal type includes meter failure, electric energy remote terminal failure and communication line failure; Based on the abnormal type of the host and the communication fault electric meter, a first switching instruction is generated, wherein the first switching instruction is used to instruct the second electric energy remote terminal to take over the meter reading right of the communication fault electric meter.

2. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 1 is characterized in that: The control method further comprises: If the first electric energy remote terminal is a standby machine, the standby machine monitors the communication line between the host machine and the standby machine; If the host's communication status is detected to be abnormal, a takeover request instruction is sent to the host; If a takeover request response is received from the host, an operation instruction of the standby machine is determined based on the takeover request response, wherein the takeover request response includes confirmation of takeover or refusal of takeover; If no takeover response is received from the host, it is determined that the operation instruction of the standby machine is a second switching instruction, and the second switching instruction is to take over the meter reading rights of the multiple electricity meters.

3. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 2 is characterized in that: The step of determining the operation instruction of the standby machine based on the request takeover response includes: If the takeover request response is a takeover confirmation, determining that the operation instruction of the standby machine is the second switching instruction; If the response to the request for takeover is a refusal to take over, the node with the host communication abnormality is monitored, and timing is started to obtain the timing duration; if the timing duration is greater than the set duration, and the node with the host communication abnormality has no data transmission within the timing duration, then the operation instruction of the standby machine is determined to be the third switching instruction, and the third switching instruction is to take over the meter reading rights of the electric meter related to the node with the host communication abnormality.

4. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 1 is characterized in that: The control method further comprises: If the communication status of the host changes from abnormal communication to normal communication, the host detects whether the stored data is missing; If the host detects that data is missing, it determines the target meter and target time period corresponding to the missing data; Generate a data recovery instruction based on the target electric meter and time period corresponding to the missing data; Send data recovery instructions to the backup machine; receiving a data recovery response sent by the standby machine, wherein the data recovery response includes that the standby machine has no corresponding data, or the power data of the target electric meter within the target time period; If the data recovery response includes the power data of the target electric meter within the target time period, data recovery is performed based on the data recovery response and the storage data of the host, and the recovered power data is stored. If the data recovery response is that the standby machine has no corresponding data, the power data of the host machine is repaired based on the curve repair strategy, and the repaired power data is stored.

5. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 4 is characterized in that: The method of repairing the power data of the host based on the curve repair strategy includes: Divide the electricity data in the historical period before the fault to obtain multi-day metering data; Divide the daily measurement data into time intervals to obtain measurement data for multiple time intervals per day; Based on the metering data of multiple time intervals in a day, calculate the average growth rate of electricity in each time interval; Based on the total fault duration, the power increase during the fault period, and the average power growth rate in each time interval, calculate the power increase value in each time interval during the fault period; Set the valid bit of data in each time interval during the fault period to invalid; Based on the power growth value in each time interval during the fault period and the valid bits of data in each time interval, the power data of the host is repaired to obtain the repaired power data.

6. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 1 is characterized in that: The control method further comprises: Make a reasonable judgment on the storage data of the main machine or the backup machine and obtain the judgment result; If the judgment result is that the data is reasonable, the check bit of the stored data is set to indicate that the data is reasonable; If the judgment result is that the data is unreasonable, the check bits of the storage data of the master and the backup are determined based on the abnormal data and the storage data of the master and the backup.

7. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 6 is characterized in that: The rationality judgment of the storage data of the master or backup machine to obtain the judgment result includes: Dividing the stored data into time intervals to obtain power data of multiple time intervals; Calculate the power increment value and the average growth rate of the power increment value in each time interval; Based on the average growth rate of the incremental value of electric quantity, determine the expected value of the growth rate; If the power increment value of a certain time interval is negative, the power data of the time interval is determined to be abnormal data; If the average growth rate of a certain time interval is greater than N times the expected growth rate, the power data of the time interval is determined to be abnormal data; If the stored data does not contain abnormal data, then the judgment result is determined to be that the data is reasonable; If the stored data does not contain abnormal data, the judgment result is determined to be unreasonable data, and the judgment result is generated based on the abnormal data and the time interval corresponding to the abnormal data.

8. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 6 is characterized in that: The step of determining the check bits of the storage data of the master machine and the backup machine based on the abnormal data and the storage data of the master machine and the backup machine includes: Based on the abnormal time interval corresponding to the abnormal data, determine first data of the abnormal time interval in the host data and second data corresponding to the abnormal time interval in the standby data; comparing whether the first data and the second data are consistent; If the first data and the second data are consistent, the measurement data in the abnormal time interval is determined to be normal data; If the first data and the second data are inconsistent, the reasonable probabilities of the first data and the second data are compared; and the measurement data with a high reasonable probability is determined as normal data.

9. The dual-machine redundancy control method based on negotiation mechanism and data repair strategy according to claim 1 is characterized in that: The control method further comprises: Determine the integrity and rationality of the metering data of the target electric meter; If the metering data of the target meter is complete and reasonable, the metering data of the target meter is sent to the power information collection system.

10. A dual-machine redundant control system based on negotiation mechanism and data repair strategy, characterized in that: It comprises two redundantly arranged electric energy remote terminals and a plurality of electric meters connected to the electric energy remote terminals; the electric energy remote terminal comprises an electronic device, the electronic device comprises a memory and a processor, the memory stores a computer program, the processor is used to call and run the computer program stored in the memory to execute the steps of the method as claimed in any one of claims 1 to 9.