CN113364618B - Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule - Google Patents

Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule Download PDF

Info

Publication number
CN113364618B
CN113364618B CN202110618445.6A CN202110618445A CN113364618B CN 113364618 B CN113364618 B CN 113364618B CN 202110618445 A CN202110618445 A CN 202110618445A CN 113364618 B CN113364618 B CN 113364618B
Authority
CN
China
Prior art keywords
state
equipment
slave
switching
master
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110618445.6A
Other languages
Chinese (zh)
Other versions
CN113364618A (en
Inventor
王超
赵瑞锋
侯祖锋
李波
陈建钿
黎皓彬
徐春华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Power Grid Co Ltd
Zhuhai Power Supply Bureau of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Zhuhai Power Supply Bureau of Guangdong Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Power Grid Co Ltd, Zhuhai Power Supply Bureau of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202110618445.6A priority Critical patent/CN113364618B/en
Publication of CN113364618A publication Critical patent/CN113364618A/en
Application granted granted Critical
Publication of CN113364618B publication Critical patent/CN113364618B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J13/00Circuit arrangements for providing remote indication of network conditions, e.g. an instantaneous record of the open or closed condition of each circuitbreaker in the network; Circuit arrangements for providing remote control of switching means in a power distribution network, e.g. switching in and out of current consumers by using a pulse code signal carried by the network
    • H02J13/00002Circuit arrangements for providing remote indication of network conditions, e.g. an instantaneous record of the open or closed condition of each circuitbreaker in the network; Circuit arrangements for providing remote control of switching means in a power distribution network, e.g. switching in and out of current consumers by using a pulse code signal carried by the network characterised by monitoring
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J13/00Circuit arrangements for providing remote indication of network conditions, e.g. an instantaneous record of the open or closed condition of each circuitbreaker in the network; Circuit arrangements for providing remote control of switching means in a power distribution network, e.g. switching in and out of current consumers by using a pulse code signal carried by the network
    • H02J13/00006Circuit arrangements for providing remote indication of network conditions, e.g. an instantaneous record of the open or closed condition of each circuitbreaker in the network; Circuit arrangements for providing remote control of switching means in a power distribution network, e.g. switching in and out of current consumers by using a pulse code signal carried by the network characterised by information or instructions transport means between the monitoring, controlling or managing units and monitored, controlled or operated power network element or electrical equipment
    • H02J13/00007Circuit arrangements for providing remote indication of network conditions, e.g. an instantaneous record of the open or closed condition of each circuitbreaker in the network; Circuit arrangements for providing remote control of switching means in a power distribution network, e.g. switching in and out of current consumers by using a pulse code signal carried by the network characterised by information or instructions transport means between the monitoring, controlling or managing units and monitored, controlled or operated power network element or electrical equipment using the power network as support for the transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B70/00Technologies for an efficient end-user side electric power management and consumption
    • Y02B70/30Systems integrating technologies related to power network operation and communication or information technologies for improving the carbon footprint of the management of residential or tertiary loads, i.e. smart grids as climate change mitigation technology in the buildings sector, including also the last stages of power distribution and the control, monitoring or operating management systems at local level
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S20/00Management or operation of end-user stationary applications or the last stages of power distribution; Controlling, monitoring or operating thereof
    • Y04S20/20End-user application control systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application provides a power grid monitoring system master-slave device anti-error switching method, device, equipment and storage medium based on penalty coefficient rules, wherein when the slave device does not receive a heartbeat message sent by the master device, whether a broadcast message sent by the master device is received or not is detected, and the current penalty coefficient of the slave device is calculated; when the slave equipment does not receive the broadcast message and judges that the current punishment coefficient meets the switching condition, the slave equipment is switched from the slave state to the standby state, so that the primary switching of the main state and the standby state is realized, the condition that the master state and the standby state are switched due to the fact that the slave equipment does not receive the heartbeat message is prevented, and the condition of the master state and the standby state switching is more sufficient and reasonable; when the broadcast message sent by the main equipment is still not received after the preset time length, the slave equipment is switched into the main state completely, so that the switching between the main equipment and the slave equipment in the system is more reasonable and sufficient, the switching caused by false triggering is well prevented, and the system can normally and stably run.

Description

Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule
Technical Field
The application relates to the technical field of power grid monitoring, in particular to a method and a device for preventing master and slave equipment from being switched by mistake, a computer device and a storage medium of a power grid monitoring system based on a punishment coefficient rule.
Background
In the monitoring management of the power grid, the OCS is a real-time control system, and focuses on the real-time monitoring and control of the power grid, so that monitoring maintenance personnel can conveniently manage the power grid at the background, and the power grid can stably run; by utilizing the OCS system, the power grid system management is more systematic and intelligent.
The OCS system generally utilizes a master device and a slave device to build the system; by utilizing the two devices, the condition that the system is broken down due to the failure of the main device can be well prevented; however, when the heartbeat state between the master device and the slave device is frequently abnormal, the slave device may misinterpret the master device as a failure state, and then the slave device in the standby state is switched to the master state, so that two devices in the master state appear in the system, and the system cannot normally operate.
Disclosure of Invention
Therefore, it is necessary to provide a method, an apparatus, a computer device and a storage medium for preventing false switching of a master device and a slave device of a power grid monitoring system based on a penalty factor rule for solving the above technical problems.
A method for preventing error switching of master equipment and slave equipment of a power grid monitoring system based on a penalty coefficient rule is applied to slave equipment, and comprises the following steps:
if the heartbeat message sent by the main equipment is not received, determining that a data forwarding link passing through the main equipment is in a busy state, detecting whether a broadcast message sent by the main equipment is received or not, and calculating a current punishment coefficient; the broadcast message is used for indicating equipment with the priority lower than that of the main equipment to forward the service data stream of the equipment to the main equipment; the current penalty factor represents the load overhead occurring when the data forwarding link is switched from passing through the master device to passing through the slave device;
if the broadcast message is not received and the current punishment coefficient is determined to meet the switching condition, switching from the state of the data forwarding task which cannot be executed to the preparation state of the executable data forwarding task; the device attribute corresponding to the slave state and the device attribute corresponding to the preparation state are both slave device attributes;
if the broadcast message is not received within the preset time after the switching to the preparation state, switching from the preparation state to a main state; and the equipment attribute corresponding to the main state is the main equipment attribute.
In one embodiment, before determining that the primary device is in a busy state of a data forwarding link if the heartbeat packet sent by the primary device is not received, the method further includes:
and periodically detecting whether the heartbeat message sent by the main equipment is received.
In one embodiment, the method further comprises:
if receiving a heartbeat message sent by the main equipment, acquiring a state parameter in the heartbeat message;
and when the master equipment is judged to be in an abnormal state according to the state parameters, switching from the slave state to the master state.
In one embodiment, the detecting whether the broadcast packet sent by the master device is received and calculating the current penalty coefficient includes:
when the heartbeat message sent by the main equipment is not received, the lost time of the heartbeat message is calculated;
and when the loss duration exceeds the preset loss duration, detecting whether a broadcast message sent by the main equipment is received or not and calculating the current punishment coefficient.
In one embodiment, the calculating the current penalty factor includes:
obtaining the accumulated heartbeat loss times according to the loss duration;
and obtaining the current penalty coefficient according to the decreasing step length and the cumulative number of the heartbeat loss.
In one embodiment, the determining that the current penalty factor satisfies a handover condition includes:
subtracting the cost value of the data forwarding link passing through the slave equipment from the current penalty coefficient to obtain an intermediate calculation link cost value;
and if the intermediate calculation link cost value is greater than the cost value of the data forwarding link passing through the main equipment, determining that the current penalty coefficient meets the switching condition.
A power grid monitoring system master-slave equipment anti-error switching device based on penalty coefficient rules is applied to slave equipment, and the device comprises:
the broadcast message detection module is used for determining that a data forwarding link passing through the main equipment is in a busy state if the heartbeat message sent by the main equipment is not received, detecting whether the broadcast message sent by the main equipment is received or not and calculating a current punishment coefficient; the broadcast message is used for indicating equipment with the priority lower than that of the main equipment to forward the service data stream of the equipment to the main equipment; the current penalty factor represents the load overhead occurring when the data forwarding link is switched from passing through the master device to passing through the slave device;
the first state switching module is used for switching from a state in which the data forwarding task cannot be executed to a preparation state in which the data forwarding task can be executed if the broadcast message is not received and the current penalty coefficient is determined to meet the switching condition; the device attribute corresponding to the slave state and the device attribute corresponding to the preparation state are both slave device attributes;
a second state switching module, configured to switch from the preparation state to the main state if the broadcast packet is not received within a preset time after the switching to the preparation state; and the equipment attribute corresponding to the main state is the main equipment attribute.
In one embodiment, the apparatus further comprises: and the heartbeat message detection module is used for periodically detecting whether the heartbeat message sent by the main equipment is received.
A computer device comprising a memory storing a computer program and a processor implementing the method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method.
According to the method, the device, the computer equipment and the storage medium for preventing the master equipment and the slave equipment of the power grid monitoring system from mistakenly switching based on the punishment coefficient rule, the slave equipment firstly detects a heartbeat message sent by the master equipment; when the heartbeat message sent by the master device is not detected, the broadcast message of the master device is detected and the current punishment coefficient of the slave device is calculated; when the slave device does not detect the broadcast message sent by the master device and judges that the current punishment coefficient meets the switching condition, the slave device is switched from the slave state to the standby state, so that the primary switching of the master and standby states is realized, the condition that the master and standby switching is carried out due to the fact that the slave device does not receive the heartbeat message is well prevented, and the master and standby switching condition is more sufficient and reasonable; when the broadcast message sent by the master device is still not received after the preset duration, the slave device can be switched into the master state completely, so that the switching between the master device and the slave device in the system is more reasonable and sufficient, the switching caused by false triggering is well prevented, and the system can normally and stably run.
Drawings
Fig. 1 is a schematic flow chart of a method for preventing false switching of master and slave devices of a power grid monitoring system based on a penalty factor rule in an embodiment;
FIG. 2 is a schematic flow chart illustrating a method for preventing false switching between a master device and a slave device of a power grid monitoring system based on a penalty factor rule in an embodiment;
FIG. 3 is a schematic flow chart illustrating a method for preventing false switching between a master device and a slave device of a power grid monitoring system based on a penalty factor rule according to an embodiment;
fig. 4 is a block diagram of a master-slave device anti-error switching device of a power grid monitoring system based on a penalty factor rule in an embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As shown in fig. 1, the present application provides a method for preventing false switching between a master device and a slave device of a power grid monitoring system based on a penalty factor rule, where the method may be applied to a slave device, and the slave device may perform the following steps when implementing the method:
step S101, if the heartbeat message sent by the main equipment is not received, determining that a data forwarding link passing through the main equipment is in a busy state, detecting whether a broadcast message sent by the main equipment is received or not, and calculating a current punishment coefficient.
Step S102, if the broadcast message is not received and the current punishment coefficient is determined to meet the switching condition, switching from the state that the data forwarding task cannot be executed to the preparation state that the data forwarding task can be executed; the device attribute corresponding to the slave state and the device attribute corresponding to the preparation state are both slave device attributes;
step S103, if the broadcast message is not received within a preset time after the preparation state is switched, switching from the preparation state to a main state; and the equipment attribute corresponding to the main state is the main equipment attribute.
The master device and the slave device are relative and have no necessary distinguishing limit; for example, in a master-slave hot backup network system, under normal conditions, a preset master device performs data transmission, exchange and forwarding (at this time, a data forwarding link passes through the master device), while a preset slave device does not need to perform data transmission, exchange and forwarding; however, when the preset master device fails, the preset slave device is switched from the slave state to the master state to perform transmission, switching and forwarding on data in the network, and the preset slave device is changed from the slave device to a new master device (at this time, the data forwarding link passes through the slave device).
It will be appreciated that the master and slave devices may be routers, switches, servers, or other data transfer devices. The master and slave devices are essentially identical, except for the priority of data transmission during operation of the network. Under normal conditions, the master device realizes the forwarding transmission of data, and when the master device fails, the slave device is switched from the slave state to the master state to become a new master device, so as to realize the forwarding transmission of data, and enable the network system to operate normally. When the failure of the original master device is resolved, the original master device can be restored to the master state and the original slave device can be restored to the slave state by using the relevant protocol mechanism.
The broadcast message is used for indicating the equipment with the priority lower than that of the main equipment to forward the service data stream of the equipment to the main equipment. The broadcast message may be a VRRP broadcast message (Virtual Router Redundancy Protocol) or a free ARP broadcast message (Address Resolution Protocol), where the broadcast message includes priority information, and when receiving the broadcast message, the neighboring network device compares the priority information of the broadcast message, and when determining that the priority of the broadcast message sending device is higher than its own height, forwards the service data stream to the device end that sends the broadcast message. When the slave equipment receives the broadcast message sent by the master equipment, the master equipment is determined to be still in a normal working state, and master-slave equipment switching does not need to be triggered.
The current penalty coefficient represents a load overhead generated when the data forwarding link is switched from passing through the master device to passing through the slave device, and is an important factor for measuring the switching of the master device and the slave device. In the embodiment, the current penalty coefficient is calculated, and whether the condition of master-slave switching is met or not is judged by using the current penalty coefficient, so that the master-slave equipment switching is more sufficient and reasonable.
The preparation state is a state between the master state and the slave state, the data forwarding task cannot be executed when the slave device is in the slave state, and the data forwarding task can be executed when the slave device is in the preparation state, so that the system can keep a normal operation state; but the device attribute of the slave device in the slave state or the ready state is the slave device attribute, and still does not change, and the slave device in the ready state only temporarily acts as the master device; when the slave device is in the master state, not only the data forwarding task may be performed, but also the device attribute is in the master state.
It should be noted that, the previous switching between the master device and the slave device is generally only based on whether the slave device receives the heartbeat message sent by the master device, and when the duration of not receiving the heartbeat message exceeds a preset value, the slave device is switched to the master state; however, when a data forwarding link passing through the master device is in an idle state, the master device sends a heartbeat message to the slave device; when a data forwarding link passing through the master device is in a busy state for a long time, the master device does not send a heartbeat message to the slave device, so that the slave device may be switched from a slave state to a master state even if the master device is not in a fault state, and two devices in the master state appear in a network system, thereby causing the network system to be incapable of normally operating.
In this embodiment, not only the heartbeat message is detected, but also whether the master device is sending the broadcast message is detected, and if the slave device receives the broadcast message sent by the master device, it indicates that the master device is in a normal working state, and the master device and the slave device are not triggered to be switched; when the slave equipment does not receive the heartbeat message or the broadcast message, the current punishment coefficient calculation is triggered, whether the current punishment coefficient meets the switching condition or not is judged according to the punishment coefficient obtained by calculation, and when the current punishment coefficient meets the switching condition, the slave equipment is switched from the slave state to the preparation state and executes a data forwarding task; and in the preset time length after the switching to the preparation state, when the slave equipment still does not receive the broadcast message, indicating that the master equipment fails, and at the moment, switching the slave equipment from the preparation state to the master state.
In the method for preventing the master device and the slave device of the power grid monitoring system from mistakenly switching based on the punishment coefficient rule, the slave device firstly detects a heartbeat message sent by the master device; when the heartbeat message sent by the master device is not detected, the broadcast message of the master device is detected and the current punishment coefficient of the slave device is calculated; when the slave device does not detect the broadcast message sent by the master device and judges that the current punishment coefficient meets the switching condition, the slave device is switched from the slave state to the standby state, so that the primary switching of the master and standby states is realized, the condition that the master and standby switching is carried out due to the fact that the slave device does not receive the heartbeat message is well prevented, and the master and standby switching condition is more sufficient and reasonable; when the broadcast message sent by the master device is still not received after the preset duration, the slave device can be switched into the master state completely, so that the switching between the master device and the slave device in the system is more reasonable and sufficient, the switching caused by false triggering is well prevented, and the system can normally and stably run.
Further, before the slave device performs the step of determining that the master device is in a busy state of the data forwarding link if the slave device does not receive the heartbeat packet sent by the master device, the following steps may also be performed: and periodically detecting whether the heartbeat message sent by the main equipment is received.
In the above manner, the time length periodically detected by the slave device may be set to 0.5 ms, 1 ms or 10 ms, the set time value may be changed correspondingly according to the data transmission requirement of the network system, and at this time, the slave device detects whether the heartbeat message sent by the master device is received according to the set time length interval, so that the master device and the slave device are switched more reasonably and meet the use requirement.
Further, if receiving a heartbeat message sent by the master device, the slave device acquires a state parameter in the heartbeat message; and when the master equipment is judged to be in an abnormal state according to the state parameters, switching from the slave state to the master state.
The status parameter extracted from the heartbeat message may include a status flag of the master device, and the slave device may quickly determine whether the master device is in a normal operating state or a fault state according to the status flag in the status parameter.
In the above manner, when the slave device detects the heartbeat message sent by the master device, and then extracts the state parameters from the heartbeat message, when the master device is determined to be in an abnormal state according to the state parameters, the slave device can be switched from the slave state to the master state immediately.
In an embodiment, as shown in fig. 2, when the slave device performs the steps of detecting whether the broadcast packet sent by the master device is received and calculating the current penalty coefficient, the following steps may be specifically performed:
step S201, when the heartbeat message sent by the main equipment is not received, calculating the loss duration of the heartbeat message;
step S202, when the loss duration exceeds the preset loss duration, detecting whether a broadcast message sent by the main equipment is received or not and calculating a current punishment coefficient.
The preset loss duration may be set to 15ms, 20ms or other values, and the user may set the default loss duration according to the condition of the system network.
In this embodiment, when the slave device determines that the heartbeat message sent by the master device is not received, the slave device starts to calculate the loss duration of the heartbeat message; when the loss duration of the heartbeat message exceeds the preset loss duration, the slave device detects whether the broadcast message sent by the master device is received or not and calculates the current punishment coefficient, and judges whether the slave device needs to be switched from the slave state to the master state or not, so that accurate switching is ensured.
Further, when the slave device performs the step of calculating the current penalty coefficient, the following steps may be specifically performed: obtaining the accumulated heartbeat loss times according to the loss duration; and obtaining the current penalty coefficient according to the decreasing step length and the cumulative number of the heartbeat loss.
That is, the slave device can divide the acquired loss duration by the set time interval for detecting the heartbeat message, so as to obtain the cumulative number of times of heartbeat loss; then, the current penalty coefficient can be obtained according to the decrement step length and the obtained cumulative number of the heartbeat loss, and the load overhead of the link, which is generated when the data forwarding link is switched from passing through the master device to passing through the slave device, can be further determined.
In an embodiment, as shown in fig. 3, when the slave device performs the step of determining that the current penalty coefficient satisfies the handover condition, the following steps may be specifically performed:
step S301, subtracting the cost value of the data forwarding link passing through the slave device from the current penalty coefficient to obtain an intermediate calculation link cost value;
step S302, if the intermediate calculation link cost value is greater than the cost value of the data forwarding link passing through the master device, determining that the current penalty coefficient satisfies a handover condition.
In this embodiment, the slave device makes a difference between the cost value of the data forwarding link passing through the slave device and the current penalty coefficient, so as to obtain an intermediate calculation link cost value; then the slave device compares the cost value of the intermediate calculation link with the cost value of the data forwarding link passing through the master device, and when the cost value of the intermediate calculation link is greater than the cost value of the data forwarding link passing through the master device, the slave device determines that the current political coefficient meets the switching condition, so that the conditions of the master device and the slave device are more sufficient and reasonable.
It should be understood that, although the steps in the flowcharts of fig. 1 to 3 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1 to 3 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 4, there is provided a grid monitoring system master-slave device anti-error switching apparatus based on penalty factor rule, applied to a slave device, the apparatus including:
a broadcast message detection module 401, configured to determine that a data forwarding link passing through a primary device is in a busy state if a heartbeat message sent by the primary device is not received, detect whether a broadcast message sent by the primary device is received, and calculate a current penalty coefficient; the broadcast message is used for indicating equipment with the priority lower than that of the main equipment to forward the service data stream of the equipment to the main equipment; the current penalty factor represents the load overhead occurring when the data forwarding link is switched from passing through the master device to passing through the slave device;
a first state switching module 402, configured to switch from a state in which a data forwarding task cannot be executed to a preparation state in which the data forwarding task can be executed if the broadcast packet is not received and it is determined that the current penalty coefficient meets a switching condition; the device attribute corresponding to the slave state and the device attribute corresponding to the preparation state are both slave device attributes;
a second state switching module 403, configured to switch from the preparation state to the main state if the broadcast packet is not received within a preset time after the switching to the preparation state; and the equipment attribute corresponding to the main state is the main equipment attribute.
In one embodiment, the apparatus further comprises: and the heartbeat message detection module is used for periodically detecting whether the heartbeat message sent by the main equipment is received.
In one embodiment, the apparatus further comprises: the third state switching module is used for acquiring state parameters in the heartbeat message if the heartbeat message sent by the main equipment is received; and when the master equipment is judged to be in an abnormal state according to the state parameters, switching from the slave state to the master state.
In an embodiment, the broadcast message detecting module 401 is further configured to start to calculate a loss duration of the heartbeat message when the heartbeat message sent by the master device is not received; and when the loss duration exceeds the preset loss duration, detecting whether a broadcast message sent by the main equipment is received or not and calculating the current punishment coefficient.
In an embodiment, the broadcast packet detecting module 401 is further configured to obtain a cumulative number of heartbeat losses according to the loss duration; and obtaining the current penalty coefficient according to the decreasing step length and the cumulative number of the heartbeat loss.
In an embodiment, the first state switching module 402 is further configured to make a difference between a cost value of a data forwarding link passing through the slave device and the current penalty coefficient, so as to obtain an intermediate calculated link cost value; and if the intermediate calculation link cost value is greater than the cost value of the data forwarding link passing through the main equipment, determining that the current penalty coefficient meets the switching condition.
For specific limitation of the master-slave device anti-error switching device of the power grid monitoring system based on the penalty coefficient rule, reference may be made to the above limitation on the master-slave device anti-error switching method of the power grid monitoring system based on the penalty coefficient rule, and details are not described here. All modules in the master-slave equipment anti-error switching device of the power grid monitoring system based on the penalty coefficient rule can be completely or partially realized through software, hardware and a combination of the software and the hardware. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing the error switching prevention data of the master equipment and the slave equipment of the power grid monitoring system based on the penalty coefficient rule. The network interface of the computer device is used for communicating with an external terminal through a network connection. When being executed by a processor, the computer program realizes the method for preventing the false switching of the master equipment and the slave equipment of the power grid monitoring system based on the punishment coefficient rule.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the respective method embodiment as described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for preventing master-slave equipment from being switched in an error mode of a power grid monitoring system based on a penalty coefficient rule is applied to slave equipment, and comprises the following steps:
if the heartbeat message sent by the main equipment is not received, determining that a data forwarding link passing through the main equipment is in a busy state, and starting to calculate the loss duration of the heartbeat message when the heartbeat message sent by the main equipment is not received; when the loss duration exceeds a preset loss duration, detecting whether a broadcast message sent by the main equipment is received or not and calculating a current punishment coefficient; the broadcast message is used for indicating equipment with the priority lower than that of the main equipment to forward the service data stream of the equipment to the main equipment; the current penalty factor represents the load overhead occurring when the data forwarding link is switched from passing through the master device to passing through the slave device;
if the broadcast message is not received and the current punishment coefficient is determined to meet the switching condition, switching from the state in which the data forwarding task cannot be executed to the preparation state in which the data forwarding task can be executed; the device attribute corresponding to the slave state and the device attribute corresponding to the preparation state are both slave device attributes;
if the broadcast message is not received within the preset time after the switching to the preparation state, switching from the preparation state to a main state; and the equipment attribute corresponding to the main state is the main equipment attribute.
2. The method according to claim 1, wherein before determining that the primary device is in a busy state of a data forwarding link if the heartbeat packet sent by the primary device is not received, the method further comprises:
and periodically detecting whether the heartbeat message sent by the main equipment is received.
3. The method of claim 1, further comprising:
if receiving a heartbeat message sent by the main equipment, acquiring a state parameter in the heartbeat message;
and when the master equipment is judged to be in an abnormal state according to the state parameters, switching from the slave state to the master state.
4. The method of claim 1, wherein calculating the current penalty factor comprises:
obtaining the accumulated heartbeat loss times according to the loss duration;
and obtaining the current penalty coefficient according to the decreasing step length and the cumulative number of the heartbeat loss.
5. The method of claim 1, wherein the determining that the current penalty factor satisfies a handover condition comprises:
subtracting the cost value of the data forwarding link passing through the slave equipment from the current penalty coefficient to obtain an intermediate calculation link cost value;
and if the intermediate calculation link cost value is greater than the cost value of the data forwarding link passing through the main equipment, determining that the current penalty coefficient meets the switching condition.
6. A power grid monitoring system master-slave equipment anti-error switching device based on penalty coefficient rules is applied to slave equipment, and the device comprises:
the broadcast message detection module is used for determining that a data forwarding link passing through the main equipment is in a busy state if the heartbeat message sent by the main equipment is not received, and starting to calculate the loss duration of the heartbeat message when the heartbeat message sent by the main equipment is not received; when the loss duration exceeds a preset loss duration, detecting whether a broadcast message sent by the main equipment is received or not and calculating a current punishment coefficient; the broadcast message is used for indicating equipment with the priority lower than that of the main equipment to forward the service data stream of the equipment to the main equipment; the current penalty coefficient represents the load overhead generated when the data forwarding link is switched from passing through the master equipment to passing through the slave equipment;
the first state switching module is used for switching from a state in which the data forwarding task cannot be executed to a preparation state in which the data forwarding task can be executed if the broadcast message is not received and the current penalty coefficient is determined to meet the switching condition; the device attribute corresponding to the slave state and the device attribute corresponding to the preparation state are both slave device attributes;
a second state switching module, configured to switch from the preparation state to the main state if the broadcast packet is not received within a preset time after the switching to the preparation state; and the equipment attribute corresponding to the main state is the main equipment attribute.
7. The apparatus of claim 6, further comprising: the third state switching module is used for acquiring state parameters in the heartbeat message if the heartbeat message sent by the main equipment is received; and when the master equipment is judged to be in an abnormal state according to the state parameters, switching from the slave state to the master state.
8. The apparatus of claim 6, further comprising: and the heartbeat message detection module is used for periodically detecting whether the heartbeat message sent by the main equipment is received.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the method of any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
CN202110618445.6A 2021-06-03 2021-06-03 Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule Active CN113364618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110618445.6A CN113364618B (en) 2021-06-03 2021-06-03 Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110618445.6A CN113364618B (en) 2021-06-03 2021-06-03 Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule

Publications (2)

Publication Number Publication Date
CN113364618A CN113364618A (en) 2021-09-07
CN113364618B true CN113364618B (en) 2022-06-14

Family

ID=77531872

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110618445.6A Active CN113364618B (en) 2021-06-03 2021-06-03 Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule

Country Status (1)

Country Link
CN (1) CN113364618B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114935779B (en) * 2022-06-14 2022-11-29 天津君秒安减灾科技有限公司 Master-slave switching system for automatic connection between earthquake rescue field devices
CN116937578B (en) * 2023-09-18 2024-01-23 广东电网有限责任公司江门供电局 Power grid monitoring system data processing method, device, terminal and storage medium
CN117424352B (en) * 2023-12-19 2024-03-12 浙江简捷物联科技有限公司 Master-slave autonomous switching method and system for energy storage cabinet

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577661A (en) * 2008-05-09 2009-11-11 华为技术有限公司 Method and equipment for switching path

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101640688B (en) * 2009-08-20 2014-03-12 中兴通讯股份有限公司 Content delivery network (CDN)-based switching method for main node controller and spare controller and CDN
CN111106967A (en) * 2019-12-30 2020-05-05 联想(北京)有限公司 Intelligent routing method, device and storage medium
CN111447094B (en) * 2020-03-27 2023-06-16 深圳融安网络科技有限公司 Master-slave switching method of dual computers, terminal equipment and computer readable storage medium
CN112260893B (en) * 2020-10-14 2022-04-19 天津津航计算技术研究所 Ethernet redundancy device of VxWorks operating system based on network heartbeat

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577661A (en) * 2008-05-09 2009-11-11 华为技术有限公司 Method and equipment for switching path

Also Published As

Publication number Publication date
CN113364618A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN113364618B (en) Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule
CN108712309B (en) Micro service node protection method and system under micro service architecture
CN109344014B (en) Main/standby switching method and device and communication equipment
CN109104349B (en) Train network data transmission method, system and device based on CANopen protocol
CN106533805B (en) Micro-service request processing method, micro-service controller and micro-service architecture
CN110830283B (en) Fault detection method, device, equipment and system
CN112866004A (en) Switching method and device of control plane equipment and transfer control separation system
CN104506392B (en) A kind of delay machine detection method and equipment
CN106936613B (en) Method and system for rapidly switching main and standby Openflow switch
WO2019128670A1 (en) Method and apparatus for enabling self-recovery of management capability in distributed system
CN108429675B (en) VRRP (virtual router redundancy protocol) linkage switching method and device and electronic equipment
CN113114563B (en) Traffic back-off delay method, device and storage medium based on segmented routing strategy
CN113489149B (en) Power grid monitoring system service master node selection method based on real-time state sensing
CN112367197B (en) Network equipment migration method and device
CN112231153B (en) Equipment switching method and network equipment
CN114168071A (en) Distributed cluster capacity expansion method, distributed cluster capacity expansion device and medium
CN111309515A (en) Disaster recovery control method, device and system
WO2007059667A1 (en) A method for obtaining the network element alarm data
CN115333983B (en) Heartbeat management method and node
CN108616423B (en) Offline device monitoring method and device
CN114124803B (en) Device management method and device, electronic device and storage medium
CN113098709B (en) Network recovery method and device based on distributed networking system and computer equipment
CN101414937A (en) Method and apparatus for switching tunnel
CN112751740B (en) ERPS subring resource release method, system, server and storage medium
CN113438105A (en) Method, device and equipment for assisting multi-IRF (inter-range radio frequency) splitting detection by MAD (multi-object detection)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant