Keep alive long connection method, device, communication terminal and storage medium
A communication terminal and connection method technology, applied in the field of communication, can solve the problems of high memory occupancy rate, high power consumption, inability to reasonably control the sending frequency of heartbeat packets, etc., and achieve the effect of reducing power consumption and memory occupancy rate
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0048] This embodiment provides a keep-alive and long-term connection method, which is applied to a communication terminal. The communication terminal may be a mobile terminal such as a mobile phone, a tablet computer, an electronic school card, a personal digital assistant, a notebook computer, etc., or a personal computer or a desktop computer. , self-service terminals and other non-mobile terminals.
[0049] like figure 1 As shown, the keep-alive long connection method provided by this embodiment includes:
[0050] S10, obtaining the running state of the communication terminal every first predetermined time;
[0051] In application, the first predetermined time can be set to any time according to actual needs, for example, any time in the range of 1S to 60S. The first predetermined time may be a time preset by the system or a user-defined time, and the running state includes a screen-on state and a non-bright-screen state, wherein the screen-on state includes a call state...
Embodiment 2
[0090] This embodiment provides a keep-alive long connection device for performing the method steps in the first embodiment.
[0091] like figure 2 As shown, the present invention also provides a keep-alive long connection device 100, comprising:
[0092] an acquisition module 10, configured to acquire the running state of the mobile terminal every first predetermined time;
[0093] matching module 20, for matching the corresponding heartbeat packet sending frequency according to the operating state;
[0094] The sending module 30 is configured to send the heartbeat packet to the server according to the sending frequency of the heartbeat packet.
[0095] In one embodiment, the matching module 20 is specifically used for:
[0096] Determine whether the running state is a bright screen state;
[0097] If the running state is a bright screen state, determine whether the communication terminal and the server interact with data in the bright screen state;
[0098] If no data ...
Embodiment 3
[0116] image 3 It is a schematic diagram of a keep-alive long-connection communication terminal provided by an embodiment of the present invention. like image 3 As shown, the keep-alive communication terminal 80 of this embodiment includes: a processor 803 , a memory 801 , and a computer program 802 stored in the memory 801 and executable on the processor 803 . When the processor 803 executes the computer program 802, the steps in each of the above-mentioned embodiments of the keep-alive methods for long-term connections are implemented, for example, figure 1 Steps S10 to S30 are shown. Alternatively, when the processor 803 executes the computer program 802, the functions of the modules / units in the foregoing device embodiments are implemented.
[0117] Exemplarily, the computer program 802 can be divided into one or more modules / units, and the one or more modules / units are stored in the memory 801 and executed by the processor 803 to complete. this invention. The one o...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


