A kind of method and device for sending heartbeat packet of long connection center
A sending method and long-term connection technology, which is applied in the network field, can solve the problem of terminal battery life reduction, meet the needs of message timeliness, and reduce the consumption of device resources
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0042] Such as figure 1 As shown, it is a flow chart of a method for sending a persistent connection heartbeat packet provided in Embodiment 1 of the present application, including the following steps:
[0043] S101: Obtain operating parameters of a terminal establishing a persistent connection with the server.
[0044] Here, the operating parameters obtained from the terminal establishing a persistent connection with the server include more than one of the following parameters: the operating status of the instant messaging software in the terminal, the system time of the terminal, network signal, and remaining power.
[0045] S102: Determine the current scene of the terminal according to the operating parameters.
[0046] Here, the current scene of the terminal may include any of the following scenes: an instant messaging scene, a night scene, a low battery scene, a weak network scene, and a normal scene. Wherein, the normal scene may refer to a scene other than an instant ...
Embodiment 2
[0063] Such as figure 2 As shown, it is a structural diagram of a sending device for a long connection heartbeat packet provided in Embodiment 2 of the present application, including:
[0064] Obtaining module 21, is used for obtaining the operating parameter of the terminal that establishes long connection with server;
[0065] The first determining module 22 is configured to determine the current scene of the terminal according to the operating parameters;
[0066] The second determining module 23 is configured to determine a heartbeat packet sending strategy corresponding to the scene where the terminal is currently located;
[0067] The control module 24 is configured to control the sending of the heartbeat packets in the long connection according to the determined heartbeat packet sending policy.
[0068] Optionally, the current scenario of the terminal determined by the first determination module 22 includes any of the following scenarios: instant messaging scenario, ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

