CN110974204A - Method, system and device for realizing bidirectional heartbeat mechanism - Google Patents

Method, system and device for realizing bidirectional heartbeat mechanism Download PDF

Info

Publication number
CN110974204A
CN110974204A CN201911355452.0A CN201911355452A CN110974204A CN 110974204 A CN110974204 A CN 110974204A CN 201911355452 A CN201911355452 A CN 201911355452A CN 110974204 A CN110974204 A CN 110974204A
Authority
CN
China
Prior art keywords
heartbeat
sub
equipment end
time
message
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.)
Pending
Application number
CN201911355452.0A
Other languages
Chinese (zh)
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.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information Technology 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 Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN201911355452.0A priority Critical patent/CN110974204A/en
Publication of CN110974204A publication Critical patent/CN110974204A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/02Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
    • A61B5/024Detecting, measuring or recording pulse rate or heart rate
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/0002Remote monitoring of patients using telemetry, e.g. transmission of vital signals via a communication network
    • A61B5/0004Remote monitoring of patients using telemetry, e.g. transmission of vital signals via a communication network characterised by the type of physiological signal transmitted

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Medical Informatics (AREA)
  • Cardiology (AREA)
  • Biophysics (AREA)
  • Pathology (AREA)
  • Physiology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Physics & Mathematics (AREA)
  • Molecular Biology (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The present invention relates to the field of communications technologies, and in particular, to a method, a system, and a device for implementing a bidirectional heartbeat mechanism. The method comprises the following steps: when the main equipment end receives heartbeat messages sent by the sub-equipment end every second heartbeat time within the first heartbeat time, the main equipment end recalculates the first heartbeat time; when the main equipment end does not receive the heartbeat message, the main equipment end sends a heartbeat inquiry message to the sub-equipment end; if the main equipment end receives a response message of the sub-equipment end responding to the heartbeat inquiry message, the main equipment end recalculates the first heartbeat time; if the main equipment end does not receive the response message, the main equipment end records the result; wherein the first heartbeat time is greater than the second heartbeat time. According to the invention, through the double-heartbeat mechanism of the main equipment end and the sub-equipment end, the heartbeat time set by the main equipment end and the sub-equipment end is different, the main equipment end can send out heartbeat inquiry messages when necessary, the network burden can not be increased, and the accurate tracking of whether the sub-equipment end is on line or not is ensured.

Description

Method, system and device for realizing bidirectional heartbeat mechanism
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a system, and a device for implementing a bidirectional heartbeat mechanism.
Background
The heartbeat mechanism is a mechanism that sends a self-defined structure (heartbeat message) at regular time to let the other side know that the other side is still alive so as to ensure the validity of the connection. In practical application, the heartbeat mechanism is mainly a technical method for managing the online and offline of a plurality of sub (slave) devices by a main device end, in the prior art, the heartbeat mechanism of the devices is mainly that a fixed heartbeat time is set by the sub device end, or the heartbeat time of the sub device end is set by the main device end, when the heartbeat time of the sub device end is up, the sub device end sends a heartbeat message to the main device end, the main device end receives the heartbeat message and then considers that the sub device end is online, otherwise, the sub device end is considered to be offline.
The existing heartbeat mechanism has an unobvious problem when the number of the sub-device ends is small, but when the number of the sub-device ends is large, a plurality of the sub-device ends report heartbeat messages at the same time, so that a large amount of data is reported at the same time point, data collision occurs, and a packet loss event occurs, so that the main device end makes a misjudgment, and the sub-device end is considered to be offline.
Disclosure of Invention
The invention aims to provide a method for realizing a bidirectional heartbeat mechanism, a system and a device thereof, which can effectively solve the problem of misjudgment caused by data collision due to the report of a large amount of data at the same time point.
In order to achieve the above object, a technical solution of a first aspect of the present invention provides a method for implementing a bidirectional heartbeat mechanism, including the following steps:
when the main equipment end receives heartbeat messages sent by the sub-equipment end every second heartbeat time within the first heartbeat time, recalculating the first heartbeat time by the main equipment end;
when the main device end does not receive the heartbeat message sent by the sub device end every second heartbeat time within the first heartbeat time, the main device end sends a heartbeat inquiry message to the sub device end;
if the main equipment end receives a response message of the sub-equipment end responding to the heartbeat inquiry message, the main equipment end recalculates the first heartbeat time;
if the main equipment end does not receive the response message, the main equipment end records a result;
wherein the first heartbeat time is greater than the second heartbeat time.
Further, the master device sends a heartbeat query message for 1-3 times to the slave device side when the master device side does not receive the response message.
Further, the master device sends the heartbeat inquiry message to the slave device end once every a period of time when the master device end does not receive the response message, wherein the period of time is less than the second heartbeat time.
Further, the number of the sub-device terminals is multiple, and each sub-device terminal is set to the second heartbeat time.
Further, the response message and the heartbeat message are the same message.
The technical scheme of the second aspect of the invention provides a bidirectional heartbeat mechanism system, which comprises a main equipment end module;
the master end module includes:
the timing module is used for timing the first heartbeat time of the main equipment end and recalculating the first heartbeat time when the main equipment end receives heartbeat messages sent by the sub-equipment end every second heartbeat time or the sub-equipment end receives response messages responding to the heartbeat inquiry messages within the first heartbeat time;
the query module is used for sending a heartbeat query message to the sub-equipment end when the main equipment end does not receive the heartbeat message sent by the sub-equipment end every second heartbeat time within the first heartbeat time;
the recording module is used for recording a result when the main equipment end does not receive a response message of the sub-equipment end responding to the heartbeat inquiry message;
wherein the first heartbeat time is greater than the second heartbeat time.
Furthermore, the query module is provided with the frequency and time interval for sending the heartbeat query message.
Further, the bidirectional heartbeat mechanism system also comprises more than one sub-equipment end module;
and the sub-equipment end module is used for sending a heartbeat message to the main equipment end by the sub-equipment end every second heartbeat time, responding to a heartbeat inquiry message sent by the main equipment end and sending a response message.
Further, the heartbeat message and the response message sent by the sub-device side module are the same message.
The technical scheme of the third aspect of the invention provides a bidirectional heartbeat mechanism device, which comprises a main device;
the main equipment comprises the main equipment end module.
Furthermore, the device also comprises more than one piece of sub-equipment, and the sub-equipment comprises the sub-equipment end module.
Compared with the prior art, the invention has the following beneficial effects:
1. in the invention, the sub-equipment can report the heartbeat actively, the main equipment can inquire the heartbeat actively, and the occurrence of packet loss of the sub-equipment is prevented through the bidirectional heartbeat mechanism.
2. Because the heartbeat time set by the main equipment end is greater than the heartbeat time set by the sub-equipment end, when the sub-equipment end has data to report (including any other data including heartbeat), the main equipment end can recalculate the heartbeat time, and the main equipment cannot send a heartbeat inquiry message at the moment, so that the network burden cannot be increased in the whole process.
3. When the heartbeat of the sub-equipment end is lost, the main equipment end ensures the reliability of the heartbeat of the sub-equipment end through inquiry or multiple times of inquiry.
4. The mechanism provided by the invention is not only suitable for small networks, but also reliable for large networks, and has wide application range.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 shows a block flow diagram of a method involved in an embodiment of the present invention;
FIG. 2 shows a block flow diagram of another method involved in embodiments of the present invention;
fig. 3 is a block diagram illustrating a structure of a master device side module according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating another main device side module according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating another main device side module according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a connection relationship between a master device and a slave device according to an embodiment of the present invention;
in the figure:
100-a master device side module; 101-a timing module; 102-a query module; 103-a recording module; 1000-a master device; 2000-subset.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
In the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance; the term "plurality" means two or more unless expressly limited otherwise. The terms "mounted," "connected," "fixed," and the like are to be construed broadly, and for example, "connected" may be a fixed connection, a removable connection, an integral connection, or a virtual connection; "coupled" may be direct or indirect through an intermediary. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the description of the present invention, it is to be understood that the terms "upper", "lower", "left", "right", "front", "rear", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the referred device or unit must have a specific direction, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In a first aspect, the present invention provides a method for implementing a bidirectional heartbeat mechanism, referring to fig. 1, including the following steps:
when the main equipment end receives heartbeat messages sent by the sub-equipment end every second heartbeat time within the first heartbeat time, recalculating the first heartbeat time by the main equipment end;
when the main device end does not receive the heartbeat message sent by the sub device end every second heartbeat time within the first heartbeat time, the main device end sends a heartbeat inquiry message to the sub device end;
if the main equipment end receives a response message of the sub-equipment end responding to the heartbeat inquiry message, the main equipment end recalculates the first heartbeat time;
if the main equipment end does not receive the response message, the main equipment end records a result;
wherein the first heartbeat time is greater than the second heartbeat time.
According to the invention, the heartbeat time is respectively set at the main equipment end and the sub-equipment end, the heartbeat time of the main equipment end is greater than that of the sub-equipment end, namely the first heartbeat time is greater than the second heartbeat time; therefore, the main equipment end and the sub-equipment end time count simultaneously, the sub-equipment end sends a heartbeat message to the main equipment end every second heartbeat time, and the main equipment end receives the heartbeat message within the first heartbeat time counted by the main equipment, considers that the sub-equipment is on line and starts to time again, and the operation is repeated under the normal condition; if the main equipment end does not receive the heartbeat message within the timed first heartbeat time, sending a heartbeat inquiry message to the sub-equipment end, and judging whether the sub-equipment is on line or not according to the feedback of the sub-equipment end. Specifically, the main device sends a heartbeat query message to the sub device, and if the main device receives a response message from the sub device, the sub device is considered to be online, and the main device starts to count time again; and if the main equipment end does not receive the response message responded by the sub-equipment end, the main equipment end records the result. The main device side recording result can be a result of obtaining that the sub-device is not on-line, and can also directly send out an alarm of the abnormality of the sub-device, and the like.
It should be noted that the heartbeat message in the present invention is a broad meaning, and includes both a specific character string for monitoring the operation state of the machine network memory and other data sent by the sub-device to the main device. That is, when the main device receives the specific character string or other data of the sub device, the main device recalculates the heartbeat time.
In short, the invention realizes the double heartbeat mechanism of the main equipment end and the sub-equipment end by respectively setting the heartbeat time at the main equipment end and the sub-equipment end, actively reporting the heartbeat message by the sub-equipment end and actively inquiring the condition of the sub-equipment end when the main equipment end does not receive the heartbeat message. And because the heartbeat time set by the main equipment end is different from that set by the sub-equipment end, the main equipment end can send out heartbeat inquiry messages when necessary, so that the network burden is not increased, and whether the sub-equipment end is on-line accurately tracked is ensured.
In some embodiments, the main device end sends the heartbeat inquiry message to the sub device end for 1 to 3 times under the condition that the main device end does not receive the response message.
Specifically, referring to fig. 2, after the main device end sends the heartbeat query message, if the main device end does not receive the response message, the main device end sends the heartbeat query message again to confirm that the sub-devices are not on-line, and can send the heartbeat query message again after not receiving the response message.
In some embodiments, when the master device end does not receive the response packet, the master device end sends the heartbeat query packet to the child device end at intervals, where the interval is less than the second heartbeat time.
In addition, in the invention, the main device end can stop timing when sending the heartbeat inquiry message to the sub-device end for the first time, and can also trigger the main device end to stop timing when the main device end finally records the result, and the latter condition requires that the total time from sending the heartbeat inquiry message to receiving the response message by the main device end is less than the difference value between the first heartbeat time and the second heartbeat time.
Generally, in the present invention, the first heartbeat time is set according to the number of the sub-devices, for example, the first heartbeat time is 3-5min, the second heartbeat time is 30s-1min shorter than the first heartbeat time, and the period of time may be 3-8 s. Therefore, whether the sub-equipment is off-line or not is judged through quick heartbeat inquiry message confirmation.
In the invention, for the convenience of management, a plurality of sub-devices are all set to be the second heartbeat time, so that the sub-devices can send heartbeat messages at different time points after the inquiry messages are confirmed through the difference of access time or the conflict between the sub-devices and other data at the beginning. In some embodiments, the number of the slave device terminals is multiple, and each of the slave device terminals is set to the second heartbeat time.
In the invention, in the aspect of program implementation, a mode that a response message is different from a heartbeat message can be adopted, namely a group of programs are independently arranged to additionally detect whether the sub-equipment is online; after the main device end sends the heartbeat inquiry message, the sub device end receives the message, the response task is transferred into the program of sending the heartbeat message of the sub device end, and the sub device end sends the heartbeat message to prove that the sub device end is online, so that the latter program is more convenient to realize. In some embodiments, the response message and the heartbeat message are the same message.
In addition, it should be noted that the main device side records the result, which also includes a mechanism that the main device side stops the bidirectional heartbeat between the main device side and the sub-device side, and the main device side terminates the timing between the main device side and the sub-device side.
A technical solution of a second aspect of the present invention provides a bidirectional heartbeat mechanism system, as shown in fig. 3, including a main device side module 100;
the master end module 100 includes:
the timing module 101 is configured to time a first heartbeat time of the master device, and recalculate the first heartbeat time when the master device receives a heartbeat message sent by the slave device every second heartbeat time within the first heartbeat time or a response message responding to a heartbeat inquiry message is received by the slave device;
the query module 102 is configured to send a heartbeat query message to the child device end when the primary device end does not receive a heartbeat message sent by the child device end every second heartbeat time within the first heartbeat time;
the recording module 103 is configured to record a result when the main device side does not receive a response message of the sub device side responding to the heartbeat inquiry message;
wherein the first heartbeat time is greater than the second heartbeat time.
In the bidirectional heartbeat mechanism system provided by the invention, the timing module 101 is used for timing of the main device end and recalculating the first heartbeat time when receiving a heartbeat message or when receiving a corresponding message, the query module 102 is used for sending a heartbeat query message to the sub-device end when the main device end does not receive the heartbeat message, and the recording module 103 is used for recording a result when the main device end does not receive a response message, wherein the recording result can be a result of obtaining that the sub-device is not on-line, and can also be used for directly sending an alarm and the like of abnormality of the sub-device. The main device side module 100 included in the present invention is used for implementing a bidirectional heartbeat mechanism between the main device side and the sub device side.
In some embodiments, the query module 102 is configured to send the number of times and the time interval of the heartbeat query message.
That is, when the main device end does not receive the response message sent by the sub device end, the query module 102 may send the heartbeat query message to the sub device end again, and may send the heartbeat query message for multiple times to confirm whether the sub device end is offline. If the query module 102 receives a response message after sending a heartbeat query message to the sub-device, the timing module 101 starts to recalculate the first heartbeat time.
As described in the above method, the master device may stop timing when the heartbeat inquiry packet is sent to the slave device for the first time until any time when the master device records the result finally triggers the master device to stop timing. If the main device side can stop timing when sending the heartbeat inquiry message to the sub device side for the first time, if the main device side sends the heartbeat inquiry message to the sub device side for multiple times, timing can also be stopped when sending the heartbeat inquiry message to the sub device side for the second time and the third time, and the like, the main device side can also stop timing when the main device side finally records the result.
As shown in fig. 4, the recording module 103 further has a function of instructing the timing module 101 to terminate timing, and the recording module 103 instructs the timing module 101 to terminate timing when the master device starts to record a result.
As shown in fig. 5, the query module 102 further has a function of instructing the timing module 101 to terminate timing, and the query module 102 may instruct the timing module 101 to terminate timing when or during any heartbeat query message is sent.
And terminating the bidirectional heartbeat mechanism of the main equipment end and the sub-equipment end by the timely termination of timing of the main equipment end so as to reduce the burden of the program.
In some embodiments, the bidirectional heartbeat mechanism system further includes more than one sub-device side module;
and the sub-equipment end module is used for sending a heartbeat message to the main equipment end by the sub-equipment end every second heartbeat time, responding to a heartbeat inquiry message sent by the main equipment end and sending a response message.
In some embodiments, the heartbeat message and the response message sent by the sub-device side module are the same message.
The technical scheme of the third aspect of the invention provides a bidirectional heartbeat mechanism device, which comprises a main device;
the master device includes the master device side module 100.
The main device end module 100 is arranged in the main device and is used for forming a bidirectional heartbeat mechanism with a response module of the sub device end so as to judge the operation state of the sub device end.
Preferably, as shown in fig. 5, the apparatus further includes one or more sub-devices, and each of the one or more sub-devices includes the sub-device end module.
According to the device provided by the invention, the main equipment end module and the sub-equipment end module are arranged in the device to form interaction, so that the normal operation of the sub-equipment can be better monitored.
Some specific examples are listed below.
Example 1
As shown in fig. 1, the method for implementing a bidirectional heartbeat mechanism according to an embodiment of the present invention includes the following steps:
the main equipment end starts to time a first heartbeat time, and when the main equipment end receives heartbeat messages sent by the sub-equipment end every other second heartbeat time within the first heartbeat time, the main equipment end recalculates the first heartbeat time;
when the main equipment end does not receive heartbeat messages sent by the sub-equipment end every second heartbeat time within the first heartbeat time, the main equipment end sends heartbeat inquiry messages to the sub-equipment end;
if the main equipment end receives a response message of the sub-equipment end responding to the heartbeat inquiry message, the main equipment end recalculates the first heartbeat time;
if the main equipment end does not receive the response message, the main equipment end records the result and judges that the sub-equipment is not on line;
wherein the first heartbeat time is greater than the second heartbeat time.
Example 2
As shown in fig. 2, the method for implementing a bidirectional heartbeat mechanism according to an embodiment of the present invention includes the following steps:
the main equipment end starts to time a first heartbeat time, and when the main equipment end receives heartbeat messages sent by the sub-equipment end every other second heartbeat time within the first heartbeat time, the main equipment end recalculates the first heartbeat time;
when the main equipment end does not receive heartbeat messages sent by the sub-equipment end every second heartbeat time within the first heartbeat time, the main equipment end sends heartbeat inquiry messages to the sub-equipment end;
if the main equipment end receives a response message of the sub-equipment end responding to the heartbeat inquiry message, the main equipment end recalculates the first heartbeat time;
if the main equipment end does not receive the response message, the main equipment end sends a heartbeat inquiry message to the sub-equipment end, if the main equipment end does not receive the response message, the main equipment end can also send the heartbeat inquiry message to the sub-equipment end, so that the heartbeat inquiry message is sent for 1-3 times, and after the heartbeat inquiry message is sent to the sub-equipment end for the last time, the main equipment end still does not receive the response message, the main equipment end records the result and judges that the sub-equipment is not on line;
wherein the first heartbeat time is greater than the second heartbeat time.
Example 3
As shown in fig. 3, the bidirectional heartbeat mechanism system provided in the embodiment of the present invention includes a main device end module;
the master end module 100 includes:
the timing module 101 is configured to time a first heartbeat time of the master device, and recalculate the first heartbeat time when the master device receives a heartbeat message sent by the slave device every second heartbeat time within the first heartbeat time or a response message responding to a heartbeat inquiry message is received by the slave device;
the query module 102 is configured to send a heartbeat query message to the child device end when the primary device end does not receive a heartbeat message sent by the child device end every second heartbeat time within the first heartbeat time;
the recording module 103 is configured to record a result when the main device side does not receive a response message of the sub device side responding to the heartbeat inquiry message;
wherein the first heartbeat time is greater than the second heartbeat time.
The master device side module 100 provided in this embodiment can implement the method of embodiment 1 or embodiment 2.
Example 4
As shown in fig. 4, the bidirectional heartbeat mechanism system provided in the embodiment of the present invention includes a main device end module;
the master end module 100 includes:
the timing module 101 is configured to time a first heartbeat time of the master device, and recalculate the first heartbeat time when the master device receives a heartbeat message sent by the slave device every second heartbeat time within the first heartbeat time or a response message responding to a heartbeat inquiry message is received by the slave device;
the query module 102 is configured to send a heartbeat query message to the child device end when the primary device end does not receive a heartbeat message sent by the child device end every second heartbeat time within the first heartbeat time;
the recording module 103 is configured to record a result when the main device side does not receive a response packet of the sub device side responding to the heartbeat query packet, and instruct the timing module to terminate timing.
Wherein the first heartbeat time is greater than the second heartbeat time.
The master device side module 100 provided in this embodiment can implement the method of embodiment 1 or embodiment 2.
It should be noted that, in embodiments 1 to 4, there may be a plurality of sub-devices 2000 corresponding to the main device 1000, and a schematic diagram of the two is shown in fig. 5 provided by the present invention, and reference is made to embodiments 1 to 4 for a specific connection relationship between each sub-device 2000 and the main device 1000.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for implementing a bi-directional heartbeat mechanism, comprising the steps of:
when the main equipment end receives heartbeat messages sent by the sub-equipment end every second heartbeat time within the first heartbeat time, recalculating the first heartbeat time by the main equipment end;
when the main device end does not receive the heartbeat message sent by the sub device end every second heartbeat time within the first heartbeat time, the main device end sends a heartbeat inquiry message to the sub device end;
if the main equipment end receives a response message of the sub-equipment end responding to the heartbeat inquiry message, the main equipment end recalculates the first heartbeat time;
if the main equipment end does not receive the response message, the main equipment end records a result;
wherein the first heartbeat time is greater than the second heartbeat time.
2. The method according to claim 1, wherein the master device sends a heartbeat inquiry packet for 1-3 times to the slave device when the master device does not receive the response packet.
3. The method according to claim 2, wherein the main device sends the heartbeat inquiry packet to the sub-device end at a time interval when the main device end does not receive the response packet, and the time interval is shorter than the second heartbeat time.
4. The method according to claim 1, wherein there are a plurality of said sub-device terminals, and each of said sub-device terminals is set to said second heartbeat time.
5. A method for implementing a bidirectional heartbeat mechanism according to any one of claims 1 to 4, in which the response message is the same message as the heartbeat message.
6. A bidirectional heartbeat mechanism system is characterized by comprising a main equipment end module;
the master end module includes:
the timing module is used for timing the first heartbeat time of the main equipment end and recalculating the first heartbeat time when the main equipment end receives heartbeat messages sent by the sub-equipment end every second heartbeat time or the sub-equipment end receives response messages responding to the heartbeat inquiry messages within the first heartbeat time;
the query module is used for sending a heartbeat query message to the sub-equipment end when the main equipment end does not receive the heartbeat message sent by the sub-equipment end every second heartbeat time within the first heartbeat time;
the recording module is used for recording a result when the main equipment end does not receive a response message of the sub-equipment end responding to the heartbeat inquiry message;
wherein the first heartbeat time is greater than the second heartbeat time.
7. The bidirectional heartbeat mechanism system of claim 6 wherein the query module is further configured with a number of times and a time interval for sending heartbeat query messages.
8. A bidirectional heartbeat mechanism system as claimed in claim 6 or 7 further comprising more than one sub-device side module;
and the sub-equipment end module is used for sending a heartbeat message to the main equipment end by the sub-equipment end every second heartbeat time, responding to a heartbeat inquiry message sent by the main equipment end and sending a response message.
9. The bidirectional heartbeat mechanism system of claim 8 wherein the heartbeat message and the response message sent out by the sub-device side module are the same message.
10. A bidirectional heartbeat mechanism device is characterized by comprising a main device;
the main equipment comprises a main equipment end module of any one of claims 6-8;
preferably, the apparatus further comprises more than one sub-device, and the sub-device end module of claim 9 is contained in the more than one sub-device.
CN201911355452.0A 2019-12-25 2019-12-25 Method, system and device for realizing bidirectional heartbeat mechanism Pending CN110974204A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911355452.0A CN110974204A (en) 2019-12-25 2019-12-25 Method, system and device for realizing bidirectional heartbeat mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911355452.0A CN110974204A (en) 2019-12-25 2019-12-25 Method, system and device for realizing bidirectional heartbeat mechanism

Publications (1)

Publication Number Publication Date
CN110974204A true CN110974204A (en) 2020-04-10

Family

ID=70075335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911355452.0A Pending CN110974204A (en) 2019-12-25 2019-12-25 Method, system and device for realizing bidirectional heartbeat mechanism

Country Status (1)

Country Link
CN (1) CN110974204A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111884875A (en) * 2020-07-17 2020-11-03 青岛易来智能科技股份有限公司 Offline device determination method and device
CN113542380A (en) * 2021-07-06 2021-10-22 四川创智联恒科技有限公司 High-efficiency heartbeat keep-alive method

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1411247A (en) * 2001-09-29 2003-04-16 华为技术有限公司 Method of realizing
CN1501636A (en) * 2002-11-19 2004-06-02 华为技术有限公司 A method for detecting whether or not WEB authentication user is on line
CN1925429A (en) * 2006-09-30 2007-03-07 杭州华为三康技术有限公司 Method and equipment for realizing fast detection
CN101909059A (en) * 2010-07-30 2010-12-08 北京星网锐捷网络技术有限公司 Method and system for deleting residual client information and authentication server
CN102014416A (en) * 2010-12-03 2011-04-13 中兴通讯股份有限公司 Method and system for bidirectional detection of connection
CN102647314A (en) * 2012-05-16 2012-08-22 深圳市乐唯科技开发有限公司 Client side on-line state judgment method and system
CN102984029A (en) * 2012-11-30 2013-03-20 福建星网锐捷网络有限公司 Heartbeat detection device and method applied to distributed system and network equipment
CN103428037A (en) * 2012-05-16 2013-12-04 华为技术有限公司 User online detecting method, device and system
CN105515901A (en) * 2015-11-27 2016-04-20 努比亚技术有限公司 Message processing apparatus and method
CN105517195A (en) * 2015-11-27 2016-04-20 上海华为技术有限公司 State detection method and wireless network node
CN105635248A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and system for releasing TCP (Transmission Control Protocol) connection resources
CN105827697A (en) * 2016-03-14 2016-08-03 广州趣丸网络科技有限公司 User off-line detection method and user off-line detection system
CN105916100A (en) * 2016-04-01 2016-08-31 华为技术有限公司 Heartbeat packet agency method, device and communication system
CN106411446A (en) * 2016-08-29 2017-02-15 烽火通信科技股份有限公司 Self-adaptive method for realizing 1588 time synchronization in unicast mode
CN106922039A (en) * 2015-12-25 2017-07-04 阿里巴巴集团控股有限公司 The sending method and device of a kind of heartbeat message
CN110365803A (en) * 2019-08-26 2019-10-22 四川艾贝斯科技发展有限公司 A kind of network channel maintenance method based on udp protocol
CN110417761A (en) * 2019-07-17 2019-11-05 上海东土远景工业科技有限公司 Communication means and device based on dual-computer redundancy

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1411247A (en) * 2001-09-29 2003-04-16 华为技术有限公司 Method of realizing
CN1501636A (en) * 2002-11-19 2004-06-02 华为技术有限公司 A method for detecting whether or not WEB authentication user is on line
CN1925429A (en) * 2006-09-30 2007-03-07 杭州华为三康技术有限公司 Method and equipment for realizing fast detection
CN101909059A (en) * 2010-07-30 2010-12-08 北京星网锐捷网络技术有限公司 Method and system for deleting residual client information and authentication server
CN102014416A (en) * 2010-12-03 2011-04-13 中兴通讯股份有限公司 Method and system for bidirectional detection of connection
CN102647314A (en) * 2012-05-16 2012-08-22 深圳市乐唯科技开发有限公司 Client side on-line state judgment method and system
CN103428037A (en) * 2012-05-16 2013-12-04 华为技术有限公司 User online detecting method, device and system
CN102984029A (en) * 2012-11-30 2013-03-20 福建星网锐捷网络有限公司 Heartbeat detection device and method applied to distributed system and network equipment
CN105515901A (en) * 2015-11-27 2016-04-20 努比亚技术有限公司 Message processing apparatus and method
CN105517195A (en) * 2015-11-27 2016-04-20 上海华为技术有限公司 State detection method and wireless network node
CN105635248A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and system for releasing TCP (Transmission Control Protocol) connection resources
CN106922039A (en) * 2015-12-25 2017-07-04 阿里巴巴集团控股有限公司 The sending method and device of a kind of heartbeat message
CN105827697A (en) * 2016-03-14 2016-08-03 广州趣丸网络科技有限公司 User off-line detection method and user off-line detection system
CN105916100A (en) * 2016-04-01 2016-08-31 华为技术有限公司 Heartbeat packet agency method, device and communication system
CN106411446A (en) * 2016-08-29 2017-02-15 烽火通信科技股份有限公司 Self-adaptive method for realizing 1588 time synchronization in unicast mode
CN110417761A (en) * 2019-07-17 2019-11-05 上海东土远景工业科技有限公司 Communication means and device based on dual-computer redundancy
CN110365803A (en) * 2019-08-26 2019-10-22 四川艾贝斯科技发展有限公司 A kind of network channel maintenance method based on udp protocol

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111884875A (en) * 2020-07-17 2020-11-03 青岛易来智能科技股份有限公司 Offline device determination method and device
CN113542380A (en) * 2021-07-06 2021-10-22 四川创智联恒科技有限公司 High-efficiency heartbeat keep-alive method

Similar Documents

Publication Publication Date Title
EP1734691A1 (en) Scalable selective alarm suppression for data communication network
WO2002095580A1 (en) Methods and systems for automatically configuring network monitoring system
CN111817940B (en) Industrial control ring network system and implementation method thereof
EP1947806A1 (en) A method and system for service trace and service trace terminal, network element
CN110974204A (en) Method, system and device for realizing bidirectional heartbeat mechanism
CN102263651A (en) Method for detecting connection state of local end equipment in SNMP (simple network management protocol) network management system (NMS)
CN101247282B (en) Network test method, system and network managing station based on service level protocol
CN112994971A (en) Equipment offline monitoring method based on cloud server and related device
CN107426166B (en) A kind of acquisition methods of information, device and electronic equipment
CA2668671A1 (en) Serial communications protocol for safety critical systems
AU623444B2 (en) A token ring communication loop
CN110597226A (en) Abnormity early warning method and device for vehicle-mounted Ethernet
US7046693B1 (en) Method and system for determining availability in networks
CN113810238A (en) Network monitoring method, electronic device and storage medium
US20050262224A1 (en) Method for modifying one or more parameters for the operation of a network and subscribers for carrying out this method
JPH08102756A (en) Network management system
CN106982127A (en) Message detection and shunt method and tandem agent apparatus in a kind of convergent billing
JP3727466B2 (en) Network evaluation method, apparatus for implementing the same, and medium on which processing program is recorded
CN115412483B (en) Method and system for cross-device link aggregation keep-alive message interaction
KR19980050158A (en) Delivery protocol of communication processing system
CN110636098B (en) Monitoring data sharing method, monitoring device, server and system
CN111901216A (en) Backup processing method and system for RS485 ring network
KR100386948B1 (en) Apparatus for Traffic Monitoring and Interface of ITMA
JP3889687B2 (en) Monitoring and control system for communication system
DE19843447A1 (en) Network with coupling apparatus for connecting several network segments

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200410