CN109981800A - Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time - Google Patents

Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time Download PDF

Info

Publication number
CN109981800A
CN109981800A CN201910315287.XA CN201910315287A CN109981800A CN 109981800 A CN109981800 A CN 109981800A CN 201910315287 A CN201910315287 A CN 201910315287A CN 109981800 A CN109981800 A CN 109981800A
Authority
CN
China
Prior art keywords
heartbeat
heartbeat packet
transmitting terminal
keep
packet transmitting
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
CN201910315287.XA
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.)
Guangzhou Lu Bangtong Networking Technology Co Ltd
Original Assignee
Guangzhou Lu Bangtong Networking 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 Guangzhou Lu Bangtong Networking Technology Co Ltd filed Critical Guangzhou Lu Bangtong Networking Technology Co Ltd
Priority to CN201910315287.XA priority Critical patent/CN109981800A/en
Publication of CN109981800A publication Critical patent/CN109981800A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention belongs to the communications fields; disclose the method for terminal quick sensing NAT keep-alive time a kind of; the method specifically: heartbeat packet transmitting terminal sends heartbeat packet to heartbeat responder according to the exploration period continued to increase, until because of the too long heartbeat response for causing heartbeat packet transmitting terminal that can not receive heartbeat responder feedback of heartbeat packet sending cycle;The period is soundd out as the longest keep-alive time of keep-alive connection between heartbeat packet transmitting terminal and heartbeat responder using what is be most recently successfully;The exploration period increases according to exponential mode;The heartbeat packet transmitting terminal is client, and heartbeat responder is server;Or the heartbeat packet transmitting terminal is server, heartbeat responder is client.This method can rapidly know the keep-alive time, meanwhile, the invention also discloses be related to the heartbeat packet transmitting terminal and interactive system of this method.

