Unlock instant, AI-driven research and patent intelligence for your innovation.

Application program heartbeat processing method, device, electronic device and storage medium

A technology of an application program and a processing method, which is applied in the field of communication, can solve problems such as inability to consume resources and balance the timeliness of connection detection, and achieve the effects of saving resource consumption, balancing resource consumption, and balancing the timeliness of connection detection

Active Publication Date: 2022-03-15
北京云中融信网络科技有限公司
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The purpose of the embodiments of the present application is to provide a heartbeat processing method, device, electronic device, and storage medium for an application program, so as to solve the problem that a good balance cannot be achieved between resource consumption and connection detection timeliness in the prior art. technical problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Application program heartbeat processing method, device, electronic device and storage medium
  • Application program heartbeat processing method, device, electronic device and storage medium
  • Application program heartbeat processing method, device, electronic device and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0037] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.

[0038] The characteristic of IM application program is "timely", almost all IM application programs realize timeliness through TCP long connection combined with heartbeat mechanism. The reason for using TCP long connection is that TCP can ensure the integrity, timely and reliable sending and receiving of messages in the connected state, and the reason for using heartbeat is to detect the availability of TCP link. In practical applications, the following factors will affect the survival of TCP long connections, for example:

[0039] 1. NAT timeout; most mobile wireless network operators will eliminate the corresponding item of the link in the NAT table when there is no data communication on the link for a period of time, causing the link to be interrupted. The long connection heartbeat interval must...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present application provides a heartbeat processing method, device, electronic equipment and storage medium of an application program. The method includes: if it is detected that the application program is switched from the background running state to the foreground running state, obtaining the duration of the application program in the background running state; if the duration is greater than a first preset threshold, obtaining the duration of the application program Connection state, adjusting the current heartbeat period according to the connection state; the current heartbeat period is a period for sending heartbeat data to the server. The device is used to execute the above method. In the embodiment of the present application, when it is detected that the application is switched to the foreground running state and the running time in the background exceeds the first preset threshold, the connection state of the application is judged, and the current state is dynamically adjusted according to the connection state. Heartbeat cycle, because the current heartbeat cycle is set differently due to different connection states, on the one hand, it can perform connection detection in time, and on the other hand, it can save resource consumption.

Description

technical field [0001] The present application relates to the technical field of communications, and in particular, to a heartbeat processing method, device, electronic device, and storage medium for an application program. Background technique [0002] Due to the immediacy of information transmission by an instant messaging (Instant Message, IM) application program, the IM application program needs to be in a running state for a long time, so as to maintain an effective connection with the server. [0003] In the prior art, two fixed heartbeat periods are set, that is, when the IM application program is running in the background, the first heartbeat period is used, and when the IM application program is in the foreground running state, the second heartbeat period is used. Send a data packet (heartbeat signaling) to the server every other heartbeat cycle to detect the network, so as to achieve the effect of long connection. [0004] However, due to factors such as Network A...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): H04L67/145
CPCH04L67/145
Inventor 魏钦校周加涛杨攀
Owner 北京云中融信网络科技有限公司