CN108632108B - Monitoring method and device based on polling protocol and readable storage medium - Google Patents

Monitoring method and device based on polling protocol and readable storage medium Download PDF

Info

Publication number
CN108632108B
CN108632108B CN201810028055.1A CN201810028055A CN108632108B CN 108632108 B CN108632108 B CN 108632108B CN 201810028055 A CN201810028055 A CN 201810028055A CN 108632108 B CN108632108 B CN 108632108B
Authority
CN
China
Prior art keywords
state
target information
value
polling
changed
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
CN201810028055.1A
Other languages
Chinese (zh)
Other versions
CN108632108A (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.)
Siemens Power Automation Ltd
Original Assignee
Siemens Power Automation 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 Siemens Power Automation Ltd filed Critical Siemens Power Automation Ltd
Priority to CN201810028055.1A priority Critical patent/CN108632108B/en
Publication of CN108632108A publication Critical patent/CN108632108A/en
Application granted granted Critical
Publication of CN108632108B publication Critical patent/CN108632108B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/403Bus networks with centralised control, e.g. polling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a monitoring method, a monitoring device and a readable storage medium based on a polling protocol, wherein the monitoring method comprises the following steps: receiving an inquiry request sent by a monitoring end aiming at target information of a client, wherein the inquiry request is used for acquiring the current state of the target information, and the current state is one of a normal state and an abnormal state; acquiring a current state of target information and a corresponding indication value, wherein the indication value is used for indicating whether the state of the target information is reset and changed in a polling cycle, the polling cycle is a time period between a currently received inquiry request and a received last inquiry request, and the reset and change indicates that the state of the target information is changed and is recovered to an initial state when the polling cycle is started when the polling cycle is ended; and judging whether to send the current state to the monitoring end or not according to the marking value. According to the invention, the loss of the monitoring information can be avoided as much as possible.

Description