Description

Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time
Technical field
The present invention relates to the communications field, specifically a kind of method, the heartbeat packet of terminal quick sensing NAT keep-alive time Transmitting terminal and interactive system.
Background technique
Applicant Beijing holds Lian Yitong Information Technology Co., Ltd and has applied for a patent of invention CN in 2016 201610414480.5 disclose a kind of heartbeat method and system for keeping connecting, and are divided into two sides of terminal and Cloud Server Face acquires the maximum heartbeat packet period by terminal and uploads to Cloud Server, then counts optimal heartbeat packet week by Cloud Server Phase;When terminal is under certain network state, server issues the corresponding optimal heartbeat packet period, in this, as initial heart packet week Phase is used for keep-alive network link, is avoided that unnecessary exploration and waste terminal flow and electricity in this way.
Its 42nd section of record in the description: when meeting intelligent heartbeat packet acquisition probing condition, with current network heartbeat The period is wrapped along with a step-length is as the period is soundd out, is sent to server and sounds out heartbeat packet, then continued to increase step-length and send examination Heartbeat is visited not, until failing accordingly because sending heartbeat packet serverless backup caused by excessive cycle, at this moment to be most recently successfully The period is soundd out as the maximum heartbeat packet period.
The maximum defect of the program is, improves heartbeat packet sending cycle in the form of a step-length every time, can not be rapid The keep-alive time for knowing NAT (Network Address Translation, network address translation).
Summary of the invention
The purpose of the present invention is to provide the method for terminal quick sensing NAT keep-alive time a kind of, heartbeat packet transmitting terminal and Interactive system, this method can rapidly know the keep-alive time, meanwhile, the invention also discloses be related to the heartbeat packet hair of this method Sending end and interactive system.
Specific technical solution of the invention are as follows: a kind of method of terminal quick sensing NAT keep-alive time, the method Specifically:
Heartbeat packet transmitting terminal sends heartbeat packet to heartbeat responder according to the exploration period continued to increase, until because of heartbeat The too long heartbeat response for causing heartbeat packet transmitting terminal that can not receive heartbeat responder feedback of packet sending cycle;With what is be most recently successfully Sound out longest keep-alive time of the period as keep-alive connection between heartbeat packet transmitting terminal and heartbeat responder;
The exploration period increases according to exponential mode;
The heartbeat packet transmitting terminal is client, and heartbeat responder is server;Or the heartbeat packet transmitting terminal is Server, heartbeat responder are client.
In the method for above-mentioned terminal quick sensing NAT keep-alive time, include the following steps:
Step 1: heartbeat packet transmitting terminal is to sound out cycle TKThe heartbeat packet sent to heartbeat responder;The heartbeat response End after receiving heartbeat packet to the feedback heartbeat of heartbeat packet transmitting terminal for responding;
Step 2: step 1 is carried out if heartbeat packet transmitting terminal receives heartbeat response, if heartbeat packet transmitting terminal is not received by Heartbeat response then carries out step 3;
Step 3: if heartbeat packet transmitting terminal does not receive heartbeat response after n-th sends heartbeat packet, being sent out with heartbeat packet The exploration cycle T of sending end the N-1 times transmission heartbeat packetN-1For the longest keep-alive time;
The exploration period that heartbeat packet transmitting terminal sends heartbeat packet for the first time is T1;The exploration period of kth transmission heartbeat packet For TK
TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
In the method for above-mentioned terminal quick sensing NAT keep-alive time, X=2.
Further include step 4 after the step 3 in the method for above-mentioned terminal quick sensing NAT keep-alive time:
Step 4: heartbeat packet transmitting terminal is with longest keep-alive time TN-1Based on exploration period for continuing to increase responded to heartbeat End sends heartbeat packet, until because heartbeat packet sending cycle too long to cause heartbeat packet transmitting terminal that can not receive heartbeat responder anti- The heartbeat of feedback responds;It is connected most using the exploration period being most recently successfully as keep-alive between heartbeat packet transmitting terminal and heartbeat responder The excellent keep-alive time;
The exploration period in the step 4 increases according to linearly increasing mode.
In the method for above-mentioned terminal quick sensing NAT keep-alive time, the step 4 specifically:
Step S41: heartbeat packet transmitting terminal is to sound out cycle TJThe heartbeat packet sent to heartbeat responder;
Step S42: step S41 is carried out if heartbeat packet transmitting terminal receives heartbeat response, if heartbeat packet transmitting terminal does not connect It receives heartbeat response and then carries out step S43;
Step S43: if heartbeat packet transmitting terminal does not receive heartbeat response after the M times transmission heartbeat packet, with heartbeat packet The exploration cycle T of transmitting terminal the M-1 times transmission heartbeat packetM-1For the optimal keep-alive time;
TJ-TJ-1=Y, Y are preset value;M > J > N;
As J=N+1, TJ=TN-1+Y。
In the method for above-mentioned terminal quick sensing NAT keep-alive time, Y=1.
Meanwhile the invention also discloses the heartbeat packet transmitting terminals of quick sensing NAT keep-alive time a kind of, including such as lower die Block:
Heartbeat packet sending module: to sound out cycle TKThe heartbeat packet sent to heartbeat responder;
Receiving module is reacted in heartbeat: for receiving heartbeat response;The heartbeat response is being received by heartbeat responder It is sent after heartbeat packet to heartbeat reaction receiving module;
Control module: for when heartbeat reaction receiving module receives heartbeat response, control heartbeat packet sending module to be sent out Send heartbeat packet;Exploration cycle T is preset in the control moduleKIncreasing law be exponential growth;
Longest keep-alive time determining module: for determining when heartbeat reaction receiving module is not received by heartbeat response The exploration cycle T of heartbeat packet is sent with heartbeat packet sending module the N-1 timesN-1For the longest keep-alive time;
The exploration period that heartbeat packet transmitting terminal sends heartbeat packet for the first time is T1;The exploration period of kth transmission heartbeat packet For TK
TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
It further include the optimal keep-alive time determining mould in the heartbeat packet transmitting terminal of above-mentioned quick sensing NAT keep-alive time Block;
The optimal keep-alive time determining module is used to determine the longest keep-alive time in longest keep-alive time determining module Afterwards, with longest keep-alive time TN-1Based on exploration period for continuing to increase sent out by heartbeat packet sending module to heartbeat responder Heartbeat packet is sent, leads to heartbeat reaction receiving module until because heartbeat packet sending cycle is too long can not to receive heartbeat responder anti- The heartbeat of feedback responds;It is connected most using the exploration period being most recently successfully as keep-alive between heartbeat packet transmitting terminal and heartbeat responder The excellent keep-alive time;
The preset increasing law for souning out the period of optimal keep-alive time determining module is linear increase.
In the heartbeat packet transmitting terminal of above-mentioned quick sensing NAT keep-alive time, the heartbeat packet transmitting terminal is client End or server.
In addition, the invention also discloses the interactive system of quick sensing NAT keep-alive time a kind of, including client and service Device;
The client is heartbeat packet transmitting terminal as described above;The server is to cooperate with heartbeat packet transmitting terminal After receiving heartbeat packet to heartbeat reaction receiving module send heartbeat packet server;
Or the server is heartbeat packet transmitting terminal as described above;The client is to match with heartbeat packet transmitting terminal That closes sends the client of heartbeat packet after receiving heartbeat packet to heartbeat reaction receiving module.
Compared with prior art, the beneficial effects of the present invention are:
Client of the invention, server optional one as heartbeat packet transmitting terminal and another is as heartbeat response End, by sending heartbeat packet with the exponential exploration period, can be soundd out to obtain most when network is added in terminal The long keep-alive time.Although the longest keep-alive time be not optimize the keep-alive time, be their ability to the faster time it is true A fixed longer keep-alive interval.
Preferably, we can be in the base of the longest keep-alive time of Chinese fir if to determine the upper limit of keep-alive time Keep-alive time and heartbeat packet sending cycle are improved on plinth in linearly increasing manner.The optimal keep-alive time can be determined in this way.
Detailed description of the invention
Fig. 1 is the flow diagram of the embodiment of the present invention 1;
Fig. 2 is the structural block diagram of the embodiment of the present invention 2;
Fig. 3 is the structural block diagram of the embodiment of the present invention 3.
Specific embodiment
With reference to embodiment, technical solution of the present invention is described in further detail, but do not constituted pair Any restrictions of the invention.
Embodiment 1
As shown in Figure 1, a kind of method of terminal quick sensing NAT keep-alive time, the method specifically:
The determination of longest keep-alive time:
Heartbeat packet transmitting terminal sends heartbeat packet to heartbeat responder according to the exploration period continued to increase, until because of heartbeat The too long heartbeat response for causing heartbeat packet transmitting terminal that can not receive heartbeat responder feedback of packet sending cycle;With what is be most recently successfully Sound out longest keep-alive time of the period as keep-alive connection between heartbeat packet transmitting terminal and heartbeat responder;
The exploration period increases according to exponential mode;
The heartbeat packet transmitting terminal is client, and heartbeat responder is server;Or the heartbeat packet transmitting terminal is Server, heartbeat responder are client.
Specifically, above-mentioned method includes the following steps:
Step 1: heartbeat packet transmitting terminal is to sound out cycle TKThe heartbeat packet sent to heartbeat responder;The heartbeat response End after receiving heartbeat packet to the feedback heartbeat of heartbeat packet transmitting terminal for responding;
Step 2: step 1 is carried out if heartbeat packet transmitting terminal receives heartbeat response, if heartbeat packet transmitting terminal is not received by Heartbeat response then carries out step 3;
Step 3: if heartbeat packet transmitting terminal does not receive heartbeat response after n-th sends heartbeat packet, being sent out with heartbeat packet The exploration cycle T of sending end the N-1 times transmission heartbeat packetN-1For the longest keep-alive time;
The exploration period that heartbeat packet transmitting terminal sends heartbeat packet for the first time is T1;The exploration period of kth transmission heartbeat packet For TK
TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
Entire control flow is illustrated by taking X=2 as an example below are as follows:
Step1: network is added in terminal, and heartbeat packet transmitting terminal sends heartbeat packet to sound out cycle T 1, and heartbeat responder receives Heartbeat is sent after to heartbeat packet to respond to heartbeat packet transmitting terminal;
Step2: heartbeat packet transmitting terminal is to sound out cycle T2(T2=2T1) heartbeat packet is sent, heartbeat responder receives heartbeat Heartbeat is sent after packet to respond to heartbeat packet transmitting terminal;
Step3: heartbeat packet transmitting terminal is to sound out cycle T3(T3=2T2) heartbeat packet is sent, heartbeat responder receives heartbeat Heartbeat is sent after packet to respond to heartbeat packet transmitting terminal;
......
StepN: heartbeat packet transmitting terminal is to sound out cycle TN(TN=2N-1*T1) heartbeat packet is sent, heartbeat packet transmitting terminal does not have Receive any heartbeat response;
This when, heartbeat packet transmitting terminal was just realised that the longest keep-alive time, which is TN-1(TN-1=2N -2*T1)。
Arrive this, heartbeat packet transmitting terminal can with the longest keep-alive time carry out keep-alive connection, the used time is short, can and opposite end into The reliable keep-alive connection of row.
Above-mentioned steps 1-3 only gives the determination method of longest keep-alive time, actually the keep-alive time can also be carried out into One-step optimization, the optimization determine method with reference to traditional keep-alive time, the content as described in CN 201610414480.5.
Specifically, described to advanced optimize method are as follows: to further include step 4 after the step 3:
Step 4: heartbeat packet transmitting terminal is with longest keep-alive time TN-1Based on exploration period for continuing to increase responded to heartbeat End sends heartbeat packet, until because heartbeat packet sending cycle too long to cause heartbeat packet transmitting terminal that can not receive heartbeat responder anti- The heartbeat of feedback responds;It is connected most using the exploration period being most recently successfully as keep-alive between heartbeat packet transmitting terminal and heartbeat responder The excellent keep-alive time;
The exploration period in the step 4 increases according to linearly increasing mode.
Specifically: the step 4 specifically:
Step S41: heartbeat packet transmitting terminal is to sound out cycle TJThe heartbeat packet sent to heartbeat responder;
Step S42: step S41 is carried out if heartbeat packet transmitting terminal receives heartbeat response, if heartbeat packet transmitting terminal does not connect It receives heartbeat response and then carries out step S43;
Step S43: if heartbeat packet transmitting terminal does not receive heartbeat response after the M times transmission heartbeat packet, with heartbeat packet The exploration cycle T of transmitting terminal the M-1 times transmission heartbeat packetM-1For the optimal keep-alive time;
TJ-TJ-1=Y, Y are preset value;M > J > N;
As J=N+1, TJ=TN-1+Y。
Entire control flow is illustrated by taking Y=1 as an example below are as follows:
Step4-1: heartbeat packet transmitting terminal is to sound out cycle TJ(TJ=TN-1+ 1) heartbeat packet is sent, heartbeat responder receives Heartbeat is sent after heartbeat packet to respond to heartbeat packet transmitting terminal;
Step4-2: heartbeat packet transmitting terminal is to sound out cycle TJ+1(TJ+1=TJ+ 1) heartbeat packet is sent, heartbeat responder receives Heartbeat is sent after to heartbeat packet to respond to heartbeat packet transmitting terminal;
Step4-3: heartbeat packet transmitting terminal is to sound out cycle TJ+2(TJ+2=TJ+1+ 1) heartbeat packet, heartbeat response termination are sent Transmission heartbeat is responded to heartbeat packet transmitting terminal after receiving heartbeat packet;
......
StepM: heartbeat packet transmitting terminal is to sound out cycle TM(TM=TN-1+ M-J) heartbeat packet is sent, heartbeat packet transmitting terminal does not have Receive any heartbeat response;
This when, heartbeat packet transmitting terminal was just realised that the optimal keep-alive time, which is TM-1(TM-1=TN-1 +M-J-1)。
The measurement unit in the exploration period of this paper can be for second, millisecond etc., according to the actual situation can be with flexible choice.
This is arrived, heartbeat packet transmitting terminal can carry out keep-alive connection with the optimal keep-alive time.
The determination method of longest keep-alive time and the determination method of optimal keep-alive time are combined, can be by optimal keep-alive The determination of time is executed with most fast speed, effectively reduces duration used, and reliable.
Embodiment 2
The method of the above embodiments 1 mainly passes through heartbeat packet transmitting terminal and executes, and heartbeat packet transmitting terminal can be client, It may be server.
In the present embodiment, as shown in Fig. 2, being illustrated so that heartbeat packet transmitting terminal is client as an example.
Heartbeat packet transmitting terminal is client, specifically includes following module:
Heartbeat packet sending module 11: to sound out cycle TKThe heartbeat packet sent to heartbeat responder;
Receiving module 12 is reacted in heartbeat: for receiving heartbeat response;The heartbeat response is being received by heartbeat responder It is sent after to heartbeat packet to heartbeat reaction receiving module 12;
Control module 13: for when heartbeat reaction receiving module 12 receives heartbeat response, control heartbeat packet to send mould Block 11 sends heartbeat packet;Exploration cycle T is preset in the control module 13KIncreasing law be exponential growth;
Longest keep-alive time determining module 14: for heartbeat reaction receiving module 12 be not received by heartbeat response when, Determine the exploration cycle T that heartbeat packet is sent with heartbeat packet sending module 11 the N-1 timesN-1For the longest keep-alive time;
The exploration period that heartbeat packet transmitting terminal sends heartbeat packet for the first time is T1;The exploration period of kth transmission heartbeat packet For TK
TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
Optimal keep-alive time determining module 15: for determining the longest keep-alive time in longest keep-alive time determining module 14 Afterwards, with longest keep-alive time TN-1Based on exploration period for continuing to increase by heartbeat packet sending module 11 to heartbeat responder Heartbeat packet is sent, until causing heartbeat reaction receiving module 12 that can not receive heartbeat response because heartbeat packet sending cycle is too long The heartbeat response of end feedback;It is connected using the exploration period being most recently successfully as keep-alive between heartbeat packet transmitting terminal and heartbeat responder The optimal keep-alive time;
The preset increasing law for souning out the period of optimal keep-alive time determining module 15 is linear increase;
In its course of work, when this client is added to network, needs to establish optimal protection with server and connects, Matching relationship between each module are as follows:
Control module 13 controls exploration cycle T of the beginning of heartbeat packet sending module 11 to initialize1To heartbeat responder (clothes Be engaged in device) send heartbeat packet;
Receiving module 12 is reacted in heartbeat can constantly receive heartbeat response;
Whether control module 13 constantly can receive heartbeat response by monitoring heartbeat reaction receiving module 12, if so, then The heartbeat packet that control heartbeat packet sending module 11 is sent with the heart beat cycle exponentially increased to heartbeat responder (server); If monitoring that reaction receiving module does not receive heartbeat response in n-th, longest keep-alive time determining module 14 is controlled Determine that the longest keep-alive time is TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
To at this point, optimal keep-alive time determining module 15 control heartbeat packet sending module 11 resets the rule in exploration period Then, rules modification is to increase in linear form in the exploration period, and control module 13 controls heartbeat packet sending module 11 with new rule It then sends heartbeat packet and continues to monitor whether heartbeat reaction receiving module 12 receives heartbeat response, once receiving module is reacted in heartbeat 12 do not receive heartbeat response, then control module 13 is using exploration period for being most recently successfully as heartbeat packet transmitting terminal and heartbeat response The optimal keep-alive time that keep-alive connects between end.
Determine longest keep-alive time and optimal keep-alive time by above-mentioned module, can by the determination of optimal keep-alive time with Most fast speed executes, and effectively reduces duration used, and reliable.
Embodiment 3
As shown in figure 3, a kind of interactive system of quick sensing NAT keep-alive time, including client 1 and server 2;
The client 1 is described in embodiment 2;The server 2 be with client after receiving heartbeat packet The server 2 of heartbeat packet is sent to heartbeat reaction receiving module 12.
Above-described is only presently preferred embodiments of the present invention, all made within the scope of the spirit and principles in the present invention What modifications, equivalent substitutions and improvements etc., should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of method of terminal quick sensing NAT keep-alive time, which is characterized in that the method specifically:
Heartbeat packet transmitting terminal sends heartbeat packet to heartbeat responder according to the exploration period continued to increase, until because heartbeat packet is sent out The heartbeat response for sending excessive cycle to cause heartbeat packet transmitting terminal that can not receive heartbeat responder feedback;With the exploration being most recently successfully The longest keep-alive time that period connects as keep-alive between heartbeat packet transmitting terminal and heartbeat responder;
The exploration period increases according to exponential mode;
The heartbeat packet transmitting terminal is client, and heartbeat responder is server;Or the heartbeat packet transmitting terminal is service Device, heartbeat responder are client.
2. the method for terminal quick sensing NAT keep-alive time according to claim 1, which is characterized in that including walking as follows It is rapid:
Step 1: heartbeat packet transmitting terminal is to sound out cycle TKThe heartbeat packet sent to heartbeat responder;The heartbeat responder is used It is responded in feeding back heartbeat to heartbeat packet transmitting terminal after receiving heartbeat packet;
Step 2: step 1 is carried out if heartbeat packet transmitting terminal receives heartbeat response, if heartbeat packet transmitting terminal is not received by heartbeat Response then carries out step 3;
Step 3: if heartbeat packet transmitting terminal does not receive heartbeat response after n-th sends heartbeat packet, with heartbeat packet transmitting terminal The exploration cycle T of the N-1 times transmission heartbeat packetN-1For the longest keep-alive time;
The exploration period that heartbeat packet transmitting terminal sends heartbeat packet for the first time is T1;The exploration period that kth sends heartbeat packet is TK
TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
3. the method for terminal quick sensing NAT keep-alive time according to claim 2, which is characterized in that X=2.
4. the method for terminal quick sensing NAT keep-alive time according to claim 2, which is characterized in that the step 3 Later further include step 4:
Step 4: heartbeat packet transmitting terminal is with longest keep-alive time TN-1Based on exploration period for continuing to increase sent out to heartbeat responder Heartbeat packet is sent, until causing heartbeat packet transmitting terminal that can not receive heartbeat responder feedback because heartbeat packet sending cycle is too long Heartbeat response;The period is soundd out as the optimal guarantor of keep-alive connection between heartbeat packet transmitting terminal and heartbeat responder using what is be most recently successfully Live time;
The exploration period in the step 4 increases according to linearly increasing mode.
5. the method for terminal quick sensing NAT keep-alive time according to claim 4, which is characterized in that the step 4 Specifically:
Step S41: heartbeat packet transmitting terminal is to sound out cycle TJThe heartbeat packet sent to heartbeat responder;
Step S42: step S41 is carried out if heartbeat packet transmitting terminal receives heartbeat response, if heartbeat packet transmitting terminal is not received by Heartbeat response then carries out step S43;
Step S43: it if heartbeat packet transmitting terminal does not receive heartbeat response after the M times transmission heartbeat packet, is sent with heartbeat packet Hold the exploration cycle T of the M-1 times transmission heartbeat packetM-1For the optimal keep-alive time;
TJ-TJ-1=Y, Y are preset value;M > J > N;
As J=N+1, TJ=TN-1+Y。
6. the method for terminal quick sensing NAT keep-alive time according to claim 5, which is characterized in that Y=1.
7. a kind of heartbeat packet transmitting terminal of quick sensing NAT keep-alive time, which is characterized in that including following module:
Heartbeat packet sending module: to sound out cycle TKThe heartbeat packet sent to heartbeat responder;
Receiving module is reacted in heartbeat: for receiving heartbeat response;The heartbeat, which is responded, is receiving heartbeat by heartbeat responder Bao Houxiang heartbeat is reacted receiving module and is sent;
Control module: for when heartbeat reaction receiving module receives heartbeat response, control heartbeat packet sending module to send the heart Jump packet;Exploration cycle T is preset in the control moduleKIncreasing law be exponential growth;
Longest keep-alive time determining module: for determining with the heart when heartbeat reaction receiving module is not received by heartbeat response Jump the exploration cycle T of packet sending module the N-1 times transmission heartbeat packetN-1For the longest keep-alive time;
The exploration period that heartbeat packet transmitting terminal sends heartbeat packet for the first time is T1;The exploration period that kth sends heartbeat packet is TK
TN-1=XN-1*T1;X is greater than 1, N >=K >=1.
8. the heartbeat packet transmitting terminal of quick sensing NAT keep-alive time according to claim 7, which is characterized in that further include Optimal keep-alive time determining module;
After the optimal keep-alive time determining module is in the longest keep-alive time, determining module to determine the longest keep-alive time, with Longest keep-alive time TN-1Based on exploration period for continuing to increase heartbeat sent to heartbeat responder by heartbeat packet sending module Packet, until because of the too long heart for causing heartbeat reaction receiving module that can not receive heartbeat responder feedback of heartbeat packet sending cycle Jump response;The optimal keep-alive in period as keep-alive connection between heartbeat packet transmitting terminal and heartbeat responder is soundd out using what is be most recently successfully Time;
The preset increasing law for souning out the period of optimal keep-alive time determining module is linear increase.
9. the heartbeat packet transmitting terminal of quick sensing NAT keep-alive time according to claim 7 or 8, which is characterized in that described Heartbeat packet transmitting terminal be client or server.
10. a kind of interactive system of quick sensing NAT keep-alive time, which is characterized in that including client and server;
The client is the heartbeat packet transmitting terminal as described in claim 7-9 is any;The server is and heartbeat packet The server for sending heartbeat packet to heartbeat reaction receiving module after receiving heartbeat packet of transmitting terminal cooperation;
Or the server is the heartbeat packet transmitting terminal as described in claim 7-9 is any;The client is and heartbeat The client for sending heartbeat packet to heartbeat reaction receiving module after receiving heartbeat packet of packet transmitting terminal cooperation.
CN201910315287.XA 2019-04-19 2019-04-19 Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time Pending CN109981800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910315287.XA CN109981800A (en) 2019-04-19 2019-04-19 Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910315287.XA CN109981800A (en) 2019-04-19 2019-04-19 Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time

