WO2016065552A1 - 一种心跳周期的设置方法及终端 - Google Patents

一种心跳周期的设置方法及终端 Download PDF

Info

Publication number
WO2016065552A1
WO2016065552A1 PCT/CN2014/089787 CN2014089787W WO2016065552A1 WO 2016065552 A1 WO2016065552 A1 WO 2016065552A1 CN 2014089787 W CN2014089787 W CN 2014089787W WO 2016065552 A1 WO2016065552 A1 WO 2016065552A1
Authority
WO
WIPO (PCT)
Prior art keywords
heartbeat
test
period
application
applications
Prior art date
Application number
PCT/CN2014/089787
Other languages
English (en)
French (fr)
Inventor
邓宇
李启林
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201480083019.5A priority Critical patent/CN107078925B/zh
Priority to US15/523,259 priority patent/US10355963B2/en
Priority to PCT/CN2014/089787 priority patent/WO2016065552A1/zh
Priority to EP14905112.0A priority patent/EP3197098B1/en
Publication of WO2016065552A1 publication Critical patent/WO2016065552A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Definitions

  • the invention belongs to the technical field of communications, and in particular relates to a method for setting a heartbeat cycle.
  • an application installed on a terminal establishes a long connection with a remote application server through a network. If the long connection does not have data communication for a certain period of time, the core network will disconnect the long connection. Therefore, the application needs to maintain a long connection with the application server through the heartbeat mechanism.
  • the so-called heartbeat mechanism that is, the transmission of heartbeat packets between the terminal and the server, periodically ensures that the long connection is normal. For example, the terminal sends a heartbeat packet to the server every other time interval. If the server responds to the heartbeat packet within a certain time, the connection between the terminal and the server is normal; if the server does not respond to the heartbeat packet within a certain time, The connection between the terminal and the server is disconnected. After the disconnection is known, remedial measures such as fault detection and reconnection can be taken.
  • the heartbeat service can also be implemented by using a server to actively send a heartbeat packet to the terminal, or by other means.
  • Heartbeat cycle setting Too small the heartbeat service is frequent, and the energy and signaling consumption is large. If the heartbeat period is set too large, the heartbeat period threshold of the application server or the core network may be exceeded, causing the connection to be disconnected and the heartbeat service to be interrupted.
  • the embodiment of the invention provides a method for setting a heartbeat period, and sets an identical heartbeat period for an application on the terminal.
  • an embodiment of the present invention provides a method for setting a heartbeat period, including:
  • the heartbeat period of the multiple applications is set to T1, and the heartbeat service is performed;
  • the T1 is a minimum heartbeat period of the preset heartbeat period of the test application and the multiple applications.
  • Performing the second heartbeat test includes: if the first heartbeat test passes, setting a heartbeat period of the plurality of applications to T2, performing a first overall heartbeat test, and if the first overall heartbeat test passes, The heartbeat period of the test application is set to T3, and the second heart is performed. Jump test.
  • the heartbeat period of the multiple applications is set to T1, and the heartbeat is performed. business.
  • performing the third heartbeat test includes: if the second heartbeat test passes, setting a heartbeat period of the plurality of applications to T3, performing a second overall heartbeat test, if the second overall heartbeat test passes Then, the heartbeat period of the test application is set to T4, and the third heartbeat test is performed.
  • the heartbeat period of the multiple applications is set to T2, and the heartbeat is performed. business.
  • T2 T1+ ⁇ t
  • T3 T2+ ⁇ t
  • T4 T3+ ⁇ t
  • t is a time constant
  • the first heartbeat test includes: the terminal is in a period of T2, and the test application server is periodically The heartbeat message is sent to the test application server to test whether the test application server normally responds to the heartbeat message.
  • the first overall heartbeat test includes: the terminal periodically, to the multiple application servers, in a period of T2 Sending a heartbeat message to test whether the plurality of application servers normally respond to the heartbeat message.
  • the method further includes: recording a heartbeat period of the plurality of applications set in the current network.
  • an embodiment of the present invention provides a terminal, including:
  • a first test unit configured to set a heartbeat period of the test application to T2, and perform a first heartbeat test
  • a first heartbeat service unit configured to: if the first heartbeat test fails, set a heartbeat period of the multiple applications to T1, and perform a heartbeat service;
  • a second test unit configured to: if the first heartbeat test passes, set a heartbeat period of the test application to T3, and perform a second heartbeat test;
  • a second heartbeat service unit configured to: if the second heartbeat test fails, set a heartbeat period of the multiple applications to T2, and perform a heartbeat service;
  • a third test unit configured to: if the second heartbeat test passes, set a heartbeat period of the test application to T4, and perform a third heartbeat test;
  • the T1 is a minimum heartbeat period of the preset heartbeat period of the test application and the multiple applications.
  • the terminal further includes: a first all test unit, configured to: if the first heartbeat test passes, And setting a heartbeat period of the plurality of applications to T2, performing a first overall heartbeat test; the second testing unit is further configured to: if the first whole heartbeat test passes, setting a heartbeat period of the test application For T3, a second heartbeat test is performed.
  • a first all test unit configured to: if the first heartbeat test passes, And setting a heartbeat period of the plurality of applications to T2, performing a first overall heartbeat test
  • the second testing unit is further configured to: if the first whole heartbeat test passes, setting a heartbeat period of the test application For T3, a second heartbeat test is performed.
  • the first heartbeat service unit is further configured to: if the first heartbeat test fails, The heartbeat period of the plurality of applications is set to T1, and the heartbeat service is performed.
  • the terminal further includes:
  • a second whole test unit configured to pass the second heartbeat test, set a heartbeat period of the plurality of applications to T3, and perform a second overall heartbeat test;
  • the third test unit is further configured to: if the second whole heartbeat test passes, set a heartbeat period of the test application to T4, and perform a third heartbeat test.
  • the second heartbeat service unit is further configured to: if the second total heartbeat test fails, The heartbeat period of the application is set to T2 to perform heartbeat services.
  • T2 T1+ ⁇ t
  • T3 T2+ ⁇ t
  • T4 T3+ ⁇ t
  • t is a time constant.
  • the first heartbeat test includes: periodically reporting to the application server in a period of T2 Sending a heartbeat message to test whether the test application server normally responds to the heartbeat message.
  • the first total heartbeat test includes: periodically transmitting to multiple application servers in a cycle of T2 A heartbeat message is sent to test whether the plurality of application servers normally respond to the heartbeat message.
  • the terminal further includes:
  • a recording unit for recording a heartbeat period of a plurality of applications set in the current network For recording a heartbeat period of a plurality of applications set in the current network.
  • an embodiment of the present invention further provides another terminal, including: a memory and a processor, where the program stores program code, and the processor is configured to process the program code to perform the following operations:
  • the heartbeat period of the multiple applications is set to T1, and the heartbeat service is performed;
  • the method for setting a heartbeat period and the terminal provided by the embodiment of the present invention, by gradually extending the test heartbeat period to test the heartbeat period threshold value, under the premise of ensuring the normal operation of the heartbeat service, selecting and setting a large heartbeat period, so that each The application performs the heartbeat service at the same time in the same heartbeat cycle, thereby effectively reducing the power consumption and signaling overhead of the terminal, and reducing the load of the application server.
  • FIG. 1 is a schematic diagram of a network architecture of a heartbeat service according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for setting a heartbeat period according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart diagram of another method for setting a heartbeat period according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart diagram of another method for setting a heartbeat period according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a mobile terminal according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of another mobile terminal according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of another mobile terminal according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of another mobile terminal according to an embodiment of the present invention.
  • the terminal described in the embodiment of the present invention includes, but is not limited to, a terminal device such as a mobile phone, a tablet computer or a palmtop computer.
  • a terminal device such as a mobile phone, a tablet computer or a palmtop computer.
  • the method and apparatus of the embodiments of the present invention can be applied to any smart terminal device that can run an application.
  • the maximum threshold of the heartbeat period applied by the terminal is determined by the routing area of the current network. Different routing areas may have different maximum thresholds, and the terminal cannot know the maximum threshold of the current routing area. Therefore, when the terminal switches from one routing area to another, the following steps can be triggered to set the same heartbeat period of multiple applications.
  • the method for setting a heartbeat period includes the following steps:
  • Step 101 Set a heartbeat period of the test application to T2, and perform a first heartbeat test.
  • Step 102 If the first heartbeat test fails, set a heartbeat period of multiple applications to T1, and perform a heartbeat service.
  • Step 103 If the first heartbeat test passes, set a heartbeat period of the test application to T3, and perform a second heartbeat test.
  • Step 104 If the second heartbeat test fails, set a heartbeat period of multiple applications to T2, and perform a heartbeat service.
  • Step 105 If the second heartbeat test passes, set a heartbeat period of the test application to T4, and perform a third heartbeat test;
  • T1, T2, T3, and T4 are heartbeat period values of any size relationship, such as 30s, 60s, and so on.
  • T1, T2, T3, and T4 may be preset heartbeat periods of applications on the terminal, or other heartbeat period values that are randomly selected by the terminal or selected by other mechanisms.
  • the heartbeat period such as T5, T6...Tn greater than T4 may be further tested until the nth heartbeat test with Tn as the heartbeat period fails, and Tn-1 is selected and set.
  • the heartbeat service is performed for the heartbeat cycle of multiple applications.
  • Each application on the terminal originally has a different preset heartbeat period and a heartbeat starting point. Through the heartbeat test, the test application confirms that a heartbeat period is safe relative to the maximum threshold of the current core network. Therefore, after the heartbeat period is determined, each application on the terminal can perform heartbeat with the same heartbeat period at the same time. business.
  • the heartbeat test described in all the embodiments of the present invention may specifically include: the baseband processor periodically sends a heartbeat message to the application server corresponding to the application in a specific period. Test whether the application server responds normally to the heartbeat message. The test can last for one or more cycles. The so-called "normal response" refers to whether the application server returns a heartbeat response message to the terminal within a specified time. Those skilled in the art can know that there is a certain redundancy for determining whether the heartbeat message is normally responded to. And fault tolerance.
  • test application in the embodiment of the present invention may be one of multiple applications installed on the terminal, or may be a simulation application specifically used to test the heartbeat period threshold of the network, and the application is not implemented. Substantial business, thus testing a large heartbeat cycle, The network connection of the test application is disconnected, and when the heartbeat service is interrupted, there is no impact on the physical service on the terminal.
  • the "multiple applications" in all the embodiments of the present invention may be an application that needs to perform a heartbeat service on the terminal, or an application that needs to perform a heartbeat service on the terminal, which is not limited by the present invention.
  • the test heartbeat period is gradually extended to test the heartbeat period threshold of the network, and a large heartbeat period is selected and set under the premise of ensuring the normal operation of the heartbeat service, so that Each application performs heartbeat services in the same heartbeat cycle at the same time, thereby effectively reducing terminal power consumption and signaling overhead, and reducing the load of the application server.
  • an embodiment of the present invention further provides another method for setting a heartbeat period.
  • the terminal generally includes an application processor and a baseband processor, the application processor runs an operating system and various applications on the terminal; the baseband processor is responsible for communication functions of the terminal, and provides link layer and physical layer support for communication of the terminal.
  • the embodiment of the present invention uses the baseband processor to proxy the heartbeat service of the application running by the application processor, thereby uniformly maintaining the connection between the application and the network side server without waking up the application processor.
  • the embodiments of the present invention can also be applied to other situations in which the baseband processor proxy applies the heartbeat service, for example, the application processor controls the heartbeat service of the application.
  • the baseband processor is responsible for the heartbeat service of multiple applications.
  • Each application has a preset heartbeat period, which may be specified by the application server or by the application itself, which is not limited by the present invention.
  • the baseband processor tries to extend the heartbeat period of the test application and other applications to test the maximum tolerance of the network to the heartbeat period of the application. If a heartbeat service test fails, the baseband processor will test the previous heartbeat service.
  • the heartbeat period passed by the test is set to the heartbeat period of multiple applications, and the heartbeat service is performed. Referring to FIG. 3, the embodiment may specifically include the following steps:
  • Step 201 Perform heartbeat services by using all applications of the terminal with T1 as a heartbeat period.
  • T1 is a small heartbeat period, which can be the smallest heartbeat period in all applications, or a heartbeat period smaller than the minimum heartbeat period.
  • Step 202 If an application heartbeat service does not receive a response from the application server, the application is not considered in the subsequent heartbeat cycle test. Since T1 is small enough, the application's heartbeat service should be able to operate normally if the application server is normal. Therefore, by implementing this step, the application of the application server may be removed or the service is interrupted, and the accuracy of the subsequent heartbeat cycle test is improved.
  • Step 203 Set a heartbeat period of the test application to T2, and perform a first heartbeat test.
  • the test application may be one of a plurality of applications installed on the terminal.
  • the test application may be an application with a minimum preset heartbeat period.
  • T1 may be a preset heartbeat period of the test application; the test application may also be a dedicated application.
  • the simulation application of testing the heartbeat period threshold of the network the application does not implement any substantial service, and thus tests a large heartbeat period, for example, when testing T2, if the network connection of the test application is disconnected, the heartbeat service is interrupted. At the time, there will be no impact on the physical business on the terminal.
  • Step 204 If the first heartbeat test fails, set a heartbeat period of multiple applications to T1, and perform a heartbeat service.
  • the terminal or the baseband processor When the application server cannot respond to the heartbeat message of the test application, the terminal or the baseband processor considers that the first heartbeat test fails. This means that T2 may exceed the heartbeat period threshold of the current core network or routing area. The network does not allow the test application to use T2 as the heartbeat period for heartbeat services, and the connection between the terminal and the application server is disconnected. Therefore, T1 smaller than T2 is set as the heartbeat period of a plurality of applications, the heartbeat service is performed, and the test is ended.
  • Step 205 If the first heartbeat test passes, set the heartbeat period of the test application to T3, and perform a second heartbeat test.
  • the terminal may set a maximum period value Tmax of the test.
  • Tmax the test heartbeat period of the test.
  • the heartbeat test is performed using the test application.
  • other applications should also use Tn as the heartbeat period when the test application passes the heartbeat test with Tn as the heartbeat period. Pass the heartbeat test.
  • a particular application server may also have limitations on the heartbeat period of a particular application. A situation that may occur at this time is that although the heartbeat period Tn passed by the tested application test is lower than the heartbeat period threshold of the core network or the router, it exceeds the maximum heartbeat period specified by a specific application server, which will Causes the particular application server to disconnect from the particular application and interrupt the heartbeat service. Therefore, the embodiment of the present invention may include the steps of other applications participating in the heartbeat test. Referring to FIG. 4, the embodiment may include the following steps:
  • Step 301 Set a heartbeat period of the test application to T2, and perform a first heartbeat test.
  • Step 302 If the first heartbeat test fails, set a heartbeat period of multiple applications to T1, and perform a heartbeat service.
  • Step 303 If the first heartbeat test passes, set a heartbeat period of multiple applications to T2, and perform a first overall heartbeat test.
  • Step 304 If the first heartbeat test fails, set a heartbeat period of multiple applications to T1, and perform a heartbeat service.
  • Step 305 If the first heartbeat test passes, set a heartbeat period of the test application to T3, and perform a second heartbeat test.
  • Step 306 If the second heartbeat test fails, set a heartbeat period of multiple applications to T2, and perform a heartbeat service.
  • Step 307 If the second heartbeat test passes, set a heartbeat period of multiple applications to T2, and perform a second overall heartbeat test.
  • Step 308 If the second heartbeat test fails, set a heartbeat period of multiple applications to T2, and perform a heartbeat service.
  • Step 309 If the second whole heartbeat test passes, set the heartbeat period of the test application to T3, and perform a third heartbeat test.
  • the overall heartbeat test described in the embodiment of the present invention includes the first and second whole heartbeat tests, and specifically may be multiple application servers corresponding to multiple applications installed and executed by the baseband processor to the terminal in a certain test period.
  • Heartbeat packets are sent periodically to test whether all application servers respond to heartbeat packets. The test can last for one or more cycles. If any heartbeat packet fails to respond normally, it indicates that an application cannot use the heartbeat period of the test to maintain the heartbeat service, and the test result is not passed. Multiple applications in the overall heartbeat test may or may not include a test application.
  • the third heartbeat test passes, the third overall heartbeat test can be continued. Until the nth heartbeat test or the first heartbeat test fails, the heartbeat period passed by the test in the n-1th heartbeat test is set to be a heartbeat period of a plurality of applications, the heartbeat service is performed, and the test is ended.
  • the heartbeat test is performed on the test application, and then the whole heartbeat test of multiple applications is performed, which not only improves the accuracy and security of setting the same heartbeat cycle for multiple applications, but also avoids directly performing the whole
  • the heartbeat test can cause a large area of heartbeat business interruption.
  • the terminal may also record in the current core network or route in time.
  • the heartbeat period of multiple applications set by the zone.
  • the heartbeat period can be directly used, and the heartbeat period of multiple applications does not need to be tested.
  • an embodiment of the present invention further provides a terminal, including:
  • a first testing unit 41 configured to set a heartbeat period of the test application to T2, and perform a first heartbeat test
  • the first heartbeat service unit 42 is configured to: if the first heartbeat test fails, set a heartbeat period of the multiple applications to T1, and perform a heartbeat service;
  • the second testing unit 43 is configured to: if the first heartbeat test passes, set a heartbeat period of the test application to T3, and perform a second heartbeat test;
  • the second heartbeat service unit 44 is configured to: if the second heartbeat test fails, set a heartbeat period of the multiple applications to T2, and perform a heartbeat service;
  • the third testing unit 45 is configured to: if the second heartbeat test passes, set a heartbeat period of the test application to T4, and perform a third heartbeat test;
  • T1, T2, T3, and T4 are heartbeat period values of any size relationship, such as 30s, 60s, and so on.
  • T1, T2, T3, and T4 may be preset heartbeat periods of applications on the terminal, or other heartbeat period values that are randomly selected by the terminal or selected by other mechanisms.
  • the heartbeat period such as T5, T6...Tn greater than T4 may be further tested until the nth heartbeat test with Tn as the heartbeat period fails, and Tn-1 is selected and set.
  • the heartbeat service is performed for the heartbeat cycle of multiple applications.
  • Each application on the terminal originally has a different preset heartbeat period and a heartbeat starting point.
  • the test application confirms that a heartbeat period is safe relative to the maximum threshold of the current core network, so after the heartbeat period is determined, each application on the terminal can be at the same time.
  • the heartbeat business is performed with the same heartbeat cycle.
  • Each application on the terminal originally has a different preset heartbeat period and a heartbeat starting point. Through the heartbeat test, the test application confirms that a heartbeat period is safe relative to the maximum threshold of the current core network. Therefore, after the heartbeat period is determined, each application on the terminal can perform heartbeat with the same heartbeat period at the same time. business.
  • the test heartbeat period is gradually extended to test the heartbeat period threshold of the network, and a large heartbeat period is selected and set under the premise of ensuring the normal operation of the heartbeat service, so that Each application performs heartbeat services in the same heartbeat cycle at the same time, thereby effectively reducing terminal power consumption and signaling overhead, and reducing the load of the application server.
  • T1 is the minimum heartbeat period of the test application and the preset heartbeat period of the multiple applications.
  • the terminal may set a maximum period value Tmax of the test.
  • Tmax the test heartbeat period of the test.
  • the heartbeat test is performed using the test application.
  • other applications should also use Tn as the heartbeat period when the test application passes the heartbeat test with Tn as the heartbeat period. Pass the heartbeat test.
  • a particular application server may also have limitations on the heartbeat period of a particular application. A situation that may occur at this time is that although the heartbeat period Tn passed by the tested application test is lower than the heartbeat period threshold of the core network or the router, it exceeds the maximum heartbeat period specified by a specific application server, which will Causes the particular application server to disconnect from the particular application and interrupt the heartbeat service. Therefore, optionally, referring to FIG. 6, the terminal in the embodiment of the present invention further includes:
  • a first whole test unit 46 configured to: if the first heartbeat test passes, the plurality of The heartbeat period used is set to T2, and the first whole heartbeat test is performed;
  • the second testing unit 43 is further configured to perform a second heartbeat test by setting a heartbeat period of the test application to T3 if the first heartbeat test passes.
  • the first heartbeat service unit 42 is further configured to perform a heartbeat service by setting a heartbeat period of the plurality of applications to T1 if the first heartbeat test fails.
  • a second whole test unit 47 configured to pass the second heartbeat test, set a heartbeat period of the plurality of applications to T3, and perform a second overall heartbeat test;
  • the third test unit 45 is further configured to perform a third heartbeat test by setting a heartbeat period of the test application to T4 if the second whole heartbeat test passes.
  • the second heartbeat service unit 44 is further configured to perform a heartbeat service by setting a heartbeat period of the plurality of applications to T2 if the second heartbeat test fails.
  • the overall heartbeat test described in the embodiment of the present invention includes the first and second whole heartbeat tests, and specifically may be multiple application servers corresponding to multiple applications installed and executed by the baseband processor to the terminal in a certain test period.
  • Heartbeat packets are sent periodically to test whether all application servers respond to heartbeat packets. The test can last for one or more cycles. If any heartbeat packet fails to respond normally, it indicates that an application cannot use the heartbeat period of the test to maintain the heartbeat service, and the test result is not passed. Multiple applications in the overall heartbeat test may or may not include a test application.
  • the heartbeat test is performed on the test application, and then the whole heartbeat test of multiple applications is performed, which not only improves the accuracy and security of setting the same heartbeat cycle for multiple applications, but also avoids directly performing the whole
  • the heartbeat test can cause a large area of heartbeat business interruption.
  • the terminal may further include: a recording unit, configured to record a heartbeat period of the plurality of applications set in the current network, thereby timely recording a heartbeat period of the plurality of applications set in the current core network or the routing area.
  • a recording unit configured to record a heartbeat period of the plurality of applications set in the current network, thereby timely recording a heartbeat period of the plurality of applications set in the current core network or the routing area.
  • each unit in the embodiment of the present invention is only divided into one logical function, and may be further divided in actual implementation, and each unit may be integrated in one processing unit (such as a baseband processor). It may be that each unit physically exists alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units, which is not limited by the present invention.
  • the embodiment of the present invention further provides another terminal, including: a memory 52 and a processor 51.
  • the memory 52 stores program code
  • the processor 51 is configured to process the program code to perform the following operations:
  • the heartbeat period of the multiple applications is set to T1, and the heartbeat service is performed;
  • the heartbeat period of the multiple applications is set to T2, and the heartbeat service is performed;
  • the memory 52 in the embodiment of the present invention may be a dedicated memory, or may be a comparison.
  • a part of the storage space in the mass storage device may also be an external storage connected to the core network management entity, such as a Security Digital (SD) card.
  • SD Security Digital
  • the present invention can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is a better implementation. the way.
  • the technical solution of the present invention which is essential or contributes to the prior art, can be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk, etc. includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention.