Monitoring method and device based on polling protocol and readable storage medium
Technical Field
The invention relates to the field of industry, in particular to a monitoring method and device based on a polling protocol and a readable storage medium.
Background
In the power system, an SCADA (Supervisory Control And Data Acquisition) system is most widely used, And the technical development is the most mature. The SCADA system is a data acquisition and monitoring control system, and can monitor and control on-site operating equipment so as to realize various functions of data acquisition, equipment control, measurement, parameter adjustment, various signal alarms and the like.
In the prior art, a Device monitored by the SCADA system may be referred to as an IED (intelligent electronic Device), and a polling protocol adopted is generally a Modbus protocol. The polling protocol means that the monitoring terminal sends an inquiry request to the client at regular time, and the client returns response information immediately after receiving the inquiry request. In the SCADA system, the SCADA system sends an inquiry request to the IED, and the IED returns response information immediately after receiving the inquiry request. The response information is generally status information, for example, the IED returns "0" indicating that its current status is normal, and the IED returns "1" indicating that its current status is abnormal.
However, in practice, the following problems arise: from a normal state to an abnormal state, an IED changes its status indicator from "0" to "1", but soon it reverts back to the normal state, i.e. changes its status indicator from "1" to "0". If the polling period is long, the monitoring host is likely not to monitor the status, that is, the status numbers returned by the two inquiry request IEDs are both "0". Thus, a situation in which the monitoring information is lost occurs.
Disclosure of Invention
In view of the above, the present invention provides a monitoring method, apparatus and readable storage medium based on polling protocol, for avoiding loss of monitoring information.
One aspect of the present invention provides a monitoring method based on a polling protocol, including:
receiving an inquiry request sent by a monitoring terminal aiming at target information of a client, wherein the inquiry request is used for acquiring the current state of the target information, and the current state is one of a normal state and an abnormal state;
acquiring a current state of the target information and a corresponding indication value, wherein the indication value is used for indicating whether the state of the target information is reset and changed in a polling cycle, the polling cycle is a time period separated by a currently received inquiry request and a received last inquiry request, and the reset change indicates that the state of the target information is changed and is recovered to an initial state at the beginning of the polling cycle when the polling cycle is finished;
and judging whether to send the current state to the monitoring terminal according to the indication value.
According to the invention, after receiving the inquiry request sent by the monitoring terminal aiming at the target information of the client, the current state and the marking value of the target information are obtained in real time, and whether the current state is sent to the monitoring terminal is judged according to the marking value, so that the monitoring information can be ensured not to be lost.
According to the monitoring method, optionally, the determining whether to send the current state to the monitoring end according to the indication value includes:
determining whether the indication value is a value indicating that the state of the target information is reset and changed in a polling period;
and if the determination result is yes, sending another state different from the current state to the monitoring end.
According to the monitoring method, optionally, the method further comprises:
and if the determination result is negative, sending the current state to the monitoring end.
According to the monitoring method, optionally, after acquiring the current state of the target information and a corresponding indication value, the method further includes: and modifying the indication value into a value which indicates that the state of the target information is not reset and changed in a polling period. This facilitates the determination of the next polling period.
According to the monitoring method, optionally, before receiving an inquiry request sent by a monitoring end for a target message of a client, the method further includes:
in the polling period, if the state of the target information is identified to be changed, determining the number of times of changing the state of the client in the polling period;
if the change times is even, modifying the indication value into a value indicating that the state of the target information is reset and changed in a polling period;
and if the change times are odd, keeping the initial value of the mark value unchanged, wherein the initial value of the mark value is a value indicating that the state of the target information is not reset and changed in one polling period.
Therefore, when the period is finished, the marking value is determined by determining the change times of the state of the target information, and the method is simple and high in accuracy.
According to the monitoring method, optionally, before receiving an inquiry request sent by a monitoring end for a target message of a client, the method further includes:
in the polling cycle, if the state of the target information is identified to be changed, modifying the value of the indicating value according to the following preset rule according to each change:
if the change is the ith change, modifying the marking value into a value which indicates that the state of the target information is reset and changed in a polling period, wherein i is an even number;
and if the j time is the j time change, modifying the marking value into a value which indicates that the state of the target information is not reset and changed in a polling period, wherein j is an odd number.
And after the 2 nd change of the state of the target information, the value of the indicating value is modified immediately after each change, and the method is simple and reliable.
Another aspect of the present invention provides a polling protocol-based monitoring apparatus, including:
a receiving unit, configured to receive an inquiry request sent by a monitoring end for a target information of a client, where the inquiry request is used to obtain a current state of the target information, and the current state is one of a normal state and an abnormal state;
an obtaining unit, configured to obtain a current state of the target information and a corresponding indication value, where the indication value is used to indicate whether a reset change occurs to the state of the target information in a polling cycle, the polling cycle is a time period between a currently received inquiry request and a received previous inquiry request, and the reset change indicates that the state of the target information is changed and then is restored to an initial state in the polling cycle;
and the determining unit is used for judging whether to send the current state to the monitoring end or not according to the indication value.
According to the invention, after receiving the inquiry request sent by the monitoring terminal aiming at the target information of the client, the current state and the marking value of the target information are obtained in real time, and whether the current state is sent to the monitoring terminal is judged according to the marking value, so that the monitoring information can be ensured not to be lost.
According to the monitoring device, optionally, the determining unit is specifically configured to:
determining whether the indication value is a value indicating that the state of the target information is reset and changed in a polling period;
and if the determination result is yes, sending another state different from the current state to the monitoring end.
According to the monitoring device, optionally, the determining unit is further specifically configured to:
and if the determination result is negative, sending the current state to the monitoring end.
According to the monitoring device, optionally, the monitoring device further comprises: and the first modifying unit is used for modifying the marking value into a value which indicates that the state of the target information is not reset and changed in a polling cycle. This facilitates the determination of the next polling period.
Optionally, the monitoring device further includes a second modification unit, configured to:
in the polling period, if the state of the target information is identified to be changed, determining the number of times of changing the state of the client in the polling period;
if the change times is even, modifying the indication value into a value indicating that the state of the target information is reset and changed in a polling period;
and if the change times are odd, keeping the initial value of the mark value unchanged, wherein the initial value of the mark value is a value indicating that the state of the target information is not reset and changed in one polling period.
Therefore, when the period is finished, the marking value is determined by determining the change times of the state of the target information, and the method is simple and high in accuracy.
Optionally, the monitoring device further includes a third modification unit, configured to:
in the polling cycle, if the state of the target information is identified to be changed, modifying the value of the indicating value according to the following preset rule according to each change:
if the change is the ith change, modifying the marking value into a value which indicates that the state of the target information is reset and changed in a polling period, wherein i is an even number;
and if the j time is the j time change, modifying the marking value into a value which indicates that the state of the target information is not reset and changed in a polling period, wherein j is an odd number.
And after the 2 nd change of the state of the target information, the value of the indicating value is modified immediately after each change, and the method is simple and reliable.
The present invention provides in one aspect a polling protocol based monitoring device comprising:
at least one memory for storing instructions;
at least one processor configured to perform the polling protocol-based monitoring method of any of the above in accordance with instructions stored by the memory. According to the invention, after receiving the inquiry request sent by the monitoring terminal aiming at the target information of the client, the current state and the marking value of the target information are obtained in real time, and whether the current state is sent to the monitoring terminal is judged according to the marking value, so that the monitoring information can be ensured not to be lost.
Yet another aspect of the invention provides a readable storage medium having stored therein machine readable instructions which, when executed by a machine, perform a polling protocol based monitoring method as described in any one of the above. According to the invention, after receiving the inquiry request sent by the monitoring terminal aiming at the target information of the client, the current state and the marking value of the target information are obtained in real time, and whether the current state is sent to the monitoring terminal is judged according to the marking value, so that the monitoring information can be ensured not to be lost.
Drawings
The foregoing and other features and advantages of the invention will become more apparent to those skilled in the art to which the invention relates upon consideration of the following detailed description of a preferred embodiment of the invention with reference to the accompanying drawings, in which:
fig. 1 is a flowchart illustrating a polling protocol-based monitoring method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a polling protocol-based monitoring method according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a polling protocol-based monitoring method according to still another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a monitoring apparatus based on a polling protocol according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail by referring to the following examples.
In the prior art, a monitoring end needs to know whether target information of a client is abnormal or not. For example, the target information of the client is changed from the normal state to the abnormal state and is restored to the normal state quickly and is kept stable, and if the polling cycle is greater than the time period of the two reset changes, the monitoring end loses the information that the target information was in the abnormal state. Because the monitoring end only needs to know whether the target information of the client is abnormal or not, the abnormality can be known by monitoring personnel and relevant processing can be carried out, and the abnormality is irrelevant to the times and time of the abnormal state, the invention presets a marking bit, and uses a marking value on the marking bit to indicate whether the state of the target information is reset and changed in a polling period, and further judges whether the current state of the target information is sent to the monitoring end or not.
Example one
The embodiment provides a monitoring method based on a polling protocol, an execution subject of the monitoring method is a monitoring device based on the polling protocol, and the monitoring device may be set in a client of an electric power system, for example, a client corresponding to an SCADA system, or may be set separately, which is not limited in this embodiment. The client is, for example, an intelligent electronic device, and may specifically be a protection measurement and control device used in an electric power system.
The polling protocol means that the monitoring terminal sends an inquiry request to the client at regular time, and the client returns response information immediately after receiving the inquiry request. In the prior art, there are many polling protocols, such as MODBUS protocol.
Fig. 1 is a schematic flow chart of a polling protocol-based monitoring method according to this embodiment. The monitoring method comprises the following steps:
step 101, receiving an inquiry request sent by a monitoring end for a target message of a client, where the inquiry request is used to obtain a current state of the target message, and the current state of the target message is one of a normal state and an abnormal state.
The monitoring end of the embodiment may be a SCADA system. The monitoring terminal sends an inquiry request to the client terminal every polling period based on a polling protocol so that the client terminal reports the current state of the target information according to the inquiry request, namely, the client terminal sends the target information to the monitoring terminal whether the target information is in a normal state or an abnormal state. The current state of the target information is in two types, one is a normal state, and the other is an abnormal state.
For example, the target information may be a power-on state of the client, where if the client is currently in a normal power-on working state, that is, the current state is a normal state, and if the client is currently in a power-off state, that is, the current state is an abnormal state; the target information can be the picture display state of the client, if the current picture display is normal, the current state is the normal state, and if the current picture display is abnormal, the current state is the abnormal state; the target information may also be a communication state of the client, where if the current communication of the client is normal, that is, the current state is a normal state, and if the communication is not possible, that is, the current state is an abnormal state. There may be many more target information and will not be described herein. Each target information corresponds to two states, a normal state and an abnormal state. The current state is one of a normal state and an abnormal state. The normal state or the abnormal state may be represented by a preset value as long as the monitoring terminal can recognize it.
Step 102, acquiring a current state of the client and an indication value of the client, where the indication value is used to indicate whether the state of the target information is reset and changed in a polling cycle, the polling cycle is a time period between a currently received inquiry request and a received last inquiry request, and the reset and change indicates that the state of the target information is changed and is restored to an initial state when the polling cycle is started when the polling cycle is ended.
For example, the current state of the target information of the client and the current mark value of a mark bit preset in the client are obtained in real time. In this embodiment, a flag bit is preset at the client, and when the state of the client changes in a polling cycle, the reset change is marked with a preset value. For example, when the index value is 0, it indicates that the state of the client has not been reset and changed in the polling cycle, and when the index value is 1, it indicates that the state of the client has been reset and changed in the polling cycle.
In this implementation, when the state of the target information changes in one polling cycle, and the state of the target information corresponding to the starting time point of the polling cycle is the same as the state of the target information corresponding to the ending time point of the polling cycle, the state of the target information is reset and changed, otherwise, the state of the target information is not considered as being reset and changed. For example, if the state of the target information is a normal state at the start time point of a polling period and changes during the polling period, and the state of the target information is a normal state at the end time point of the polling period, it may be determined that the state of the target information has changed by resetting during the polling period.
And 103, judging whether to send the current state to the monitoring terminal according to the indication value.
Specifically, if the current indication value indicates a value that the state of the target information of the client is reset and changed in one polling cycle, another state different from the current state is sent to the monitoring end.
For example, during a polling period, the state of the target information of the client is reset and changed, for example, from a normal state to an abnormal state and then to a normal state. And the monitoring device receives an inquiry request aiming at the target information, acquires that the current state of the target information is a normal state and the target information with the marking value of the client is reset and changed, and sends an abnormal state to the monitoring terminal. Therefore, the monitoring end can not lose information. If it is determined that the state of the target information has changed by resetting, after step 102, the flag value may be modified to a value indicating that the state of the target information has not changed by resetting in one polling cycle, for example, an initial value of the flag value. This step may be performed in no order from step 103, for example, it may be performed simultaneously, or it may be performed after step 103.
In a polling period, the target information of the client changes from a normal state to an abnormal state and is kept in the abnormal state. And the monitoring device receives an inquiry request aiming at the target information, acquires that the current state of the target information is an abnormal state and the target information with the marking value of the client side is not subjected to reset change, and sends the abnormal state to the monitoring terminal. Thus, the monitoring end still has no information loss.
According to the invention, after receiving the inquiry request sent by the monitoring terminal aiming at the target information of the client, the current state and the marking value of the target information are obtained in real time, and whether the current state is sent to the monitoring terminal is judged according to the marking value, so that the monitoring information can be ensured not to be lost.
Example two
The present embodiment further supplements the monitoring method based on the polling protocol in the above-mentioned embodiment.
Fig. 2 is a schematic flow chart of a monitoring method based on a polling protocol according to this embodiment. The embodiment comprises the following steps:
step 201, receiving an inquiry request sent by a monitoring end aiming at a target information of a client, wherein the inquiry request is used for acquiring a current state of the target information, the target information corresponds to a normal state or an abnormal state, and the current state is one of the normal state or the abnormal state, and the step is converted into step 202.
This step is identical to step 101 and will not be described herein.
Step 202, obtaining the current state and an indication value, where the indication value is used to indicate whether the state of the target information has been changed by resetting in a polling cycle, and the polling cycle is a time period between the currently received inquiry request and the last received inquiry request, and then turning to step 203.
This step is identical to step 102 and will not be described herein.
Step 203, determining whether the indication value is a value indicating that the state of the target information is reset and changed in a polling cycle, if so, turning to step 204, and if not, turning to step 206.
Specifically, how to use the indication value to indicate whether the target information has been changed by over-reset may be set according to actual requirements, for example, if the indication value is M, and if the indication value is N, the indication value is N.
Step 204, another state different from the current state is sent to the monitoring end, and the process goes to step 205.
If the current state is a normal state, sending an abnormal state; and if the current state is the abnormal state, sending the normal state.
Step 205, modify the flag value to a value indicating that the state of the client has not been reset within a polling period.
Thus, the judgment of the next polling period is facilitated.
This step 205 may be performed simultaneously with step 204. If step 205 is performed after step 204, the integrity of the state information can be further ensured.
Step 206, sending the current state to the monitoring end.
In this embodiment, in a polling cycle, if the state of the client is reset and changed, the flag value is modified to a value indicating that the state of the client is reset and changed in one polling cycle. Namely before step 201, further comprising:
in a polling period, if the state of the client is identified to change, determining the change times of the state of the client in the polling period;
if the change times are even numbers, the marking value is modified to a value which represents that the state of the target information is reset and changed in a polling period;
if the number of changes is odd, the initial value of the index value is kept unchanged, and the initial value of the index value is a value indicating that the state of the target information is not reset and changed in one polling cycle.
Specifically, for example, in a polling cycle, when the state of the target information is identified to change, the number of times of the change in the state is recorded in real time, and when the polling cycle is ended, whether the number of times of the change is an odd number or an even number is determined, thereby determining the value of the indicating value. For example, when the state of the target information changes from the normal state to the abnormal state and then to the normal state, the number of times of the change is two, and at this time, the indication value needs to be modified to a value indicating that the state of the target information is reset and changed in one polling cycle; when the state of the target information changes from the normal state to the abnormal state to the normal state and then to the abnormal state again, the number of times it changes is one, and the index value may be maintained as the initial value at this time.
Therefore, when the period is finished, the marking value is determined by determining the change times of the state of the target information, and the method is simple and high in accuracy.
Of course, the tag value may also be modified in the following manner:
in the polling period, if the state of the target information is identified to be changed, the value of the indicating value is modified according to the following preset rule according to each change:
if the change is the ith change, the marking value is modified into a value which represents that the state of the target information is reset and changed in a polling period, wherein i is an even number;
if the j time is the change, the marking value is modified to a value which indicates that the state of the target information is not reset and changed in a polling period, and j is an odd number.
For example, in one polling cycle, if the state of the target information is identified to change, it is determined that the target information changes for the second time. For example, if the state of the target information changes from a normal state to an abnormal state, in which case the 1 st time changes, the flag value may be kept unchanged, the initial value of the flag value is a value indicating that the state of the target information has not been reset-changed in one polling cycle, if the state of the target information subsequently changes from the abnormal state to the normal state, in which case the 2 nd time changes, the flag value may be modified to a value indicating that the state of the target information has been reset-changed in one polling cycle, and if the state of the target information subsequently changes from the normal state to the abnormal state, in which case the 3 rd time changes, the flag value may be modified to a value indicating that the state of the target information has not been reset-changed in one polling cycle, and so on.
And after the 2 nd change of the state of the target information, the value of the indicating value is modified immediately after each change, and the method is simple and reliable.
According to the embodiment, after an inquiry request sent by a monitoring terminal for target information of a client is received, the current state and the marking value of the target information are obtained in real time, whether the marking value is a value indicating that the state of the target information is reset and changed in a polling cycle is determined, if the result of the determination is positive, another state different from the current state is sent to the monitoring terminal, and if the result of the determination is negative, the current state is sent to the monitoring terminal, so that the monitoring information can be ensured not to be lost.
EXAMPLE III
The present embodiment specifically exemplifies the monitoring method based on the polling protocol in the foregoing embodiment. In the present embodiment, the normal state is represented by "0", and the abnormal state is represented by "1". The flag value Maskbit of 0 indicates that the state of the target information is not reset and changed in a polling period, and the flag value Maskbit of 1 indicates that the state of the target information is reset and changed in a polling period.
Example one:
in the first polling period a, the state of the target information remains "0", and the Maskbit remains at the initial value of 0. When the first polling cycle a is finished, the client receives an inquiry request requestA of the monitoring end for the current state of the target information, and then the current state of the target information is acquired to be 0 and the Maskbit is acquired to be 0. The client judges that the target information is not subjected to reset change in the first polling period A according to the value of the Maskbit, and sends a response reply ResponseA to the monitoring end, wherein the current state 0 with the information as the target information is carried.
During the second polling period B, the state of the target information changes from "0" to "1" to "0" again, and remains stable. The Maskbit has an initial value of 0. When the client identifies that the target information is reset and changed, the value of the Maskbit corresponding to the target information is set to be 1. And when the second polling cycle B is ended, the client receives an inquiry request B which is sent by the monitoring end and aims at the current state of the target information. The client acquires that the current target information is 0 and acquires that the Maskbit is 1. And the client determines that the target information is reset and changed in the polling period according to the current value 1 of the Maskbit, and sends a response reply ResponseB to the monitoring end, wherein the carried information is in a state 1 opposite to the current state of the target information. The Maskbit is then set to a value of 0.
In the third polling period C, the state of the target information remains "0", and the Maskbit remains at the initial value of 0. When the third polling cycle is finished and the client receives the query request requestC for the current state of the target information, the current state of the target information is acquired to be 0 and the Maskbit is acquired to be 0. And the client judges that the target information is not reset and changed in the third polling period C according to the value of the Maskbit, and sends a response reply ResponseC to the monitoring end, wherein the carried information is the current state 0 of the target information.
As can be seen from the first example, although the target information has a short abnormal state in one polling cycle and then returns to normal, the monitoring end can still monitor the abnormal state.
Example two:
the difference between this example and example one is that, in the second polling period B, the state of the target information changes from "0" to "1" to "0" again, then to "1" again, and remains stable. It can be seen that the state of the target information is not reset during the second polling period B. Thus, at the end of the second polling period B, the client receives the query request requestB for the target information sent by the monitoring end. The client acquires that the current state of the current target information is 1 and acquires that the value of the Maskbit is 0. And the client determines that the target information is not reset and changed in the polling period according to the marking value 0, and sends a response reply to the monitoring end to the client, wherein the carried information is 1.
In the third polling period C, the state of the target information remains "1", and the Maskbit remains at the initial value of 0. When the third polling cycle is finished and the client receives the query request requestC for the current state of the target information, the current state of the target information is acquired to be 1 and the Maskbit is acquired to be 0. And the client judges that the target information is not subjected to reset change in the third polling cycle C according to the value of the Maskbit, and sends a response reply ResponSeC to the monitoring terminal, wherein the current state 1 takes the information as the target information.
As can be seen from this example two, in the second query period, the client returns an abnormal state to the monitoring end, and no information loss in the abnormal state occurs.
Example three:
the difference between this example and example one is that in the second polling period B, the state of the target information changes from "0" to "1" to "0" again and then to "1" again, at which time the second polling period B ends and the mask bit becomes 0. And the client receives an inquiry request B which is sent by the monitoring end and aims at the current state of the target information. The client acquires that the current state of the current target information is 1 and acquires that the marking value is 0. And the client determines that the target information is not reset and changed in the polling period according to the marking value 0, and sends a response reply to the monitoring end, wherein the carried information is 1.
In the third polling period C, the state of the target information changes from "1" to "0" again, and the Maskbit is still 0. When the third polling cycle is finished and the client receives the query request requestC for the current state of the target information, the current state of the target information is acquired to be 0 and the Maskbit is acquired to be 0. And the client judges that the target information is not reset and changed in the third polling period C according to the value of the Maskbit, and sends a response reply ResponseC to the monitoring end, wherein the carried information is the current state 0 of the target information.
As can be seen from this example three, the information of the abnormal state is still not lost.
Example four
The present embodiment provides a monitoring apparatus based on a polling protocol, which is used to execute the monitoring method based on the polling protocol in the first embodiment. The monitoring device may be disposed in a client of the power system, for example, a client corresponding to the SCADA system, or may be disposed separately, which is not limited in this embodiment. The client is, for example, an intelligent electronic device, and may specifically be a protection measurement and control device used in an electric power system.
Fig. 3 is a schematic structural diagram of the monitoring apparatus based on the polling protocol according to this embodiment. The monitoring device comprises a receiving unit 301, an obtaining unit 302 and a determining unit 303.
The receiving unit 301 is configured to receive an inquiry request sent by a monitoring end for a target information of a client, where the inquiry request is used to obtain a current state of the target information, and the current state is one of a normal state and an abnormal state; the acquiring unit 302 is connected to the receiving unit 301, the acquiring unit 302 is configured to acquire a current state of the target information and a corresponding indication value, the indication value is used to indicate whether a state of the target information is reset and changed in a polling cycle, the polling cycle is a time period between a currently received inquiry request and a received last inquiry request, and the reset change indicates that the state of the target information is changed and then is restored to an initial state in the polling cycle; a determining unit 303 is connected to the obtaining unit 302, and configured to determine whether to send the current status to the monitoring end according to the indication value.
Optionally, the determining unit 303 is specifically configured to:
determining whether the indication value is a value indicating that a reset change of the state of the target information occurs within one polling period;
and if the determination result is yes, sending another state different from the current state to the monitoring end.
Optionally, the determining unit 303 is further specifically configured to:
and if the current state is determined to be not the current state, sending the current state to the monitoring end.
Optionally, as shown in fig. 4, the monitoring apparatus further includes a first modification unit 410. The first modifying unit 410 is connected to the obtaining unit 302, but the first modifying unit 410 may also be connected to the determining unit 303, and is configured to modify the indication value to a value indicating that the state of the target information remains unchanged in a polling period.
Optionally, the monitoring device further comprises a second modification unit for:
in a polling period, if the state of the target information is identified to change, determining the change times of the state of the client in the polling period;
if the change times are even numbers, the marking value is modified to a value which represents that the state of the target information is reset and changed in a polling period;
if the number of changes is odd, the initial value of the index value is kept unchanged, and the initial value of the index value is a value indicating that the state of the target information is not reset and changed in one polling cycle.
Optionally, the monitoring device further comprises a third modification unit, configured to:
in the polling period, if the state of the target information is identified to be changed, the value of the indicating value is modified according to the following preset rule according to each change:
if the change is the ith change, the marking value is modified into a value which represents that the state of the target information is reset and changed in a polling period, wherein i is an even number;
if the j time is the change, the marking value is modified to a value which indicates that the state of the target information is not reset and changed in a polling period, and j is an odd number.
It should be noted that the second modification unit and the third modification unit of this embodiment may exist simultaneously, for the user to select different modification modes of the indication value, or may exist separately, for example, only the second modification unit or the third modification unit exists. Details are not repeated.
The method performed by each unit in this embodiment is the same as that in the previous embodiment, and is not described herein again.
The above units can be realized in the form of hardware, and also can be realized in the form of software functional modules. It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
According to the invention, after receiving the inquiry request sent by the monitoring terminal aiming at the target information of the client, the current state and the marking value of the target information are obtained in real time, and whether the current state is sent to the monitoring terminal is judged according to the marking value, so that the monitoring information can be ensured not to be lost.
The invention also provides a monitoring device based on the polling protocol, which comprises a memory and a processor. Wherein the memory is to store instructions. The processor is configured to execute the polling protocol-based monitoring method described in any of the foregoing embodiments according to instructions stored in the memory.
Embodiments of the present invention also provide a readable storage medium. The readable storage medium has stored therein machine readable instructions which, when executed by a machine, the machine performs the polling protocol based monitoring method described in any of the foregoing embodiments.
The readable storage medium has stored thereon machine readable instructions which, when executed by a processor, cause the processor to perform any of the methods previously described. In particular, a system or apparatus may be provided which is provided with a readable storage medium on which software program code implementing the functionality of any of the embodiments described above is stored and which causes a computer or processor of the system or apparatus to read and execute machine-readable instructions stored in the readable storage medium.
In this case, the program code itself read from the readable medium can realize the functions of any of the above-described embodiments, and thus the machine-readable code and the readable storage medium storing the machine-readable code form part of the present invention.
Examples of the readable storage medium include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-R, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs, DVD + RWs), magnetic tapes, nonvolatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or from the cloud via a communications network.
It will be understood by those skilled in the art that various changes and modifications may be made in the above-disclosed embodiments without departing from the spirit of the invention. Accordingly, the scope of the invention should be determined from the following claims.
It should be noted that not all steps and units in the above flows and system structure diagrams are necessary, and some steps or units may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structures described in the above embodiments may be physical structures or logical structures, that is, some units may be implemented by the same physical entity, or some units may be implemented by a plurality of physical entities, or some units may be implemented by some components in a plurality of independent devices.
In the above embodiments, the hardware unit may be implemented mechanically or electrically. For example, a hardware element may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware elements may also comprise programmable logic or circuitry, such as a general purpose processor or other programmable processor, that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The monitoring method based on the polling protocol is characterized by comprising the following steps:
receiving an inquiry request sent by a monitoring terminal aiming at target information of a client, wherein the inquiry request is used for acquiring the current state of the target information, and the current state is one of a normal state and an abnormal state;
acquiring a current state of the target information and a corresponding indication value, wherein the indication value is used for indicating whether the state of the target information is reset and changed in a polling cycle, the polling cycle is a time period separated by a currently received inquiry request and a received last inquiry request, and the reset change indicates that the state of the target information is changed and is recovered to an initial state at the beginning of the polling cycle when the polling cycle is finished;
judging whether to send the current state to the monitoring terminal according to the indication value;
before receiving an inquiry request sent by a monitoring end aiming at target information of a client, the method further comprises the following steps:
in the polling period, if the state of the target information is identified to be changed, determining the number of times of changing the state of the client in the polling period;
if the change times is even, modifying the indication value into a value indicating that the state of the target information is reset and changed in a polling period;
and if the change times are odd, keeping the initial value of the mark value unchanged, wherein the initial value of the mark value is a value indicating that the state of the target information is not reset and changed in one polling period.
2. The monitoring method according to claim 1, wherein the determining whether to send the current state to the monitoring end according to the indication value comprises:
determining whether the indication value is a value indicating that the state of the target information is reset and changed in a polling period;
and if the determination result is yes, sending another state different from the current state to the monitoring end.
3. The monitoring method of claim 2, further comprising:
and if the determination result is negative, sending the current state to the monitoring end.
4. The monitoring method according to claim 2, further comprising, after obtaining the current state of the target information and a corresponding one of the indication values:
and modifying the indication value into a value which indicates that the state of the target information is not reset and changed in a polling period.
5. A polling protocol based monitoring device, comprising:
a receiving unit, configured to receive an inquiry request sent by a monitoring end for a target information of a client, where the inquiry request is used to obtain a current state of the target information, and the current state is one of a normal state and an abnormal state;
an obtaining unit, configured to obtain a current state of the target information and a corresponding indication value, where the indication value is used to indicate whether a reset change occurs to the state of the target information in a polling cycle, the polling cycle is a time period between a currently received inquiry request and a received previous inquiry request, and the reset change indicates that the state of the target information is changed and then is restored to an initial state in the polling cycle;
a determining unit, configured to determine whether to send the current state to the monitoring end according to the indication value;
further comprising a second modification unit for:
in the polling period, if the state of the target information is identified to be changed, determining the number of times of changing the state of the client in the polling period;
if the change times is even, modifying the indication value into a value indicating that the state of the target information is reset and changed in a polling period;
and if the change times are odd, keeping the initial value of the mark value unchanged, wherein the initial value of the mark value is a value indicating that the state of the target information is not reset and changed in one polling period.
6. The monitoring device according to claim 5, wherein the determining unit is specifically configured to:
determining whether the indication value is a value indicating that the state of the target information is reset and changed in a polling period;
and if the determination result is yes, sending another state different from the current state to the monitoring end.
7. The monitoring device of claim 6, wherein the determining unit is further specifically configured to:
and if the determination result is negative, sending the current state to the monitoring end.
8. The monitoring device of claim 6, further comprising:
and the first modifying unit is used for modifying the marking value into a value which indicates that the state of the target information is not reset and changed in a polling cycle.
9. A polling protocol based monitoring device, comprising:
at least one memory for storing instructions;
at least one processor configured to perform the polling protocol-based monitoring method of any one of claims 1-4 in accordance with instructions stored by the memory.
10. Readable storage media having stored therein machine readable instructions which, when executed by a machine, perform a polling protocol based monitoring method according to any one of claims 1-4.
CN201810028055.1A 2018-01-11 2018-01-11 Monitoring method and device based on polling protocol and readable storage medium Active CN108632108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810028055.1A CN108632108B (en) 2018-01-11 2018-01-11 Monitoring method and device based on polling protocol and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810028055.1A CN108632108B (en) 2018-01-11 2018-01-11 Monitoring method and device based on polling protocol and readable storage medium