Publications (1)

Publication Number Publication Date
CN109981800A true CN109981800A (en) 2019-07-05

Family

ID=67085358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910315287.XA Pending CN109981800A (en) 2019-04-19 2019-04-19 Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time

Country Status (1)

Country Link
CN (1) CN109981800A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111817877A (en) * 2020-06-05 2020-10-23 北京嘀嘀无限科技发展有限公司 Charging pile heartbeat control method and device, electronic equipment, feedback method, server and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
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
CN107819642A (en) * 2017-09-15 2018-03-20 中国科学院计算技术研究所 Based on distributed adaptive heartbeat method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
CN107819642A (en) * 2017-09-15 2018-03-20 中国科学院计算技术研究所 Based on distributed adaptive heartbeat method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111817877A (en) * 2020-06-05 2020-10-23 北京嘀嘀无限科技发展有限公司 Charging pile heartbeat control method and device, electronic equipment, feedback method, server and storage medium
CN111817877B (en) * 2020-06-05 2023-06-30 北京嘀嘀无限科技发展有限公司 Charging pile heartbeat control method and device, electronic equipment, feedback method, server and storage medium

Similar Documents

Publication Publication Date Title
CN110535965A (en) A kind of data processing method and device, storage medium
CN107800791B (en) Debugging method and device
CN103634203B (en) Message asynchronous transport method, device and system
CN106961426B (en) Communication method and device of intelligent equipment
CN110493075B (en) Method, device and system for monitoring online duration of equipment
CN111917562B (en) Broadcast message forwarding method, device, equipment and storage medium
CN108111596A (en) A kind of method based on Telnet debugging electric power acquisition terminal
CN106101264A (en) Content distributing network daily record method for pushing, device and system
CN107888456A (en) Method and device for monitoring port data volume
CN106375453B (en) Bidirectional communication equipment, system and method based on HTTP connection
CN109981800A (en) Method, heartbeat packet transmitting terminal and the interactive system of terminal quick sensing NAT keep-alive time
EP3761653A1 (en) Playing control method and apparatus for device group, and playing system
CN112994971A (en) Equipment offline monitoring method based on cloud server and related device
CN103784125B (en) For the one-to-many data acquisition means of communication of physiological compensation effects
CN106357478B (en) A kind of server cluster monitoring method and system
CN110166322B (en) Detection method and related device for metering automation terminal
CN111600808A (en) Information processing method and device for instant messaging
CN105406955A (en) Data output control method and system
CN109584889A (en) Audio frequency transmission method and device and storage medium
CN109938716A (en) A kind of blood glucose blood pressure all-in-one machine and its operating method
CN107888693A (en) NB IOT apparatus debugging methods and server
Salas et al. Implementation analysis of GPRS communication for precision agriculture
CN105721231A (en) Service quality sensing detection method and service quality sensing detection device
CN112492555A (en) Control instruction processing method and device
CN211235715U (en) Formaldehyde monitoring system

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: 20190705