Abstract

本发明实施例公开了一种心跳周期的设置方法,包括:将测试应用的心跳周期设置为T2,进行第一心跳测试;若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;其中,T1<T2<T3<T4。本发明实施例还公开了相应的移动终端。通过应用本发明的心跳周期的设置方法和终端,使得各个应用以相同的心跳周期,在同一时刻进行心跳业务,从而有效地降低了终端能耗和信令开销,还能够减少应用服务器的负载。

Description

一种心跳周期的设置方法及终端 技术领域
本发明属于通信技术领域,尤其涉及一种心跳周期的设置方法。
背景技术
参照图1,终端上安装的应用与远端的应用服务器通过网络建立长连接。若该长连接在一定时间内没有数据通信,则核心网将断开该长连接。因此应用需要通过心跳机制保持与应用服务器的长连接。所谓的心跳机制,即终端与服务器之间,周期性地进行心跳包的传输,以确保长连接的正常。譬如,终端每隔一个时间间隔即发送一个心跳包给服务器,如果服务器在特定时间内响应心跳包,则说明终端与服务器之间的连接正常;如果服务器在特定时间内未响应心跳包,则说明终端与服务器之间的连接断开,在获知断线后,即可以采取故障检测和重连等补救措施。心跳业务也可以采用服务器主动向终端发送心跳包的方式,或者其他方式实现。
应用一般拥有一个预设心跳周期,以满足当前应用业务的需要。终端上的应用若具有不同的心跳起始点和周期,则终端需要在不同时间点,多次唤醒终端的modem与基站建立无线资源控制协议(Radio Resource Control,RRC)连接,并分别发送单个心跳包到各个应用服务器,这会造成较大的能量损耗和信令浪费。
若所有应用采用相同的心跳周期进行心跳业务,则可以通过一个RRC连接发送多个心跳包,从而有效地降低能量损耗和信令的浪费。然而如何确定一个合适的心跳周期是一个亟待解决的问题。心跳周期设置 得太小,则心跳业务频繁,能量和信令的消耗较大;心跳周期设置得太大,则可能超过应用服务器或核心网的心跳周期门限值,导致连接断开,心跳业务中断。
发明内容
本发明实施例提供了一种心跳周期的设置方法,给终端上的应用设置一个相同的心跳周期。
第一方面,本发明实施例提供了一种心跳周期的设置方法,包括:
将测试应用的心跳周期设置为T2,进行第一心跳测试;
若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;
若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;
若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;
其中,T1<T2<T3<T4。
在第一方面的第一种可能的实现方式中,所述T1为所述测试应用和所述多个应用的预设心跳周期中最小的心跳周期。
结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述若所述第一心跳测试通过则将所述测试应用的心跳周期设置为T3,进行第二心跳测试包括:若所述第一心跳测试通过,则将所述多个应用的心跳周期设置为T2,进行第一全体心跳测试,若所述第一全体心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心 跳测试。
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,若所述第一全体心跳测试不通过,则将所述多个应用的心跳周期设置为T1,进行心跳业务。
结合第一方面或第一方面的第一种至第三种可能的实现方式,在第四种可能的实现方式中,所述若所述第二心跳测试通过则将所述测试应用的心跳周期设置为T4,进行第三心跳测试包括:若所述第二心跳测试通过,则将所述多个应用的心跳周期设置为T3,进行第二全体心跳测试,若所述第二全体心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试。
结合第一方面的第四种可能的实现方式,在第五种可能的实现方式中,若所述第二全体心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务。
结合第一方面或第一方面的第一种至第五种可能的实现方式,在第六种可能的实现方式中,T2=T1+△t;T3=T2+△t;T4=T3+△t;△t为一个时间常量。
结合第一方面或第一方面的第一种至第六种可能的实现方式,在第七种可能的实现方式中,所述第一心跳测试包括:终端以T2为周期,向测试应用服务器周期性地发送心跳报文,测试所述测试应用服务器是否正常响应所述心跳报文。
结合第一方面的第二种至第七种可能的实现方式,在第八种可能的实现方式中,所述第一全体心跳测试包括:终端以T2为周期,向多个应用服务器周期性地发送心跳报文,测试所述多个应用服务器是否正常响应所述心跳报文。
结合第一方面或第一方面的第一种至第八种可能的实现方式,在第九 种可能的实现方式中,所述方法还包括:记录在当前网络设置的多个应用的心跳周期。
第二方面,本发明实施例提供了一种终端,包括:
第一测试单元,用于将测试应用的心跳周期设置为T2,进行第一心跳测试;
第一心跳业务单元,用于若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
第二测试单元,用于若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;
第二心跳业务单元,用于若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;
第三测试单元,用于若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;
其中,T1<T2<T3<T4。
在第二方面的第一种可能的实现方式中,所述T1为所述测试应用和所述多个应用的预设心跳周期中最小的心跳周期。
结合第二方面或第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述终端还包括:第一全体测试单元,用于若所述第一心跳测试通过,则将所述多个应用的心跳周期设置为T2,进行第一全体心跳测试;所述第二测试单元还用于若所述第一全体心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试。
结合第二方面或第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述第一心跳业务单元还用于若所述第一全体心跳测试不通过,则将所述多个应用的心跳周期设置为T1,进行心跳业务。
结合第二方面或第二方面的第一种至第三种可能的实现方式,在第四 种可能的实现方式中,所述终端还包括:
第二全体测试单元,用于所述第二心跳测试通过,则将所述多个应用的心跳周期设置为T3,进行第二全体心跳测试;
所述第三测试单元还用于若所述第二全体心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试。
结合第二方面的第四种可能的实现方式,在第五种可能的实现方式中,所述第二心跳业务单元还用于若所述第二全体心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务。
结合第二方面或第二方面的第一种至第五种可能的实现方式,在第六种可能的实现方式中,T2=T1+△t;T3=T2+△t;T4=T3+△t;△t为一个时间常量。
结合第二方面或第二方面的第一种至第六种可能的实现方式,在第七种可能的实现方式中,所述第一心跳测试包括:以T2为周期,向测试应用服务器周期性地发送心跳报文,测试所述测试应用服务器是否正常响应所述心跳报文。
结合第二方面的第二种至第七种可能的实现方式,在第八种可能的实现方式中,所述第一全体心跳测试包括:以T2为周期,向多个应用服务器周期性地发送心跳报文,测试所述多个应用服务器是否正常响应所述心跳报文。
结合第二方面或第二方面的第一种至第八种可能的实现方式,在第九种可能的实现方式中,所述终端还包括:
记录单元,用于记录在当前网络设置的多个应用的心跳周期。
第三方面,本发明实施例还提供了另一种终端,包括:存储器和处理器,所述存储器中存储有程序代码,所述处理器用于处理所述程序代码从而执行以下操作:
将测试应用的心跳周期设置为T2,进行第一心跳测试;
若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;
若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;
若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;
其中,T1<T2<T3<T4。
本发明实施例提供的心跳周期的设置方法及终端,通过逐渐延长测试心跳周期来试探的心跳周期门限值,在保障心跳业务正常进行的前提下,选取并设置一个大的心跳周期,使得各个应用以相同的心跳周期,在同一时刻进行心跳业务,从而有效地降低了终端能耗和信令开销,还能够减少应用服务器的负载。
附图说明
图1为本发明实施例公开的一种心跳业务的网络架构示意图;
图2为本发明实施例公开的一种心跳周期的设置方法的流程示意图;
图3为本发明实施例公开的另一种心跳周期的设置方法的流程示意图;
图4为本发明实施例公开的另一种心跳周期的设置方法的流程示意图;
图5为本发明实施例公开的一种移动终端的结构示意图;
图6为本发明实施例公开的另一种移动终端的结构示意图;
图7为本发明实施例公开的另一种移动终端的结构示意图;
图8为本发明实施例公开的另一种移动终端的结构示意图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面结合附图对本发明具体实施例作进一步的详细描述。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
首先,需要说明的是在本发明实施例当中描述的终端包括但不限于手机、平板电脑或掌上电脑等终端设备。本领域技术人员可以知道,凡是可以运行应用程序的智能终端设备,均可以应用本发明实施例的方法和装置。
终端在通过基站接入当前网络的路由区后,其应用的心跳周期的最大门限值由当前网络的路由区决定。不同的路由区可能具有不同的最大门限值,而终端无法得知当前路由区的最大门限值。因此当终端从一个路由区切换到另一个路由区时,可以触发下述的步骤,设置一个多个应用的相同的心跳周期。
如图2所示,本发明实施例提供的心跳周期的设置方法包括以下步骤:
步骤101、将测试应用的心跳周期设置为T2,进行第一心跳测试;
步骤102、若该第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
步骤103、若该第一心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第二心跳测试;
步骤104、若该第二心跳测试不通过,则将多个应用的心跳周期设置为T2,进行心跳业务;
步骤105、若该第二心跳测试通过,则将该测试应用的心跳周期设置为T4,进行第三心跳测试;
其中,T1<T2<T3<T4。
T1,T2,T3,T4为任意具有大小关系的心跳周期值,如30s,60s等。譬如T1,T2,T3,T4可以是终端上的应用的预设心跳周期,也可以是终端随机或通过其他机制选择的其他心跳周期值。
可选的,若第三心跳测试通过,则可以进一步测试比T4更大的T5、T6…Tn等心跳周期,直至以Tn为心跳周期的第n心跳测试不通过,则选择并设置Tn-1为多个应用的心跳周期,进行心跳业务。
终端上的各个应用原本具有不同的预设心跳周期和心跳起点。通过心跳测试,测试应用确认某个心跳周期相对于当前核心网的最大门限值是安全的,因此在该心跳周期确定后,终端上的各个应用可以在同一时间,以相同的心跳周期进行心跳业务。
需要说明的是,本发明所有实施例中描述的心跳测试,包括上述的第一心跳测试,具体可以包括:基带处理器以某个特定周期,向应用对应的应用服务器周期性地发送心跳报文,测试该应用服务器是否正常响应该心跳报文。测试可以持续一个或多个周期。所谓的“正常响应”,指的是应用服务器是否在指定时间内向终端返回一个心跳响应报文,本领域技术人员可以知道,对于是否正常响应该心跳报文的判断,还可以存在一定的冗余和容错。
还需要说明的是,本发明实施例中的测试应用可以是终端上安装的多个应用中的一个;也可以是一个专门用来测试网络的心跳周期门限值的模拟应用,该应用不实现实质的业务,因而在测试较大的心跳周期, 导致该测试应用的网络连接断开,心跳业务中断时,不会对终端上的实质业务产生任何影响。本发明所有实施例中的“多个应用”,可以是终端上所有需要执行心跳业务的应用,也可以是终端上一部分需要执行心跳业务的应用,本发明对此不作限制。
通过本发明实施例的应用,在一个测试应用上,逐渐延长测试心跳周期来试探网络的心跳周期门限值,在保障心跳业务正常进行的前提下,选取并设置一个较大的心跳周期,使得各个应用在同一时刻以相同的心跳周期进行心跳业务,从而有效地降低了终端能耗和信令开销,还减少了应用服务器的负载。
参照图3,本发明实施例还提供了另一种心跳周期的设置方法。
终端一般包括应用处理器和基带处理器,应用处理器运行终端上的操作系统和各种应用;基带处理器负责终端的通信功能,为终端提供通信的链路层和物理层支持。为方便说明,本发明实施例使用基带处理器代理应用处理器运行的应用的心跳业务,从而在不唤醒应用处理器的情况下,统一维护应用和网络侧服务器的连接。本领域技术人员可以知道,本发明实施例也可以应用于基带处理器代理应用心跳业务之外的其他情况,譬如由应用处理器自行控制应用的心跳业务。
本发明实施例的基本思路是由基带处理器负责多个应用的心跳业务。各个应用均拥有一个预设心跳周期,该预设心跳周期可以由应用服务器规定,也可以由应用本身规定,本发明对此不做限制。之后基带处理器通过不断地延长测试应用和其他应用的心跳周期,来试探网络对应用的心跳周期的最大容忍值,若某次心跳业务测试不通过,基带处理器则将前一次心跳业务测试中,测试通过的心跳周期设置为多个应用的心跳周期,进行心跳业务。参考图3,本实施例具体可以包括以下步骤:
步骤201、将终端的所有应用以T1为心跳周期,进行心跳业务。
其中T1为一个较小的心跳周期,可以是所有应用中最小的心跳周期,也可以是比最小的心跳周期更小的心跳周期。
步骤202、若某个应用心跳业务没有收到应用服务器的应答,则在后续的心跳周期测试中不考虑该应用。由于T1足够小,在应用服务器正常的情况下,应用的心跳业务应该可以正常进行。因此通过实施本步骤,可以剔除出应用服务器存在故障或中断服务等情况的应用,提高后续的心跳周期测试的准确度。
步骤203、将测试应用的心跳周期设置为T2,进行第一心跳测试。
测试应用可以是终端上安装的多个应用中的一个,譬如测试应用可以是预设心跳周期最小的应用,此时T1可以是测试应用的预设心跳周期;测试应用也可以是一个专门用来测试网络的心跳周期门限值的模拟应用,该应用不实现任何实质的业务,因而在测试较大的心跳周期,譬如在测试T2时,若导致该测试应用的网络连接断开,心跳业务中断时,不会对终端上的实质业务产生任何影响。
步骤204、若该第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
当应用服务器无法正常响应测试应用的心跳报文时,终端或基带处理器则认为该第一心跳测试不通过。这意味着T2可能超过了当前核心网或路由区的心跳周期门限值,网络不允许测试应用以T2作为心跳周期进行心跳业务,终端与应用服务器之间的连接断开。因此将比T2小的T1设置为多个应用的心跳周期,进行心跳业务,结束测试。
步骤205、若第一心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第二心跳测试;
若第一心跳测试通过,则可以继续尝试以比T2更大的T3为心跳周期, 继续进行第二心跳测试。直至在第n次心跳测试不通过时,则设置在第n-1次心跳测试时通过测试的心跳周期为多个应用的心跳周期,进行心跳业务,结束测试。可选的,本发明所有实施例中的T1,T2,T3….Tn的关系可以是T2=T1+△t,T3=T2+△t,…Tn+△t,其中△t为一个时间常量,譬如10s。
可选的,终端可以设置一个测试的最大周期值Tmax,在测试过程中,若测试的心跳周期Tn大于或等于Tmax时,则结束心跳测试,将Tmax或Tn设置为多个应用的心跳周期,进行心跳业务。
以上实施例中,使用测试应用进行心跳测试。一般情况下,由于测试应用与其他应用受限于相同的核心网或路由区的心跳周期门限值,在测试应用以Tn为心跳周期通过心跳测试时,其他应用也应当可以以Tn为心跳周期通过心跳测试。然而,特定的应用服务器也可能对特定的应用的心跳周期有限制。此时可能出现的一种情况是,虽然经测试应用测试通过的心跳周期Tn低于核心网或路由器的心跳周期门限值,但却超过了某个特定应用服务器规定的最大心跳周期,这将导致该特定应用服务器断开与该特定应用的连接,中断心跳业务。因此,可选的,本发明实施例可以包括其他应用参加心跳测试的步骤,参考图4,本实施例可以包括以下步骤:
步骤301、将测试应用的心跳周期设置为T2,进行第一心跳测试;
步骤302、若该第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
步骤303、若该第一心跳测试通过,则将多个应用的心跳周期设置为T2,进行第一全体心跳测试;
步骤304、若该第一全体心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
步骤305、若该第一全体心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第二心跳测试;
步骤306、若该第二心跳测试不通过,则将多个应用的心跳周期设置为T2,进行心跳业务;
步骤307、若该第二心跳测试通过,则将多个应用的心跳周期设置为T2,进行第二全体心跳测试;
步骤308、若该第二全体心跳测试不通过,则将多个应用的心跳周期设置为T2,进行心跳业务;
步骤309、若该第二全体心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第三心跳测试。
本发明实施例中描述的全体心跳测试,包括第一和第二全体心跳测试,具体可以是基带处理器以某个测试周期,向终端上安装和运行的多个应用分别对应的多个应用服务器周期性地发送心跳报文,测试所有应用服务器是否正常响应心跳报文。测试可以持续一个或多个周期。若有任何一个心跳报文未能正常响应,则说明某个应用无法使用测试的心跳周期保持心跳业务,测试结果为不通过。全体心跳测中的多个应用,可以包括测试应用,也可以不包括测试应用。
若第三心跳测试通过,则可以继续进行第三全体心跳测试。直至在第n次心跳测试或第全体心跳测试不通过时,则设置在第n-1次心跳测试时通过测试的心跳周期为多个应用的心跳周期,进行心跳业务,结束测试。
在本发明实施例中,先对测试应用进行心跳测试,再进行多个应用的全体心跳测试,既提高了给多个应用设置相同的心跳周期的准确性和安全性,也避免了直接进行全体心跳测试可能导致的大面积的心跳业务中断的情况。
可选的,在另一实施例中,终端还可以及时记录在当前核心网或路由 区设置的多个应用的心跳周期。当终端后续再次进入该核心网或路由区时,则可以直接使用该心跳周期,无需再通过测试设置多个应用的心跳周期。
参考图5,本发明实施例还提供了一种终端,包括:
第一测试单元41,用于将测试应用的心跳周期设置为T2,进行第一心跳测试;
第一心跳业务单元42,用于若该第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
第二测试单元43,用于若该第一心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第二心跳测试;
第二心跳业务单元44,用于若该第二心跳测试不通过,则将该多个应用的心跳周期设置为T2,进行心跳业务;
第三测试单元45,用于若该第二心跳测试通过,则将该测试应用的心跳周期设置为T4,进行第三心跳测试;
其中,T1<T2<T3<T4。
T1,T2,T3,T4为任意具有大小关系的心跳周期值,如30s,60s等。譬如T1,T2,T3,T4可以是终端上的应用的预设心跳周期,也可以是终端随机或通过其他机制选择的其他心跳周期值。
可选的,若第三心跳测试通过,则可以进一步测试比T4更大的T5、T6…Tn等心跳周期,直至以Tn为心跳周期的第n心跳测试不通过,则选择并设置Tn-1为多个应用的心跳周期,进行心跳业务。
终端上的各个应用原本具有不同的预设心跳周期和心跳起点。通过心跳测试,测试应用确认某个心跳周期相对于当前核心网的最大门限值是安全的,因此在该心跳周期确定后,终端上的各个应用可以在同一时 间,以相同的心跳周期进行心跳业务。
终端上的各个应用原本具有不同的预设心跳周期和心跳起点。通过心跳测试,测试应用确认某个心跳周期相对于当前核心网的最大门限值是安全的,因此在该心跳周期确定后,终端上的各个应用可以在同一时间,以相同的心跳周期进行心跳业务。
通过本发明实施例的应用,在一个测试应用上,逐渐延长测试心跳周期来试探网络的心跳周期门限值,在保障心跳业务正常进行的前提下,选取并设置一个较大的心跳周期,使得各个应用在同一时刻以相同的心跳周期进行心跳业务,从而有效地降低了终端能耗和信令开销,还减少了应用服务器的负载。
可选的,T1为该测试应用和该多个应用的预设心跳周期中最小的心跳周期。
可选的,终端可以设置一个测试的最大周期值Tmax,在测试过程中,若测试的心跳周期Tn大于或等于Tmax时,则结束心跳测试,将Tmax或Tn设置为多个应用的心跳周期,进行心跳业务。
以上实施例中,使用测试应用进行心跳测试。一般情况下,由于测试应用与其他应用受限于相同的核心网或路由区的心跳周期门限值,在测试应用以Tn为心跳周期通过心跳测试时,其他应用也应当可以以Tn为心跳周期通过心跳测试。然而,特定的应用服务器也可能对特定的应用的心跳周期有限制。此时可能出现的一种情况是,虽然经测试应用测试通过的心跳周期Tn低于核心网或路由器的心跳周期门限值,但却超过了某个特定应用服务器规定的最大心跳周期,这将导致该特定应用服务器断开与该特定应用的连接,中断心跳业务。因此,可选的,参考图6,本发明实施例中的终端还包括:
第一全体测试单元46,用于若该第一心跳测试通过,则将该多个应 用的心跳周期设置为T2,进行第一全体心跳测试;
该第二测试单元43还用于若该第一全体心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第二心跳测试。
该第一心跳业务单元42还用于若该第一全体心跳测试不通过,则将该多个应用的心跳周期设置为T1,进行心跳业务。
第二全体测试单元47,用于该第二心跳测试通过,则将该多个应用的心跳周期设置为T3,进行第二全体心跳测试;
该第三测试单元45还用于若该第二全体心跳测试通过,则将该测试应用的心跳周期设置为T4,进行第三心跳测试。
该第二心跳业务单元44还用于若该第二全体心跳测试不通过,则将该多个应用的心跳周期设置为T2,进行心跳业务。
本发明实施例中描述的全体心跳测试,包括第一和第二全体心跳测试,具体可以是基带处理器以某个测试周期,向终端上安装和运行的多个应用分别对应的多个应用服务器周期性地发送心跳报文,测试所有应用服务器是否正常响应心跳报文。测试可以持续一个或多个周期。若有任何一个心跳报文未能正常响应,则说明某个应用无法使用测试的心跳周期保持心跳业务,测试结果为不通过。全体心跳测中的多个应用,可以包括测试应用,也可以不包括测试应用。
在本发明实施例中,先对测试应用进行心跳测试,再进行多个应用的全体心跳测试,既提高了给多个应用设置相同的心跳周期的准确性和安全性,也避免了直接进行全体心跳测试可能导致的大面积的心跳业务中断的情况。
可选的,参考图7,终端还可以包括:记录单元,用于记录在当前网络设置的多个应用的心跳周期,从而及时记录在当前核心网或路由区设置的多个应用的心跳周期。当终端后续再次进入该核心网或路由区时,则可 以直接使用该心跳周期,无需再通过测试设置多个应用的心跳周期。
需要说明的是,本发明实施例中的各个单元,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,各个单元可以集成在一个处理单元(譬如基带处理器中)中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现,本发明对此不做限制。
本发明实施例还提供了另一种终端,包括:存储器52和处理器51,该存储器52中存储有程序代码,该处理器51用于处理该程序代码从而执行以下操作:
将测试应用的心跳周期设置为T2,进行第一心跳测试;
若该第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
若该第一心跳测试通过,则将该测试应用的心跳周期设置为T3,进行第二心跳测试;
若该第二心跳测试不通过,则将该多个应用的心跳周期设置为T2,进行心跳业务;
若该第二心跳测试通过,则将该测试应用的心跳周期设置为T4,进行第三心跳测试;
其中,T1<T2<T3<T4。
本发明实施例中程序代码所对应的其他操作,可以参照前面的方法实施例所提供的流程操作,本领域技术人员可以知道如何通过软件程序代码的形式实现前述操作,在此不再赘述。
本发明实施例中的存储器52可以是专用的存储器,也可以是一个较 大容量存储器中的一部分存储空间,还可以是与核心网管理实体连接的外接存储器,例如安全数码(Security Digital,SD)卡。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
本领域的技术人员可以理解:附图只是一个优选实施例的示意图,附图中的模块、实体或流程并不一定是实施本发明所必需的。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘,硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (30)

  1. 一种心跳周期的设置方法,其特征在于,包括:
    将测试应用的心跳周期设置为T2,进行第一心跳测试;
    若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
    若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;
    若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;
    若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;
    其中,T1<T2<T3<T4。
  2. 如权利要求1所述的方法,其特征在于,所述T1为所述测试应用和所述多个应用的预设心跳周期中最小的心跳周期。
  3. 如权利要求1或2所述的方法,其特征在于,所述若所述第一心跳测试通过则将所述测试应用的心跳周期设置为T3,进行第二心跳测试包括:
    若所述第一心跳测试通过,则将所述多个应用的心跳周期设置为T2,进行第一全体心跳测试,若所述第一全体心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试。
  4. 如权利要求3所述的方法,其特征在于,若所述第一全体心跳测试不通过,则将所述多个应用的心跳周期设置为T1,进行心跳业务。
  5. 如权利要求1至4任意一项所述的方法,其特征在于,所述若所述第二心跳测试通过则将所述测试应用的心跳周期设置为T4,进行第三心跳测试包括:
    若所述第二心跳测试通过,则将所述多个应用的心跳周期设置为T3,进行第二全体心跳测试,若所述第二全体心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试。
  6. 如权利要求5所述的方法,其特征在于,若所述第二全体心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务。
  7. 如权利要求1至6任意一项所述的方法,其特征在于,
    T2=T1+△t;
    T3=T2+△t;
    T4=T3+△t;
    △t为一个时间常量。
  8. 如权利要求1至7任意一项所述的方法,其特征在于,所述第一心跳测试包括:终端以T2为周期,向测试应用服务器周期性地发送心跳报文,测试所述测试应用服务器是否正常响应所述心跳报文。
  9. 如权利要求3至8任意一项所述的方法,其特征在于,所述第一全体心跳测试包括:终端以T2为周期,向多个应用服务器周期性地发送心跳报文,测试所述多个应用服务器是否正常响应所述心跳报文。
  10. 如权利要求1至9任意一项所述的方法,其特征在于,所述方法还包括:记录在当前网络设置的多个应用的心跳周期。
  11. 一种终端,其特征在于,包括:
    第一测试单元,用于将测试应用的心跳周期设置为T2,进行第一心跳测试;
    第一心跳业务单元,用于若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
    第二测试单元,用于若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;
    第二心跳业务单元,用于若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;
    第三测试单元,用于若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;
    其中,T1<T2<T3<T4。
  12. 如权利要求11所述的终端,其特征在于,所述T1为所述测试应用和所述多个应用的预设心跳周期中最小的心跳周期。
  13. 如权利要求11或12所述的终端,其特征在于,所述终端还包括:
    第一全体测试单元,用于若所述第一心跳测试通过,则将所述多个应用的心跳周期设置为T2,进行第一全体心跳测试;
    所述第二测试单元还用于若所述第一全体心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试。
  14. 如权利要求13所述的终端,其特征在于,所述第一心跳业务单元还用于若所述第一全体心跳测试不通过,则将所述多个应用的心跳周期设置为T1,进行心跳业务。
  15. 如权利要求11至14任意一项所述的终端,其特征在于,所述终端还包括:
    第二全体测试单元,用于所述第二心跳测试通过,则将所述多个应用的心跳周期设置为T3,进行第二全体心跳测试;
    所述第三测试单元还用于若所述第二全体心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试。
  16. 如权利要求15所述的终端,其特征在于,所述第二心跳业务单元还用于若所述第二全体心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务。
  17. 如权利要求11至16任意一项所述的终端,其特征在于,
    T2=T1+△t;
    T3=T2+△t;
    T4=T3+△t;
    △t为一个时间常量。
  18. 如权利要求11至17任意一项所述的终端,其特征在于,所述第一心跳测试包括:以T2为周期,向测试应用服务器周期性地发送心跳报文,测试所述测试应用服务器是否正常响应所述心跳报文。
  19. 如权利要求13至18任意一项所述的终端,其特征在于,所述第一全体心跳测试包括:以T2为周期,向多个应用服务器周期性地发送心跳报文,测试所述多个应用服务器是否正常响应所述心跳报文。
  20. 如权利要求11至19任意一项所述的终端,其特征在于,所述终端还包括:
    记录单元,用于记录在当前网络设置的多个应用的心跳周期。
  21. 一种终端,其特征在于,包括:存储器和处理器,所述存储器中存储有程序代码,所述处理器用于处理所述程序代码从而执行以下操作:
    将测试应用的心跳周期设置为T2,进行第一心跳测试;
    若所述第一心跳测试不通过,则将多个应用的心跳周期设置为T1,进行心跳业务;
    若所述第一心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试;
    若所述第二心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务;
    若所述第二心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试;
    其中,T1<T2<T3<T4。
  22. 如权利要求21所述的终端,其特征在于,所述T1为所述测试应用和所述多个应用的预设心跳周期中最小的心跳周期。
  23. 如权利要求21或22所述的终端,其特征在于,所述若所述第一心跳测试通过则将所述测试应用的心跳周期设置为T3,进行第二心跳测试的操作包括:
    若所述第一心跳测试通过,则将所述多个应用的心跳周期设置为T2,进行第一全体心跳测试,若所述第一全体心跳测试通过,则将所述测试应用的心跳周期设置为T3,进行第二心跳测试。
  24. 如权利要求23所述的终端,其特征在于,若所述第一全体心跳测试不通过,则将所述多个应用的心跳周期设置为T1,进行心跳业务。
  25. 如权利要求21至24任意一项所述的终端,其特征在于,所述若所述第二心跳测试通过则将所述测试应用的心跳周期设置为T4,进行第三心跳测试的操作包括:
    若所述第二心跳测试通过,则将所述多个应用的心跳周期设置为T3,进行第二全体心跳测试,若所述第二全体心跳测试通过,则将所述测试应用的心跳周期设置为T4,进行第三心跳测试。
  26. 如权利要求25所述的终端,其特征在于,若所述第二全体心跳测试不通过,则将所述多个应用的心跳周期设置为T2,进行心跳业务。
  27. 如权利要求21至26任意一项所述的终端,其特征在于,
    T2=T1+△t;
    T3=T2+△t;
    T4=T3+△t;
    △t为一个时间常量。
  28. 如权利要求21至27任意一项所述的终端,其特征在于,所述第一心跳测试包括:以T2为周期,向测试应用服务器周期性地发送心跳报 文,测试所述测试应用服务器是否正常响应所述心跳报文。
  29. 如权利要求23至28任意一项所述的终端,其特征在于,所述第一全体心跳测试包括:以T2为周期,向多个应用服务器周期性地发送心跳报文,测试所述多个应用服务器是否正常响应所述心跳报文。
  30. 如权利要求21至29任意一项所述的终端,其特征在于,所述操作还包括:记录在当前网络设置的多个应用的心跳周期。