Publications (2)

Publication Number Publication Date
CN108632108A CN108632108A (en) 2018-10-09
CN108632108B true CN108632108B (en) 2020-07-28

Family

ID=63706025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810028055.1A Active CN108632108B (en) 2018-01-11 2018-01-11 Monitoring method and device based on polling protocol and readable storage medium

Country Status (1)

Country Link
CN (1) CN108632108B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064753B (en) * 2019-12-30 2023-03-14 深圳Tcl新技术有限公司 Host state acquisition method, system, intelligent terminal and storage medium
CN111401994A (en) * 2020-03-06 2020-07-10 五八有限公司 House resource safety selection label adding method and house resource safety selection label adding device
CN111711642A (en) * 2020-07-15 2020-09-25 网易(杭州)网络有限公司 Protocol request processing method and device, electronic equipment and storage medium
WO2024000119A1 (en) * 2022-06-27 2024-01-04 西门子股份公司 Wlan communication method, client, computing device, and storage medium
CN115766461A (en) * 2022-09-27 2023-03-07 广东电网有限责任公司 Full-width belt utilization method, system, terminal equipment and medium for power internet of things
CN116074355B (en) * 2023-03-13 2023-06-27 北京全路通信信号研究设计院集团有限公司 ATS data acquisition method, device, system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821011A (en) * 2012-08-28 2012-12-12 北京星网锐捷网络技术有限公司 Opposite terminal state detection method, device and equipment
CN106972978A (en) * 2017-05-27 2017-07-21 郑州云海信息技术有限公司 A kind of ALM method for pushing and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IL121521A (en) * 1997-08-11 2003-04-10 Nds Ltd Television signal glitch detector
JP2007201828A (en) * 2006-01-26 2007-08-09 Fujifilm Corp Infrared data communication device, printer, and notification method of communication failure
CN101459549B (en) * 2007-12-14 2011-09-21 华为技术有限公司 Link failure processing method and data forwarding device
CN102523137B (en) * 2011-12-22 2014-10-08 华为技术服务有限公司 Fault monitoring method, device and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821011A (en) * 2012-08-28 2012-12-12 北京星网锐捷网络技术有限公司 Opposite terminal state detection method, device and equipment
CN106972978A (en) * 2017-05-27 2017-07-21 郑州云海信息技术有限公司 A kind of ALM method for pushing and device

Also Published As

Publication number Publication date
CN108632108A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
CN108632108B (en) Monitoring method and device based on polling protocol and readable storage medium
CN111935172A (en) Network abnormal behavior detection method based on network topology, computer device and computer readable storage medium
CN103795580A (en) Data monitoring method, system and related equipment
CN112636979B (en) Cluster alarm method and related device
CN109313686A (en) Invasion detecting device and intrusion detection program
US11489746B2 (en) Detection device, detection method, and detection program
JP2019515595A (en) Data transmission method, apparatus and system
CN108038127B (en) Data synchronization method, device, terminal equipment and storage medium
CN110740190B (en) Event reporting method, power terminal and computer readable storage medium
CN108829563B (en) Alarm method and alarm device
CN110830348A (en) Slave data acquisition method, device and system based on serial port communication
CN110752972A (en) Network card state monitoring method, device, equipment and medium
CN113824724B (en) Method and device for judging tampered sensor data of intelligent substation and storage medium
CN102761430B (en) A kind of method and system obtaining warning information
CN114296979A (en) Method and device for detecting abnormal state of Internet of things equipment
CN114598602A (en) Data acquisition method and device, computer equipment and computer readable storage medium
CN110781146A (en) Event storage method, power terminal and computer-readable storage medium
JPWO2018167967A1 (en) Apparatus for verifying identity of operation rules of sensor device
CN112865312A (en) Power dispatching system and power data processing method
CN111723116A (en) Data backfill method, device and system
CN113328823B (en) Clock identification method and device based on PTP
CN111127855A (en) Environmental event monitoring method and system of environmental Internet of things
CN104394003A (en) Power supply fault processing method and device and power supply equipment
CN115277794B (en) Intelligent data acquisition method and system based on multiple protocols
CN116112398B (en) Link jitter suppression method and device, storage medium and electronic equipment

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