


技术领域technical field
本发明涉及移动通信技术领域,具体而言,涉及一种移动终端和点对点连接保持方法。The invention relates to the technical field of mobile communication, in particular to a mobile terminal and a method for maintaining a point-to-point connection.
背景技术Background technique
近年来,随着移动互联网络应用的推广,移动终端不仅是通话沟通工具,还可以安装运行各种应用程序,通过移动终端与网络侧的各种应用服务器相连,进行数据业务数据交互。移动终端永远在线(always online)为这种业务数据交互提供良好的体验。在这种永远在线的方式中,移动终端和网络之间建立一直保持连接状态的长连接,移动终端运行的各种网络应用程序可以随时向网络侧应用服务器发送数据和接收来自网络侧的数据。例如智能手机常用的即时通信应用软件,天气预报,手机邮箱等。为了维持移动终端永远在线,一些手机应用程序和网络应用服务器必需通过心跳数据包来维持通信链路的保活。In recent years, with the promotion of mobile Internet applications, mobile terminals are not only communication tools, but also can install and run various applications, and connect to various application servers on the network side through mobile terminals to perform data service data interaction. Mobile terminals are always online (always online) to provide a good experience for this kind of business data interaction. In this always-on mode, a persistent connection is established between the mobile terminal and the network, and various network applications running on the mobile terminal can send data to and receive data from the network side application server at any time. For example, instant messaging application software commonly used in smart phones, weather forecast, mobile mailbox, etc. In order to keep the mobile terminal always online, some mobile application programs and network application servers must use heartbeat data packets to keep the communication link alive.
为了维持移动终端永远在线,移动终端与应用服务器之间的长连接要一直保持连接状态,而位于移动终端与应用服务器之间的包数据服务节点(Packet Data Serving Node,PDSN)需要周期性接收来自移动终端或应用服务器的数据流量来保持PPP(Point-to-Point Protocol,点对点协议)的连接状态,因此移动终端的应用程序需要以小于PDSN所需周期的时长,不断地向应用服务器发送心跳数据包以进行长连接的保活,该心跳数据包传输过程穿过PDSN,触发长连接有效,PDSN不得断开此PPP连接。但对于大多数移动互联网应用程序,例如浏览器,并没有心跳数据包。因此移动终端在没有运行有发送心跳数据包功能的应用程序时,在移动终端同PDSN没有数据流的时间大于保活周期后,PDSN断开移动终端的PPP长连接,释放占用的资源。移动终端在检测到连接断开后,为了维持永远在线的特性,不得不再次拨号做接入。这种PDSN超时断开PPP链路,移动终端再进行接入的过程反复进行,不但占用大量的无线网络资源,也会使移动终端无法长时间待机,待机时间变短。In order to keep the mobile terminal always online, the long connection between the mobile terminal and the application server must be kept connected, and the Packet Data Serving Node (PDSN) between the mobile terminal and the application server needs to periodically receive data from The data traffic of the mobile terminal or application server is used to maintain the connection state of PPP (Point-to-Point Protocol, point-to-point protocol), so the application program of the mobile terminal needs to continuously send heartbeat data to the application server with a period shorter than the period required by the PDSN The packet is used to keep alive the long connection. The transmission process of the heartbeat data packet passes through the PDSN, triggering the long connection to be valid, and the PDSN must not disconnect the PPP connection. But for most mobile Internet applications, such as browsers, there is no heartbeat packet. Therefore, when the mobile terminal does not run the application program with the function of sending heartbeat data packets, after the mobile terminal has no data flow with the PDSN for longer than the keep-alive period, the PDSN disconnects the PPP persistent connection of the mobile terminal and releases the occupied resources. After the mobile terminal detects that the connection is disconnected, in order to maintain the always-on feature, it has to dial again for access. This kind of PDSN disconnects the PPP link over time, and the process of the mobile terminal re-accessing is repeated, which not only occupies a large amount of wireless network resources, but also makes the mobile terminal unable to stand by for a long time, and the standby time becomes shorter.
因此,需要一种新的长连接保持方案,在移动终端没有运行具有控制发送心跳数据包功能的应用程序时,也能保持与应用服务器之间的连接状态。Therefore, there is a need for a new long-term connection maintenance scheme, which can maintain the connection state with the application server even when the mobile terminal is not running the application program with the function of controlling the sending of heartbeat data packets.
发明内容Contents of the invention
考虑到上述背景技术,本发明所要解决的技术问题是提供一种长连接保持方案,在移动中没有运行具有控制发送心跳数据包功能的应用程序时,也能保持与应用服务器之间的连接状态。Considering the above-mentioned background technology, the technical problem to be solved by the present invention is to provide a long-term connection maintenance scheme, which can maintain the connection state with the application server when the application program with the function of controlling the sending of heartbeat data packets is not running during the movement .
根据本发明的一个方面,提供了一种移动终端,包括:检测单元,用于在所述移动终端进入休眠状态时,检测所述移动终端与所述应用服务器之间是否有数据流量;通信单元,在所述检测单元在预定时间段内未检测到所述数据流量时,发送心跳数据包至所述应用服务器。According to one aspect of the present invention, a mobile terminal is provided, including: a detection unit, configured to detect whether there is data traffic between the mobile terminal and the application server when the mobile terminal enters a dormant state; a communication unit , sending a heartbeat data packet to the application server when the detection unit does not detect the data traffic within a predetermined period of time.
为了阻止移动终端进入空闲状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点也同时断开连接),当移动终端进入休眠状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点保持连接)时,如果在预定时间段内没有检测到移动终端与应用服务器之间具有数据交互,那么发送心跳数据包给应用服务器,该心跳数据包通过包数据服务节点,触发点对点连接有效,这样就保持了移动终端与应用服务器之间的点对点连接状态,因此解决了在移动终端未运行具有控制发送心跳功能的应用程序时,仍可维持点对点连接状态。In order to prevent the mobile terminal from entering the idle state (the mobile terminal is disconnected from the base station controller, and the base station controller is also disconnected from the packet data service node at the same time), when the mobile terminal enters the dormant state (the mobile terminal is disconnected from the base station controller, When the base station controller keeps connected with the packet data service node), if no data interaction between the mobile terminal and the application server is detected within a predetermined period of time, then a heartbeat data packet is sent to the application server, and the heartbeat data packet passes through the packet data service The node triggers the point-to-point connection to be effective, so that the point-to-point connection state between the mobile terminal and the application server is maintained, so it solves the problem that the point-to-point connection state can still be maintained when the mobile terminal is not running the application program with the function of controlling the sending of heartbeat.
在上述技术方案中,优选的,所述预定时间段小于点对点连接保活周期。由于包数据服务节点必须周期性接收来自移动终端或应用服务器的数据流量来保持点对点的连接状态,因此,必须在小于该包数据服务节点需要的周期时长即点对点连接保活周期内发送心跳数据包,以维持移动终端与应用服务器之间的连接状态。In the above technical solution, preferably, the predetermined time period is shorter than the keep-alive period of the point-to-point connection. Since the packet data service node must periodically receive data traffic from the mobile terminal or application server to maintain the point-to-point connection state, it must send a heartbeat packet within the period shorter than the period required by the packet data service node, that is, the point-to-point connection keep-alive period , to maintain the connection state between the mobile terminal and the application server.
在上述技术方案中,优选的,所述通信单元包括:定时器,在所述移动终端进入休眠状态时,所述定时器开始计时,以及在所述检测单元于所述预定时间内检测到所述数据流量时,所述定时器清零重新开始计时。In the above technical solution, preferably, the communication unit includes: a timer, the timer starts counting when the mobile terminal enters the dormant state, and when the detection unit detects the When the data flow rate is exceeded, the timer is cleared and restarted.
通过定时器来控制心跳数据包的发送时间,若在定时器规定的时间内内检测到数据流量,则定时器清零重新开始计时,重新控制心跳数据包的发送时间。The sending time of the heartbeat data packet is controlled by the timer. If the data flow is detected within the time specified by the timer, the timer is cleared and restarted to count, and the sending time of the heartbeat data packet is re-controlled.
在上述任一技术方案中,优选的,所述心跳数据包存储于所述通信单元。在本方案中,将心跳数据包设计于通信单元中,直接由通信单元的调制解调器来发送该心跳数据包。不依赖于应用程序,调制解调器也无需上报断开状态到AP处理器,AP处理器可以一直休眠,就不需要再执行一次重新接入的过程,从而节省了移动终端的功耗。In any of the above technical solutions, preferably, the heartbeat data packet is stored in the communication unit. In this solution, the heartbeat data packet is designed in the communication unit, and the heartbeat data packet is directly sent by the modem of the communication unit. It does not depend on the application program, and the modem does not need to report the disconnection status to the AP processor. The AP processor can always sleep, and there is no need to perform a re-connection process, thereby saving the power consumption of the mobile terminal.
在上述技术方案中,优选的,所述检测单元还用于检测所述移动终端是否运行具有控制发送心跳数据包功能的应用程序;所述通信单元在所述检测单元检测到所述移动终端进入休眠状态且未检测到运行所述应用程序时,将所述心跳数据包发送至应用服务器。In the above technical solution, preferably, the detection unit is also used to detect whether the mobile terminal is running an application program with the function of controlling the sending of heartbeat data packets; the communication unit detects that the mobile terminal enters the When in a dormant state and no running of the application program is detected, the heartbeat data packet is sent to the application server.
在检测到移动终端进入休眠状态时,若运行了具有控制发送心跳数据包功能的应用程序,则无需通信单元发送该心跳数据包,进一步节省终端的功耗。When it is detected that the mobile terminal enters the sleep state, if the application program with the function of controlling the sending of the heartbeat data packet is run, the communication unit does not need to send the heartbeat data packet, further saving the power consumption of the terminal.
根据本发明的另一方面,还提供了一种点对点连接保持方法,用于保持移动终端与应用服务器之间的长连接,包括:在所述移动终端进入休眠状态时,检测所述移动终端与所述应用服务器之间是否有数据流量;若在预定时间段内未检测到所述数据流量,则发送心跳数据包至所述应用服务器。According to another aspect of the present invention, there is also provided a method for maintaining a point-to-point connection, which is used to maintain a long connection between a mobile terminal and an application server, including: when the mobile terminal enters a dormant state, detecting the connection between the mobile terminal and the application server Whether there is data flow between the application servers; if the data flow is not detected within a predetermined period of time, send a heartbeat data packet to the application server.
为了阻止移动终端进入空闲状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点也同时断开连接),当移动终端进入休眠状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点保持连接)时,如果在预定时间段内没有检测到移动终端与应用服务器之间具有数据交互,那么发送心跳数据包给应用服务器,该心跳数据包通过包数据服务节点,触发点对点连接有效,这样就保持了移动终端与应用服务器之间的点对点连接状态,因此解决了在移动终端未运行具有控制发送心跳功能的应用程序时,仍可维持点对点连接状态。In order to prevent the mobile terminal from entering the idle state (the mobile terminal is disconnected from the base station controller, and the base station controller is also disconnected from the packet data service node at the same time), when the mobile terminal enters the dormant state (the mobile terminal is disconnected from the base station controller, When the base station controller keeps connected with the packet data service node), if no data interaction between the mobile terminal and the application server is detected within a predetermined period of time, then a heartbeat data packet is sent to the application server, and the heartbeat data packet passes through the packet data service The node triggers the point-to-point connection to be effective, so that the point-to-point connection state between the mobile terminal and the application server is maintained, so it solves the problem that the point-to-point connection state can still be maintained when the mobile terminal is not running the application program with the function of controlling the sending of heartbeat.
在上述技术方案中,优选的,所述预定时间段小于点对点连接保活周期。由于包数据服务节点必须周期性接收来自移动终端或应用服务器的数据流量来保持点对点的连接状态,因此,必须在小于该包数据服务节点需要的周期时长即点对点连接保活周期内发送心跳数据包,以维持移动终端与应用服务器之间的连接状态。In the above technical solution, preferably, the predetermined time period is shorter than the keep-alive period of the point-to-point connection. Since the packet data service node must periodically receive data traffic from the mobile terminal or application server to maintain the point-to-point connection state, it must send a heartbeat packet within the period shorter than the period required by the packet data service node, that is, the point-to-point connection keep-alive period , to maintain the connection state between the mobile terminal and the application server.
在上述技术方案中,优选的,在所述移动终端进入休眠状态时,所述定时器开始计时;若在所述预定时间内检测到所述数据流量,则所述定时器清零重新开始计时。通过定时器来控制心跳数据包的发送时间,若在定时器规定的时间内内检测到数据流量,则定时器清零重新开始计时,重新控制心跳数据包的发送时间。In the above technical solution, preferably, when the mobile terminal enters the dormant state, the timer starts counting; if the data flow is detected within the predetermined time, the timer is cleared and restarted . The sending time of the heartbeat data packet is controlled by the timer. If the data flow is detected within the time specified by the timer, the timer is cleared and restarted to count, and the sending time of the heartbeat data packet is re-controlled.
在上述任一技术方案中,优选的,所述心跳数据保存于所述移动终端的通信单元中。在本方案中,将心跳数据包设计于通信单元中,直接由通信单元的调制解调器来发送该心跳数据包。不依赖于应用程序,调制解调器也无需上报断开状态到AP处理器,AP处理器可以一直休眠,就不需要再执行一次重新接入的过程,从而节省了移动终端的功耗。In any of the above technical solutions, preferably, the heartbeat data is stored in the communication unit of the mobile terminal. In this solution, the heartbeat data packet is designed in the communication unit, and the heartbeat data packet is directly sent by the modem of the communication unit. It does not depend on the application program, and the modem does not need to report the disconnection status to the AP processor. The AP processor can always sleep, and there is no need to perform a re-connection process, thereby saving the power consumption of the mobile terminal.
在上述技术方案中,优选的,在检测到所述移动终端进入休眠状态时,所述长连接保持方法还包括:检测所述移动终端是否运行具有控制发送心跳数据包功能的应用程序;若未检测到运行所述应用程序,则由所述通信单元发送所述心跳数据包。在检测到移动终端进入休眠状态时,若终端运行了具有控制发送心跳数据包功能的应用程序,则无需通信单元发送该心跳数据包,进一步节省终端的功耗。In the above technical solution, preferably, when it is detected that the mobile terminal enters a dormant state, the method for maintaining a persistent connection further includes: detecting whether the mobile terminal is running an application program with the function of controlling sending of heartbeat data packets; If it is detected that the application program is running, the communication unit sends the heartbeat data packet. When it is detected that the mobile terminal enters the dormant state, if the terminal runs an application program capable of controlling the sending of the heartbeat data packet, the communication unit does not need to send the heartbeat data packet, further saving the power consumption of the terminal.
本发明的移动终端的调制解调器在满足一定条件时可自动传送心跳数据包,使移动终端不依赖应用软件,可维持移动终端永远在线,不过多占用网络资源,即不需要网络侧发送断开指令到调制解调器,这样调制解调器就不需要上报断开状态到AP处理器,AP处理器就不需要再执行一次重新接入的过程。如果执行这个过程会增加网络的信令开消。同时不需要AP处理器醒机,即不需要上报断开状态到AP处理器,AP处理器就可以一直处于休眠状态,使移动终端的待机时间更长,使用户可随时随地使用移动互联网。The modem of the mobile terminal of the present invention can automatically transmit heartbeat data packets when certain conditions are met, so that the mobile terminal does not depend on application software, and can keep the mobile terminal online forever, but does not occupy too much network resources, that is, it does not need the network side to send a disconnection command to the modem, so that the modem does not need to report the disconnection state to the AP processor, and the AP processor does not need to perform a re-connection process again. If this process is performed, the signaling overhead of the network will be increased. At the same time, the AP processor does not need to wake up, that is, it does not need to report the disconnection state to the AP processor, and the AP processor can always be in a dormant state, so that the standby time of the mobile terminal is longer, and the user can use the mobile Internet anytime and anywhere.
附图说明Description of drawings
图1示出了根据本发明的实施例的移动终端的应用场景示意图;FIG. 1 shows a schematic diagram of an application scenario of a mobile terminal according to an embodiment of the present invention;
图2示出了根据本发明的实施例的移动终端的框图;Figure 2 shows a block diagram of a mobile terminal according to an embodiment of the present invention;
图3示出了根据本发明的实施例的长连接保持方法的流程图;Fig. 3 shows the flowchart of the method for maintaining a persistent connection according to an embodiment of the present invention;
图4示出了根据本发明的实施例的长连接保持方法的原理图。Fig. 4 shows a schematic diagram of a method for maintaining a persistent connection according to an embodiment of the present invention.
具体实施方式Detailed ways
为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施方式对本发明进行进一步的详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to understand the above-mentioned purpose, features and advantages of the present invention more clearly, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是,本发明还可以采用其他不同于在此描述的其他方式来实施,因此,本发明的保护范围并不受下面公开的具体实施例的限制。In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described here. Therefore, the protection scope of the present invention is not limited by the specific details disclosed below. EXAMPLE LIMITATIONS.
图1示出了根据本发明的实施例的移动终端的应用场景示意图。Fig. 1 shows a schematic diagram of an application scenario of a mobile terminal according to an embodiment of the present invention.
在本实施例中,移动终端的应用场景是CDMA网络结构,如图1所示,移动终端110与应用服务器之间具有基站108、基站控制器106和包数据服务节点(PDSN)104,移动终端110通过基站108和基站控制器(BSC)106与包数据服务节点104建立PPP连接(点对点连接)后,移动终端110可以在这个PPP链路上承载TCP/IP包,可自由接入互联网。移动终端110这时有三种状态:激活状态(ACTIVE),休眠状态(Dormant),空闲状态(IDLE)。在激活状态,移动终端110可随时发送/接收数据;在休眠状态,移动终端110同基站控制器106断开,但基站控制器106同包数据服务节点104的PPP连接保留,移动终端110可以接入后收发数据;在空闲状态,移动终端110同基站控制器106,基站控制器106同包数据服务节点104都是断开的,即PPP链路断开,移动终端110不能发送数据。In this embodiment, the application scenario of the mobile terminal is a CDMA network structure. As shown in FIG. After 110 establishes a PPP connection (point-to-point connection) with packet data service node 104 through
为了保持移动终端110永远在线,需要阻止移动终端110进入空闲状态。空闲状态是由包数据服务节点104的定义的时间周期来控制的(PPPidle time,点对点保活周期,一般为10分钟)。在该点对点保活周期内,移动终端110同PDSN无数据交互,则PDSN断开PPP链路,移动终端110进入空闲态。In order to keep the
当移动终端110进入休眠态(Dormant)后,由移动终端的调制解调器启动一个小于点对点保活周期的定时器T1,在T1计时内,如果没有数据收发,则在T1计时满后,由调制解调器自动发送一个ICMP(Internetcontrol message protocol,互联网控制报文协议)心跳数据包,这个心跳数据包将通过PDSN,使点对点保活周期停止计时。在T1计时内,如果有其它数据包收发,则T1清零重新开始计时。这样可阻止移动终端110进入空闲态。When the
其中,移动终端110可以通过一个时间器来控制其进入休眠状态,例如在没有数据收发后10~30秒,使移动终端110进入休眠状态。当有数据包收发,这个时间器清零,如果定时时间到,则开始进入休眠过程(包括断开移动终端与基站控制器的连接)。Wherein, the
因此,ICMP心跳数据包设计在调制解调器中,不用处理器(AP)来发送,这样AP可以保持长时间待机。移动终端可以永远在先,同包数据服务节点的点对点连接不会断开,不需要反复接入来占用BSC资源。Therefore, the ICMP heartbeat packet is designed in the modem, not sent by the processor (AP), so that the AP can remain on standby for a long time. The mobile terminal can always be the first, and the point-to-point connection with the packet data service node will not be disconnected, and there is no need to repeatedly access to occupy BSC resources.
图2示出了根据本发明的实施例的移动终端的框图。FIG. 2 shows a block diagram of a mobile terminal according to an embodiment of the present invention.
如图2所示,根据本发明的实施例的移动终端110,包括:检测单元202,用于在所述移动终端进入休眠状态时,检测所述移动终端110与所述应用服务器之间是否有数据流量;通信单元204,在所述检测单元202在预定时间段内未检测到所述数据流量时,发送心跳数据包至所述应用服务器。As shown in FIG. 2, the
为了阻止移动终端110进入空闲状态(移动终端110与基站控制器断开连接,基站控制器与包数据服务节点也同时断开连接),当移动终端110进入休眠状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点保持连接)时,如果在预定时间段内没有检测到移动终端110与应用服务器之间具有数据交互,那么发送心跳数据包给应用服务器,该心跳数据包通过包数据服务节点,触发点对点连接有效,这样就保持了移动终端与应用服务器之间的点对点连接状态,因此解决了在移动终端110未运行具有控制发送心跳功能的应用程序时,仍可维持点对点连接状态。In order to prevent the mobile terminal 110 from entering the idle state (the
在上述技术方案中,优选的,所述预定时间段小于点对点连接保活周期。由于包数据服务节点必须周期性接收来自移动终端或应用服务器的数据流量来保持点对点的连接状态,因此,必须在小于该包数据服务节点需要的周期时长即点对点连接保活周期内发送心跳数据包,以维持移动终端与应用服务器之间的连接状态。In the above technical solution, preferably, the predetermined time period is shorter than the keep-alive period of the point-to-point connection. Since the packet data service node must periodically receive data traffic from the mobile terminal or application server to maintain the point-to-point connection state, it must send a heartbeat packet within the period shorter than the period required by the packet data service node, that is, the point-to-point connection keep-alive period , to maintain the connection state between the mobile terminal and the application server.
在上述技术方案中,优选的,所述通信单元204包括:定时器2042,在所述移动终端进入休眠状态时,所述定时器2042开始计时,以及在所述检测单元202于所述预定时间内检测到所述数据流量时,所述定时器2042清零重新开始计时。In the above technical solution, preferably, the communication unit 204 includes: a timer 2042, when the mobile terminal enters the dormant state, the timer 2042 starts timing, and when the detection unit 202 When the data traffic is detected, the timer 2042 is cleared to zero and starts counting again.
通过定时器2042来控制心跳数据包的发送时间,若在定时器2042规定的时间内内检测到数据流量,则定时器2042清零重新开始计时,重新控制心跳数据包的发送时间。The sending time of the heartbeat data packet is controlled by the timer 2042. If the data flow is detected within the time specified by the timer 2042, the timer 2042 is cleared to restart timing, and the sending time of the heartbeat data packet is re-controlled.
在上述任一技术方案中,优选的,所述心跳数据包存储于所述通信单元204。在本方案中,将心跳数据包设计于通信单元中,直接由通信单元的调制解调器来发送该心跳数据包。不依赖于应用程序,调制解调器也无需上报断开状态到AP处理器,AP处理器可以一直休眠,就不需要再执行一次重新接入的过程,从而节省了移动终端的功耗。In any of the above technical solutions, preferably, the heartbeat data packet is stored in the communication unit 204 . In this solution, the heartbeat data packet is designed in the communication unit, and the heartbeat data packet is directly sent by the modem of the communication unit. It does not depend on the application program, and the modem does not need to report the disconnection status to the AP processor. The AP processor can always sleep, and there is no need to perform a re-connection process, thereby saving the power consumption of the mobile terminal.
在上述技术方案中,优选的,所述检测单元202还用于检测所述移动终端是否运行具有控制发送心跳数据包功能的应用程序;所述通信单元204在所述检测单元202检测到所述移动终端110进入休眠状态且未检测到运行所述应用程序时,将所述心跳数据包发送至应用服务器。In the above technical solution, preferably, the detection unit 202 is also used to detect whether the mobile terminal is running an application program with the function of controlling the sending of heartbeat data packets; the communication unit 204 detects the When the
在检测到移动终端进入休眠状态时,若运行了具有控制发送心跳数据包功能的应用程序,则无需通信单元发送该心跳数据包,进一步节省终端的功耗。When it is detected that the mobile terminal enters the sleep state, if the application program with the function of controlling the sending of the heartbeat data packet is run, the communication unit does not need to send the heartbeat data packet, further saving the power consumption of the terminal.
检测单元202可以是个定时器,在移动终端110与外部没有数据交互时,定时器开始计时,在设定时间段内(例如20秒)移动终端110与外部均没有数据交互,则认为移动终端110进入休眠状态。The detection unit 202 may be a timer. When the
移动终端110包括但不限于手机、平板电脑以及其他便携设备。The
图3示出了根据本发明的实施例的长连接保持方法的流程图。Fig. 3 shows a flowchart of a method for maintaining a persistent connection according to an embodiment of the present invention.
如图3所示,根据本发明的实施例的点对点连接保持方法,用于保持移动终端与应用服务器之间的长连接,可以包括以下步骤:步骤302,在所述移动终端进入休眠状态时,检测所述移动终端与所述应用服务器之间是否有数据流量;步骤304,若在预定时间段内未检测到所述数据流量,则发送心跳数据包至所述应用服务器。As shown in FIG. 3 , the method for maintaining a point-to-point connection according to an embodiment of the present invention is used to maintain a long connection between a mobile terminal and an application server, and may include the following steps: Step 302, when the mobile terminal enters a dormant state, Detect whether there is data traffic between the mobile terminal and the application server;
为了阻止移动终端进入空闲状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点也同时断开连接),当移动终端进入休眠状态(移动终端与基站控制器断开连接,基站控制器与包数据服务节点保持连接)时,如果在预定时间段内没有检测到移动终端与应用服务器之间具有数据交互,那么发送心跳数据包给应用服务器,该心跳数据包通过包数据服务节点,触发点对点连接有效,这样就保持了移动终端与应用服务器之间的点对点连接状态,因此解决了在移动终端未运行具有控制发送心跳功能的应用程序时,仍可维持点对点连接状态。In order to prevent the mobile terminal from entering the idle state (the mobile terminal is disconnected from the base station controller, and the base station controller is also disconnected from the packet data service node at the same time), when the mobile terminal enters the dormant state (the mobile terminal is disconnected from the base station controller, When the base station controller keeps connected with the packet data service node), if no data interaction between the mobile terminal and the application server is detected within a predetermined period of time, then a heartbeat data packet is sent to the application server, and the heartbeat data packet passes through the packet data service The node triggers the point-to-point connection to be effective, so that the point-to-point connection state between the mobile terminal and the application server is maintained, so it solves the problem that the point-to-point connection state can still be maintained when the mobile terminal is not running the application program with the function of controlling the sending of heartbeat.
在上述技术方案中,优选的,所述预定时间段小于点对点连接保活周期。由于包数据服务节点必须周期性接收来自移动终端或应用服务器的数据流量来保持点对点的连接状态,因此,必须在小于该包数据服务节点需要的周期时长即点对点连接保活周期内发送心跳数据包,以维持移动终端与应用服务器之间的连接状态。In the above technical solution, preferably, the predetermined time period is shorter than the keep-alive period of the point-to-point connection. Since the packet data service node must periodically receive data traffic from the mobile terminal or application server to maintain the point-to-point connection state, it must send a heartbeat packet within the period shorter than the period required by the packet data service node, that is, the point-to-point connection keep-alive period , to maintain the connection state between the mobile terminal and the application server.
在上述技术方案中,优选的,在所述移动终端进入休眠状态时,所述定时器开始计时;若在所述预定时间内检测到所述数据流量,则所述定时器清零重新开始计时。通过定时器来控制心跳数据包的发送时间,若在定时器规定的时间内内检测到数据流量,则定时器清零重新开始计时,重新控制心跳数据包的发送时间。In the above technical solution, preferably, when the mobile terminal enters the dormant state, the timer starts counting; if the data flow is detected within the predetermined time, the timer is cleared and restarted . The sending time of the heartbeat data packet is controlled by the timer. If the data flow is detected within the time specified by the timer, the timer is cleared and restarted to count, and the sending time of the heartbeat data packet is re-controlled.
在上述任一技术方案中,优选的,所述心跳数据保存于所述移动终端的通信单元中。在本方案中,将心跳数据包设计于通信单元中,直接由通信单元的调制解调器来发送该心跳数据包。不依赖于应用程序,调制解调器也无需上报断开状态到AP处理器,AP处理器可以一直休眠,就不需要再执行一次重新接入的过程,从而节省了移动终端的功耗。In any of the above technical solutions, preferably, the heartbeat data is stored in the communication unit of the mobile terminal. In this solution, the heartbeat data packet is designed in the communication unit, and the heartbeat data packet is directly sent by the modem of the communication unit. It does not depend on the application program, and the modem does not need to report the disconnection status to the AP processor. The AP processor can always sleep, and there is no need to perform a re-connection process, thereby saving the power consumption of the mobile terminal.
在上述技术方案中,优选的,在检测到所述移动终端进入休眠状态时,所述长连接保持方法还包括:检测所述移动终端是否运行具有控制发送心跳数据包功能的应用程序;若未检测到运行所述应用程序,则由所述通信单元发送所述心跳数据包。在检测到移动终端进入休眠状态时,若终端运行了具有控制发送心跳数据包功能的应用程序,则无需通信单元发送该心跳数据包,进一步节省终端的功耗。In the above technical solution, preferably, when it is detected that the mobile terminal enters a dormant state, the method for maintaining a persistent connection further includes: detecting whether the mobile terminal is running an application program with the function of controlling sending of heartbeat data packets; If it is detected that the application program is running, the communication unit sends the heartbeat data packet. When it is detected that the mobile terminal enters the dormant state, if the terminal runs an application program capable of controlling the sending of the heartbeat data packet, the communication unit does not need to send the heartbeat data packet, further saving the power consumption of the terminal.
下面结合图4来说明本发明的点对点连接保持方法的工作时序。The working sequence of the point-to-point connection maintenance method of the present invention will be described below in conjunction with FIG. 4 .
如图4所示,首先通过检测移动终端110是否进入休眠状态,若进入休眠状态,则在移动终端110侧启动一个定时器,开始计时,在预定时间段t(t小于点对点连接保活周期)内若检测到移动终端110与应用服务器之间没有数据交互,则发送心跳数据包至基站控制器106,通过基站控制器106将心跳数据包传输至包数据服务器节点104,通过包数据服务器节点104触发点对点连接有效,从而保持移动终端110与应用服务器之间的点对点连接状态。As shown in Figure 4, first by detecting whether the
因此,本发明的移动终端的调制解调器在满足一定条件时可自动传送心跳数据包,使移动终端不依赖应用软件,可维持移动终端永远在线,不过多占用网络资源,即不需要网络侧发送断开指令到调制解调器,这样调制解调器就不需要上报断开状态到AP处理器,AP处理器就不需要再执行一次重新接入的过程。如果执行这个过程会增加网络的信令开消。同时不需要AP处理器醒机,即不需要上报断开状态到AP处理器,AP处理器就可以一直处于休眠状态,使移动终端的待机时间更长,使用户可随时随地使用移动互联网。Therefore, the modem of the mobile terminal of the present invention can automatically transmit heartbeat data packets when certain conditions are met, so that the mobile terminal does not depend on application software, and the mobile terminal can be kept online forever, but it does not occupy too much network resources, that is, it does not need to send a disconnection message from the network side. command to the modem, so that the modem does not need to report the disconnection state to the AP processor, and the AP processor does not need to perform a re-connection process again. If this process is performed, the signaling overhead of the network will be increased. At the same time, the AP processor does not need to wake up, that is, it does not need to report the disconnection state to the AP processor, and the AP processor can always be in a dormant state, so that the standby time of the mobile terminal is longer, and the user can use the mobile Internet anytime and anywhere.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2013100135860ACN103079285A (en) | 2013-01-14 | 2013-01-14 | Mobile terminal and method for maintaining point-to-point connection |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2013100135860ACN103079285A (en) | 2013-01-14 | 2013-01-14 | Mobile terminal and method for maintaining point-to-point connection |
| Publication Number | Publication Date |
|---|---|
| CN103079285Atrue CN103079285A (en) | 2013-05-01 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2013100135860APendingCN103079285A (en) | 2013-01-14 | 2013-01-14 | Mobile terminal and method for maintaining point-to-point connection |
| Country | Link |
|---|---|
| CN (1) | CN103079285A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103546876A (en)* | 2013-10-28 | 2014-01-29 | 深圳全智达通信股份有限公司 | Information sending method, terminal device, application server and system |
| CN103561392A (en)* | 2013-10-31 | 2014-02-05 | 宇龙计算机通信科技(深圳)有限公司 | Method for sending information and terminal |
| CN103843418A (en)* | 2013-10-29 | 2014-06-04 | 华为终端有限公司 | Method of service agent, modem and terminal |
| CN104244448A (en)* | 2013-06-20 | 2014-12-24 | 腾讯科技(深圳)有限公司 | Method and system for reducing data transmission delay |
| CN104519064A (en)* | 2014-12-22 | 2015-04-15 | 厦门为那通信科技有限公司 | Online link maintaining method in communication |
| CN104579813A (en)* | 2013-10-29 | 2015-04-29 | 华为终端有限公司 | Detection method and terminal |
| WO2015109535A1 (en)* | 2014-01-24 | 2015-07-30 | 华为技术有限公司 | Service data transmission method and apparatus |
| CN105247843A (en)* | 2013-05-28 | 2016-01-13 | 高通股份有限公司 | Method and apparatus for enhanced application signaling from a wireless communication device |
| CN105554906A (en)* | 2015-12-10 | 2016-05-04 | 希姆通信息技术(上海)有限公司 | Method and system for improving data sending speed after terminal wakeup in wireless network |
| CN105657860A (en)* | 2016-01-29 | 2016-06-08 | 珠海市魅族科技有限公司 | Method and device for improving data service response speed |
| CN106793172A (en)* | 2016-12-22 | 2017-05-31 | 努比亚技术有限公司 | A kind of message obtains terminal and method |
| CN106817751A (en)* | 2016-12-27 | 2017-06-09 | 广东欧珀移动通信有限公司 | A kind of data transmission method for uplink and mobile terminal |
| WO2017128185A1 (en)* | 2016-01-28 | 2017-08-03 | 华为技术有限公司 | Method and terminal for controlling service connection |
| CN107508916A (en)* | 2017-09-27 | 2017-12-22 | 深圳狗尾草智能科技有限公司 | Server link management method for intelligent robot |
| WO2019034001A1 (en)* | 2017-08-18 | 2019-02-21 | 华为技术有限公司 | Power consumption control method and apparatus |
| CN110121173A (en)* | 2019-05-10 | 2019-08-13 | 南京硅基智能科技有限公司 | A method of the virtual mobile phone based on cloud remains online |
| CN110162161A (en)* | 2019-04-17 | 2019-08-23 | 努比亚技术有限公司 | Control method, wearable device and the computer readable storage medium of target application |
| CN110557301A (en)* | 2019-08-23 | 2019-12-10 | 福建科立讯通信有限公司 | Method for realizing server-side heartbeat detection mechanism for reducing power consumption |
| CN111295701A (en)* | 2017-11-10 | 2020-06-16 | Nec显示器解决方案株式会社 | Method of controlling image and image display apparatus |
| CN111669624A (en)* | 2020-05-08 | 2020-09-15 | 广州微算互联信息技术有限公司 | Cloud mobile phone control method and system |
| CN112511536A (en)* | 2020-11-27 | 2021-03-16 | 北京经纬恒润科技股份有限公司 | Communication method and communication system |
| CN112532264A (en)* | 2020-11-27 | 2021-03-19 | 石家庄市善理通益科技有限公司 | Power consumption optimization method of talkback terminal and execution device thereof |
| US11153825B2 (en) | 2017-08-18 | 2021-10-19 | Huawei Technologies Co., Ltd. | Power consumption control method and apparatus |
| CN116697611A (en)* | 2022-02-25 | 2023-09-05 | 芜湖美的厨卫电器制造有限公司 | Water heater system, control method and control device, readable storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101072385A (en)* | 2007-06-27 | 2007-11-14 | 蒋晓海 | Method for realizing mobile instant messaging by socket direct connection of mobile phone |
| WO2009154401A2 (en)* | 2008-06-18 | 2009-12-23 | Samsung Electronics Co., Ltd. | Method and system for maintaining connections between a terminal and servers in a communication system |
| CN102036349A (en)* | 2009-09-29 | 2011-04-27 | 联想(北京)有限公司 | Method for maintaining connection of terminal and network server, terminal and network server |
| CN102684949A (en)* | 2012-06-04 | 2012-09-19 | 北京神州泰岳软件股份有限公司 | Method and device for processing heartbeat data packet under persistent connection, and client |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101072385A (en)* | 2007-06-27 | 2007-11-14 | 蒋晓海 | Method for realizing mobile instant messaging by socket direct connection of mobile phone |
| WO2009154401A2 (en)* | 2008-06-18 | 2009-12-23 | Samsung Electronics Co., Ltd. | Method and system for maintaining connections between a terminal and servers in a communication system |
| CN102036349A (en)* | 2009-09-29 | 2011-04-27 | 联想(北京)有限公司 | Method for maintaining connection of terminal and network server, terminal and network server |
| CN102684949A (en)* | 2012-06-04 | 2012-09-19 | 北京神州泰岳软件股份有限公司 | Method and device for processing heartbeat data packet under persistent connection, and client |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105247843A (en)* | 2013-05-28 | 2016-01-13 | 高通股份有限公司 | Method and apparatus for enhanced application signaling from a wireless communication device |
| CN104244448B (en)* | 2013-06-20 | 2018-07-20 | 腾讯科技(深圳)有限公司 | Reduce the method and system of data transmission delay |
| CN104244448A (en)* | 2013-06-20 | 2014-12-24 | 腾讯科技(深圳)有限公司 | Method and system for reducing data transmission delay |
| WO2014201912A1 (en)* | 2013-06-20 | 2014-12-24 | Tencent Technology (Shenzhen) Company Limited | Method, system and computer-readable storage medium for reducing data transmission delay |
| US9826568B2 (en) | 2013-06-20 | 2017-11-21 | Tencent Technology (Shenzhen) Company Limited | Method, system and computer-readable storage medium for reducing data transmission delay |
| CN103546876A (en)* | 2013-10-28 | 2014-01-29 | 深圳全智达通信股份有限公司 | Information sending method, terminal device, application server and system |
| CN103546876B (en)* | 2013-10-28 | 2017-03-29 | 深圳全智达通信股份有限公司 | A kind of method of transmission information, terminal unit, application server and system |
| CN103843418B (en)* | 2013-10-29 | 2018-06-05 | 华为终端(东莞)有限公司 | A kind of method of service agent, modem and terminal |
| CN104579813A (en)* | 2013-10-29 | 2015-04-29 | 华为终端有限公司 | Detection method and terminal |
| CN104579813B (en)* | 2013-10-29 | 2018-09-07 | 华为终端(东莞)有限公司 | Detection method and terminal |
| WO2015061957A1 (en)* | 2013-10-29 | 2015-05-07 | 华为终端有限公司 | Service agent method, modem, and terminal |
| CN103843418A (en)* | 2013-10-29 | 2014-06-04 | 华为终端有限公司 | Method of service agent, modem and terminal |
| US9568989B2 (en) | 2013-10-29 | 2017-02-14 | Huawei Device Co., Ltd. | Method for acting as service agent, modem, and terminal by establishing a heartbeat connection with an application server |
| CN103561392A (en)* | 2013-10-31 | 2014-02-05 | 宇龙计算机通信科技(深圳)有限公司 | Method for sending information and terminal |
| WO2015109535A1 (en)* | 2014-01-24 | 2015-07-30 | 华为技术有限公司 | Service data transmission method and apparatus |
| CN105144797B (en)* | 2014-01-24 | 2019-12-24 | 华为技术有限公司 | Service data transmission method and device |
| CN105144797A (en)* | 2014-01-24 | 2015-12-09 | 华为技术有限公司 | Service data transmission method and apparatus |
| CN104519064A (en)* | 2014-12-22 | 2015-04-15 | 厦门为那通信科技有限公司 | Online link maintaining method in communication |
| CN104519064B (en)* | 2014-12-22 | 2018-09-25 | 厦门广控物联科技有限公司 | A method of realizing that communication link is kept online |
| CN105554906A (en)* | 2015-12-10 | 2016-05-04 | 希姆通信息技术(上海)有限公司 | Method and system for improving data sending speed after terminal wakeup in wireless network |
| WO2017128185A1 (en)* | 2016-01-28 | 2017-08-03 | 华为技术有限公司 | Method and terminal for controlling service connection |
| CN108141901A (en)* | 2016-01-28 | 2018-06-08 | 华为技术有限公司 | The method and terminal of control service connection |
| CN105657860B (en)* | 2016-01-29 | 2019-09-10 | 珠海市魅族科技有限公司 | A kind of method and device improving data service response speed |
| CN105657860A (en)* | 2016-01-29 | 2016-06-08 | 珠海市魅族科技有限公司 | Method and device for improving data service response speed |
| CN106793172A (en)* | 2016-12-22 | 2017-05-31 | 努比亚技术有限公司 | A kind of message obtains terminal and method |
| CN106817751A (en)* | 2016-12-27 | 2017-06-09 | 广东欧珀移动通信有限公司 | A kind of data transmission method for uplink and mobile terminal |
| US11153825B2 (en) | 2017-08-18 | 2021-10-19 | Huawei Technologies Co., Ltd. | Power consumption control method and apparatus |
| WO2019034001A1 (en)* | 2017-08-18 | 2019-02-21 | 华为技术有限公司 | Power consumption control method and apparatus |
| CN107508916A (en)* | 2017-09-27 | 2017-12-22 | 深圳狗尾草智能科技有限公司 | Server link management method for intelligent robot |
| CN107508916B (en)* | 2017-09-27 | 2021-02-26 | 苏州狗尾草智能科技有限公司 | Server link management method for intelligent robot |
| CN111295701A (en)* | 2017-11-10 | 2020-06-16 | Nec显示器解决方案株式会社 | Method of controlling image and image display apparatus |
| CN111295701B (en)* | 2017-11-10 | 2022-12-20 | 夏普Nec显示器解决方案株式会社 | Method of controlling image and image display apparatus |
| US11373571B2 (en) | 2017-11-10 | 2022-06-28 | Sharp Nec Display Solutions, Ltd. | Method for controlling image and image display device |
| CN110162161A (en)* | 2019-04-17 | 2019-08-23 | 努比亚技术有限公司 | Control method, wearable device and the computer readable storage medium of target application |
| CN110121173A (en)* | 2019-05-10 | 2019-08-13 | 南京硅基智能科技有限公司 | A method of the virtual mobile phone based on cloud remains online |
| CN110557301A (en)* | 2019-08-23 | 2019-12-10 | 福建科立讯通信有限公司 | Method for realizing server-side heartbeat detection mechanism for reducing power consumption |
| CN111669624A (en)* | 2020-05-08 | 2020-09-15 | 广州微算互联信息技术有限公司 | Cloud mobile phone control method and system |
| CN112532264A (en)* | 2020-11-27 | 2021-03-19 | 石家庄市善理通益科技有限公司 | Power consumption optimization method of talkback terminal and execution device thereof |
| CN112511536A (en)* | 2020-11-27 | 2021-03-16 | 北京经纬恒润科技股份有限公司 | Communication method and communication system |
| CN116697611A (en)* | 2022-02-25 | 2023-09-05 | 芜湖美的厨卫电器制造有限公司 | Water heater system, control method and control device, readable storage medium |
| Publication | Publication Date | Title |
|---|---|---|
| CN103079285A (en) | Mobile terminal and method for maintaining point-to-point connection | |
| US10548087B2 (en) | Techniques for managing idle state activity in mobile devices | |
| CN103874035B (en) | A kind of Mobile terminal message push method and equipment | |
| CN102395119B (en) | A method, system and device for supporting application clients to be permanently online | |
| EP2596673B1 (en) | User device dormancy | |
| KR102191174B1 (en) | Method and apparatus for setting up/releasing radio resource control connection between evolved node b base station and user equipment in communication system | |
| CN103312766B (en) | A kind of method, system and device supporting applications client forever online | |
| WO2013097452A1 (en) | Method for receiving data, method for transmitting data, mobile terminal, and server | |
| CN104813637A (en) | Push service without persistent TCP connection in mobile network | |
| CN103200653A (en) | Method and device for discontinuous reception | |
| CN103916936B (en) | Realize method, system and mobile terminal, the server of data connection long | |
| CN102957623B (en) | A kind of maintaining method of neighborhood of border gate protocol and equipment | |
| WO2013167068A2 (en) | Method and device for reducing power consumption of terminal | |
| WO2015154462A1 (en) | Method and device for managing instant communication application program, and mobile terminal thereof | |
| CN107484232A (en) | Message method, system, the network equipment and readable storage medium storing program for executing | |
| WO2017107339A1 (en) | Method for waking network telephone | |
| JP2009182956A (en) | Network connection control method and terminal | |
| CN103888933A (en) | Information transmission method and system based on terminal power, and related device | |
| CN105101364A (en) | Method and terminal for activating fast dormancy | |
| WO2012027888A1 (en) | Method and system for inhibiting signaling storm | |
| CN104363579A (en) | Online application implementing method and device | |
| CN104066159A (en) | Mobile terminal sleep awakening method | |
| CN102340430A (en) | Connection management method and system of personal area network equipment | |
| EP3560272B1 (en) | Methods, wireless device, network node and core node for managing reachability of the wireless device | |
| CN117793173A (en) | A terminal wake-up processing method, device, equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into 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:20130501 |