PCT/CN2014/089787 2014-10-29 2014-10-29 一种心跳周期的设置方法及终端 WO2016065552A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201480083019.5A CN107078925B (zh) 2014-10-29 2014-10-29 一种心跳周期的设置方法及终端
US15/523,259 US10355963B2 (en) 2014-10-29 2014-10-29 Heartbeat period setting method, and terminal
PCT/CN2014/089787 WO2016065552A1 (zh) 2014-10-29 2014-10-29 一种心跳周期的设置方法及终端
EP14905112.0A EP3197098B1 (en) 2014-10-29 2014-10-29 Heartbeat cycle setting method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/089787 WO2016065552A1 (zh) 2014-10-29 2014-10-29 一种心跳周期的设置方法及终端

Publications (1)

Publication Number Publication Date
WO2016065552A1 true WO2016065552A1 (zh) 2016-05-06

Family

ID=55856372

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/089787 WO2016065552A1 (zh) 2014-10-29 2014-10-29 一种心跳周期的设置方法及终端

Country Status (4)

Country Link
US (1) US10355963B2 (zh)
EP (1) EP3197098B1 (zh)
CN (1) CN107078925B (zh)
WO (1) WO2016065552A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110381130A (zh) * 2019-07-12 2019-10-25 湖南新云网科技有限公司 保活长连接方法、装置、通信终端及存储介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10439925B2 (en) * 2017-12-21 2019-10-08 Akamai Technologies, Inc. Sandbox environment for testing integration between a content provider origin and a content delivery network
US11003369B1 (en) 2019-01-14 2021-05-11 Pure Storage, Inc. Performing a tune-up procedure on a storage device during a boot process
CN112752329B (zh) * 2019-10-30 2022-12-13 北京小米移动软件有限公司 事件通知方法、装置、移动终端及存储介质
US20230217269A1 (en) * 2020-06-04 2023-07-06 Telefonaktiebolaget Lm Ericsson (Publ) Verifying Availability of at Least Part of a Communication Link
CN112512103B (zh) * 2020-11-02 2023-08-18 鹏城实验室 一种省电精确移动端网络测量方法
CN113873017B (zh) * 2021-09-06 2023-12-26 绿盟科技集团股份有限公司 一种心跳周期调整方法、装置、客户端以及服务器
US11902138B2 (en) * 2022-01-26 2024-02-13 Getac Technology Corporation Connection maintenance method for internet of things device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594268A (zh) * 2009-06-23 2009-12-02 中兴通讯股份有限公司 链路检测方法
CN101697554A (zh) * 2009-09-27 2010-04-21 华中科技大学 一种p2p流媒体视频数据传输调度方法
CN103905257A (zh) * 2012-12-24 2014-07-02 中国电信股份有限公司 常在线应用自适应设置心跳时间的方法与装置、手机终端

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6002868A (en) * 1996-12-31 1999-12-14 Compaq Computer Corporation Test definition tool
US20020083213A1 (en) * 2000-09-18 2002-06-27 Oberstein Brien M. Method and system for simulating and certifying complex business applications
US7228453B2 (en) * 2000-10-16 2007-06-05 Goahead Software, Inc. Techniques for maintaining high availability of networked systems
AU2003302232A1 (en) * 2002-11-13 2004-06-30 Educational Testing Service Systems and methods for testing over a distributed network
US7178065B2 (en) * 2003-04-02 2007-02-13 Sun Microsystems, Inc. System and method for measuring performance with distributed agents
US7734763B2 (en) * 2003-10-24 2010-06-08 Sap Ag Application for testing the availability of software components
CN100367714C (zh) 2004-02-27 2008-02-06 联想(北京)有限公司 基于网络和主机负载的变速心跳机制的实现方法
US7523197B2 (en) 2006-03-09 2009-04-21 International Business Machines Corporation Method for IP address discovery in rapidly changing network environment
US20080165796A1 (en) * 2007-01-05 2008-07-10 International Business Machines Corporation Method for a heartbeat algorithm for a dynamically changing network environment
US8294566B2 (en) * 2008-05-02 2012-10-23 Escherlogic Inc. Emergency warning system and method of installation
US8893009B2 (en) * 2009-01-28 2014-11-18 Headwater Partners I Llc End user device that secures an association of application to service policy with an application certificate check
KR101520349B1 (ko) 2009-04-13 2015-05-14 삼성전자주식회사 무선통신 시스템에서 액티브싱크 서비스 핑 주기 결정 방법 및 장치
CN102843250B (zh) * 2011-06-21 2018-01-19 中兴通讯股份有限公司 一种心跳周期的自适应方法和装置
CN102438181A (zh) * 2011-08-18 2012-05-02 中兴通讯股份有限公司 在iptv系统内调整心跳消息发送时间的方法及系统
CA2889387C (en) * 2011-11-22 2020-03-24 Solano Labs, Inc. System of distributed software quality improvement
CN103139008A (zh) * 2011-11-23 2013-06-05 中兴通讯股份有限公司 检测报文心跳周期的自适应方法和装置
US8966318B1 (en) * 2012-04-27 2015-02-24 Symantec Corporation Method to validate availability of applications within a backup image
KR20140032542A (ko) 2012-08-30 2014-03-17 삼성전자주식회사 무선 네트워크에서 푸시 서비스의 hearthbeat 주기 결정 방법 및 장치
CN103856954B (zh) * 2012-11-28 2017-11-28 中国电信股份有限公司 探测游牧终端心跳周期的方法、系统、游牧终端与服务器
CN103118188B (zh) * 2013-01-25 2014-08-20 华为终端有限公司 应用心跳周期调整方法及装置、终端
US20150370674A1 (en) * 2014-06-19 2015-12-24 Microsoft Corporation Tenant provisioning for testing a production multi-tenant service
US10311515B2 (en) * 2014-09-17 2019-06-04 Iex Group, Inc. System and method for a semi-lit market

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594268A (zh) * 2009-06-23 2009-12-02 中兴通讯股份有限公司 链路检测方法
CN101697554A (zh) * 2009-09-27 2010-04-21 华中科技大学 一种p2p流媒体视频数据传输调度方法
CN103905257A (zh) * 2012-12-24 2014-07-02 中国电信股份有限公司 常在线应用自适应设置心跳时间的方法与装置、手机终端

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110381130A (zh) * 2019-07-12 2019-10-25 湖南新云网科技有限公司 保活长连接方法、装置、通信终端及存储介质

Also Published As

Publication number Publication date
EP3197098A4 (en) 2017-09-20
US10355963B2 (en) 2019-07-16
CN107078925B (zh) 2020-07-07
CN107078925A (zh) 2017-08-18
US20170317910A1 (en) 2017-11-02
EP3197098A1 (en) 2017-07-26
EP3197098B1 (en) 2019-04-10

Similar Documents

Publication Publication Date Title
WO2016065552A1 (zh) 一种心跳周期的设置方法及终端
RU2748679C1 (ru) Обработка безопасности для возобновления rrc из неактивного состояния
JP7280380B2 (ja) 端末の挙動に関する分析を決定するための方法および装置
WO2019184433A1 (zh) 一种网络数据的监测方法及装置
US11683218B2 (en) Compromised network node detection system
WO2018045877A1 (zh) 网络切片控制方法及相关设备
JP7128897B2 (ja) Rrc接続の回復方法、装置及びコンピュータ記憶媒体
RU2495548C2 (ru) Способ, устройство и система мобильной связи для обеспечения бесперебойности обслуживания
US9532359B2 (en) Resource allocation method and device
WO2017133553A1 (zh) Ue上下文信息恢复方法、装置和系统
WO2013078671A1 (zh) 一种故障检测方法、网关、用户设备及通信系统
WO2017076278A1 (zh) 网元间链路弹性处理方法及装置
CN103167479B (zh) 实现终端遥毙或遥开的方法、装置和系统
WO2014101508A1 (zh) 预警消息发送处理方法、接收方法以及相关设备
AU2017443204A1 (en) Method for paging user equipment, first network device, and user equipment
KR101536884B1 (ko) 클러스터 유저를 기반으로 하는 메시지 전송 방법 및 장치
CN104038955B (zh) 一种移动通信系统中的故障检测及处理的方法及基站
EP3100433A1 (en) Discriminating or prioritizing users during failover in a voip system
CN111314272B (zh) 一种任务处理方法及装置
WO2018099302A1 (zh) 一种链路处理方法以及链路处理设备
WO2021168671A1 (zh) 一种通信方法及装置
CN116132855A (zh) 环形组网保护方法、装置、电子设备及存储介质
CN114531485A (zh) 数据传输方法、系统及相应设备和存储介质
CN113853032A (zh) 一种rrc状态转移的方法、装置及存储介质
TW201218686A (en) Method and device for notifying of leaving of mobile node quickly

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14905112

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014905112

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 15523259

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE