CN113489149A - Power grid monitoring system service master node selection method based on real-time state perception - Google Patents

Power grid monitoring system service master node selection method based on real-time state perception Download PDF

Info

Publication number
CN113489149A
CN113489149A CN202110747857.XA CN202110747857A CN113489149A CN 113489149 A CN113489149 A CN 113489149A CN 202110747857 A CN202110747857 A CN 202110747857A CN 113489149 A CN113489149 A CN 113489149A
Authority
CN
China
Prior art keywords
node
identification information
slave node
slave
information
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.)
Granted
Application number
CN202110747857.XA
Other languages
Chinese (zh)
Other versions
CN113489149B (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 CN202110747857.XA priority Critical patent/CN113489149B/en
Publication of CN113489149A publication Critical patent/CN113489149A/en
Application granted granted Critical
Publication of CN113489149B publication Critical patent/CN113489149B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/00032Systems characterised by the controlled or operated power network elements or equipment, the power network elements or equipment not otherwise provided for
    • H02J13/00036Systems characterised by the controlled or operated power network elements or equipment, the power network elements or equipment not otherwise provided for the elements or equipment being or involving switches, relays or circuit breakers
    • H02J13/0004Systems characterised by the controlled or operated power network elements or equipment, the power network elements or equipment not otherwise provided for the elements or equipment being or involving switches, relays or circuit breakers involved in a protection system
    • 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
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Remote Monitoring And Control Of Power-Distribution Networks (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application relates to a method and a device for selecting a service master node of a power grid monitoring system based on real-time state perception, computer equipment and a storage medium. The method comprises the following steps: when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node; acquiring at least one type of operation identification information returned by each slave node in response to the election instruction; wherein, the various operation identification information have priority order; and screening the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node. By adopting the method, a new main node can be rapidly elected and the work can be rapidly recovered.

Description

Power grid monitoring system service master node selection method based on real-time state perception
Technical Field
The present application relates to the field of distributed cluster technologies, and in particular, to a method and an apparatus for selecting a service master node of a power grid monitoring system based on real-time state sensing, a computer device, and a storage medium.
Background
The power grid monitoring system plays an important role in the daily maintenance and management process of the power grid. With the continuous progress of the technology level and the rapid increase of the data volume of the power grid, the distributed cluster technology is applied to the power grid monitoring system.
Distributed clusters are composed of multiple servers, and typically provide services such as data publishing, subscription, cluster management, etc. externally in a cluster mode. In a distributed cluster, it is specified that one of the servers, which is often referred to as the primary server, is responsible for the coordinated synchronization of data. When the primary server fails, other servers need to interrupt work, and one server is selected as a new primary server again.
However, the current election mechanism is complex, so that the distributed cluster cannot quickly recover the previously interrupted work in the face of a failure.
Disclosure of Invention
Therefore, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for selecting a service master node of a power grid monitoring system based on real-time state awareness, which can provide fast selection of a master server.
A method for selecting a service master node of a power grid monitoring system based on real-time state perception comprises the following steps:
when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node;
acquiring at least one type of operation identification information returned by each slave node respectively responding to the election instruction; wherein, the various operation identification information have priority order;
and screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
In one embodiment, the method further comprises:
acquiring running state information of a current main node, and detecting the running state information by using a preset threshold value; wherein the operation state information includes internal operation information and external link information;
and when the running state information is detected to be abnormal state information, determining that the running state of the current main node is abnormal.
In one embodiment, the operation identification information includes, in order of priority: time identification information corresponding to the first priority order, version identification information corresponding to the second priority order, and node identification information corresponding to the third priority order.
In one embodiment, the screening out the most significant information from the operation identification information of each slave node based on the priority order, and electing the slave node corresponding to the most significant information as a new master node includes:
screening out a first maximum value in the time identification information corresponding to the first priority order from the operation identification information respectively corresponding to each slave node;
and determining a first slave node corresponding to the first maximum value, and determining a new master node based on the first slave node.
In one embodiment, the determining a first slave node corresponding to the first maximum value and determining a new master node based on the first slave node includes:
when the number of the first slave nodes is more than one, screening out a second maximum value from the version identification information corresponding to the second priority order of each first slave node;
and determining a second slave node corresponding to the second maximum value, and determining a new master node based on the second slave node.
In one embodiment, the determining the second slave node corresponding to the second maximum value and determining a new master node based on the second slave node includes:
when the number of the second slave nodes is more than one, screening out a third maximum value from the node identification information of each second slave node corresponding to the third priority order;
and taking the second slave node corresponding to the third maximum value as a new master node.
In one embodiment, the method further comprises the following steps:
receiving operation recovery information sent by the main node before the election is recovered to be normal;
and taking the master node before the current election as a new master node again according to the operation recovery information.
A power grid monitoring system service master node selecting device based on real-time state perception comprises:
the system comprises a detection module, a selection module and a selection module, wherein the detection module is used for sending a selection pushing instruction to each slave node connected with a current main node when detecting that the running state of the current main node is abnormal;
the acquisition module is used for acquiring at least one type of operation identification information returned by each slave node in response to the election instruction; wherein, the various operation identification information have priority order;
and the processing module is used for screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node;
acquiring at least one type of operation identification information returned by each slave node respectively responding to the election instruction; wherein, the various operation identification information have priority order;
and screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node;
acquiring at least one type of operation identification information returned by each slave node respectively responding to the election instruction; wherein, the various operation identification information have priority order;
and screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
According to the power grid monitoring system service master node selecting method, device, computer equipment and storage medium based on real-time state perception, the running state of the current master node is detected in real time through the monitoring nodes, when the fact that the running state of the master node is abnormal is detected, at least one type of running identification information of each slave node is obtained, the most value information is sequentially screened out based on the priority sequence among various types of running identification information, the slave node corresponding to the most value information is selected as a new master node in a pushing mode, the new master node can be selected out quickly, and the distributed cluster can quickly recover when the distributed cluster faces the fault of the master node.
Drawings
Fig. 1 is an application environment diagram of a power grid monitoring system service master node selection method based on real-time state awareness in an embodiment;
FIG. 2 is a schematic flow chart illustrating a method for selecting a service master node of a power grid monitoring system based on real-time state awareness in an embodiment;
FIG. 3 is a schematic flow chart illustrating a method for selecting a service master node of a power grid monitoring system based on real-time status awareness in another embodiment;
fig. 4 is a flowchart illustrating a step of screening the most significant information from the operation identification information of each slave node based on the priority order and electing the slave node corresponding to the most significant information as a new master node in one embodiment;
FIG. 5 is a flowchart illustrating steps of determining a first slave node corresponding to a first maximum value and using the first slave node as a new master node according to an embodiment;
FIG. 6 is a flowchart illustrating steps of determining a second slave node corresponding to a second maximum value and using the second slave node as a new master node according to an embodiment;
FIG. 7 is a block diagram illustrating an embodiment of a device for selecting a service master node of a power grid monitoring system based on real-time status awareness;
FIG. 8 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.
The method for selecting the service master node of the power grid monitoring system based on real-time state perception can be applied to the application environment shown in fig. 1. In the distributed cluster, a master node 110, a monitoring node 100 for monitoring the operating state of the master node, and a plurality of slave nodes 120 are provided. The master node 110 is also called a master server, and is responsible for operations such as resource and task allocation, or data update in the distributed cluster. The monitoring node 100 is also called a monitoring server, and is configured to monitor the working state of the primary server in real time, and trigger a election pushing action in time when the working state of the primary server is abnormal, so as to elect a new master node. The slave node 120 is configured to perform a corresponding task according to an instruction of the master node 110. Illustratively, the distributed cluster is a Zookeeper distributed cluster. Zookeeper is a distributed, open source application coordination service implemented by the open source of Google Chubby (a file system that provides coarse-grained lock services). Zookeeper generally provides services to the outside by using a cluster mode as a server, and the services include configuration management, domain name service, cluster management, distributed lock and the like. In the Zookeeper distributed cluster, data synchronization among the nodes is realized according to a Zab protocol.
In some embodiments, the monitoring node 100 may be a server in the distributed cluster, or may be a server independent from the distributed cluster. The monitoring node 100 may be implemented by one server or a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a method for selecting a service master node of a power grid monitoring system based on real-time state sensing is provided, which is described by taking the monitoring node in fig. 1 as an example, and includes the following steps:
step S202, when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node.
The monitoring node is in communication connection with the current main node and monitors the running state of the current main node in real time. The real-time monitoring means that the monitoring node continuously detects the operating state of the master node, and may continuously monitor the operating state of the current master node for a period of time, for example, according to a certain time interval or frequency. When the monitoring node detects that the running state of the current main node is abnormal, in order to prevent the work of the distributed cluster from being trapped in a state of stagnation or paralysis, the monitoring node triggers a election action so as to realize the switching between the current main node and a new main node. That is, the monitoring node sends a election pushing instruction to each slave node connected with the current master node, so as to trigger election pushing action. Illustratively, the monitoring node may communicate with each slave node in a broadcast manner in the distributed cluster, send a election instruction to each slave node, and receive information returned by each slave node.
In some embodiments, as shown in fig. 3, the above method further comprises the steps of:
step S302, obtaining the running state information of the current main node, and detecting the running state information by using a preset threshold value.
Wherein the operation state information includes internal operation information and external link information. The internal operation information includes a system state condition of the current master node, such as one or more of a memory occupation condition, a CPU occupation condition, a hard disk occupation condition, and the like. The external link information includes the condition of each communication link connected with the current main node, including one or more of the fault condition, the congestion condition, the packet loss condition and the like of each communication link.
Specifically, the monitoring node monitors and acquires the running state information of the current host node in real time, and compares the current running state information with a preset threshold value to perform detection. For example, a threshold value of memory occupancy is set to be 95% in advance, and when the monitoring node acquires the operating state information of the current host node, and detects that the memory occupancy of the current host node exceeds the threshold value of 95%, it is determined that the operating state information is abnormal state information.
Step S304, when the running state information is detected to be abnormal state information, determining that the running state of the current main node is abnormal. Specifically, when the monitoring node detects that the running state information of the current host node is abnormal state information, it is determined that the running state of the current host node is abnormal.
In the above embodiment, the operation state information of the current main node is monitored in real time, and the operation state information is detected in a threshold setting mode, so that the fault of the current main node can be accurately and quickly detected.
And step S204, acquiring at least one type of operation identification information returned by each slave node respectively in response to the election instruction.
The operation identification information includes time identification information, version identification information, and node identification information. The time identification information is logic clock information. In the distributed cluster, each node performs data transmission exchange every time, logic clocks are superposed, and the larger the logic clock is, the message receiving and transmitting of the corresponding node are the latest. The version identification information is Zxid of each node and represents a data version on the node, and the larger the Zxid is, the more comprehensive the data information stored on the node is. The node identification information is a node ID, each node in the distributed cluster is assigned with a node ID, and the larger the node ID is, the more late the corresponding node is in the networking process is.
In order to rapidly select a new main node and avoid work interruption caused by long-time selection, various operation identification information have priority sequences. Illustratively, the various types of operation identification information are, in order from high to low according to the priority order: time identification information corresponding to the first priority order, version identification information corresponding to the second priority order, and node identification information corresponding to the third priority order.
Specifically, after receiving the election instruction, the slave node sends its own operation identification information to the monitoring node according to the election instruction. And the monitoring node acquires the operation identification information returned by each slave node.
In some embodiments, the slave nodes may first return time identification information corresponding to the first priority order, and the monitoring node performs a election operation after receiving the time identification information returned by each slave node; and when the monitoring node cannot deduce a new main node according to the time identification information returned by each slave node, sending a deduction instruction again, returning the version identification information corresponding to the second priority sequence by the slave node according to the deduction instruction, and so on.
In order to further increase the speed of the election and recovery operations, in some embodiments, each slave node returns all the operation identification information according to the election instruction, that is, returns three types of operation identification information, so that the monitoring node performs the election operation.
And S206, screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
Wherein the most value information refers to a maximum value in the operation identification information. As mentioned earlier, in the distributed cluster, the larger the time identification information is, the more recent the message reception and transmission of the corresponding node is; the larger the version identification information is, the more comprehensive the data information stored on the corresponding node is; the larger the node identification information is, the later the node identification information is added into the distributed cluster, the available idle resources of the server are less, and the server is relatively updated. Therefore, in the process of screening the slave nodes, the monitoring node compares the most value information of the operation identification information corresponding to each slave node, so as to determine a better slave node as a master node.
Specifically, after acquiring the operation identification information returned by each slave node, the monitoring node sequentially screens out the most value information from the operation identification information corresponding to each slave node according to the priority order of each type of operation identification information, and selects the slave node corresponding to the most value information as a new master node.
In some embodiments, as shown in fig. 4, based on the priority order, the step of screening the most significant information from the running identification information of each slave node, and electing the slave node corresponding to the most significant information as a new master node includes:
step S402, screening out a first maximum value of time identification information corresponding to a first priority order from operation identification information respectively corresponding to each slave node;
step S404, determining a first slave node corresponding to the first maximum value, and determining a new master node based on the first slave node.
Specifically, the monitoring node screens out the maximum value in the time identification information corresponding to each node from the acquired operation identification information of each node, and determines a new master node based on the slave node corresponding to the maximum value (for simplicity and convenience of description, the slave node screened out according to the time identification information is referred to as a first slave node). For example, the monitoring node may take the slave node corresponding to the maximum value as a new master node. For example, if the logic clocks of the slave node A, B, C are 2,3, and 1, respectively, the monitoring node determines the slave node B corresponding to the maximum value of 3 as the new master node.
It should be understood that the terms "first", "second", and "third" are used in this application to describe slave nodes screened according to different operational identification information, but these slave nodes should not be limited by these terms. These terms are only used to distinguish one slave node from another. For example, a first slave node may be referred to as a second slave node, and similarly, a second slave node may be referred to as a first slave node, without departing from the scope of the various described embodiments, but they are not the same slave node unless the context clearly dictates otherwise.
In some embodiments, when there is more than one first slave node, the monitoring node may randomly select one of the plurality of first slave nodes as the new master node.
In the above embodiment, each slave node is screened according to the time identification information belonging to the high priority, and the slave node corresponding to the maximum value among the slave nodes is screened as the new master node, so that the message reception and transmission of the new master node are performed the latest time, and the timeliness of the node data is guaranteed.
In order to take timeliness and comprehensiveness of node data into consideration, in some embodiments, as shown in fig. 5, determining a first slave node corresponding to a first maximum value, and determining a new master node based on the first slave node includes:
step S502, when more than one first slave node is provided, a second maximum value is screened out from the version identification information corresponding to the second priority order of each first slave node;
step S504, determining a second slave node corresponding to the second maximum value, and determining a new master node based on the second slave node.
Specifically, when the monitoring node screens each slave node according to the time identification information, and there is more than one first slave node corresponding to the maximum value of the time identification information determined by the time identification information, at this time, the monitoring node further screens each first slave node according to the version identification information corresponding to the first slave node. The monitoring node screens the slave node corresponding to the maximum value of the version identification information in the version identification information corresponding to each first slave node (for the sake of distinction, the slave node screened for the second time is called a second slave node), and determines a new master node based on the second slave node. For example, the monitoring node may take the slave node corresponding to the maximum value as a new master node.
In some embodiments, when there is more than one second slave node, the monitoring node may randomly select one of the plurality of second slave nodes as the new master node.
In the above embodiment, under the condition that there is more than one slave node screened according to the time identification information, secondary screening is performed according to the version identification information belonging to the medium priority, so that the timeliness of the new master node can be ensured, and the comprehensiveness of the data information stored on the node can be further ensured.
In order to take timeliness, comprehensiveness, and expansibility of node data into consideration, in some embodiments, as shown in fig. 6, the second slave node corresponding to the second maximum value is determined, and a new master node is determined based on the second slave node, including:
step S602, when there are more than one second slave nodes, screening out a third maximum value from the node identification information of each second slave node corresponding to the third priority order;
step S604, the second slave node corresponding to the third maximum value is used as a new master node.
Specifically, when the monitoring node performs the second screening on each slave node according to the version identification information, and there is more than one second slave node corresponding to the maximum value of the version identification information determined by the second screening, at this time, the monitoring node performs further screening on each second slave node according to the node identification information corresponding to the second slave node. And the monitoring node screens the slave node corresponding to the maximum value of the node identification information from the node identification information corresponding to each second slave node, and takes the slave node as a new master node. For the sake of illustration, the slave node screened for the third time is referred to as a third slave node.
In the above embodiment, under the condition that there is more than one slave node screened according to the version identification information, the three-time screening is performed according to the version identification information belonging to the low priority, so that the timeliness and comprehensiveness of the new master node can be ensured, and meanwhile, the new master node is ensured to be a server node which is accessed later relatively, and correspondingly available idle resources are more sufficient.
According to the power grid monitoring system service master node selection method based on real-time state perception, the operation state of the current master node is detected in real time through the monitoring nodes, when the fact that the operation state of the master node is abnormal is detected, at least one type of operation identification information of each slave node is obtained, the most value information is sequentially screened out based on the priority sequence among various types of operation identification information, the slave node corresponding to the most value information is selected as a new master node in a pushing mode, the new master node can be selected out quickly, and the distributed cluster can quickly recover when the master node is in fault.
In some embodiments, further comprising: receiving operation recovery information sent by the main node before the election is recovered to be normal; and taking the master node before the push as a new master node again according to the operation recovery information.
Specifically, the monitoring node may further maintain the communication connection with the previous host node after a new host node is elected, and receive the operation recovery information sent by the previous host node after the previous host node recovers to normal. The recovery operation information is, for example, normal operation state information. And the monitoring node determines that the previous main node is recovered to be normal (for example, the fault is eliminated) according to the recovery operation information, and takes the previous main node as a new main node again to perform work such as data updating.
In the above embodiment, after the master node before election returns to normal, the master node before election is taken as a new master node again, so that the data content required to be updated by the master node is less, and the communication resources in the cluster are saved.
It should be understood that although the various steps in the flow charts of fig. 2-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order 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. 2-6 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 7, there is provided a grid monitoring system service master node selecting apparatus 700 based on real-time status awareness, including: a detection module 710, an acquisition module 720, and a processing module 730, wherein:
the detecting module 710 is configured to send a election instruction to each slave node connected to the current master node when detecting that the operating state of the current master node is abnormal.
An obtaining module 720, configured to obtain at least one type of operation identification information returned by each slave node in response to the election instruction; wherein, the various types of operation identification information have a priority order.
And the processing module 730 is configured to, based on the priority order, screen out the most significant information from the operation identification information corresponding to each slave node, and push and select the slave node corresponding to the most significant information as a new master node.
In one embodiment, the detection module is further configured to acquire operation state information of the current host node, and detect the operation state information by using a preset threshold; the running state information comprises internal running information and external link information; and when the detected running state information is abnormal state information, determining that the running state of the current main node is abnormal.
In one embodiment, the running identification information comprises, in order of priority: time identification information corresponding to the first priority order, version identification information corresponding to the second priority order, and node identification information corresponding to the third priority order.
In one embodiment, the processing module is further configured to filter out a first maximum value of the time identification information corresponding to the first priority order from the operation identification information corresponding to each slave node; and determining a first slave node corresponding to the first maximum value, and determining a new master node based on the first slave node.
In one embodiment, the processing module is further configured to, when there is more than one first slave node, filter out a second maximum value from the version identification information corresponding to the second priority order of each first slave node; and determining a second slave node corresponding to the second maximum value, and determining a new master node based on the second slave node.
In one embodiment, the processing module is further configured to, when there are more than one second slave nodes, screen out a third maximum value from the node identification information of each second slave node corresponding to the third priority order; and taking the second slave node corresponding to the third maximum value as a new master node.
In one embodiment, the processing module is further configured to receive operation resuming information sent by the master node before the election is resumed; and taking the master node before the push as a new master node again according to the operation recovery information.
For specific limitations of the power grid monitoring system service master node selection device based on real-time state sensing, reference may be made to the above limitations of the power grid monitoring system service master node selection method based on real-time state sensing, which are not described herein again. All modules in the power grid monitoring system service master node selection device based on real-time state perception 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, and the computer device may be a monitoring node (also called a monitoring server) in the foregoing embodiments, and its internal structure diagram may be as shown in fig. 8. 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 device is used for storing the operation identification information. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a power grid monitoring system service master node selection method based on real-time state perception.
Those skilled in the art will appreciate that the architecture shown in fig. 8 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 having a computer program stored therein, the processor implementing the following steps when executing the computer program: when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node; acquiring at least one type of operation identification information returned by each slave node in response to the election instruction; wherein, the various operation identification information have priority order; and screening the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the running state information of the current main node, and detecting the running state information by using a preset threshold; the running state information comprises internal running information and external link information; and when the detected running state information is abnormal state information, determining that the running state of the current main node is abnormal.
In one embodiment, the processor, when executing the computer program, further performs the steps of: screening out a first maximum value of time identification information corresponding to a first priority order from operation identification information respectively corresponding to each slave node; and determining a first slave node corresponding to the first maximum value, and determining a new master node based on the first slave node.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the number of the first slave nodes is more than one, screening out a second maximum value from the version identification information corresponding to the second priority order of each first slave node; and determining a second slave node corresponding to the second maximum value, and determining a new master node based on the second slave node.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when more than one second slave node is provided, screening out a third maximum value from the node identification information of each second slave node corresponding to the third priority order; and taking the second slave node corresponding to the third maximum value as a new master node.
In one embodiment, the processor, when executing the computer program, further performs the steps of: receiving operation recovery information sent by the main node before the election is recovered to be normal; and taking the master node before the push as a new master node again according to the operation recovery information.
According to the computer equipment, the running state of the current main node is detected in real time through the monitoring node, when the running state of the main node is detected to be abnormal, at least one type of running identification information of each slave node is obtained, the most value information is sequentially screened out based on the priority sequence among the various types of running identification information, the slave node corresponding to the most value information is pushed and selected as a new main node, the new main node can be quickly pushed and selected, and the distributed cluster can quickly recover when the fault of the main node is met.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node; acquiring at least one type of operation identification information returned by each slave node in response to the election instruction; wherein, the various operation identification information have priority order; and screening the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring the running state information of the current main node, and detecting the running state information by using a preset threshold; the running state information comprises internal running information and external link information; and when the detected running state information is abnormal state information, determining that the running state of the current main node is abnormal.
In one embodiment, the computer program when executed by the processor further performs the steps of: screening out a first maximum value of time identification information corresponding to a first priority order from operation identification information respectively corresponding to each slave node; and determining a first slave node corresponding to the first maximum value, and determining a new master node based on the first slave node.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the number of the first slave nodes is more than one, screening out a second maximum value from the version identification information corresponding to the second priority order of each first slave node; and determining a second slave node corresponding to the second maximum value, and determining a new master node based on the second slave node.
In one embodiment, the computer program when executed by the processor further performs the steps of: when more than one second slave node is provided, screening out a third maximum value from the node identification information of each second slave node corresponding to the third priority order; and taking the second slave node corresponding to the third maximum value as a new master node.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving operation recovery information sent by the main node before the election is recovered to be normal; and taking the master node before the push as a new master node again according to the operation recovery information.
According to the computer-readable storage medium, the running state of the current master node is detected in real time through the monitoring node, when the running state of the master node is detected to be abnormal, at least one type of running identification information of each slave node is obtained, the most value information is sequentially screened out based on the priority sequence among the various running identification information, the slave node corresponding to the most value information is pushed and selected as a new master node, the new master node can be quickly pushed and selected, and the distributed cluster can quickly recover when the distributed cluster faces the fault of the master node.
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-mentioned embodiments 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 selecting a service master node of a power grid monitoring system based on real-time state perception is characterized by comprising the following steps:
when the abnormal operation state of the current main node is detected, a election instruction is sent to each slave node connected with the current main node;
acquiring at least one type of operation identification information returned by each slave node respectively responding to the election instruction; wherein, the various operation identification information have priority order;
and screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
2. The method of claim 1, further comprising:
acquiring running state information of a current main node, and detecting the running state information by using a preset threshold value; wherein the operation state information includes internal operation information and external link information;
and when the running state information is detected to be abnormal state information, determining that the running state of the current main node is abnormal.
3. The method of claim 1, wherein the run identification information comprises, in order of priority: time identification information corresponding to the first priority order, version identification information corresponding to the second priority order, and node identification information corresponding to the third priority order.
4. The method according to claim 3, wherein the screening out most value information from the operation identification information of each slave node based on the priority order, and electing the slave node corresponding to the most value information as a new master node comprises:
screening out a first maximum value in the time identification information corresponding to the first priority order from the operation identification information respectively corresponding to each slave node;
and determining a first slave node corresponding to the first maximum value, and determining a new master node based on the first slave node.
5. The method of claim 4, wherein determining the first slave node corresponding to the first maximum value and determining a new master node based on the first slave node comprises:
when the number of the first slave nodes is more than one, screening out a second maximum value from the version identification information corresponding to the second priority order of each first slave node;
and determining a second slave node corresponding to the second maximum value, and determining a new master node based on the second slave node.
6. The method of claim 5, wherein determining the second slave node corresponding to the second maximum value and determining a new master node based on the second slave node comprises:
when the number of the second slave nodes is more than one, screening out a third maximum value from the node identification information of each second slave node corresponding to the third priority order;
and taking the second slave node corresponding to the third maximum value as a new master node.
7. The method of any one of claims 1 to 6, further comprising:
receiving operation recovery information sent by the main node before the election is recovered to be normal;
and taking the master node before the current election as a new master node again according to the operation recovery information.
8. A device for selecting a service master node of a power grid monitoring system based on real-time state perception is characterized by comprising:
the system comprises a detection module, a selection module and a selection module, wherein the detection module is used for sending a selection pushing instruction to each slave node connected with a current main node when detecting that the running state of the current main node is abnormal;
the acquisition module is used for acquiring at least one type of operation identification information returned by each slave node in response to the election instruction; wherein, the various operation identification information have priority order;
and the processing module is used for screening out the most value information from the operation identification information corresponding to each slave node based on the priority sequence, and selecting the slave node corresponding to the most value information as a new master node.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110747857.XA 2021-07-01 2021-07-01 Power grid monitoring system service master node selection method based on real-time state sensing Active CN113489149B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110747857.XA CN113489149B (en) 2021-07-01 2021-07-01 Power grid monitoring system service master node selection method based on real-time state sensing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110747857.XA CN113489149B (en) 2021-07-01 2021-07-01 Power grid monitoring system service master node selection method based on real-time state sensing

Publications (2)

Publication Number Publication Date
CN113489149A true CN113489149A (en) 2021-10-08
CN113489149B CN113489149B (en) 2023-07-28

Family

ID=77940161

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110747857.XA Active CN113489149B (en) 2021-07-01 2021-07-01 Power grid monitoring system service master node selection method based on real-time state sensing

Country Status (1)

Country Link
CN (1) CN113489149B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422521A (en) * 2022-01-12 2022-04-29 北京京东振世信息技术有限公司 Method and device for determining main node, electronic equipment and storage medium
CN115240379A (en) * 2022-07-19 2022-10-25 安徽远航交通科技有限公司 Linkage alarm system based on intelligent road cone

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080281938A1 (en) * 2007-05-09 2008-11-13 Oracle International Corporation Selecting a master node in a multi-node computer system
US20110309683A1 (en) * 2010-06-16 2011-12-22 Kaj Skov Nielsen Electric power control system and electric power facility comprising the electric power control system
CN104539055A (en) * 2015-01-07 2015-04-22 山东鲁能智能技术有限公司 Electric system key equipment actualizing-one-prepared method and system based on network
CN106161495A (en) * 2015-03-25 2016-11-23 中兴通讯股份有限公司 A kind of host node electoral machinery, device and storage system
CN113014634A (en) * 2021-02-20 2021-06-22 成都新希望金融信息有限公司 Cluster election processing method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080281938A1 (en) * 2007-05-09 2008-11-13 Oracle International Corporation Selecting a master node in a multi-node computer system
US20110309683A1 (en) * 2010-06-16 2011-12-22 Kaj Skov Nielsen Electric power control system and electric power facility comprising the electric power control system
CN104539055A (en) * 2015-01-07 2015-04-22 山东鲁能智能技术有限公司 Electric system key equipment actualizing-one-prepared method and system based on network
CN106161495A (en) * 2015-03-25 2016-11-23 中兴通讯股份有限公司 A kind of host node electoral machinery, device and storage system
CN113014634A (en) * 2021-02-20 2021-06-22 成都新希望金融信息有限公司 Cluster election processing method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422521A (en) * 2022-01-12 2022-04-29 北京京东振世信息技术有限公司 Method and device for determining main node, electronic equipment and storage medium
CN114422521B (en) * 2022-01-12 2024-04-05 北京京东振世信息技术有限公司 Method and device for determining master node, electronic equipment and storage medium
CN115240379A (en) * 2022-07-19 2022-10-25 安徽远航交通科技有限公司 Linkage alarm system based on intelligent road cone

Also Published As

Publication number Publication date
CN113489149B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN110460676B (en) Request quantity control method and device, storage medium and computer equipment
CN110830283B (en) Fault detection method, device, equipment and system
CN108897658B (en) Method and device for monitoring master database, computer equipment and storage medium
CN113489149A (en) Power grid monitoring system service master node selection method based on real-time state perception
CN114070739B (en) Cluster deployment method, device, equipment and computer readable storage medium
CN113364618B (en) Power grid monitoring system master-slave equipment anti-error switching method based on penalty coefficient rule
CN110674096A (en) Node troubleshooting method, device and equipment and computer readable storage medium
CN115499447A (en) Cluster master node confirmation method and device, electronic equipment and storage medium
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN106878096B (en) VNF state detection notification method, device and system
CN113765690A (en) Cluster switching method, system, device, terminal, server and storage medium
CN111309515B (en) Disaster recovery control method, device and system
CN108881011B (en) LACP (Link aggregation control protocol) switching method and device applied to cross-device
CN113098709B (en) Network recovery method and device based on distributed networking system and computer equipment
CN113824595B (en) Link switching control method and device and gateway equipment
CN114168071B (en) Distributed cluster capacity expansion method, distributed cluster capacity expansion device and medium
JP2017521802A (en) Architecture for correlation events for supercomputer monitoring
CN112437146B (en) Equipment state synchronization method, device and system
CN107710165B (en) Method and device for storage node synchronization service request
CN113157493A (en) Backup method, device and system based on ticket checking system and computer equipment
CN116668269A (en) Arbitration method, device and system for dual-activity data center
CN111934909A (en) Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium
CN110932878A (en) Management method, equipment and system of distributed network
CN111866041B (en) Service equipment selection method, cloud storage cluster updating method, device and storage medium
CN109218206B (en) Method and device for limiting link state advertisement quantity

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