CN106416133B - The determination method, apparatus and equipment of optimal heart beat cycle - Google Patents
The determination method, apparatus and equipment of optimal heart beat cycle Download PDFInfo
- Publication number
- CN106416133B CN106416133B CN201580029631.9A CN201580029631A CN106416133B CN 106416133 B CN106416133 B CN 106416133B CN 201580029631 A CN201580029631 A CN 201580029631A CN 106416133 B CN106416133 B CN 106416133B
- Authority
- CN
- China
- Prior art keywords
- heart beat
- beat cycle
- connection
- optimal
- cycle
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
Abstract
The present embodiments relate to the determination method, apparatus and equipment of optimal heart beat cycle, this method comprises: the first interval range that the optimal heart beat cycle for obtaining two equipment rooms belongs to;Multiple connections are established in two equipment rooms, and are that different heart beat cycles is arranged in each connection within the scope of first interval;In different heart beat cycles in the time of maximum heart beat cycle, the connection for whether occurring disconnecting in multiple connections detected;When testing result is the connection disconnected occur in multiple connections, the heart beat cycle for the connection that will be switched off is determined as the first heart beat cycle, and the heart beat cycle less than the first heart beat cycle in different heart beat cycles is determined as optimal heart beat cycle.Therefore in the embodiment of the present invention, by establishing multiple connections in two equipment rooms, and different heart beat cycles is set for each connection, determines the time used in optimal heart beat cycle so as to effectively shorten, determine the high-efficient of optimal heart beat cycle.
Description
Technical field
The present invention relates to the determination method, apparatus and equipment of network technique field more particularly to optimal heart beat cycle.
Background technique
The deletion for the network element meeting timing for needing to keep the long connection of two equipment rooms in some systems, but having in network is long
The connection that time does not have message to send, such as firewall, connection is upper in order to prevent does not have data transmission for a long time, and by intermediate net
Member disconnects, and periodically can send data packet in two equipment rooms, the movement of this periodicity sending data packet is known as heartbeat.
Heart beat cycle is too long, will lead to the disconnection of connection;Heart beat cycle is too short, will lead to the flow, electricity and property of equipment
The unnecessary consumption of energy, so an it needs to be determined that optimal heart beat cycle.
The optimal heart beat cycle that following manner determines two equipment rooms is generallyd use in the prior art, and specific process flow is such as
Under:
Step 1 obtains the range of the optimal heart beat cycle of two equipment rooms, maximum heart beat cycle value according to statistical information
It is L for H and minimum heart beat cycle value.
Step 2 establishes a connection in two equipment rooms, and the heart beat cycle that the connection is arranged is C=L.
Step 3, after time C, if the connection does not disconnect, the heart beat cycle that the connection is arranged is C=C+1.
Step 3 is repeated, until connection disconnection, thens follow the steps four, alternatively, the connection does not disconnect until C=H,
Then follow the steps five.
Step 4, if the connection disconnects, it is determined that the optimal heart beat cycle of two equipment rooms is C=C-1.
Step 5, if the C=H connection does not disconnect, it is determined that the optimal heart beat cycle of two equipment rooms is C=H.
The optimal heart beat cycle of two equipment rooms is determined using method in the prior art, takeing a long time can
The specific value for determining optimal heart beat cycle determines the low efficiency of optimal heart beat cycle.
Summary of the invention
The embodiment of the invention provides the determination method, apparatus and equipment of optimal heart beat cycle, determination can be effectively shortened
Time used in optimal heart beat cycle improves the efficiency for determining optimal heart beat cycle.
In a first aspect, providing a kind of determination method of optimal heart beat cycle, which comprises
Obtain the first interval range that the optimal heart beat cycle of two equipment rooms belongs to;
Multiple connections are established in described two equipment rooms, and are that each connection setting is different within the scope of the first interval
Heart beat cycle;
In the different heart beat cycle in the time of maximum heart beat cycle, detects in the multiple connection and whether occur
The connection of disconnection;
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, the heart beat cycle less than first heart beat cycle in the different heart beat cycle is determined
For the optimal heart beat cycle.
With reference to first aspect, in the first possible implementation of the first aspect, described when testing result is described
When there is the connection disconnected in multiple connections, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, by institute
The heart beat cycle less than first heart beat cycle stated in different heart beat cycles is determined as the optimal heart beat cycle, packet
It includes:
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, in the heart beat cycle less than first heart beat cycle in the different heart beat cycle,
The smallest heart beat cycle of difference with first heart beat cycle is determined as the optimal heart beat cycle.
With reference to first aspect or the first possible implementation of first aspect, second in first aspect are possible
It is described to establish multiple connections in described two equipment rooms in implementation, and be each connection within the scope of the first interval
Different heart beat cycles is set, comprising:
Multiple connections, and the precision for needing to meet according to the optimal heart beat cycle are established in described two equipment rooms,
There are within the scope of the first interval for each connection setting the different heart beat cycles of chronomere corresponding with the precision.
With reference to first aspect or the first or second of possible implementation of first aspect, in the third of first aspect
It is described when testing result is the connection disconnected occur in the multiple connection in the possible implementation of kind, by the disconnection
The heart beat cycle of connection be determined as the first heart beat cycle, the first heartbeat week will be less than in the different heart beat cycle
The heart beat cycle of phase is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, and, determine the second interval range that the optimal heart beat cycle belongs to, the second interval model
The lower limit enclosed is the heart beat cycle less than first heart beat cycle in the different heart beat cycle, the second interval model
The upper limit enclosed is first heart beat cycle;
Judge whether the siding-to-siding block length of the second interval range is less than or equal to the optimal heart beat cycle and needs to meet
Precision;
It needs to meet when the siding-to-siding block length for judging the second interval range is less than or equal to the optimal heart beat cycle
Precision when, the lower limit of the second interval range is determined as the optimal heart beat cycle.
The third possible implementation with reference to first aspect, in the 4th kind of possible implementation of first aspect
In, the method also includes:
When the siding-to-siding block length for judging the second interval range is greater than the precision that the optimal heart beat cycle needs to meet
When, using the second interval range as the first interval range, execution is described to establish multiple companies in described two equipment rooms
It connects, and is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
With reference to first aspect or the first any implementation into the 4th kind of possible implementation of first aspect,
In the fifth possible implementation of the first aspect, the method also includes:
It, will be in the different heart beat cycle when testing result is the connection disconnected do not occur in the multiple connection
Maximum heart beat cycle is determined as the optimal heart beat cycle.
The 5th kind of possible implementation with reference to first aspect, in the 6th kind of possible implementation of first aspect
In, it is described when testing result is the connection disconnected do not occur in the multiple connection, it will be in the different heart beat cycle
Maximum heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected do not occur in the multiple connection, determine that the optimal heart beat cycle belongs to
3rd interval range, the lower limit of the 3rd interval range is the maximum heart beat cycle in the different heart beat cycle, institute
The upper limit for stating 3rd interval range is the upper limit of the first interval range;
Judge whether the siding-to-siding block length of the 3rd interval range is less than or equal to the optimal heart beat cycle and needs to meet
Precision;
It needs to meet when the siding-to-siding block length for judging the 3rd interval range is less than or equal to the optimal heart beat cycle
Precision when, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle.
The 6th kind of possible implementation with reference to first aspect, in the 7th kind of possible implementation of first aspect
In, the method also includes:
When the siding-to-siding block length for judging the 3rd interval range is greater than the precision that the optimal heart beat cycle needs to meet
When, using the 3rd interval range as the first interval range, execution is described to establish multiple companies in described two equipment rooms
It connects, and is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
Second aspect, provides a kind of determining device of optimal heart beat cycle, and described device includes:
Acquiring unit, the first interval range that the optimal heart beat cycle for obtaining two equipment rooms belongs to;
Connection establishment unit, for establishing multiple connections in described two equipment rooms, and obtained in the acquiring unit
Different heart beat cycles is set for each connection within the scope of first interval;
Detection unit, for heart beat cycle maximum in the different heart beat cycles that the connection establishment unit is arranged when
In, the connection for whether occurring disconnecting in the multiple connection detected;
Determination unit, for being the connection disconnected occur in the multiple connection when the testing result of the detection unit
When, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, by being less than in the different heart beat cycle
The heart beat cycle of first heart beat cycle is determined as the optimal heart beat cycle.
In conjunction with second aspect, in the first possible implementation of the second aspect, the determination unit is specifically used for
When the testing result of the detection unit is the connection disconnected occur in the multiple connection, by the heart of the connection of the disconnection
Hop cycle is determined as the first heart beat cycle, and the heartbeat less than first heart beat cycle in the different heart beat cycle is all
It is interim, the smallest heart beat cycle of difference with first heart beat cycle is determined as the optimal heart beat cycle.
In conjunction with the possible implementation of the first of second aspect or second aspect, second in second aspect is possible
In implementation, the connection establishment unit, specifically for establishing multiple connections in described two equipment rooms, and according to it is described most
Excellent heart beat cycle needs the precision met, is that each connection setting has within the scope of the first interval that the acquiring unit obtains
The different heart beat cycles of chronomere corresponding with the precision.
In conjunction with the first or second of possible implementation of second aspect or second aspect, in the third of second aspect
In the possible implementation of kind, the determination unit includes:
First interval determines subelement, for being to break in the multiple connection when the testing result of the detection unit
When the connection opened, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, and, determine the optimal heartbeat
The second interval range that period belongs to, the lower limit of the second interval range are in the different heart beat cycle less than described
The heart beat cycle of first heart beat cycle, the upper limit of the second interval range are first heart beat cycle;
First judgment sub-unit, for judging that the first interval determines the section of the determining second interval range of subelement
Whether length is less than or equal to the precision that the optimal heart beat cycle needs to meet;
First optimal heart beat cycle determines subelement, for judging the second interval when first judgment sub-unit
When the siding-to-siding block length of range is less than or equal to the precision that the optimal heart beat cycle needs to meet, by the second interval range
Lower limit is determined as the optimal heart beat cycle.
In conjunction with the third possible implementation of second aspect, in the 4th kind of possible implementation of second aspect
In, described device further include:
First circulation triggers subelement, for judging the area of the second interval range when first judgment sub-unit
Between length when being greater than the precision that the optimal heart beat cycle needs to meet, using the second interval range as the first interval
Range establishes multiple connections in described two equipment rooms by connection establishment unit execution is described, and in the first interval
The step of different heart beat cycles are set for each connection in range.
In conjunction with any implementation of the first of second aspect or second aspect into the 4th kind of possible implementation,
In a fifth possible implementation of the second aspect, the determination unit is also used to the detection knot when the detection unit
Fruit is that when not occurring the connection disconnected in the multiple connection, the maximum heart beat cycle in the different heart beat cycle is determined
For the optimal heart beat cycle.
In conjunction with the 5th kind of possible implementation of second aspect, in the 6th kind of possible implementation of second aspect
In, the determination unit includes:
Second interval determines subelement, for being not occur in the multiple connection when the testing result of the detection unit
When the connection of disconnection, the 3rd interval range that the optimal heart beat cycle belongs to is determined, the lower limit of the 3rd interval range is
Maximum heart beat cycle in the different heart beat cycle, the upper limit of the 3rd interval range are the first interval range
The upper limit;
Second judgment sub-unit, for judging that the second interval determines the section of the determining 3rd interval range of subelement
Whether length is less than or equal to the precision that the optimal heart beat cycle needs to meet;
Second optimal heart beat cycle determines subelement, for judging the 3rd interval when second judgment sub-unit
When the siding-to-siding block length of range is less than or equal to the precision that the optimal heart beat cycle needs to meet, by the different heart beat cycle
In maximum heart beat cycle be determined as the optimal heart beat cycle.
In conjunction with the 6th kind of possible implementation of second aspect, in the 7th kind of possible implementation of second aspect
In, described device further include:
Second circulation triggers subelement, for judging the area of the 3rd interval range when second judgment sub-unit
Between length when being greater than the precision that the optimal heart beat cycle needs to meet, using the 3rd interval range as the first interval
Range establishes multiple connections in described two equipment rooms by connection establishment unit execution is described, and in the first interval
The step of different heart beat cycles are set for each connection in range.
The third aspect, provides a kind of equipment, and the equipment includes:
Memory;
Processor;
The memory, for storing program instruction;
The processor, for executing following operation according to the program instruction stored in the memory:
Obtain the first interval range that the optimal heart beat cycle of two equipment rooms belongs to;
Multiple connections are established in described two equipment rooms, and are that each connection setting is different within the scope of the first interval
Heart beat cycle;
In the different heart beat cycle in the time of maximum heart beat cycle, detects in the multiple connection and whether occur
The connection of disconnection;
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, the heart beat cycle less than first heart beat cycle in the different heart beat cycle is determined
For the optimal heart beat cycle.
It is in the first possible implementation of the third aspect, described when testing result is described in conjunction with the third aspect
When there is the connection disconnected in multiple connections, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, by institute
The heart beat cycle less than first heart beat cycle stated in different heart beat cycles is determined as the optimal heart beat cycle, packet
It includes:
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, in the heart beat cycle less than first heart beat cycle in the different heart beat cycle,
The smallest heart beat cycle of difference with first heart beat cycle is determined as the optimal heart beat cycle.
In conjunction with the possible implementation of the first of the third aspect or the third aspect, second in the third aspect is possible
It is described to establish multiple connections in described two equipment rooms in implementation, and be each connection within the scope of the first interval
Different heart beat cycles is set, comprising:
Multiple connections, and the precision for needing to meet according to the optimal heart beat cycle are established in described two equipment rooms,
There are within the scope of the first interval for each connection setting the different heart beat cycles of chronomere corresponding with the precision.
In conjunction with the first or second of possible implementation of the third aspect or the third aspect, in the third of the third aspect
It is described when testing result is the connection disconnected occur in the multiple connection in the possible implementation of kind, by the disconnection
The heart beat cycle of connection be determined as the first heart beat cycle, the first heartbeat week will be less than in the different heart beat cycle
The heart beat cycle of phase is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, and, determine the second interval range that the optimal heart beat cycle belongs to, the second interval model
The lower limit enclosed is the heart beat cycle less than first heart beat cycle in the different heart beat cycle, the second interval model
The upper limit enclosed is first heart beat cycle;
Judge whether the siding-to-siding block length of the second interval range is less than or equal to the optimal heart beat cycle and needs to meet
Precision;
It needs to meet when the siding-to-siding block length for judging the second interval range is less than or equal to the optimal heart beat cycle
Precision when, the lower limit of the second interval range is determined as the optimal heart beat cycle.
In conjunction with the third possible implementation of the third aspect, in the 4th kind of possible implementation of the third aspect
In, the processor is also used to execute following operation according to the program instruction stored in the memory:
When the siding-to-siding block length for judging the second interval range is greater than the precision that the optimal heart beat cycle needs to meet
When, using the second interval range as the first interval range, execution is described to establish multiple companies in described two equipment rooms
It connects, and is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
In conjunction with any implementation of the first of the third aspect or the third aspect into the 4th kind of possible implementation,
In the 5th kind of possible implementation of the third aspect, the processor is also used to according to the journey stored in the memory
It is operated below sequence instruction execution:
It, will be in the different heart beat cycle when testing result is the connection disconnected do not occur in the multiple connection
Maximum heart beat cycle is determined as the optimal heart beat cycle.
In conjunction with the 5th kind of possible implementation of the third aspect, in the 6th kind of possible implementation of the third aspect
In, it is described when testing result is the connection disconnected do not occur in the multiple connection, it will be in the different heart beat cycle
Maximum heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected do not occur in the multiple connection, determine that the optimal heart beat cycle belongs to
3rd interval range, the lower limit of the 3rd interval range is the maximum heart beat cycle in the different heart beat cycle, institute
The upper limit for stating 3rd interval range is the upper limit of the first interval range;
Judge whether the siding-to-siding block length of the 3rd interval range is less than or equal to the optimal heart beat cycle and needs to meet
Precision;
It needs to meet when the siding-to-siding block length for judging the 3rd interval range is less than or equal to the optimal heart beat cycle
Precision when, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle.
In conjunction with the 6th kind of possible implementation of the third aspect, in the 7th kind of possible implementation of the third aspect
In, the processor is also used to execute following operation according to the program instruction stored in the memory:
When the siding-to-siding block length for judging the 3rd interval range is greater than the precision that the optimal heart beat cycle needs to meet
When, using the 3rd interval range as the first interval range, execution is described to establish multiple companies in described two equipment rooms
It connects, and is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
Fourth aspect, provides a kind of computer storage medium, and the computer storage medium is stored with program, the journey
The step of sequence executes is included the steps that as described in any in the possible implementation of first aspect or first aspect.
The embodiment of the invention provides a kind of determination methods of optimal heart beat cycle, first obtain the optimal heart of two equipment rooms
Then the first interval range that hop cycle belongs to establishes multiple connections in two equipment rooms, and is every within the scope of first interval
Different heart beat cycles is arranged in a connection, and, in different heart beat cycles in the time of maximum heart beat cycle, detect multiple
Whether the connection that disconnects is occurred in connection, when testing result is the connection disconnected occur in multiple connections, the connection that will be switched off
Heart beat cycle be determined as the first heart beat cycle, the heart beat cycle less than the first heart beat cycle in different heart beat cycles is true
It is set to optimal heart beat cycle.Therefore the embodiment of the present invention is by establishing multiple connections in two equipment rooms, and for per each company
It connects and different heart beat cycles is set, determine the time used in optimal heart beat cycle so as to effectively shorten, it is optimal to improve determination
The efficiency of heart beat cycle.
Detailed description of the invention
Fig. 1 is the determination method flow diagram for the optimal heart beat cycle that the embodiment of the present invention one provides;
Fig. 2 is that schematic diagram is established in the connection of the embodiment of the present invention;
Fig. 3 is the determination method flow diagram of optimal heart beat cycle provided by Embodiment 2 of the present invention;
Fig. 4 is the determination method signal flow diagram for the optimal heart beat cycle that the embodiment of the present invention three provides;
Fig. 5 is the determination method signal flow diagram for the optimal heart beat cycle that the embodiment of the present invention four provides;
Fig. 6 is the determination method signal flow diagram for the optimal heart beat cycle that the embodiment of the present invention five provides;
Fig. 7 is the determination structure drawing of device for the optimal heart beat cycle that the embodiment of the present invention six provides;
Fig. 8 is the equipment structure chart that the embodiment of the present invention seven provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical solution in the embodiment of the present invention is described, it is clear that described embodiment is a part of the invention
Embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making wound
Every other embodiment obtained under the premise of the property made labour, shall fall within the protection scope of the present invention.
When the embodiment of the present invention refers to the ordinal numbers such as " first ", " second ", unless based on context its express really it is suitable
The meaning of sequence, it should be understood that only play differentiation.
The embodiment of the invention provides a kind of determination method of optimal heart beat cycle, this method is determined for needing to protect
The optimal heart beat cycle for holding any two equipment room of long connection does not limit the concrete scene present invention of this method application
It is fixed, for example, above-mentioned two equipment can be the equipment in internet, or the equipment in local area network;Can for terminal and
Server can also be terminal, alternatively, being server.To determine between terminal A and server B in the embodiment of the present invention
It is specifically described for optimal heart beat cycle, the sender of heartbeat can be terminal, be also possible to server, description below
In be only illustrated by the sender of heartbeat of terminal.
Fig. 1 is the determination method flow diagram for the optimal heart beat cycle that the embodiment of the present invention one provides, the execution master of this method
Body is terminal, this method comprises:
Step 101, the first interval range that the optimal heart beat cycle of two equipment rooms belongs to is obtained.
In the embodiment of the present invention, the mode for obtaining first interval range is not specifically limited, can be by statistics
Information is analyzed, to obtain the first interval range that the optimal heart beat cycle between terminal A and server B belongs to;It can also be with
First interval range is set by rule of thumb by technical staff, to obtain what the optimal heart beat cycle between terminal A and server B belonged to
First interval range.Above-mentioned first interval range can be expressed as T ∈ [Tmin, Tmax], wherein and T represents optimal heart beat cycle,
Tmin represents the lower limit of optimal heart beat cycle, and Tmax represents the upper limit of optimal heart beat cycle.First interval range can be one
Biggish interval range, for example, siding-to-siding block length is 10 minutes;First interval range is also possible to a lesser interval range,
For example, siding-to-siding block length is 2 minutes.
Step 102, multiple connections are established in described two equipment rooms, and is each connection within the scope of the first interval
Different heart beat cycles is set.
It will be understood by those skilled in the art that above-mentioned multiple connections can be understood as at least two connections, it is above-mentioned different
The time span that heart beat cycle refers specifically to heart beat cycle is different, for example, when the heart beat cycle that a connection is arranged is 1 minute,
The heart beat cycle of another connection can be set to 2 minutes or 3 minutes, and cannot be set as 1 minute.
Schematic diagram is established referring to connection shown in Fig. 2, in order to find the optimal heart beat cycle T between terminal A and server B,
Start k connection between terminal A and server B, wherein 1 < k, above-mentioned connection is specifically as follows socket (socket) connection.
The heart beat cycle of i-th, j socket connection is respectively set to Ti, Tj, Ti < Tj (i < j), also, Ti, Tj are first
In interval range.
Normally, according to the requirement of system or technical staff where two equipment, optimal heart beat cycle can be determined
The precision for needing to meet, above-mentioned precision can be understood as the chronomere of optimal heart beat cycle, be every in the embodiment of the present invention
When a connection setting heart beat cycle, the precision that can need to meet according to the optimal heart beat cycle, in the first interval model
There are in enclosing for each connection setting the different heart beat cycles of chronomere corresponding with the precision, it is above-mentioned accordingly specifically
To be interpreted as precision and chronomere's numerically equal.For example, first interval range is 5min, linking number 5, when optimal
Heart beat cycle needs the precision that meets when being 1min, can be respectively for each connection setting heart beat cycle 1min, 2min, 3min,
4min,5min;When the precision that optimal heart beat cycle needs to meet is 0.5min, heart beat cycle can be set for each connection and distinguish
For 0.5min, 1min, 1.5min, 2min, 2.5min.
Step 103, it is detected in the multiple connection in the time of maximum heart beat cycle in the different heart beat cycle
Whether the connection that appearance disconnects.
Above-mentioned maximum heart beat cycle is that longest heart beat cycle of time in the different heart beat cycle.
When the maximum heart beat cycle in the heart beat cycle of k socket connection is Tk, detected within the Tk time described more
Whether the connection that disconnects is occurred in a connection.
Step 104, when testing result is the connection disconnected occur in the multiple connection, by the connection of the disconnection
Heart beat cycle is determined as the first heart beat cycle, by the heartbeat less than first heart beat cycle in the different heart beat cycle
Period is determined as optimal heart beat cycle.
In the embodiment of the present invention, when occurring the connection of multiple disconnections in the multiple connection, it is only necessary to which detection disconnects at first
That connection.Wherein, the heart beat cycle less than first heart beat cycle in different heart beat cycles may be multiple hearts
Hop cycle, can be according to heart beat cycle less than first heart beat cycle of the preset rules in the different heart beat cycle
In, select a heart beat cycle to determine it as the optimal heart beat cycle.Preferably, in the different heart beat cycle
In heart beat cycle less than first heart beat cycle, it will be determined with the smallest heart beat cycle of the difference of first heart beat cycle
For the optimal heart beat cycle.For example, in a step 102 by the heart beat cycle of i-th, j socket connection be respectively set to Ti,
Tj, Ti < Tj (i < j) can determine optimal heart beat cycle T ∈ if socket disconnection has occurred in i-th of socket connection
[Ti-1, Ti), Ti-1 directly can be determined as the optimal heart beat cycle at this time.
When the precision difference for needing to meet in view of heart beat cycle optimal in different systems, in the embodiment of the present invention,
Determine optimal heart beat cycle T ∈ [Ti-1, Ti) after, can first judge section [Ti-1, Ti) siding-to-siding block length whether be less than
The precision met is needed equal to optimal heart beat cycle.When judge section [Ti-1, Ti) siding-to-siding block length be less than or equal to the optimal heart
When the precision that hop cycle needs to meet, then Ti-1 is determined as the optimal heart beat cycle;When judge section [Ti-1, Ti)
Siding-to-siding block length be greater than optimal heart beat cycle need meet precision when, with section [Ti-1, Ti) be used as first interval range, jump
To step 102.
It can also include when testing result is described in the determination method of optimal heart beat cycle provided in an embodiment of the present invention
Do not occur the process flow of the optimal heart beat cycle of determination when the connection disconnected in multiple connections, at this point it is possible in the difference
Heart beat cycle in, select a heart beat cycle to determine it as the optimal heart beat cycle.Preferably, when testing result is institute
It states in multiple connections when not occurring the connection disconnected, the maximum heart beat cycle in the different heart beat cycle is determined as described
Optimal heart beat cycle.
For example, establishing k connection in a step 102, the heart beat cycle of i-th, j socket connection is respectively set to
Ti, Tj, Ti < Tj (i < j) can determine optimal heart beat cycle T ∈ if socket disconnection does not occur within the Tk time
Tk directly can be determined as the optimal heart beat cycle at this time by [Tk, Tmax].
When the precision difference for needing to meet in view of heart beat cycle optimal in different systems, in the embodiment of the present invention,
After determining optimal heart beat cycle T ∈ [Tk, Tmax], it can first judge whether the siding-to-siding block length in section [Tk, Tmax] is less than
The precision met is needed equal to optimal heart beat cycle.When the siding-to-siding block length for judging section [Tk, Tmax] is less than or equal to the optimal heart
When the precision that hop cycle needs to meet, then Tk is determined as the optimal heart beat cycle;When the area for judging section [Tk, Tmax]
Between length be greater than optimal heart beat cycle need meet precision when, with section [Tk, Tmax] be used as first interval range, jump to
Step 102.
Therefore the embodiment of the present invention is by establishing multiple connections in two equipment rooms, and is arranged not for each connection
Same heart beat cycle determines the time used in optimal heart beat cycle so as to effectively shorten, high-efficient.
Fig. 3 is the determination method flow diagram of optimal heart beat cycle provided by Embodiment 2 of the present invention, wherein optimal determining
When heart beat cycle, it is contemplated that the precision that optimal heart beat cycle needs to meet in different systems is different, this method comprises:
Step 301, the first interval range that the optimal heart beat cycle of two equipment rooms belongs to is obtained.
Step 302, multiple connections are established in described two equipment rooms, and need to meet according to the optimal heart beat cycle
Precision is that different heart beat cycles is arranged in each connection within the scope of the first interval.
Step 303, it is detected in the multiple connection in the time of maximum heart beat cycle in the different heart beat cycle
Whether the connection that appearance disconnects.
Step 304, when testing result is the connection disconnected occur in multiple connections, the heart beat cycle for the connection that will be switched off
It is determined as the first heart beat cycle, and, determine the second interval range that optimal heart beat cycle belongs to, the lower limit of second interval range
For the heart beat cycle less than the first heart beat cycle in different heart beat cycles, the upper limit of second interval range is the first heartbeat week
Phase.
In the embodiment of the present invention, when occurring the connection of multiple disconnections in the multiple connection, it is only necessary to which detection disconnects at first
That connection.Wherein, the heart beat cycle less than first heart beat cycle in different heart beat cycles may be multiple hearts
Hop cycle, can be according to heart beat cycle less than first heart beat cycle of the preset rules in the different heart beat cycle
In, select a heart beat cycle to determine it as the lower limit of the second interval range.Preferably, in the different heartbeat week
It, will be all with the smallest heartbeat of the difference of first heart beat cycle in the interim heart beat cycle less than first heart beat cycle
Phase is determined as the lower limit of the second interval range.
For example, the heart beat cycle of i-th, j socket connection is respectively set to Ti, Tj, Ti < Tj (i in step 302
< j), if socket disconnection has occurred in i-th of socket connection, can determine optimal heart beat cycle T ∈ [Ti-1, Ti),
I.e. determine second interval range be [Ti-1, Ti).Step 305, judge whether the siding-to-siding block length of the second interval range is less than
Or the precision for needing to meet equal to the optimal heart beat cycle.
Step 306, when the siding-to-siding block length for judging the second interval range is less than or equal to the optimal heart beat cycle
When the precision for needing to meet, the lower limit of the second interval range is determined as the optimal heart beat cycle.
Due in step 304, it is preferable that be less than first heart beat cycle in the different heart beat cycle
In heart beat cycle, the smallest heart beat cycle of difference with first heart beat cycle is determined as under the second interval range
Limit.Correspondingly, within step 306, the smallest heart beat cycle of difference with first heart beat cycle is determined as described optimal
Heart beat cycle.
It can also include working as to judge described second in the determination method of optimal heart beat cycle provided in an embodiment of the present invention
The place of the optimal heart beat cycle of determination when the siding-to-siding block length of interval range is greater than the precision that the optimal heart beat cycle needs to meet
Manage process.
Step 307, it is needed completely when the siding-to-siding block length for judging the second interval range is greater than the optimal heart beat cycle
When the precision of foot, using the second interval range as the first interval range, step 302 is jumped to.
Step 308, when testing result is the connection disconnected do not occur in the multiple connection, optimal heart beat cycle is determined
The 3rd interval range belonged to, the lower limit of 3rd interval range are the maximum heart beat cycle in different heart beat cycles, third area
Between range the upper limit be first interval range the upper limit.
For example, establishing k connection in step 302, the heart beat cycle of i-th, j socket connection is respectively set to
Ti, Tj, Ti < Tj (i < j) can determine optimal heart beat cycle T ∈ if socket disconnection does not occur within the Tk time
[Tk, Tmax] determines that the 3rd interval range is [Tk, Tmax].
Step 309, judge whether the siding-to-siding block length of the 3rd interval range is less than or equal to the optimal heart beat cycle
The precision for needing to meet.
Step 310, when the siding-to-siding block length for judging the 3rd interval range is less than or equal to the optimal heart beat cycle
When the precision for needing to meet, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle.
Step 311, it is needed completely when the siding-to-siding block length for judging the 3rd interval range is greater than the optimal heart beat cycle
When the precision of foot, using the 3rd interval range as the first interval range, step 302 is jumped to.
The embodiment of the present invention needs the precision met according to the optimal heart beat cycle, is within the scope of the first interval
Different heart beat cycle is arranged in each connection, to avoid between the different heart beat cycles of setting that difference is too small, wastes not
Necessary process resource;Also, the optimal heart beat cycle for meeting required precision can be obtained by cycle detection.
Fig. 4 is the determination method signal flow diagram for the optimal heart beat cycle that the embodiment of the present invention three provides, and terminal A is periodically sent
Heartbeat is to server B, and the range of the optimal heart beat cycle T between terminal A and server B is [1min, 5min], it is desirable that the precision of T
It is built between A and B for integer minute for the optimal heart beat cycle T (assuming that optimal heart beat cycle is 4min) being quickly found out between A, B
The step of vertical 5 connections, this method executes, is as follows:
Step 401,5 socket (S1, S2, S3, S4, S5) connections are established between A and B.
Step 402, the heart beat cycle of each connection is set, and starts timing.
Wherein, the heart beat cycle respectively connected is respectively as follows: T1=1min, T2=2min, T3=3min, T4=4min, T5=
5min。
Step 403,1 minutes arrive, and terminal A sends the heartbeat request of S1 connection to server B, server B transmission S1
The heartbeat of connection is responsive to terminal A.
Step 404,2 minutes arrive, and terminal A sends the heartbeat request of S2 connection to server B, server B transmission S2
The heartbeat of connection is responsive to terminal A.
Step 405,3 minutes arrive, and terminal A sends the heartbeat request of S3 connection to server B, server B transmission S3
The heartbeat of connection is responsive to terminal A.
Step 406,4 minutes arrive, and terminal A sends the heartbeat request of S4 connection to server B, server B transmission S4
The heartbeat of connection is responsive to terminal A.
Step 407, it arrives within 5 minutes, S5 connection disconnects, and determines that optimal heart beat cycle is 4 minutes.
Arrive within 5 minutes, S5 connection disconnect after, at this point, the range of the optimal heart beat cycle T redefined be [4min, 5min),
Siding-to-siding block length is 1min, it is desirable that the precision of T is integer minute, that is, 1min, can should since siding-to-siding block length is equal to the precision of T
The lower limit 4min in section is determined as optimal heart beat cycle.
The method of the embodiment of the present invention determines that time used time of optimal heart beat cycle is 5 minutes, and in the prior art
Method determines that time used time of optimal heart beat cycle is 15 minutes, and therefore, the method for the embodiment of the present invention can effectively shorten
Determine time used time of optimal heart beat cycle.
Fig. 5 is the determination method signal flow diagram for the optimal heart beat cycle that the embodiment of the present invention four provides, and terminal A is periodically sent
Heartbeat is to server B, and the range of the optimal heart beat cycle T between terminal A and server B is [1min, 5min], it is desirable that the precision of T
It is built between A and B for integer minute for the optimal heart beat cycle T (assuming that optimal heart beat cycle is 4min) being quickly found out between A, B
The step of vertical 2 connections, this method executes, is as follows:
Step 501,2 socket (S1, S2) connections are established between A and B.
Step 502, the heart beat cycle of each connection is set, and starts timing.
Wherein, the heart beat cycle respectively connected is respectively as follows: T1=1min, T2=3min.
Step 503,1 minutes arrive, and terminal A sends the heartbeat request of S1 connection to server B, server B transmission S1
The heartbeat of connection is responsive to terminal A.
Step 504,3 minutes arrive, and terminal A sends the heartbeat request of S2 connection to server B, server B transmission S2
The heartbeat of connection is responsive to terminal A.
At this point, the range of the optimal heart beat cycle T redefined is [3min, 5min], siding-to-siding block length 2min, it is desirable that T
Precision be integer minute, that is, 1min, due to siding-to-siding block length be greater than T precision, it is therefore desirable in the range of optimal heart beat cycle T
In [3min, 5min], continue to determine optimal heart beat cycle.
Step 505, the heart beat cycle for S1, S2 being arranged is respectively as follows: T1=4min, T2=5min, and reclocking.
Step 506,4 minutes arrive, and terminal A sends the heartbeat request of S1 connection to server B, server B transmission S1
The heartbeat of connection is responsive to terminal A.
Step 507,5 minutes arrive, and S2 connection disconnects, and determine that optimal heart beat cycle is 4 minutes.
The method of the embodiment of the present invention determines that time used time of optimal heart beat cycle is 8 minutes, and in the prior art
Method determines that time used time of optimal heart beat cycle is 15 minutes, and therefore, the method for the embodiment of the present invention can effectively shorten
Determine time used time of optimal heart beat cycle.
Fig. 6 is the determination method signal flow diagram for the optimal heart beat cycle that the embodiment of the present invention five provides, and terminal A is periodically sent
Heartbeat is to server B, and the range of the optimal heart beat cycle T between terminal A and server B is [1min, 5min], it is desirable that the precision of T
It is built between A and B for integer minute for the optimal heart beat cycle T (assuming that optimal heart beat cycle is 4min) being quickly found out between A, B
The step of vertical 3 connections, this method executes, is as follows:
Step 601,3 socket (S1, S2, S3) connections are established between A and B.
Step 602, their heart beat cycle is respectively as follows: T1=1min, T2=3min, T3=5min and starts timing.
Step 603,1 minutes arrive, and terminal A sends the heartbeat request of S1 connection to server B, server B transmission S1
The heartbeat of connection is responsive to terminal A.
Step 604,3 minutes arrive, and terminal A sends the heartbeat request of S2 connection to server B, server B transmission S2
The heartbeat of connection is responsive to terminal A.
Step 605,5 minutes arrive, and S3 is disconnected, and T2=4min, and reclocking is arranged.
5 minutes arrive, S3 disconnect after, at this point, the range of the optimal heart beat cycle T redefined be [3min, 5min),
Siding-to-siding block length is 2min, it is desirable that the precision of T is integer minute, that is, 1min, since siding-to-siding block length is greater than the precision of T, it is therefore desirable to
Optimal heart beat cycle T range [3min, 5min) in, continue to determine optimal heart beat cycle.
Step 606,4 minutes arrive, and terminal A sends the heartbeat request of S2 connection to server B, server B transmission S2
The heartbeat of connection is responsive to terminal A.
Step 607, determine that optimal heart beat cycle is 4min.
The method of the embodiment of the present invention determines that time used time of optimal heart beat cycle is 9 minutes, and in the prior art
Method determines that time used time of optimal heart beat cycle is 15 minutes, and therefore, the method for the embodiment of the present invention can effectively shorten
Determine time used time of optimal heart beat cycle.
Fig. 7 is the determination structure drawing of device for the optimal heart beat cycle that the embodiment of the present invention six provides, and the device is for executing
The determination method of optimal heart beat cycle provided in an embodiment of the present invention, described device include:
Acquiring unit 701, the first interval range that the optimal heart beat cycle for obtaining two equipment rooms belongs to;
Connection establishment unit 702, for establishing multiple connections in described two equipment rooms, and in the acquiring unit 701
Different heart beat cycles is set for each connection within the scope of the first interval of acquisition;
Detection unit 703, for heartbeat week maximum in the different heart beat cycles that the connection establishment unit 702 is arranged
In the time of phase, the connection for whether occurring disconnecting in the multiple connection detected;
Determination unit 704, for being disconnected when in the multiple connection of testing result of the detection unit 703
When connection, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, it will be in the different heart beat cycle
Heart beat cycle less than first heart beat cycle is determined as the optimal heart beat cycle.
Preferably, the determination unit 704 is the multiple specifically for the testing result when the detection unit 703
When occurring the connection disconnected in connection, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, it is described not
With heart beat cycle in the heart beat cycle less than first heart beat cycle in, by with the difference of first heart beat cycle most
Small heart beat cycle is determined as the optimal heart beat cycle.
Preferably, the connection establishment unit 702, specifically for establishing multiple connections, and root in described two equipment rooms
It is each within the scope of the first interval that the acquiring unit 701 obtains according to the precision that the optimal heart beat cycle needs to meet
Connection setting has the different heart beat cycles of chronomere corresponding with the precision.
Preferably, the determination unit 704 includes:
First interval determines subelement 7041, is the multiple connection for the testing result when the detection unit 703
It is middle that the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle when there is the connection disconnected, and, determine described in
The second interval range that optimal heart beat cycle belongs to, the lower limit of the second interval range are in the different heart beat cycle
Less than the heart beat cycle of first heart beat cycle, the upper limit of the second interval range is first heart beat cycle;
First judgment sub-unit 7042, the second interval model for determining that subelement 7041 determines for judging the first interval
Whether the siding-to-siding block length enclosed is less than or equal to the precision that the optimal heart beat cycle needs to meet;
First optimal heart beat cycle determines subelement 7043, described in judging when first judgment sub-unit 7042
When the siding-to-siding block length of second interval range is less than or equal to the precision that the optimal heart beat cycle needs to meet, by secondth area
Between the lower limit of range be determined as the optimal heart beat cycle.
Preferably, described device further include:
First circulation triggers subelement 7044, for judging the second interval when first judgment sub-unit 7042
When the siding-to-siding block length of range is greater than the precision that the optimal heart beat cycle needs to meet, using the second interval range as described in
First interval range, by the connection establishment unit 702 execute it is described establish multiple connections in described two equipment rooms, and in institute
State the step of different heart beat cycles are set for each connection within the scope of first interval.
Preferably, the determination unit 704 is also used to when the testing result of the detection unit 703 be the multiple company
When not occurring the connection disconnected in connecing, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heartbeat
Period.
Preferably, the determination unit 704 includes:
Second interval determines subelement 7045, is the multiple connection for the testing result when the detection unit 703
In when not occurring the connection disconnected, determine the 3rd interval range that the optimal heart beat cycle belongs to, the 3rd interval range
Lower limit be maximum heart beat cycle in the different heart beat cycle, the upper limit of the 3rd interval range is firstth area
Between range the upper limit;
Second judgment sub-unit 7046, the 3rd interval model for determining that subelement 7045 determines for judging the second interval
Whether the siding-to-siding block length enclosed is less than or equal to the precision that the optimal heart beat cycle needs to meet;
Second optimal heart beat cycle determines subelement 7047, described in judging when second judgment sub-unit 7046
It, will be described different when the siding-to-siding block length of 3rd interval range is less than or equal to the precision that the optimal heart beat cycle needs to meet
Maximum heart beat cycle in heart beat cycle is determined as the optimal heart beat cycle.
Preferably, described device further include:
Second circulation triggers subelement 7048, for judging the 3rd interval when second judgment sub-unit 7046
When the siding-to-siding block length of range is greater than the precision that the optimal heart beat cycle needs to meet, using the 3rd interval range as described in
First interval range, by the connection establishment unit 702 execute it is described establish multiple connections in described two equipment rooms, and in institute
State the step of different heart beat cycles are set for each connection within the scope of first interval.
Fig. 8 is the equipment structure chart that the embodiment of the present invention seven provides, and the equipment is provided in an embodiment of the present invention for executing
The determination method of optimal heart beat cycle, the equipment include:
Memory 801;
Processor 802;
The memory 801, for storing program instruction;
The processor 802, for executing following operation according to the program instruction stored in the memory 801:
Obtain the first interval range that the optimal heart beat cycle of two equipment rooms belongs to;
Multiple connections are established in described two equipment rooms, and are that each connection setting is different within the scope of the first interval
Heart beat cycle;
In the different heart beat cycle in the time of maximum heart beat cycle, detects in the multiple connection and whether occur
The connection of disconnection;
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, the heart beat cycle less than first heart beat cycle in the different heart beat cycle is determined
For the optimal heart beat cycle.
Wherein, which can also include transmitter and receiver, after described two equipment rooms establish multiple connections, lead to
It crosses transmitter and sends signal, signal is received by receiver.
Preferably, described when testing result is the connection disconnected occur in the multiple connection, by the company of the disconnection
The heart beat cycle connect is determined as the first heart beat cycle, will be less than first heart beat cycle in the different heart beat cycle
Heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, in the heart beat cycle less than first heart beat cycle in the different heart beat cycle,
The smallest heart beat cycle of difference with first heart beat cycle is determined as the optimal heart beat cycle.
Preferably, described to establish multiple connections in described two equipment rooms, and be each within the scope of the first interval
Different heart beat cycles is arranged in connection, comprising:
Multiple connections, and the precision for needing to meet according to the optimal heart beat cycle are established in described two equipment rooms,
There are within the scope of the first interval for each connection setting the different heart beat cycles of chronomere corresponding with the precision.
Preferably, described when testing result is the connection disconnected occur in the multiple connection, by the company of the disconnection
The heart beat cycle connect is determined as the first heart beat cycle, will be less than first heart beat cycle in the different heart beat cycle
Heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, by the heart beat cycle of the connection of the disconnection
It is determined as the first heart beat cycle, and, determine the second interval range that the optimal heart beat cycle belongs to, the second interval model
The lower limit enclosed is the heart beat cycle less than first heart beat cycle in the different heart beat cycle, the second interval model
The upper limit enclosed is first heart beat cycle;
Judge whether the siding-to-siding block length of the second interval range is less than or equal to the optimal heart beat cycle and needs to meet
Precision;
It needs to meet when the siding-to-siding block length for judging the second interval range is less than or equal to the optimal heart beat cycle
Precision when, the lower limit of the second interval range is determined as the optimal heart beat cycle.
Preferably, the processor 802 is also used to be executed according to the program instruction stored in the memory 801 following
Operation:
When the siding-to-siding block length for judging the second interval range is greater than the precision that the optimal heart beat cycle needs to meet
When, using the second interval range as the first interval range, execution is described to establish multiple companies in described two equipment rooms
It connects, and is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
Preferably, the processor 802 is also used to be executed according to the program instruction stored in the memory 801 following
Operation:
It, will be in the different heart beat cycle when testing result is the connection disconnected do not occur in the multiple connection
Maximum heart beat cycle is determined as the optimal heart beat cycle.
Preferably, described when testing result is the connection disconnected do not occur in the multiple connection, it will be described different
Maximum heart beat cycle in heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected do not occur in the multiple connection, determine that the optimal heart beat cycle belongs to
3rd interval range, the lower limit of the 3rd interval range is the maximum heart beat cycle in the different heart beat cycle, institute
The upper limit for stating 3rd interval range is the upper limit of the first interval range;
Judge whether the siding-to-siding block length of the 3rd interval range is less than or equal to the optimal heart beat cycle and needs to meet
Precision;
It needs to meet when the siding-to-siding block length for judging the 3rd interval range is less than or equal to the optimal heart beat cycle
Precision when, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle.
Preferably, the processor 802 is also used to be executed according to the program instruction stored in the memory 801 following
Operation:
When the siding-to-siding block length for judging the 3rd interval range is greater than the precision that the optimal heart beat cycle needs to meet
When, using the 3rd interval range as the first interval range, execution is described to establish multiple companies in described two equipment rooms
It connects, and is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
The embodiment of the invention also provides a kind of computer storage medium, the computer storage medium is stored with program,
The step of described program executes includes the steps that the determination method of optimal heart beat cycle provided in an embodiment of the present invention.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure
Unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this realization
It should not be considered as beyond the scope of the present invention.
Those of ordinary skill in the art will appreciate that implement the method for the above embodiments be can be with
By program come instruction processing unit completion, the program be can store in computer readable storage medium, and the storage is situated between
Matter is non-transitory (English: non-transitory) medium, such as random access memory, read-only memory, flash
Device, hard disk, solid state hard disk, tape (English: magnetic tape), floppy disk (English: floppy disk), CD (English:
Optical disc) and any combination thereof.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto,
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by anyone skilled in the art,
It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with scope of protection of the claims
Subject to.
Claims (25)
1. a kind of determination method of optimal heart beat cycle, which is characterized in that the described method includes:
Obtain the first interval range that the optimal heart beat cycle of two equipment rooms belongs to;
Multiple connections are established in described two equipment rooms, and are that the different hearts is arranged in each connection within the scope of the first interval
Hop cycle;
In the different heart beat cycle in the time of maximum heart beat cycle, detects in the multiple connection and whether disconnect
Connection;
When testing result is the connection disconnected occur in the multiple connection, the heart beat cycle of the connection of the disconnection is determined
For the first heart beat cycle, the heart beat cycle less than first heart beat cycle in the different heart beat cycle is determined as institute
State optimal heart beat cycle.
2. the method as described in claim 1, which is characterized in that described when testing result is to disconnect in the multiple connection
Connection when, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, will be in the different heart beat cycle
The heart beat cycle less than first heart beat cycle be determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, the heart beat cycle of the connection of the disconnection is determined
It, will be in the heart beat cycle less than first heart beat cycle in the different heart beat cycle for the first heart beat cycle
The smallest heart beat cycle of difference of first heart beat cycle is determined as the optimal heart beat cycle.
3. method according to claim 1 or 2, which is characterized in that it is described to establish multiple connections in described two equipment rooms, and
It is that different heart beat cycles is arranged in each connection within the scope of the first interval, comprising:
Multiple connections, and the precision for needing to meet according to the optimal heart beat cycle are established in described two equipment rooms, described
There are within the scope of first interval for each connection setting the different heart beat cycles of chronomere corresponding with the precision.
4. the method as described in claim 1, which is characterized in that described when testing result is to disconnect in the multiple connection
Connection when, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, will be in the different heart beat cycle
The heart beat cycle less than first heart beat cycle be determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, the heart beat cycle of the connection of the disconnection is determined
For the first heart beat cycle, and, determine the second interval range that the optimal heart beat cycle belongs to, the second interval range
Lower limit is the heart beat cycle less than first heart beat cycle in the different heart beat cycle, the second interval range
The upper limit is first heart beat cycle;
Judge whether the siding-to-siding block length of the second interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
Degree;
When the siding-to-siding block length for judging the second interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
When spending, the lower limit of the second interval range is determined as the optimal heart beat cycle.
5. method as claimed in claim 4, which is characterized in that the method also includes:
It, will when the siding-to-siding block length for judging the second interval range is greater than the precision that the optimal heart beat cycle needs to meet
For the second interval range as the first interval range, execution is described to establish multiple connections in described two equipment rooms, and
It is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
6. the method as described in claim 1, which is characterized in that the method also includes:
When testing result is the connection disconnected do not occur in the multiple connection, by the maximum in the different heart beat cycle
Heart beat cycle is determined as the optimal heart beat cycle.
7. method as claimed in claim 6, which is characterized in that described when testing result is not break in the multiple connection
When the connection opened, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected do not occur in the multiple connection, determine that the optimal heart beat cycle belongs to the
Three interval ranges, the lower limit of the 3rd interval range are the maximum heart beat cycle in the different heart beat cycle, described the
The upper limit of three interval ranges is the upper limit of the first interval range;
Judge whether the siding-to-siding block length of the 3rd interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
Degree;
When the siding-to-siding block length for judging the 3rd interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
When spending, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle.
8. the method for claim 7, which is characterized in that the method also includes:
It, will when the siding-to-siding block length for judging the 3rd interval range is greater than the precision that the optimal heart beat cycle needs to meet
For the 3rd interval range as the first interval range, execution is described to establish multiple connections in described two equipment rooms, and
It is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
9. a kind of determining device of optimal heart beat cycle, which is characterized in that described device includes:
Acquiring unit, the first interval range that the optimal heart beat cycle for obtaining two equipment rooms belongs to;
Connection establishment unit, for establishing multiple connections, and first obtained in the acquiring unit in described two equipment rooms
Different heart beat cycles is set for each connection in interval range;
Detection unit, the time for heart beat cycle maximum in the different heart beat cycles that the connection establishment unit is arranged
It is interior, the connection for whether occurring disconnecting in the multiple connection detected;
Determination unit, for inciting somebody to action when the testing result of the detection unit is the connection disconnected occur in the multiple connection
The heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, will be less than described the in the different heart beat cycle
The heart beat cycle of heart cycle is determined as the optimal heart beat cycle.
10. device as claimed in claim 9, which is characterized in that the determination unit, specifically for when the detection unit
Testing result is that when there is the connection disconnected in the multiple connection, the heart beat cycle of the connection of the disconnection is determined as first
Heart beat cycle will be with described in the heart beat cycle less than first heart beat cycle in the different heart beat cycle
The smallest heart beat cycle of the difference of heart cycle is determined as the optimal heart beat cycle.
11. the device as described in claim 9 or 10, which is characterized in that the connection establishment unit is specifically used for described two
A equipment room establishes multiple connections, and the precision for needing to meet according to the optimal heart beat cycle, obtains in the acquiring unit
First interval within the scope of for it is each connection setting have chronomere corresponding with the precision different heart beat cycles.
12. device as claimed in claim 9, which is characterized in that the determination unit includes:
First interval determines subelement, for disconnecting when in the multiple connection of testing result of the detection unit
When connection, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, and, determine the optimal heart beat cycle
The second interval range belonged to, the lower limit of the second interval range are to be less than described first in the different heart beat cycle
The heart beat cycle of heart beat cycle, the upper limit of the second interval range are first heart beat cycle;
First judgment sub-unit, for judging that the first interval determines the siding-to-siding block length of the determining second interval range of subelement
Whether precision that the optimal heart beat cycle need meet is less than or equal to;
First optimal heart beat cycle determines subelement, for judging the second interval range when first judgment sub-unit
Siding-to-siding block length when being less than or equal to the precision that the optimal heart beat cycle needs to meet, by the lower limit of the second interval range
It is determined as the optimal heart beat cycle.
13. device as claimed in claim 12, which is characterized in that described device further include:
First circulation triggers subelement, for judging that the section of the second interval range is long when first judgment sub-unit
When degree is greater than the precision that the optimal heart beat cycle needs to meet, using the second interval range as the first interval model
It encloses, establishes multiple connections in described two equipment rooms by connection establishment unit execution is described, and in the first interval model
The step of different heart beat cycles are set for each connection in enclosing.
14. device as claimed in claim 9, which is characterized in that the determination unit is also used to the inspection when the detection unit
Surveying result is when not occurring the connection disconnected in the multiple connection, by the maximum heart beat cycle in the different heart beat cycle
It is determined as the optimal heart beat cycle.
15. device as claimed in claim 14, which is characterized in that the determination unit includes:
Second interval determines subelement, for being not disconnect in the multiple connection when the testing result of the detection unit
Connection when, determine the 3rd interval range that the optimal heart beat cycle belongs to, the lower limit of the 3rd interval range is described
Maximum heart beat cycle in different heart beat cycles, the upper limit of the 3rd interval range are the upper of the first interval range
Limit;
Second judgment sub-unit, for judging that the second interval determines the siding-to-siding block length of the determining 3rd interval range of subelement
Whether precision that the optimal heart beat cycle need meet is less than or equal to;
Second optimal heart beat cycle determines subelement, for judging the 3rd interval range when second judgment sub-unit
Siding-to-siding block length when being less than or equal to the precision that the optimal heart beat cycle needs to meet, will be in the different heart beat cycle
Maximum heart beat cycle is determined as the optimal heart beat cycle.
16. device as claimed in claim 15, which is characterized in that described device further include:
Second circulation triggers subelement, for judging that the section of the 3rd interval range is long when second judgment sub-unit
When degree is greater than the precision that the optimal heart beat cycle needs to meet, using the 3rd interval range as the first interval model
It encloses, establishes multiple connections in described two equipment rooms by connection establishment unit execution is described, and in the first interval model
The step of different heart beat cycles are set for each connection in enclosing.
17. a kind of optimal heart beat cycle locking equipment really, which is characterized in that the equipment includes:
Memory;
Processor;
The memory, for storing program instruction;
The processor, for executing following operation according to the program instruction stored in the memory:
Obtain the first interval range that the optimal heart beat cycle of two equipment rooms belongs to;
Multiple connections are established in described two equipment rooms, and are that the different hearts is arranged in each connection within the scope of the first interval
Hop cycle;
In the different heart beat cycle in the time of maximum heart beat cycle, detects in the multiple connection and whether disconnect
Connection;
When testing result is the connection disconnected occur in the multiple connection, the heart beat cycle of the connection of the disconnection is determined
For the first heart beat cycle, the heart beat cycle less than first heart beat cycle in the different heart beat cycle is determined as institute
State optimal heart beat cycle.
18. equipment as claimed in claim 17, which is characterized in that described when testing result is to break in the multiple connection
When the connection opened, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, by the different heart beat cycle
In the heart beat cycle less than first heart beat cycle be determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, the heart beat cycle of the connection of the disconnection is determined
It, will be in the heart beat cycle less than first heart beat cycle in the different heart beat cycle for the first heart beat cycle
The smallest heart beat cycle of difference of first heart beat cycle is determined as the optimal heart beat cycle.
19. the equipment as described in claim 17 or 18, which is characterized in that described to establish multiple companies in described two equipment rooms
It connects, and is that different heart beat cycles is arranged in each connection within the scope of the first interval, comprising:
Multiple connections, and the precision for needing to meet according to the optimal heart beat cycle are established in described two equipment rooms, described
There are within the scope of first interval for each connection setting the different heart beat cycles of chronomere corresponding with the precision.
20. equipment as claimed in claim 17, which is characterized in that described when testing result is to break in the multiple connection
When the connection opened, the heart beat cycle of the connection of the disconnection is determined as the first heart beat cycle, by the different heart beat cycle
In the heart beat cycle less than first heart beat cycle be determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected occur in the multiple connection, the heart beat cycle of the connection of the disconnection is determined
For the first heart beat cycle, and, determine the second interval range that the optimal heart beat cycle belongs to, the second interval range
Lower limit is the heart beat cycle less than first heart beat cycle in the different heart beat cycle, the second interval range
The upper limit is first heart beat cycle;
Judge whether the siding-to-siding block length of the second interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
Degree;
When the siding-to-siding block length for judging the second interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
When spending, the lower limit of the second interval range is determined as the optimal heart beat cycle.
21. equipment as claimed in claim 20, which is characterized in that the processor is also used to deposit according in the memory
The program instruction of storage executes following operation:
It, will when the siding-to-siding block length for judging the second interval range is greater than the precision that the optimal heart beat cycle needs to meet
For the second interval range as the first interval range, execution is described to establish multiple connections in described two equipment rooms, and
It is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
22. equipment as claimed in claim 17, which is characterized in that the processor is also used to deposit according in the memory
The program instruction of storage executes following operation:
When testing result is the connection disconnected do not occur in the multiple connection, by the maximum in the different heart beat cycle
Heart beat cycle is determined as the optimal heart beat cycle.
23. equipment as claimed in claim 22, which is characterized in that described when testing result is not occur in the multiple connection
When the connection of disconnection, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle, comprising:
When testing result is the connection disconnected do not occur in the multiple connection, determine that the optimal heart beat cycle belongs to the
Three interval ranges, the lower limit of the 3rd interval range are the maximum heart beat cycle in the different heart beat cycle, described the
The upper limit of three interval ranges is the upper limit of the first interval range;
Judge whether the siding-to-siding block length of the 3rd interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
Degree;
When the siding-to-siding block length for judging the 3rd interval range is less than or equal to the essence that the optimal heart beat cycle needs to meet
When spending, the maximum heart beat cycle in the different heart beat cycle is determined as the optimal heart beat cycle.
24. equipment as claimed in claim 23, which is characterized in that the processor is also used to deposit according in the memory
The program instruction of storage executes following operation:
It, will when the siding-to-siding block length for judging the 3rd interval range is greater than the precision that the optimal heart beat cycle needs to meet
For the 3rd interval range as the first interval range, execution is described to establish multiple connections in described two equipment rooms, and
It is the step of different heart beat cycles are arranged in each connection within the scope of the first interval.
25. a kind of computer storage medium, which is characterized in that the computer storage medium is stored with program, and described program is held
Capable step includes such as step described in any item of the claim 1 to 8.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2015/076066 WO2016161577A1 (en) | 2015-04-08 | 2015-04-08 | Method, apparatus and device for determining optimal heartbeat period |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106416133A CN106416133A (en) | 2017-02-15 |
CN106416133B true CN106416133B (en) | 2019-06-28 |
Family
ID=57071682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201580029631.9A Active CN106416133B (en) | 2015-04-08 | 2015-04-08 | The determination method, apparatus and equipment of optimal heart beat cycle |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106416133B (en) |
WO (1) | WO2016161577A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109547293A (en) * | 2018-12-20 | 2019-03-29 | 上海数果科技有限公司 | Heartbeat data packet transmission method |
CN111245946B (en) * | 2020-01-15 | 2022-06-03 | 郑州春泉节能股份有限公司 | Method and device for judging reliability of equipment signal |
CN115695251A (en) * | 2022-09-13 | 2023-02-03 | 浪潮云信息技术股份公司 | Self-adaptive heartbeat interval adjusting method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103684815A (en) * | 2012-09-03 | 2014-03-26 | 中国移动通信集团公司 | Keep-alive method, device and system for data transmission link |
CN104426714A (en) * | 2013-08-30 | 2015-03-18 | 联想(北京)有限公司 | Heart-beat testing method and device for keeping connection |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8817809B2 (en) * | 2007-06-18 | 2014-08-26 | Qualcomm Incorporated | Communication link allocation based on dynamic trend analysis |
KR101520349B1 (en) * | 2009-04-13 | 2015-05-14 | 삼성전자주식회사 | Apparatus and method for determinating ping interval of activesync service in wireless communication system |
-
2015
- 2015-04-08 WO PCT/CN2015/076066 patent/WO2016161577A1/en active Application Filing
- 2015-04-08 CN CN201580029631.9A patent/CN106416133B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103684815A (en) * | 2012-09-03 | 2014-03-26 | 中国移动通信集团公司 | Keep-alive method, device and system for data transmission link |
CN104426714A (en) * | 2013-08-30 | 2015-03-18 | 联想(北京)有限公司 | Heart-beat testing method and device for keeping connection |
Also Published As
Publication number | Publication date |
---|---|
WO2016161577A1 (en) | 2016-10-13 |
CN106416133A (en) | 2017-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN205142267U (en) | Communication protocol's that discernment was being used among process control system device | |
CN105653630B (en) | Data migration method and device for distributed database | |
CN106416133B (en) | The determination method, apparatus and equipment of optimal heart beat cycle | |
CN112769897A (en) | Synchronization method and device for edge calculation message, electronic equipment and storage medium | |
CN110265006A (en) | Awakening method, master node, slave node and storage medium | |
CN105549399B (en) | A kind of indoor environment monitoring method and internet-of-things terminal | |
CN105933393A (en) | Intra-local area network data synchronization method, device and user terminal | |
CN108833490A (en) | A kind of distributed data acquisition system and its method | |
CN108683528A (en) | A kind of data transmission method, central server, server and data transmission system | |
CN106730833A (en) | A kind of network game service condition monitoring system and method | |
CN108399120A (en) | asynchronous message monitoring method and device | |
CN104270287B (en) | A kind of packet out-ordering detection method and device | |
CN108228422A (en) | Storage-type server management system and method | |
CN106027306A (en) | Resource monitoring method and device | |
CN104243473B (en) | A kind of method and device of data transmission | |
CN106302519A (en) | The method of a kind of internet security management and terminal | |
CN109561482B (en) | Data acquisition method, data acquisition device and intelligent terminal | |
CN106452905A (en) | Message processing method and device | |
CN108650217B (en) | Synchronous method, device, storage medium and the electronic device of action state | |
CN106534113B (en) | SSH connection establishment method and device | |
US10193644B2 (en) | Method and device for transmitting data in electronic device | |
CN114422412B (en) | Equipment detection method and device and communication equipment | |
CN106571938B (en) | A kind of alarm detection method and device based on access link | |
JP2015082131A (en) | Monitoring system, monitoring method, monitoring program, and monitoring device | |
CN112799921A (en) | Multi-device and multi-network environment operation and maintenance monitoring method and device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |