CN106685748B - Heartbeat information sending method, server and terminal - Google Patents
Heartbeat information sending method, server and terminal Download PDFInfo
- Publication number
- CN106685748B CN106685748B CN201510751434.XA CN201510751434A CN106685748B CN 106685748 B CN106685748 B CN 106685748B CN 201510751434 A CN201510751434 A CN 201510751434A CN 106685748 B CN106685748 B CN 106685748B
- Authority
- CN
- China
- Prior art keywords
- heartbeat
- server
- terminal
- information
- sending
- 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
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000005540 biological transmission Effects 0.000 claims description 6
- 230000000737 periodic effect Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 230000001052 transient effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the invention discloses a heartbeat information sending method, which is used for a server and comprises the following steps: determining a terminal needing to adjust the sending time of the heartbeat information; and sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset. Furthermore, the embodiment of the invention also discloses a heartbeat information sending method, which is used for a terminal; the embodiment of the invention further discloses a server and a terminal.
Description
Technical Field
The present invention relates to a connection technology in the field of communications, and in particular, to a heartbeat information sending method, a server, and a terminal.
Background
With the continuous development of mobile internet technology, the types of applications installed on terminals are increasing, and mobile terminals are taken as examples, such as mobile phones QQ, microblogs, wechat and the like. Since part of the applications belong to the application of instant messaging, the mobile terminal needs to be stably connected with various servers on the network side for a long time so as to facilitate interaction of various service data, and therefore, always online (always online) services of the mobile terminal are generated.
In the always online mode, in order to maintain the always-online state of the mobile terminal, two interconnected parties need to detect whether both parties are online or not under the condition of temporary absence of communication through a heartbeat mechanism. If the server side detects that a certain terminal is currently disconnected, resources occupied by the terminal need to be released so as to be convenient for other terminals to use, and if the mobile terminal detects that the server is currently disconnected, connection needs to be carried out again.
The existing heartbeat mechanism can refer to fig. 1:
And 102, after the mobile terminal is successfully connected with the server, setting a heartbeat sending cycle timer, wherein the overtime time is a heartbeat period T.
And 103, after the recording time of the heartbeat sending cycle timer of the mobile terminal exceeds the heartbeat period T, the mobile terminal sends heartbeat information to the server, and a second timeout timer is set.
And step 104, after receiving the heartbeat information, the server resets a first timeout timer at the server side and responds heartbeat feedback information to the mobile terminal.
And 105, if the server does not receive the heartbeat information for a long time, the first timeout timer is overtime, which indicates that the mobile terminal is disconnected and needs to release resources occupied by the mobile terminal.
And 106, if the mobile terminal receives the heartbeat feedback information of the server, the server is on line normally, and the overtime timer is deleted.
And step 107, if the mobile terminal does not receive the heartbeat feedback information for a long time, the second timeout timer is overtime, which indicates that the server has a problem and the mobile terminal needs to initiate a connection request again.
And step 108, if the mobile terminal reconnection request fails, after waiting for a preset time, re-initiating the request.
Therefore, the mobile terminal sends heartbeat information to the server at preset time intervals to maintain the always-on state. However, in practical application, a situation that a large number of mobile terminals are disconnected at the same time due to restarting of a server or network abnormality may occur, and if the number of mobile terminals which are currently disconnected is large, due to the fact that the waiting time for reconnection after each mobile terminal is disconnected is the same, a large number of mobile terminals are reconnected within the same time period, the instantaneous pressure of the server is easily too large, and the server is halted or restarted again; meanwhile, after the disconnected mobile terminals are reconnected successfully, because the heartbeat period of each mobile terminal is the same, a large number of mobile terminals can send heartbeat information at the same time in a short time, so that the server pressure is increased, and network data can be periodically congested, thereby further influencing other network services.
Disclosure of Invention
In order to solve the above technical problems, embodiments of the present invention desirably provide a heartbeat message sending method, a server, and a terminal, which can prevent a large number of terminals from sending heartbeat messages to the server at the same time in a short time, thereby reducing the instantaneous pressure of the server and avoiding the periodic congestion of network data.
The technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for sending heartbeat information, where the method is used for a server, and includes:
determining a terminal needing to adjust the sending time of the heartbeat information;
and sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset.
Optionally, before determining the terminal that needs to adjust the sending time of the heartbeat information, the method further includes:
judging whether the instantaneous heartbeat density of a reference time period is greater than or equal to the product of the maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1;
the terminal for determining that the sending time of the heartbeat information needs to be adjusted comprises the following steps:
and when the instantaneous heartbeat density is greater than or equal to the product of the maximum concurrency number and a reference coefficient, determining the terminal needing to adjust the heartbeat information sending time.
Optionally, before determining the terminal that needs to adjust the sending time of the heartbeat information, the method further includes:
the number of terminals which need to adjust the heartbeat information sending time is determined.
In a second aspect, an embodiment of the present invention provides a method for sending heartbeat information, where the method is used for a terminal and includes:
receiving first heartbeat feedback information sent by a server, wherein the first heartbeat feedback information comprises a heartbeat offset;
and adjusting the sending time of sending the heartbeat information to the server next time according to the heartbeat offset.
Optionally, before receiving the first heartbeat feedback information sent by the server, the method further includes:
and after the connection relation with the server is established, sending first heartbeat information to the server at random time in a heartbeat period.
Optionally, after sending the first heartbeat information to the server at a random time within one heartbeat cycle, the method further includes:
and if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received within the first preset time, the second heartbeat feedback information does not include the heartbeat offset, and after the random time, a connection request is sent to the server.
In a third aspect, an embodiment of the present invention provides a server, including:
the determining unit is used for determining a terminal needing to adjust the sending time of the heartbeat information;
and the sending unit is used for sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset.
Optionally, the server further includes:
the judging unit is used for judging whether the instantaneous heartbeat density of the reference time period is larger than or equal to the product of the maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1;
the determining unit is specifically configured to: and when the instantaneous heartbeat density is greater than or equal to the product of the maximum concurrency number and a reference coefficient, determining the terminal needing to adjust the heartbeat information sending time.
Optionally, the determining unit is further configured to:
the number of terminals which need to adjust the heartbeat information sending time is determined.
In a fourth aspect, an embodiment of the present invention provides a terminal, including:
the receiving unit is used for receiving first heartbeat feedback information sent by a server, wherein the first heartbeat feedback information comprises a heartbeat offset;
and the adjusting unit is used for adjusting the sending time of sending the heartbeat information to the server next time according to the heartbeat offset.
Optionally, the terminal further includes:
and the sending unit is used for sending the first heartbeat information to the server at random time in a heartbeat period after the connection relationship is established with the server.
Optionally, the sending unit is further configured to:
and if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received within the first preset time, the second heartbeat feedback information does not include the heartbeat offset, and after the random time, a connection request is sent to the server.
The embodiment of the invention provides a heartbeat information sending method, a server and a terminal, wherein the heartbeat information sending method for the server comprises the following steps: determining a terminal needing to adjust the sending time of the heartbeat information; and sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset. Compared with the prior art, if the server receives more heartbeat messages in a short time, the time for sending the heartbeat messages next time by the terminal can be adjusted through the heartbeat offset, and the heartbeat messages received by the server in one heartbeat period tend to be uniformly distributed through adjusting the sending time of the heartbeat messages of the terminal, so that the condition that a large number of terminals send the heartbeat messages to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
Drawings
Fig. 1 is a flowchart of a method for sending heartbeat information in the prior art;
fig. 2 is a flowchart of a method for sending heartbeat information according to an embodiment of the present invention;
fig. 3 is a flowchart of another method for sending heartbeat information according to an embodiment of the present invention;
fig. 4 is a flowchart of another method for sending heartbeat information according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another server according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another server according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another terminal according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another terminal according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a heartbeat information sending system according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
An embodiment of the present invention provides a method for sending heartbeat information, as shown in fig. 2, where the method is used for a server, and includes:
For example, the server may divide a heartbeat cycle into a plurality of time periods, count the number of heartbeat messages received in each time period, and when the number of heartbeat messages received in a certain time period is large, may use a terminal corresponding to the heartbeat message received in the time period as a terminal that needs to adjust the sending time of the heartbeat message. The terminal not only comprises a mobile terminal, but also comprises an Internet of things, an application client in the Internet of vehicles, or a wearable device, a personal computer and other terminals which apply high-concurrency online services.
Optionally, a reference time period is taken as an example for explanation, where the reference time period is any one of the multiple time periods. Firstly, a server can respectively obtain the instantaneous heartbeat density of a reference time period and the average heartbeat density of the heartbeat period, then judge whether the instantaneous heartbeat density exceeds the average heartbeat density by N times, and when the instantaneous heartbeat density exceeds the average heartbeat density by N times, the server shows that the quantity of received heartbeat information in the reference time period is large, and the sending time of the heartbeat information of a terminal needs to be adjusted, so that the server can determine a terminal which needs to adjust the sending time of the heartbeat information from terminals which send the heartbeat information in the reference time period; when the instantaneous heartbeat density does not exceed the average heartbeat density by N times, it indicates that the number of the received heartbeat messages in the reference time period is small, and the adjustment may not be performed. Wherein said N is greater than 1, preferably N may be equal to 2; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the average heartbeat density is a ratio of the quantity of the heartbeat information received in the heartbeat period to the heartbeat period. Specifically, assuming that the reference time period is Ts, and the number of heartbeat messages received within Ts seconds is M, the transmission density P of the heartbeat messages within the reference time period is: p is M/Ts; assuming that the number of terminals currently connected to the server is G, the transmission density P of the heartbeat information in one heartbeat periodFlat plateG/T; if P exceeds PFlat plateTwice, it means that the heartbeat information in the reference time period is too dense, and it is necessary to adjust the heartbeat information sending time of the terminal that sends the heartbeat information to the server in the reference time period.
Optionally, since the processing speed of the server is limited, so that the server has a limit on the maximum concurrency number, in order to avoid an excessive transient pressure of the server, it is also required that the instantaneous heartbeat density of the reference time period is at least less than the maximum concurrency number. Preferably, the server may also first obtain an instantaneous heartbeat density of a reference time period, and then determine whether the instantaneous heartbeat density is greater than or equal to J × E, where E is a maximum concurrent number corresponding to the server, and J is a coefficient less than or equal to 1, and when the instantaneous heartbeat density is greater than or equal to J × E, it indicates that the number of received heartbeat messages in the reference time period is large, and it is necessary to adjust the sending time of the heartbeat message of the terminal, so that a terminal that needs to adjust the sending time of the heartbeat message may be determined from terminals that send heartbeat messages in the reference time period; when the instantaneous heartbeat density is less than J × E, it indicates that the number of heartbeat messages received in the reference time period is small, and no adjustment may be performed.
In practical application, a quantity threshold may also be preset for each time period, first, the server may obtain the quantity of the heartbeat information received in a reference time period, and then judge whether the quantity is greater than or equal to a preset quantity threshold corresponding to the reference time period, when the quantity is greater than or equal to the preset quantity threshold corresponding to the reference time period, it indicates that the quantity of the heartbeat information received in the reference time period is large, and the sending time of the heartbeat information of the terminal needs to be adjusted, so that the terminal needing to adjust the sending time of the heartbeat information can be determined from the terminals sending the heartbeat information in the reference time period; when the number is smaller than the preset number threshold corresponding to the reference time period, it indicates that the number of the heartbeat messages received in the reference time period is small, and no adjustment may be performed. Preferably, the preset number threshold corresponding to the reference time period may be E × Ts × J, where E is the maximum concurrency number corresponding to the server, J is a coefficient less than or equal to 1, and Ts is the reference time period. In practical applications, the number threshold corresponding to each time period may be set according to specific situations, which is not limited in the present invention.
After determining a terminal needing to adjust the sending time of the heartbeat information, sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset, when the terminal receives the first heartbeat feedback information, acquiring the heartbeat offset, and then adjusting the time of sending the heartbeat information to the server next time according to the mobile offset.
For example, the heartbeat offset W may be calculated according to formula (2), where formula (2) is W ═ Ts + H, and H is a random integer between 0 and (T-Ts). The sending time of the heartbeat information of the terminal is adjusted through the heartbeat offset calculated by the formula (2), so that the distribution of the heartbeat information received in one heartbeat period tends to be uniform.
Therefore, if the server receives more heartbeat information in a short time, the time for the terminal to send the heartbeat information next time can be adjusted through the heartbeat offset, and the distribution of the heartbeat information received by the server in one heartbeat period tends to be uniform through adjusting the sending time of the heartbeat information of the terminal, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
Optionally, before determining the terminals whose heartbeat information transmission time needs to be adjusted, the number of the terminals whose heartbeat information transmission time needs to be adjusted may also be determined.
The server may receive a large amount of heartbeat information in the reference time period, and the sending time of the heartbeat information of each terminal is not required to be adjusted, and generally, the number of the heartbeat information received in the reference time period can be reduced to a proper level only by adjusting the sending time of the heartbeat information of a small number of terminals, so that the number of the terminals whose sending time of the heartbeat information is required to be adjusted can be determined first. For example, the number Q of terminals that need to adjust the sending time of the heartbeat information may be determined according to formula (1), where formula (1) isQ=(Ts*P-Ts*PFlat plate) 100/(Ts × P) × M, wherein Ts is the reference time period; the P is the instantaneous heartbeat density of a reference time period; the P isFlat plateIs the average heart beat density of the heart beat period; and M is the number of the heartbeat information received in the reference time period.
The embodiment of the invention provides a heartbeat information sending method, which comprises the following steps: determining a terminal needing to adjust the sending time of the heartbeat information; and sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset. Compared with the prior art, if the server receives more heartbeat messages in a short time, the time for sending the heartbeat messages next time by the terminal can be adjusted through the heartbeat offset, and the heartbeat messages received by the server in one heartbeat period tend to be uniformly distributed through adjusting the sending time of the heartbeat messages of the terminal, so that the condition that a large number of terminals send the heartbeat messages to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
The embodiment of the invention provides another heartbeat information sending method which is used for terminals, wherein the terminals comprise a mobile terminal, an Internet of things, an application client in an Internet of vehicles, or all terminals which can apply high-concurrency online services, such as wearable equipment, a personal computer and the like. As shown in fig. 3, the method for sending heartbeat information includes:
When the server determines that the terminal is a terminal needing to adjust the sending time of the heartbeat information, first heartbeat feedback information is sent to the terminal, and the first heartbeat feedback information comprises a heartbeat offset.
And step 302, adjusting the sending time of the next heartbeat information sent to the server according to the heartbeat offset.
By way of example, suppose the mobile terminal receivesThe first heartbeat feedback information comprises a heartbeat offset value W, and the time of sending the heartbeat information by the terminal is T in the heartbeat period T1At that time, the time for sending heartbeat information by the next terminal is T1+ W, i.e. the time when the next terminal sends heartbeat information is T in T of the next heartbeat cycle2T is shown2At a time T2=T1+W。
Therefore, if the server receives more heartbeat information in a short time, the terminal can adjust the time for sending the heartbeat information next time according to the heartbeat offset included in the first heartbeat feedback information sent by the server, and the distribution of the heartbeat information sent to the server in one heartbeat period tends to be uniform through the adjustment of the heartbeat information sending time, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
Optionally, before receiving the first heartbeat feedback information sent by the server, the method further includes: and after the connection relation with the server is established, sending first heartbeat information to the server at random time in a heartbeat period.
For example, if the server is restarted for a technical reason, a large number of terminals may simultaneously establish a connection relationship with the server, and therefore may also simultaneously send heartbeat information to the server, which may cause an excessive transient pressure on the server, and may further cause the server to restart again in a serious case, so that the server falls into a vicious circle that is restarted continuously due to the excessive transient pressure, and therefore, after the terminal establishes a connection relationship with the server, the time for sending the heartbeat information to the server for the first time may be between random numbers. Specifically, after the terminal establishes a connection relationship with the server, the first heartbeat information may be sent to the server at a random time within one heartbeat period. Therefore, because the time for each terminal to send the heartbeat information to the server for the first time is different, the excessive instantaneous power of the server can be avoided.
Optionally, after sending the first heartbeat information to the server at a random time within a heartbeat period, if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received within a first preset time, and the second heartbeat feedback information does not include the heartbeat offset, after waiting for the random time, sending a connection request to the server.
Generally, after receiving heartbeat information sent by a terminal, a server needs to send heartbeat feedback information to the terminal, where the heartbeat feedback information may be first heartbeat feedback information including a heartbeat offset or second heartbeat feedback information not including the heartbeat offset. Therefore, in practical applications, after the terminal sends the heartbeat information to the server, it may be determined whether the first heartbeat feedback information or the second heartbeat feedback information sent by the server is received within a first preset time, if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received by the terminal within the first preset time, it indicates that the server is disconnected, and the always-on state of the terminal cannot be maintained, so that the terminal needs to reconnect with the server,
however, if the server is disconnected due to technical restart, all terminals connected to the server may need to reconnect to the server at the same time, and the server may receive a large number of connection requests in a short time, which may easily cause a large instantaneous pressure on the server. Therefore, the time for sending the connection request to the server is different for each terminal, so that the situation that the server receives a large number of connection requests in a short time is avoided, and the instantaneous pressure of the server is prevented from being overlarge.
Alternatively, the random time X may be calculated according to formula (3), where formula (3) is X ═ a + B, and a is a fixed time; b is a random integer from 0 to (S/(R × J)); the S is the maximum user number of the server; the R is the number of connection requests which can be processed by the server per second, and the J is a coefficient which is larger than 0 and smaller than or equal to 1. The connection request is sent to the server by the terminal, so that the terminal is prevented from continuously sending the connection request to the server when the server is restarted due to the fact that the terminal detects that the server is disconnected, and resource waste can be avoided. S/R represents the number of connection requests that the server can process for each terminal per second, and since the number of heartbeat information that the server can process per second may be smaller than the number of connection requests that can be processed, R may be multiplied by a coefficient less than 1 to represent the number of heartbeat information that the server can process for each terminal per second by (S/(R × J)). By setting the random waiting time through the method, the overlarge pressure of a network and a server caused by instantaneous reconnection of a large number of clients is effectively avoided, and the stability of the system is improved.
The embodiment of the invention provides another method for sending heartbeat information, which comprises the following steps: the method comprises the steps of receiving first heartbeat feedback information sent by a server, wherein the first heartbeat feedback information comprises a heartbeat offset, and then adjusting sending time of next heartbeat information sent to the server according to the heartbeat offset. Compared with the prior art, if the server receives more heartbeat information in a short time, the terminal can adjust the time for sending the heartbeat information next time according to the heartbeat offset included in the first heartbeat feedback information sent by the server, and the distribution of the heartbeat information sent to the server in one heartbeat period tends to be uniform through the adjustment of the heartbeat information sending time, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
An embodiment of the present invention provides a method for sending heartbeat information, as shown in fig. 4, including:
Generally, a terminal needs to establish a connection relationship with a server first, specifically, the terminal sends a connection request to the server, the server sends connection feedback to the terminal after receiving the connection request, and if the terminal receives the connection feedback sent by the server, it indicates that the connection relationship between the terminal and the server has been established.
After the terminal establishes a connection relationship with the server, heartbeat information needs to be sent to the server in order to maintain the always-on state. Optionally, after receiving the connection feedback sent by the server, the terminal may set a first heartbeat sending timer, the timing is a random time in one heartbeat period T, timing is started immediately when the first heartbeat sending timer is set, and when the timing of the timer reaches or exceeds the timing, the terminal sends the first heartbeat information to the server for the first time. For example, assuming that the timing of the first heartbeat transmission timer is T0, that is, when the terminal transmits the first heartbeat information to the server after receiving the connection feedback transmitted by the server and is spaced by T0, T0 can be calculated by the formula T0 ═ RAND () (T +1), where RAND () is a uniformly distributed random function and can generate an integer between 0 and RAND _ MAX, and thus RAND () (T +1) can generate a random integer within 0 to T.
After the server sends connection feedback to the terminal, the server waits for receiving the heartbeat information of the terminal, but because the server needs to reserve resources for the terminal when waiting for the heartbeat information of the terminal, the server does not wait without limit but waits for a second preset time, if the server does not receive the heartbeat information sent by the terminal within the second preset time, the server indicates that the terminal is currently disconnected, and the server can release the resources occupied by the terminal.
For example, after the server sends the link feedback to the terminal, a connection timeout timer is set, where the timing of the connection timeout timer is a second preset time, and if the server does not receive the heartbeat information within the second preset time, which indicates that the terminal is disconnected, the server may release the resource occupied by the terminal, for example, delete the connection timeout timer set for the terminal; and if the server receives the heartbeat information within the second preset time, deleting the connection overtime timer and restarting timing.
And step 403, the server generates second heartbeat feedback information according to the heartbeat information and sends the second heartbeat feedback information to the terminal.
After receiving the heartbeat information sent by the terminal, the server can generate second heartbeat feedback information according to the heartbeat information, and because the terminal just establishes a connection relationship with the server at this time, the server cannot determine whether the time for sending the heartbeat information by the terminal needs to be adjusted, the server sends the second heartbeat feedback information which does not include the heartbeat offset to the terminal. And the server sends the second heartbeat feedback information to the terminal for informing the terminal that the current server is online and the always online state is kept.
The terminal sends heartbeat information to the server to inform the server that the terminal is in an online state currently, and after the heartbeat information is sent, the terminal needs to determine whether the server is in the online state currently. For example, the terminal may determine whether second heartbeat feedback information transmitted by the server is received within a first preset time after the heartbeat information is transmitted. Specifically, after the heartbeat information is sent, the terminal may set a feedback timeout timer, the timing of the feedback timeout timer is a first preset time, the terminal starts timing after sending the heartbeat information, and if a second heartbeat feedback information sent by the server is received within the timing of the feedback timeout timer, it indicates that the server is currently online, the feedback timeout timer is deleted; if the timing of the feedback timeout timer is exceeded and the second heartbeat feedback information sent by the server is not received, the server is indicated to be disconnected currently, and the terminal needs to be reconnected.
And 405, the terminal sends heartbeat information to the server according to the heartbeat period and executes 406.
If the terminal receives heartbeat feedback information sent by the server within the first preset time, the server is on-line, the connection relationship between the terminal and the server exists all the time, in order to guarantee the normal on-line state of the terminal, the terminal needs to send the heartbeat information to the server according to the heartbeat period T, and the first heartbeat information of the terminal is sent randomly, so that even if each terminal sends the heartbeat information to the server periodically according to the heartbeat period T, the condition that the server receives a plurality of heartbeat information within a short time can not be caused, and the instantaneous pressure of the server is avoided being too high.
In practical application, one heartbeat cycle can be divided into a plurality of time periods, because the number of terminals connected with a server is large, the condition that the heartbeat information received by the server in a certain time period is large can occur, but the processing speed of the server is limited, the limitation of the maximum concurrency number exists, and if the instantaneous heartbeat density of the server is large, the instantaneous pressure of the server can be caused to be overlarge, so that the server is restarted or halted. Therefore, the server may first obtain an instantaneous heartbeat density of a reference time period, and then determine whether the instantaneous heartbeat density is greater than or equal to J × E, where E is a maximum concurrent number corresponding to the server, and J is a coefficient greater than 0 and less than or equal to 1, and when the instantaneous heartbeat density is greater than or equal to J × E, it indicates that the number of received heartbeat messages in the reference time period is large, and it is necessary to adjust the sending time of the heartbeat message of the terminal, so that a terminal that needs to adjust the sending time of the heartbeat message may be determined from terminals that send heartbeat messages in the reference time period; when the instantaneous heartbeat density is less than J × E, it indicates that the number of heartbeat messages received in the reference time period is small, and no adjustment may be performed. The instantaneous heartbeat density is the ratio of the number of heartbeat messages received in the reference time period to the reference time period. The embodiments of the present invention have been described with reference to a time period as an example, where the reference time period is any one of a plurality of time periods.
If the number of the heartbeat messages received by the server in the reference time period is large, it is indicated that the heartbeat message sending time of the terminal sending the heartbeat messages to the server in the reference time period needs to be adjusted, and then the number of the heartbeat messages received in the reference time period is reduced. Firstly, the server determines the number of terminals that need to adjust the heartbeat information sending time, and illustratively, the calculation method of the selected parameters of the terminals is that K ═ Ts × P-Ts × PFlat plate) 100/(Ts × P), after calculating the selection parameters of the terminals, it may be determined that the number Q of the terminals that need to perform the heartbeat information sending time adjustment is Q ═ K% × M, where K% represents K percent, which is the selection ratio of the terminals, and M is the number of the heartbeat information received in the reference time period.
After the number of the terminals needing to be adjusted is determined, the server also needs to select a specific terminal as the terminal needing to be subjected to heartbeat adjustment, because if the sending times of the heartbeat messages of the first M × K% terminals received in the reference time period are adjusted at will or the sending times of the heartbeat messages of the last M × K% terminals received in the reference time period are adjusted at will, the density of the heartbeat messages received in the latter half of the reference time period is still higher, or the density of the heartbeat messages received in the former half of the reference time period is higher, or the instantaneous pressure of the server is easily higher, so the terminal needing to be adjusted needs to be selected at random in the reference time period.
For example, it may be determined whether the terminal corresponding to the currently received heartbeat information is a terminal that needs to be adjusted through a simple random algorithm. Specifically, taking the reference terminal as an example for explanation, after the server receives the heartbeat information sent by the reference terminal in the reference time period, a value of rand ()% 100 is calculated, if the value is less than K, the reference terminal is determined as a terminal requiring adjustment, otherwise, the reference terminal is determined as a terminal not requiring adjustment, wherein the rand ()% 100 can generate a random integer between 0 and 99.
For example, since it is determined that the reference terminal is a terminal that needs to be adjusted, after the server receives the heartbeat information sent by the reference terminal, the server generates first heartbeat feedback information according to the heartbeat information, where the first heartbeat feedback information includes a heartbeat offset of the reference terminal, where the heartbeat offset may be set in advance according to a specific situation, for example, the heartbeat offset W may be calculated by formula (2) W ═ Ts + rand ()% (T-Ts +1), and the time when the terminal sends the heartbeat information is adjusted by the heartbeat offset calculated by the algorithm, so that the distribution of the heartbeat information in one heartbeat period tends to be uniform.
For example, after the reference terminal receives first heartbeat feedback information including a heartbeat offset, the heartbeat offset may be obtained, specifically, the reference terminal parses the first heartbeat feedback information, determines whether the first heartbeat feedback information includes the heartbeat offset according to an identifier of the first heartbeat feedback information, and if it is determined that the first heartbeat feedback information includes the heartbeat offset, obtains the heartbeat offset included in the first heartbeat feedback information.
For example, the first heartbeat feedback information received by the reference terminal includes a heartbeat offset W, and it is assumed that the time when the current reference terminal sends the heartbeat information is T in the heartbeat period T1At the moment, the time for sending the heartbeat information by the next reference terminal is T1+ W, i.e. the time when the next reference terminal sends heartbeat information is T in T of the next heartbeat period2At a time T2=T1+ W, and the sequence number corresponding to the heartbeat information may be set to 1.
And step 412, the terminal sends the next heartbeat message to the server according to the adjusted time, and the flow step is ended.
For example, the reference terminal sends the heartbeat information to the server according to the adjusted sending time of the heartbeat information in the next heartbeat cycle, and specifically, the reference terminal may wait for T1After + W, the next heartbeat message is sent to the server.
When the number of the heartbeat messages received by the server in the reference time period is smaller than the reference threshold, it is indicated that the number of the heartbeat messages received by the server in the reference time period is not large, and the terminal does not need to be adjusted, so that the server can normally send second heartbeat feedback messages aiming at the heartbeat messages sent by each terminal, and the second heartbeat feedback messages do not include heartbeat offset.
If the terminal does not receive second heartbeat feedback information sent by the server within the first preset time, the current server is disconnected, and if the terminal needs to establish a connection relation with the server and keep a normal online state, a reconnection request needs to be sent to the server. However, if a large number of terminals are disconnected at the same time due to reasons such as restart or power failure of the server, the terminals may wait for a random time and send reconnection requests to the server in order to ensure that the large number of terminals do not initiate connection requests to the server at the same time.
For example, the random time X may be calculated according to formula (3), where formula (3) is X ═ a + B, and a is a fixed time; b is a random integer from 0 to (S/(R × J)); the S is the maximum user number of the server; and R is the number of connection requests which can be processed by the server per second, and J is a coefficient which is larger than 0 and smaller than or equal to 1. The connection request is sent to the server by the terminal, so that the terminal is prevented from continuously sending the connection request to the server when the server is restarted due to the fact that the terminal detects that the server is disconnected, and resource waste can be avoided. By setting the random waiting time through the method, the overlarge pressure of a network and a server caused by instantaneous reconnection of a large number of clients is effectively avoided, and the stability of the system is improved.
If the server does not receive the heartbeat information sent by the terminal within the second preset time, it indicates that the terminal is currently disconnected, that is, the terminal does not currently perform data interaction with the server any more, so that the server can release resources occupied by the terminal, so as to be convenient for other terminals to use.
The embodiment of the invention provides another method for sending heartbeat information, if a server receives more heartbeat information in a short time, a terminal can adjust the time for sending the heartbeat information next time according to the heartbeat offset included in first heartbeat feedback information sent by the server, and the distribution of the heartbeat information sent to the server in one heartbeat cycle tends to be uniform by adjusting the sending time of the heartbeat information, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
An embodiment of the present invention provides a server 50, as shown in fig. 5, including:
a determining unit 501, configured to determine a terminal that needs to adjust the sending time of the heartbeat information.
A sending unit 502, configured to send first heartbeat feedback information to the terminal, where the first heartbeat feedback information includes a heartbeat offset, so that the terminal adjusts sending time of next heartbeat information according to the heartbeat offset.
Therefore, if the server receives more heartbeat information in a short time, the time for the terminal to send the heartbeat information next time can be adjusted through the heartbeat offset, and the distribution of the heartbeat information received by the server in one heartbeat period tends to be uniform through adjusting the sending time of the heartbeat information of the terminal, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
Optionally, as shown in fig. 6, the server 50 further includes: a judging unit 503, configured to judge whether an instantaneous heartbeat density of a reference time period is greater than or equal to a product of a maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1. The determining unit 501 is specifically configured to: and when the instantaneous heartbeat density is greater than or equal to the product of the maximum concurrency number and a reference coefficient, determining the terminal needing to adjust the heartbeat information sending time.
Optionally, the determining unit 501 is further configured to: the number of terminals which need to adjust the heartbeat information sending time is determined.
Optionally, the determining unit 501 is specifically configured to: determining the number Q of terminals needing to adjust the heartbeat information sending time according to a formula (1), wherein the formula (1) is Q ═ Ts × P-Ts × PFlat plate) 100/(Ts × P) × M, wherein Ts is the reference time period; the P is the transient of the reference time segmentThe temporal heartbeat density; the P isFlat plateIs the average heart beat density of the heart beat period; and M is the number of the heartbeat information received in the reference time period.
Optionally, as shown in fig. 7, the server 50 further includes: a calculating unit 504, configured to calculate the heartbeat offset W according to formula (2), where formula (1) is W ═ Ts + H. Wherein H is a random integer between 0 and (T-Ts).
An embodiment of the present invention provides a server, including: and the determining unit is used for determining the terminal which needs to adjust the sending time of the heartbeat information. And the sending unit is used for sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset. Compared with the prior art, if the server receives more heartbeat messages in a short time, the terminal can adjust the time for sending the heartbeat messages next time by sending the heartbeat offset to the terminal, and the distribution of the heartbeat messages received by the server in one heartbeat period tends to be uniform by adjusting the sending time of the heartbeat messages of the terminal, so that the condition that a large number of terminals send the heartbeat messages to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
An embodiment of the present invention provides a terminal 80, as shown in fig. 8, including:
the receiving unit 801 is configured to receive first heartbeat feedback information sent by a server, where the first heartbeat feedback information includes a heartbeat offset.
An adjusting unit 802, configured to adjust a sending time for sending the heartbeat information to the server next time according to the heartbeat offset.
Therefore, if the server receives more heartbeat information in a short time, the terminal can adjust the time for sending the heartbeat information next time according to the heartbeat offset included in the first heartbeat feedback information sent by the server, and the distribution of the heartbeat information sent to the server in one heartbeat period tends to be uniform through the adjustment of the heartbeat information sending time, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
Optionally, as shown in fig. 9, the terminal 80 further includes: a sending unit 803, configured to send, after establishing a connection relationship with the server, first heartbeat information to the server at a random time within a heartbeat period.
Optionally, the sending unit 803 is further configured to: and if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received within the first preset time, the second heartbeat feedback information does not include the heartbeat offset, and after the random time, a connection request is sent to the server.
Optionally, as shown in fig. 10, the terminal 80 further includes: a calculating unit 804, configured to calculate the random time according to formula (3), where formula (3) is X ═ a + B, where a is a fixed time; b is a random integer from 0 to (S/(R × J)); the S is the maximum user number of the server; and R is the number of connection requests which can be processed by the server per second.
An embodiment of the present invention provides a terminal, including: the receiving unit is configured to receive first heartbeat feedback information sent by a server, where the first heartbeat feedback information includes a heartbeat offset. And the adjusting unit is used for adjusting the sending time of sending the heartbeat information to the server next time according to the heartbeat offset. Compared with the prior art, if the server receives more heartbeat information in a short time, the terminal can adjust the time for sending the heartbeat information next time according to the heartbeat offset included in the first heartbeat feedback information sent by the server, and the distribution of the heartbeat information sent to the server in one heartbeat period tends to be uniform through the adjustment of the heartbeat information sending time, so that the condition that a large number of terminals send the heartbeat information to the server simultaneously in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
A heartbeat information sending system 110 according to an embodiment of the present invention, as shown in fig. 11, includes a server 110A and a terminal 110B, where the terminal 110B takes a mobile phone as an example for description.
The server 110A is configured to determine a terminal 110B that needs to adjust a heartbeat information sending time; sending first heartbeat feedback information to the terminal 110B, where the first heartbeat feedback information includes a heartbeat offset, so that the terminal 110B adjusts sending time of next heartbeat information according to the heartbeat offset;
the terminal 110B is configured to receive first heartbeat feedback information sent by the server 110A, where the first heartbeat feedback information includes a heartbeat offset; adjusting the sending time of sending heartbeat information to the server 110A next time according to the heartbeat offset; the server is further configured to send first heartbeat information to the server 110A at a random time within one heartbeat cycle after establishing a connection relationship with the server 110A; and is further configured to send a connection request to the server 110A after waiting for a random time if the first heartbeat feedback information or the second heartbeat feedback information sent by the server 110A is not received within a first preset time and the second heartbeat feedback information does not include the heartbeat offset.
Therefore, if the server receives more heartbeat information in a short time, the terminal can adjust the time for sending the heartbeat information next time according to the heartbeat offset included in the first heartbeat feedback information sent by the server, the distribution of the heartbeat information sent to the server in a heartbeat period tends to be uniform through the adjustment of the heartbeat information sending time, and meanwhile, because the time for sending the heartbeat information for the first time and the time for sending the connection request again by the terminal are random times, the condition that a large number of terminals send the heartbeat information to the server at the same time in a short time can be prevented, the instantaneous pressure of the server is reduced, and the periodic congestion of network data is avoided.
It should be noted that, first, the order of the steps of the method for sending heartbeat information provided in the embodiment of the present invention may be appropriately adjusted, and the steps may also be increased or decreased according to the situation, and any method that can be easily considered by those skilled in the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention, and therefore, no further description is given.
Second, it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Thirdly, in addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.
Claims (10)
1. A method for sending heartbeat information, which is used for a server, comprises the following steps:
determining a terminal needing to adjust the sending time of the heartbeat information;
sending first heartbeat feedback information to the terminal, wherein the first heartbeat feedback information comprises a heartbeat offset so that the terminal can adjust the sending time of next heartbeat information according to the heartbeat offset;
the heartbeat offset is the sum of a certain reference time period and a certain random integer in a heartbeat cycle; the certain random integer is a random integer between 0 and the difference between the heartbeat cycle and the reference time period;
the method further comprises the following steps: before the terminal needing to adjust the heartbeat information sending time is determined, judging whether the instantaneous heartbeat density of a reference time period is greater than or equal to the product of the maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1;
the terminal for determining that the sending time of the heartbeat information needs to be adjusted comprises the following steps:
and when the instantaneous heartbeat density is greater than or equal to the product of the maximum concurrency number and a reference coefficient, determining a terminal needing to adjust the heartbeat information sending time from the terminals sending the heartbeat information in the reference time period.
2. The method according to claim 1, wherein before the determining the terminal needing to adjust the heartbeat information transmission time, the method further comprises:
the number of terminals which need to adjust the heartbeat information sending time is determined.
3. A method for sending heartbeat information, which is used for a terminal, comprises the following steps:
receiving first heartbeat feedback information sent by a server, wherein the first heartbeat feedback information comprises a heartbeat offset; the heartbeat offset is the sum of a certain reference time period and a certain random integer in a heartbeat cycle; the certain random integer is a random integer between 0 and the difference between the heartbeat cycle and the reference time period;
adjusting the sending time of sending heartbeat information to the server next time according to the heartbeat offset;
before receiving first heartbeat feedback information sent by a server, the server determines that the terminal needs to adjust the heartbeat information sending time, and the method comprises the following steps: judging whether the instantaneous heartbeat density of a reference time period is greater than or equal to the product of the maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1; and when the instantaneous heartbeat density is greater than or equal to the product of the maximum concurrency number and a reference coefficient, determining that the terminal needs to adjust the heartbeat information sending time from the terminals sending the heartbeat information in the reference time period.
4. The method according to claim 3, wherein before receiving the first heartbeat feedback information sent by the server, the method further comprises:
and after the connection relation with the server is established, sending first heartbeat information to the server at random time in a heartbeat period.
5. The method of claim 4, wherein after sending the first heartbeat information to the server at a random time within a heartbeat cycle, the method further comprises:
and if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received within the first preset time, the second heartbeat feedback information does not include the heartbeat offset, and after the random time, a connection request is sent to the server.
6. A server, comprising:
the determining unit is used for determining a terminal needing to adjust the sending time of the heartbeat information;
a sending unit, configured to send first heartbeat feedback information to the terminal, where the first heartbeat feedback information includes a heartbeat offset, so that the terminal adjusts sending time of next heartbeat information according to the heartbeat offset; the heartbeat offset is the sum of a certain reference time period and a certain random integer in a heartbeat cycle; the certain random integer is a random integer between 0 and the difference between the heartbeat cycle and the reference time period;
the server further comprises:
the judging unit is used for judging whether the instantaneous heartbeat density of the reference time period is larger than or equal to the product of the maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1;
the determining unit is specifically configured to: and when the instantaneous heartbeat density is greater than or equal to the product of the maximum concurrency number and a reference coefficient, determining a terminal needing to adjust the heartbeat information sending time from the terminals sending the heartbeat information in the reference time period.
7. The server according to claim 6, wherein the determining unit is further configured to:
the number of terminals which need to adjust the heartbeat information sending time is determined.
8. A terminal, comprising:
the receiving unit is used for receiving first heartbeat feedback information sent by a server, wherein the first heartbeat feedback information comprises a heartbeat offset, and the heartbeat offset is the sum of a certain reference time period and a certain random integer in a heartbeat cycle; the certain random integer is a random integer between 0 and the difference between the heartbeat cycle and the reference time period; the first heartbeat feedback information is sent to the terminal when the server determines that the terminal needs to adjust the heartbeat information sending time, wherein the server determines that the terminal needs to adjust the heartbeat information sending time and comprises the following steps: judging whether the instantaneous heartbeat density of a reference time period is greater than or equal to the product of the maximum concurrency number of the server and a reference coefficient; the instantaneous heartbeat density is the ratio of the quantity of the heartbeat information received in the reference time period to the reference time period; the reference coefficient is greater than 0 and less than or equal to 1; when the instantaneous heartbeat density is larger than or equal to the product of the maximum concurrency number and a reference coefficient, determining that the terminal needs to adjust the heartbeat information sending time from the terminals sending the heartbeat information in the reference time period;
and the adjusting unit is used for adjusting the sending time of sending the heartbeat information to the server next time according to the heartbeat offset.
9. The terminal of claim 8, wherein the terminal further comprises:
and the sending unit is used for sending the first heartbeat information to the server at random time in a heartbeat period after the connection relationship is established with the server.
10. The terminal of claim 9, wherein the sending unit is further configured to:
and if the first heartbeat feedback information or the second heartbeat feedback information sent by the server is not received within the first preset time, the second heartbeat feedback information does not include the heartbeat offset, and after the random time, a connection request is sent to the server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510751434.XA CN106685748B (en) | 2015-11-05 | 2015-11-05 | Heartbeat information sending method, server and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510751434.XA CN106685748B (en) | 2015-11-05 | 2015-11-05 | Heartbeat information sending method, server and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106685748A CN106685748A (en) | 2017-05-17 |
CN106685748B true CN106685748B (en) | 2020-06-12 |
Family
ID=58862795
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510751434.XA Active CN106685748B (en) | 2015-11-05 | 2015-11-05 | Heartbeat information sending method, server and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106685748B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107528729A (en) * | 2017-08-25 | 2017-12-29 | 中国南方电网有限责任公司 | Heartbeat message mechanism modeling method based on the communication of OPNET transformer station process layer |
CN109104265B (en) * | 2018-06-07 | 2021-12-24 | 海能达通信股份有限公司 | Channel configuration method, base station and readable storage medium |
CN109831474B (en) * | 2018-11-26 | 2021-07-13 | 创新先进技术有限公司 | Keep-alive system, method, server and readable storage medium for http long connection |
CN110365598B (en) * | 2019-06-26 | 2023-05-02 | 深圳市梦网科技发展有限公司 | Heartbeat message sending method, device, server, terminal and storage medium |
CN111078267A (en) * | 2019-12-31 | 2020-04-28 | 深圳市优必选科技股份有限公司 | Robot state information updating method and device, server and storage medium |
CN113612624B (en) * | 2021-06-29 | 2023-01-06 | 济南浪潮数据技术有限公司 | Method and device for processing heartbeat between nodes |
CN113873017B (en) * | 2021-09-06 | 2023-12-26 | 绿盟科技集团股份有限公司 | Heartbeat cycle adjusting method, device, client and server |
CN114500550B (en) * | 2021-12-31 | 2024-10-11 | 深圳市晨北科技有限公司 | Equipment heartbeat interval control method and device, internet of things equipment and storage medium |
CN115102885B (en) * | 2022-06-17 | 2024-05-14 | 中建八局第二建设有限公司 | Variable-speed heartbeat method for low-power-consumption Internet of things equipment |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102843250B (en) * | 2011-06-21 | 2018-01-19 | 中兴通讯股份有限公司 | The adaptive approach and device of a kind of heart beat cycle |
CN102438181A (en) * | 2011-08-18 | 2012-05-02 | 中兴通讯股份有限公司 | Method and system for adjusting heartbeat message sending time in IPTV system |
CN102447631A (en) * | 2011-12-28 | 2012-05-09 | 华为终端有限公司 | Heartbeat connection method, related device and system |
CN104144159B (en) * | 2014-06-26 | 2016-04-13 | 腾讯科技(深圳)有限公司 | Intelligent heartbeat keepalive method and intelligent heartbeat keep-alive system |
-
2015
- 2015-11-05 CN CN201510751434.XA patent/CN106685748B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106685748A (en) | 2017-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106685748B (en) | Heartbeat information sending method, server and terminal | |
CN109905259B (en) | Communication connection maintaining method, system and related equipment | |
US10402280B2 (en) | File transfer system and method, policy server, terminal and storage medium | |
CN105635248A (en) | Method and system for releasing TCP (Transmission Control Protocol) connection resources | |
CN107645517B (en) | Data pushing method and device | |
CN110474975B (en) | Heartbeat processing method and device of application program, electronic equipment and storage medium | |
CN113783775B (en) | Method and device for data transmission | |
CN102387069B (en) | Method and system for connecting clients with server and clients as well as server | |
CN101682611A (en) | When interrupting, improves physical transmission medium the method for tcp data transmission process | |
CN113301103B (en) | Data processing system, method and device | |
US10135939B2 (en) | Method and apparatus for sending delivery notification of network application-related product | |
CN106067857B (en) | Method and device for preventing user from being forced off-line | |
CN111479298B (en) | Method and device for controlling power consumption | |
US20120221672A1 (en) | Communication devices, methods and computer readable storage media | |
KR101407597B1 (en) | System and method for providing push service | |
KR20130045929A (en) | Asynchronous data streaming in a peer-to-peer network | |
CN112291180A (en) | Message load balancing method | |
CN106899510B (en) | Transmission rate control method and device based on iSCSI protocol | |
WO2015004861A1 (en) | Message distribution system, message distribution device, message distribution method, and program for message distribution | |
CN115967684B (en) | Data transmission method, device, electronic equipment and computer readable storage medium | |
EP2757756A1 (en) | Apparatus and method for reducing transmission delay of HTTP protocol and processing load of HTTP server in wireless communications network | |
CN113992737A (en) | Internet of things connection method, gateway server and gateway | |
CN115150363B (en) | IP address updating method, gateway device, gateway down-hanging device and storage medium | |
CN109921933B (en) | Information processing method and network security equipment | |
CN111314465B (en) | Weak network environment communication method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 310012 building A01, 1600 yuhangtang Road, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province Applicant after: CHINA MOBILE (HANGZHOU) INFORMATION TECHNOLOGY Co.,Ltd. Applicant after: China Mobile Communications Corp. Address before: 310012, No. 14, building three, Chang Torch Hotel, No. 259, Wensanlu Road, Xihu District, Zhejiang, Hangzhou Applicant before: CHINA MOBILE (HANGZHOU) INFORMATION TECHNOLOGY Co.,Ltd. Applicant before: China Mobile Communications Corp. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |