WO2021047611A1 - Heartbeat-based application wakeup method, and terminal apparatus - Google Patents

Heartbeat-based application wakeup method, and terminal apparatus Download PDF

Info

Publication number
WO2021047611A1
WO2021047611A1 PCT/CN2020/114596 CN2020114596W WO2021047611A1 WO 2021047611 A1 WO2021047611 A1 WO 2021047611A1 CN 2020114596 W CN2020114596 W CN 2020114596W WO 2021047611 A1 WO2021047611 A1 WO 2021047611A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
terminal device
heartbeat
time
information
Prior art date
Application number
PCT/CN2020/114596
Other languages
French (fr)
Chinese (zh)
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 华为技术有限公司
Publication of WO2021047611A1 publication Critical patent/WO2021047611A1/en

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake

Definitions

  • the embodiments of the present application relate to the computer field, and in particular to an applied heartbeat wake-up method and terminal equipment.
  • the terminal device can periodically wake up the client of the application, as shown in Figure 1A, so that the client of the application sends a heartbeat packet to the application server to remind the application server to stay with the client of the application Long connection at the end.
  • the terminal device usually wakes up all the clients of the long-connected applications running in the background of the terminal device (application clients 1 to N as shown in Fig. 1B) according to a fixed heartbeat cycle, in which, N is a positive integer) to trigger the clients of these applications to send heartbeat packets to the corresponding application server, so that the client of the application maintains a long connection with the application server.
  • N is a positive integer
  • the embodiment of the present application provides a heartbeat wake-up method for an application, which can dynamically adjust the period for the terminal device to wake up the application according to the actual usage of the terminal device and/or the actual situation of the application, so as to improve the user experience.
  • an application heartbeat wake-up method is provided.
  • the method is applied to a terminal device in which multiple application clients are installed.
  • the method includes: the terminal device acquires the first application when the screen is off One or more of the application indication information of and the usage scenario information of the terminal device; wherein, the first application establishes a long connection with the application server of the first application; the application indication information is used to indicate the application type of the first application , And/or the time information or number of times the first application runs in the foreground of the terminal device within a preset time;
  • the above-mentioned usage scenario information includes: one or more of the screen off time of the terminal device, network status information, and scene mode information Item; the above-mentioned scene mode information is used to indicate that the terminal device is in any one of sports mode, sleep mode, pocket mode, or desktop mode; the terminal device determines the heartbeat of the first application according to the above-mentioned application indication information and usage scenario information Period, the heartbeat period of the first application is used to periodically wake
  • the terminal device can be based on the off-screen time of the terminal device in the off-screen state, network state information and scene mode information, the application type of the first application, and the first application in the terminal device within a preset time.
  • One or more of the information such as the time information or the number of times the foreground is running determines the heartbeat period of the first application.
  • the terminal device can dynamically adjust the period for the terminal device to wake up the application according to the actual use situation of the terminal device and/or the actual situation of the application, so as to improve the user experience.
  • the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor At least one of: The terminal device obtains scene mode information through the parameters collected by the one or more sensors.
  • the terminal device can determine the context mode of the terminal device based on the data collected by the sensor, so that the terminal device can dynamically adjust the period of the terminal device to wake up the application according to the context mode of the terminal device to improve user experience.
  • the aforementioned network status information is used to indicate that the terminal device is connected to the network or not connected to the network; if the aforementioned terminal device is connected to the network, the network status information is also used to indicate the type of network that the terminal device is connected to, And the signal quality of the terminal equipment.
  • the terminal device can dynamically adjust the period at which the terminal device wakes up the application according to the acquired actual networking situation of the terminal device, so as to improve the user experience.
  • the above-mentioned usage scenario information includes at least: the screen-off time of the terminal device; after the terminal device enters the screen-off state, it periodically obtains the application indication information of the first application and the usage scenario information of the terminal device. One or more of the information.
  • the terminal device can periodically obtain one or more of the usage scenario information of the terminal device's screen-off time, network status information, and scenario mode information, so that the terminal device can periodically obtain the usage scenario information of the terminal device according to the usage scenario information of the terminal device. Adjust the cycle of terminal devices to wake up applications to improve user experience.
  • the above method further includes: the terminal device determines the first heartbeat moment, the first heartbeat moment starts from the current moment, and after the first time period expires, the first time period is equal to that of the first application.
  • Heartbeat cycle starting from the moment of the first heartbeat, the terminal device periodically wakes up the first application according to the heartbeat cycle of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application until the first application
  • the client of an application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state.
  • the terminal device may periodically wake up the first application according to the determined heartbeat period of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. While ensuring that the long connection established between the first application and the application server of the first application is not disconnected, it can be ensured that the power consumption of the first application due to sending the heartbeat packet is minimized.
  • the above method further includes: the terminal device determines the first heartbeat moment, the first heartbeat moment starts from the current moment, and after the first time period expires, the first time period is equal to that of the first application.
  • Heartbeat cycle after the current time, the terminal device wakes up the first application at the system heartbeat time closest to the first heartbeat time to trigger the client of the first application to send a heartbeat packet to the application server of the first application; the terminal device determines After the first heartbeat moment, the terminal device cyclically executes the following steps (1) and (2), until the client of the first application disconnects the above-mentioned long connection or the terminal device changes from the off-screen state to the on-screen state:
  • Step (1) The terminal device determines the next heartbeat time according to the heartbeat period of the first application;
  • step (2) The terminal device wakes up the first application at the system heartbeat time closest to the next heartbeat time to trigger the client of the first application
  • the heartbeat packet is sent to the application server of the first application; wherein, the system heartbeat cycle
  • the terminal device can adjust the heartbeat time of the first application determined according to the determined heartbeat cycle of the first application to the system heartbeat time according to preset rules (such as the principle of nearest alignment) to avoid the heartbeat time distribution of different applications Excessive power consumption caused by non-concentration.
  • a terminal device is provided.
  • the terminal device is installed with multiple application clients.
  • the terminal device includes: an information acquiring unit configured to acquire an application indication of a first application when the terminal device is in the off-screen state Information and one or more pieces of information in the usage scenario information of the terminal device; wherein the first application establishes a long connection with the application server of the first application; the above application indication information is used to indicate the application type of the first application, and/ Or the time information or the number of times the first application runs in the foreground of the terminal device within a preset time; the above usage scenario information includes: one or more of the screen off time of the terminal device, network status information, and scene mode information; the above The scene mode information is used to indicate that the terminal device is in any one of sports mode, sleep mode, pocket mode or desktop mode; the analysis unit is used to determine the heartbeat cycle of the first application according to the above application indication information and usage scenario information The heartbeat period of the first application is used to periodically wake up the first application to trigger the client of the first application to send
  • the terminal device can be based on the off-screen time of the terminal device in the off-screen state, network state information and scene mode information, the application type of the first application, and the first application on the terminal device within a preset time.
  • One or more of the information such as the time information or the number of times the foreground is running determines the heartbeat period of the first application.
  • the terminal device can dynamically adjust the period for the terminal device to wake up the application according to the actual use situation of the terminal device and/or the actual situation of the application, thereby improving the user experience.
  • the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor At least one of; the above-mentioned one or more sensors are used to collect parameters, so that the information acquisition unit determines the scene mode information according to the parameters.
  • the terminal device can determine the context mode of the terminal device based on the data collected by the sensor, so that the terminal device can dynamically adjust the period of the terminal device to wake up the application according to the context mode of the terminal device to improve user experience.
  • the aforementioned network status information is used to indicate that the terminal device is connected to the network or not connected to the network; if the aforementioned terminal device is connected to the network, the network status information is also used to indicate the type of network that the terminal device is connected to, And the signal quality of the terminal equipment.
  • the terminal device can dynamically adjust the period at which the terminal device wakes up the application according to the acquired actual networking situation of the terminal device, so as to improve the user experience.
  • the above-mentioned usage scenario information includes at least: the screen-off time of the terminal device; the above-mentioned information obtaining unit is configured to periodically obtain the application indication information of the first application after the terminal device enters the screen-off state And one or more pieces of information in the usage scenario information of the terminal device.
  • the terminal device can periodically obtain one or more of the usage scenario information of the terminal device's screen-off time, network status information, and scenario mode information, so that the terminal device can periodically obtain the usage scenario information of the terminal device according to the usage scenario information of the terminal device. Adjust the cycle of terminal devices to wake up applications to improve user experience.
  • the above analysis unit is also used to determine the first heartbeat moment, the first heartbeat moment is from the current moment, after the first time period cut-off time, the first time period is equal to the first application Heartbeat cycle;
  • the terminal device also includes: an application wake-up unit, configured to wake up the first application periodically according to the heartbeat cycle of the first application from the moment of the first heartbeat, so as to trigger the client of the first application to the first application
  • the application server of the application server sends a heartbeat packet until the client of the first application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state.
  • the terminal device may periodically wake up the first application according to the determined heartbeat period of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. While ensuring that the long connection established between the first application and the application server of the first application is not disconnected, it can be ensured that the power consumption of the first application due to sending the heartbeat packet is minimized.
  • the above analysis unit is also used to determine the first heartbeat moment, the first heartbeat moment is from the current moment, after the first time period cut-off time, the first time period is equal to the first application Heartbeat cycle;
  • the terminal device also includes: an application wake-up unit, which is used to wake up the first application at the system heartbeat time closest to the first heartbeat time after the above-mentioned current time, so as to trigger the client of the first application to the application of the first application
  • the server sends a heartbeat packet; after the analysis unit determines the first heartbeat moment, the analysis unit and the application wake-up unit are also used to cyclically execute the following steps (1) and (2) until the client of the first application disconnects the above
  • the long connection or the terminal device turns from the off-screen state to the on-screen state:
  • Step (2) The application wake-up unit is closest to the next heartbeat time
  • the system heartbeat time of the terminal device wakes up
  • the terminal device can adjust the heartbeat time of the first application determined according to the determined heartbeat cycle of the first application to the system heartbeat time according to preset rules (such as the principle of nearest alignment) to avoid the heartbeat time distribution of different applications Excessive power consumption caused by inconcentration.
  • a terminal device in a third aspect, includes: a memory for storing one or more computer programs; a radio frequency circuit for transmitting and receiving radio signals; and a processor for executing a memory stored in the memory. Or multiple computer programs to enable the terminal device to obtain one or more of the application indication information of the first application and the usage scenario information of the terminal device when the terminal device is in the off-screen state; wherein, the first application and the first application
  • the application server of an application establishes a long connection;
  • the above-mentioned application indication information is used to indicate the application type of the first application, and/or the time information or the number of times the first application runs in the foreground of the terminal device within a preset time;
  • the above-mentioned usage scenario information Including: one or more of the screen-off time of the terminal device, network status information, and scene mode information; the above-mentioned scene mode information is used to indicate that the terminal device is in any of sports mode, sleep mode, pocket mode, or desktop mode.
  • a mode and, according to the above application indication information and usage scenario information, the heartbeat cycle of the first application is determined, and the heartbeat cycle of the first application is used to periodically wake up the first application to trigger the client of the first application to the first application
  • the application server of an application sends a heartbeat packet.
  • the terminal device can be based on the off time of the terminal device in the off state, network state information and scene mode information, the application type of the first application, and the first application on the terminal device within a preset time.
  • One or more of the information such as the time information or the number of times the foreground is running determines the heartbeat period of the first application.
  • the terminal device can dynamically adjust the period for the terminal device to wake up the application according to the actual use situation of the terminal device and/or the actual situation of the application, so as to improve the user experience.
  • the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor At least one of; the above-mentioned one or more sensors are used to collect parameters, so that the information acquisition unit determines the scene mode information according to the parameters.
  • the terminal device can determine the context mode of the terminal device based on the data collected by the sensor, so that the terminal device can dynamically adjust the period of the terminal device to wake up the application according to the context mode of the terminal device to improve user experience.
  • the aforementioned network status information is used to indicate that the terminal device is connected to the network or not connected to the network; if the aforementioned terminal device is connected to the network, the network status information is also used to indicate the type of network that the terminal device is connected to, And the signal quality of the terminal equipment.
  • the terminal device can dynamically adjust the period at which the terminal device wakes up the application according to the acquired actual networking situation of the terminal device, so as to improve the user experience.
  • the aforementioned usage scenario information includes at least: the screen-off time of the terminal device; the aforementioned processor is configured to execute one or more computer programs stored in the memory, so that the terminal device enters the screen-off time of the terminal device. After the state, periodically obtain one or more of the application indication information of the first application and the usage scenario information of the terminal device.
  • the terminal device can periodically obtain one or more of the usage scenario information of the terminal device's screen-off time, network status information, and scenario mode information, so that the terminal device can periodically obtain the usage scenario information of the terminal device according to the usage scenario information of the terminal device. Adjust the cycle of terminal devices to wake up applications to improve user experience.
  • the above-mentioned processor is further configured to execute one or more computer programs stored in the memory, so that the terminal device determines the first heartbeat moment.
  • the first heartbeat moment starts from the current moment and passes through the first heartbeat moment.
  • a one-time cut-off time, the first duration is equal to the heartbeat cycle of the first application; and, starting from the first heartbeat time, the first application is periodically woken up according to the heartbeat cycle of the first application to trigger the client of the first application
  • the terminal sends a heartbeat packet to the application server of the first application until the client of the first application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state.
  • the terminal device may periodically wake up the first application according to the determined heartbeat period of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. While ensuring that the long connection established between the first application and the application server of the first application is not disconnected, it can be ensured that the power consumption of the first application due to sending the heartbeat packet is minimized.
  • the above-mentioned processor is further configured to execute one or more computer programs stored in the memory, so that the terminal device determines the first heartbeat moment.
  • the first heartbeat moment starts from the current moment and passes through the first heartbeat moment.
  • a one-time cut-off time, the first duration is equal to the heartbeat period of the first application; and, after the above current time, the system heartbeat time closest to the first heartbeat time, wake up the first application to trigger the client of the first application Send a heartbeat packet to the application server of the first application;
  • the above-mentioned processor is further configured to execute one or more computer programs stored in the memory, so that the terminal device cyclically executes the following steps (1) And step (2), until the client of the first application disconnects the above-mentioned long connection or the terminal device changes from the off-screen state to the on-screen state:
  • Step (2) At the system heartbeat moment closest to
  • the terminal device can adjust the heartbeat time of the first application determined according to the determined heartbeat cycle of the first application to the system heartbeat time according to preset rules (such as the principle of nearest alignment) to avoid the heartbeat time distribution of different applications Excessive power consumption caused by non-concentration.
  • a computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, an application as in any one of the possible implementation manners of the first aspect is implemented The heartbeat wake-up method.
  • a chip system may include a storage medium for storing instructions; a processing circuit for executing the foregoing instructions to realize the heartbeat wake-up of the application as in any one of the possible implementation manners of the first aspect method.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • a computer program product is provided, and a computer program product is provided.
  • the computer program product includes program instructions.
  • the program instructions When the program instructions are run on a computer, the program instructions can be implemented in any one of the possible implementation manners of the first aspect.
  • the application's heartbeat wake-up method For example, the computer may be at least one storage node.
  • FIG. 1A is a schematic diagram of a terminal device periodically waking up a client of an application according to an embodiment of the application;
  • FIG. 1B is a schematic diagram of a conventional applied heartbeat technology provided by an embodiment of this application.
  • FIG. 2A is a schematic diagram of the hardware structure of a terminal device provided by an embodiment of the application.
  • 2B is a schematic diagram of a system heartbeat clock provided by an embodiment of this application.
  • FIG. 3 is a first flowchart of an application heartbeat wake-up method provided by an embodiment of this application
  • FIG. 4 is a schematic diagram of the principle of a method for determining a heartbeat cycle provided by an embodiment of the application;
  • FIG. 5 is a schematic diagram of heartbeat clocks of multiple applications determined by a terminal device according to an embodiment of this application;
  • FIG. 6 is a second flowchart of an application heartbeat wake-up method provided by an embodiment of this application.
  • FIG. 7 is an example diagram 1 for determining the first heartbeat moment provided by an embodiment of the application.
  • FIG. 8A is an example diagram 2 for determining the first heartbeat moment provided by an embodiment of the application.
  • FIG. 8B is an example diagram 3 for determining the first heartbeat moment provided by an embodiment of the application.
  • FIG. 9 is a third flowchart of an application heartbeat wake-up method provided by an embodiment of this application.
  • FIG. 10 is a schematic diagram of an application heartbeat clock provided by an embodiment of this application.
  • FIG. 11 is an example diagram of a heartbeat time alignment provided by an embodiment of the application.
  • FIG. 12 is an example diagram of power consumption comparison between the heartbeat wake-up method of the application provided by the embodiment of the application and the conventional heartbeat wake-up method;
  • FIG. 13 is a schematic diagram of a posture of a terminal device provided by an embodiment of the application.
  • FIG. 14 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • the embodiment of the present application provides a heartbeat wake-up method of an application, which is applied to a process of periodically waking up a client of an application running in the background when a terminal device is in an off-screen state.
  • the terminal device periodically wakes up the client of the application running in the background, and is used to trigger the client of the application to send a heartbeat packet to the application server with which it has established a long connection, so that the client of the application can maintain a long connection with the application server .
  • the foreground operation refers to that the application is currently running in the terminal device, occupies the system resources of the terminal device, and the window interface of the application is currently displayed on the screen of the terminal device.
  • Background running refers to the application running in the current terminal device, occupying the system resources of the terminal device, but the relevant interface is not currently displayed on the terminal device screen.
  • the long connection is based on the Transmission Control Protocol/Internet Protocol (TCP/IP), which is also called a TCP connection.
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • the client of the application needs to perform a three-way handshake with the application server (including the first handshake, the second handshake, and the third handshake). It is used to connect to the designated port of the application server, establish a TCP connection, and synchronize the sequence number ((Sequence Number, SN), Acknowledgement Number (AN) and TCP window information of both sides of the TCP connection.
  • the TCP connection is disconnected
  • the client of the application and the application server waved four times (including the first wave, the second wave, the third wave, and the fourth wave). Used to release the TCP between the application client and the application server Connection.
  • the four waves of hands can be initiated by the client of the application or by the application server.
  • the TCP connection is to establish a connection on demand. If the data or signaling transmission between the sender and receiver is completed, the TCP connection between the sender and receiver is disconnected. When there is a demand for data or signaling transmission next time, the TCP connection is re-established. This connection is called a short connection.
  • the connection establishment phase and connection removal phase of the TCP connection are more complicated, if the TCP connection is often disconnected, then the next time the data packet is transmitted, the three-way handshake will be required to establish the TCP connection again, which will waste a certain amount of time. Time and system overhead. Therefore, in order to save time and system overhead, a long connection between the client of the application and the application server can be maintained. That is, even if the data or signaling transmission between the sender and receiver ends, the TCP connection will not be disconnected. In this way, when the data packet needs to be transmitted next time, the data packet can be directly transmitted through the long connection.
  • the application server when the client of the application maintains a long connection with the application server, if the client of the application and the application server do not transmit data or signaling for a long time, for the purpose of saving network resources, the application server will Disconnect the long connection with the client, leaving more network resources to other devices with transmission requirements. Exemplarily, under normal circumstances, if the client of the application and the application server do not transmit data or signaling within 5 minutes, the application server will disconnect the aforementioned long connection.
  • the terminal device can periodically wake up the application so that the client of the application periodically sends a heartbeat packet to the application server to ensure that the application server always considers the long connection to be Active state, so as to prevent the above-mentioned long connection from being disconnected.
  • the terminal device may be a netbook, a tablet computer, a smart watch, and the like.
  • the terminal device can also be other desktop devices, laptop devices, handheld devices, wearable devices, smart home devices, and vehicle-mounted devices with radio communication functions, such as Ultra-mobile Personal Computers (Ultra-mobile Personal Computer). , UMPC), smart cameras, netbooks, personal digital assistants (Personal Digital Assistant, PDA), portable multimedia players (Portable Multimedia Player, PMP), AR (augmented reality)/VR (virtual reality) equipment, aircraft, robots, etc.
  • PDA Personal Digital Assistant
  • PMP portable multimedia players
  • AR augmented reality
  • VR virtual reality
  • the embodiment of the present application does not limit the specific type and structure of the terminal device.
  • the terminal device 100 may include a processor 210, a memory (including an external memory interface 220 and an internal memory 221), a universal serial bus (USB) interface 230, a charging management module 240, and a power management module 241, battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, earphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
  • SIM subscriber identification module
  • the sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an acceleration sensor 280C, a magnetic sensor 280D, an ambient light sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a heart rate sensor 280H, an air pressure sensor, a fingerprint sensor, and a temperature sensor. , Touch sensor, bone conduction sensor, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100.
  • the terminal device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 210 may include one or more processing units.
  • the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in the processor 210 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 210. If the processor 210 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 210 is reduced, and the efficiency of the system is improved.
  • the processor 210 may include one or more interfaces.
  • the interface can include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the terminal device 100.
  • the terminal device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 240 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210.
  • the power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 294, the camera 293, and the wireless communication module 260.
  • the power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 241 may also be provided in the processor 210.
  • the power management module 241 and the charging management module 240 may also be provided in the same device.
  • the wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in conjunction with a tuning switch.
  • the mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the terminal device 100.
  • the mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 250 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 250 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210.
  • at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through the display screen 294.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 210 and be provided in the same device as the mobile communication module 250 or other functional modules.
  • the wireless communication module 260 can provide applications on the terminal device 100 including wireless local area networks (wireless local area networks, WLAN) (such as Wi-Fi networks), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS). ), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 260 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210.
  • the wireless communication module 260 may also receive a signal to be sent from the processor 210, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the terminal device 100 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the terminal device 100 implements a display function through a GPU, a display screen 294, and an application processor.
  • the GPU is an image processing microprocessor, which is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 294 is used to display images, videos, and the like.
  • the display screen 294 includes a display panel.
  • the terminal device 100 may include one or N display screens 294, and N is a positive integer greater than one.
  • the terminal device 100 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor.
  • the ISP is used to process the data fed back by the camera 293.
  • the camera 293 is used to capture still images or videos.
  • the terminal device 100 may include 1 or N cameras 293, and N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • the external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the terminal device 100.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function.
  • the internal memory 221 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the terminal device 100.
  • the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 210 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 221 and/or instructions stored in a memory provided in the processor.
  • the terminal device 100 can implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, and an application processor. For example, music playback, recording, etc.
  • the pressure sensor 280A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 280A may be provided on the display screen 294.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 280A, the capacitance between the electrodes changes. The terminal device 100 determines the strength of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 280A.
  • the terminal device 100 may also calculate the touched position based on the detection signal of the pressure sensor 280A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example, when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 280B may be used to determine the movement posture of the terminal device 100.
  • the angular velocity of the terminal device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 280B can be determined by the gyro sensor 280B.
  • the acceleration sensor 280C can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device 100, and is used in applications such as horizontal and vertical screen switching, pedometers and so on.
  • the magnetic sensor 280D is a device that converts the change in the magnetic properties of the sensitive element caused by external factors such as magnetic field, current, stress and strain, temperature, light, etc., into an electrical signal, and detects the corresponding physical quantity in this way.
  • the angles between the terminal device 100 and the four directions of south, east, north, and west can be measured by the magnetic sensor 280D.
  • the ambient light sensor 280E is used to sense the brightness of the ambient light.
  • the terminal device 100 can adaptively adjust the brightness of the display screen 294 according to the perceived brightness of the ambient light.
  • the ambient light sensor 280E can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 280E can also cooperate with the proximity light sensor to detect whether the terminal device 100 is in a pocket to prevent accidental touch.
  • the terminal device 100 can measure the distance by infrared or laser. In some embodiments, the distance sensor 280F may be used to detect whether there is obstruction or coverage around the terminal device 100.
  • the proximity light sensor 280G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the terminal device 100 emits infrared light to the outside through the light emitting diode.
  • the terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100.
  • the heart rate sensor 280H is used to measure the user's heart rate and other biometric indicators.
  • the heart rate sensor 280H may be an optical heart rate sensor.
  • the heart rate sensor 280H can measure the user's heart rate and other biometric indicators through a wearable device such as a wristband worn by the user.
  • the indicator 292 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
  • the button 290 includes a power-on button, a volume button, and so on.
  • the button 290 may be a mechanical button. It can also be a touch button.
  • the motor 291 can generate vibration prompts.
  • the indicator 292 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 295 is used to connect to the SIM card. The SIM card can be inserted into the SIM card interface 295 or pulled out from the SIM card interface 295 to achieve contact and separation with the terminal device 100.
  • the terminal device can periodically wake up all application clients that are running in the background of the terminal device and establish a long connection with the application server according to a fixed heartbeat cycle.
  • the terminal device may periodically wake up the client of the application according to the heartbeat time indicated by the system heartbeat clock.
  • the system heartbeat clock is set and started by the operating system of the terminal device 100 when the terminal device 100 is turned on, and a fixed duration is used as the periodic heartbeat clock.
  • the system heartbeat clock can be applied to clients of all applications installed in the terminal device 100. For example, Huawei Redmi's operating system uses a system heartbeat cycle of 8 minutes to set and activates the system heartbeat clock, LG G2's operating system uses a system heartbeat cycle of 8 minutes to set the system heartbeat clock, and Samsung note3 uses a system heartbeat cycle of 5 minutes. Set and start the system heartbeat clock. As shown in FIG. 2B, the system heartbeat cycle of the terminal device 100 is 5 minutes, and the terminal device 100 is turned on at 9:00 AM as an example, to introduce a schematic diagram of a system heartbeat clock provided by an embodiment of the present application.
  • the above-mentioned conventional methods may cause applications that are not frequently used to be awakened unnecessarily frequently, and waste the power of the terminal device.
  • the embodiment of the present application provides a heartbeat wake-up method for an application.
  • the terminal device can be based on one or more of the actual situation of at least one application installed in the terminal device 100 and the usage scenario information of the terminal device. This information determines the heartbeat period of at least one of the above-mentioned applications.
  • the heartbeat wake-up method of the application provided by the embodiment of the present application can be applied to a terminal device having a hardware structure as shown in FIG. 2A or a terminal device having a similar structure. Or it can also be applied to terminal devices of other structures, which is not limited in the embodiment of the present application.
  • the heartbeat wake-up method of the application provided in the embodiment of the present application is specifically introduced.
  • the terminal device 100 has multiple application clients installed. The terminal device 100 is in the off-screen state.
  • the heartbeat wake-up method of the application may include:
  • the terminal device 100 obtains one or more pieces of information among the application indication information of the first application and the usage scenario information of the terminal device 100.
  • the terminal device 100 has multiple application clients installed. For example, clients of applications such as “WeChat”, “foxmail”, “QQ Music”, “Bicycle Sharing”, “Alipay” and Baidu Maps.
  • the first application is one of the above multiple applications.
  • the first The application runs in the background of the terminal device 100 and establishes a long connection with the application server of the first application.
  • the application indication information of the first application is used to indicate: (A) the application type of the first application; and/or, (B) the time information of the first application running in the foreground of the terminal device within a preset time Or times.
  • the application type of the first application may be pre-configured.
  • the terminal device 100 may determine the application type of the first application by analyzing the function of the first application.
  • the application type of the application can be at least any one of instant messaging, social, audio and video, office, news, tools, travel, life, and reading.
  • social applications may include “WeChat”, “Weibo”, and “Tencent QQ”.
  • Audio-visual applications can include “Youku” and "QQ Music”.
  • Office applications can include “Microsoft office” and “foxmail mailbox”.
  • News applications can include “Today's Toutiao” and "CCTV News”.
  • Tool applications can include “alarm clock”, “calendar”, and “weather”.
  • Travel applications can include “Baidu Maps” and "12306". Life applications can include “Are you hungry”, “Alipay”, “Bicycle sharing” and “Taobao”.
  • Reading applications can include “Douban Reading”, “Southern Weekend”, “Sanlian Life Weekly” and “World literary Masterpieces”.
  • the application types of applications include but are not limited to the foregoing several application type examples, which are not limited in the embodiment of the present application.
  • the time information of the first application running in the foreground of the terminal device 100 within the preset time is used to characterize the length of time the first application is running in the foreground of the terminal device 100 within the preset time.
  • the time information of the first application running in the foreground of the terminal device 100 within the preset time may include the detailed running time of the first application running in the foreground of the terminal device 100 within the preset time (such as the last week). information.
  • the terminal device 100 can determine the length of time that the first application runs in the foreground of the terminal device 100 within the preset time according to the above-mentioned detailed running time information of the first application.
  • the detailed operating time information of "WeChat" running at the front desk of the terminal device 100 in the last week includes: 2019/8/1 20:30 ⁇ 2019/8/1 21:30, 2019/8/2 19:45 ⁇ 2019 /8/2 21:00, 8/3/2019 19:30 ⁇ 2019/8/3 21:45, 2019/8/4 19:00 ⁇ 2019/8/4 20:30, 2019/8/5 19 :30 ⁇ 2019/8/5 21:45, 2019/8/6 19:00 ⁇ 2019/8/6 20:30 and 2019/8/7 21:00 ⁇ 2019/8/7 22:12.
  • the terminal device 100 may determine that the time that "WeChat" runs in the front desk of the terminal device 100 within the preset time is 11 hours.
  • the terminal device 100 may determine the running time rule of the first application and/or the user's habit of using the first application according to the foregoing detailed running time information of the first application. For example, the terminal device 100 may determine that the "WeChat" is running within a preset time, usually between 19:00 and 22:30 in the evening, according to the detailed operation time information of the aforementioned "WeChat". Thus, the terminal device 100 can infer that the user is accustomed to using "WeChat" between 19:00 and 22:30 in the evening.
  • the usage scenario information of the first application may include: (a) the screen-off time of the terminal device 100; (b) the network status information of the terminal device 100; (c) the scenario mode information of the terminal device 100 At least one of:
  • the screen-off time of the terminal device 100 refers to the time when the terminal device 100 enters the screen-off state; or the length of time from when the terminal device 100 enters the screen-off state to the current moment.
  • the screen-off time of the terminal device 100 is "10 minutes”, it means that the terminal device 100 has entered the screen-off state to the current time for 10 minutes (that is, the terminal device 100 has been in the screen-off state for 10 minutes).
  • the screen-off time of the terminal device 100 is "11:30", which means that the terminal device 100 enters the screen-off state at 11:30.
  • the terminal device 100 may determine the rule of the terminal device 100 being used by the user and/or the user's habit of using the terminal device 10 according to the moment when the terminal device 100 enters the screen-off state.
  • the network status information of the terminal device 100 is used to indicate that the terminal device 100 is connected to the network or not connected to the network. If the terminal device 100 is connected to the network, the network status information of the terminal device 100 is also used to indicate the type of network that the terminal device 100 is connected to, and the signal quality of the terminal device 100 connected to the network.
  • the type of network to which the terminal device 100 is connected may include, but is not limited to, at least one of a 2G network, a 3G network, a 4G network, a 5G network, and a wireless fidelity (Wireless Fidelity, WiFi).
  • the terminal device 100 if the terminal device 100 is not connected to the network, the client of the first application cannot maintain a long connection with the application server. In this case, the terminal device 100 does not need to periodically wake up the client of the first application.
  • the terminal device 100 is connected to a network, and the terminal device 100 is connected to a network of a different network type, the heartbeat period at which the first application is periodically awakened is different, and the impact on the user is different.
  • the client of the first application sends a heartbeat packet to the application server through the 2G network. If the heartbeat period is set too small, frequent heartbeat packets will be sent, causing additional traffic costs to the user.
  • the terminal device 100 is connected to WiFi, the client of the first application sends a heartbeat packet to the application server via WiFi. If the heartbeat period is set too large, it may cause the long connection between the application client and the application server to be disconnected due to the too large period, which affects the user experience.
  • the scene mode information of the terminal device 100 is used to indicate that the terminal device 100 is in any of the sports mode, the sleep mode, the pocket mode, or the desktop mode.
  • that the terminal device 100 is in a sports mode means that the terminal device 100 is in a sports state, for example, the terminal device 100 is in a walking state or a running state.
  • the terminal device 100 being in the sleep mode means that the terminal device 100 detects that the user is in the sleep state.
  • the terminal device 100 is in the pocket mode, it means that the terminal device 100 is placed in a storage object such as a pocket, a bag, or a drawer.
  • the terminal device 100 is statically placed in a fixed position such as a desktop.
  • the terminal device 100 may determine the context mode information of the terminal device 100 by analyzing data collected by sensors provided in the terminal device 100.
  • the sensor may be at least one of an acceleration sensor, a gyroscope sensor, a magnetic sensor, an ambient light sensor, a distance sensor, and a proximity light sensor. The method and process for the terminal device 100 to determine the scene mode information of the terminal device 100 by analyzing the data collected by the sensor set in the terminal device 100 will be described in detail below.
  • the application indication information of the first application is not limited to the application type of the first application or the time information or number of times the first application runs in the foreground of the terminal device within a preset time.
  • the usage scenario information of the first application is also not limited to the screen-off time of the terminal device 100 described above, the network status information of the terminal device 100, or the scenario mode information of the terminal device 100.
  • the application indication information of the first application and the usage scenario information of the first application may also include other information, which is not limited in the embodiment of the present application.
  • the terminal device 100 may periodically obtain one or more of the application indication information of the first application and the usage scenario information of the terminal device 100 after the terminal device 100 enters the screen-off state.
  • the terminal device 100 determines the heartbeat period of the first application according to the application indication information and the usage scenario information.
  • the heartbeat period of the first application is used by the terminal device 100 to periodically wake up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application, thereby keeping the client of the first application and the first application A long connection between application servers of an application.
  • the terminal device 100 may be preset with a correspondence between application indication information and/or usage scenario information and a heartbeat cycle.
  • the terminal device 100 can determine the heartbeat period of the first application by searching for the corresponding relationship.
  • FIG. 4 it is a schematic diagram of the principle of a method for determining an application heartbeat cycle provided by an embodiment of this application.
  • the terminal device 100 can comprehensively consider the application type of the first application, the time information or the number of times the terminal device 100 runs the first application in the foreground of the terminal device 100 within a preset time, the screen off time of the terminal device 100, and the terminal device 100
  • the network status information of the device 100 and the scene mode information of the terminal device 100 determine the heartbeat period of the first application.
  • Figure 4 is only an example.
  • the terminal device 100 can determine the heartbeat period of the first application according to any one or more of (A), (B), (a), (b), and (c) above.
  • the correspondence relationship between the application indication information and/or usage scenario information and the heartbeat cycle may be preset in the terminal device 100 in the form of a table, or may be preset in the terminal device 100 in other forms, which is not limited in the embodiment of the present invention.
  • Table 1 is described in a form of a table, taking the corresponding relationship between "application type”, “screen off time”, and “scene mode” and "heartbeat cycle” preset in the terminal device 100 as an example to introduce the preset
  • the corresponding relationship between the application indication information and/or usage scenario information in the terminal device 100 and the heartbeat cycle may also be in other forms, and the embodiment of the present invention does not limit the form of the table.
  • the terminal device 100 may set the heartbeat period of the social application to 1t step regardless of the context mode of the terminal device 100 , Set the heartbeat cycle of life applications to 2t step , and set the heartbeat cycle of tool applications to 1t step .
  • the terminal device 100 can set the heartbeat cycle of social applications to 2t step , the heartbeat cycle of life applications to 4t step , and the heartbeat cycle of tool applications to 2t step .
  • the terminal device 100 can set the heartbeat cycle of the social application to 1t step to set life
  • the heartbeat cycle of the class application is set to 2t step
  • the heartbeat cycle of the tool class application is set to 1t step .
  • the terminal device 100 It is understandable that if the duration of the screen off state of the terminal device 100 is greater than or equal to the preset threshold, and the scene mode of the terminal device 100 is any one of sports mode, sleep mode, pocket mode, or desktop mode, the terminal device 100 It is predicted that the terminal device 100 will not be noticed or used by the user for a relatively long period of time. In this case, the terminal device 100 can wake up the application with a relatively large heartbeat cycle.
  • the terminal device 100 predicts that the first application will be longer than other tool applications or life applications, etc. It is more likely to be followed or used by users within a period of time. Therefore, the first application and this type of application can be awakened with a relatively small heartbeat cycle. It should be noted that the above Table 1 is only an example. In some embodiments, in order to avoid excessive heartbeat cycles from affecting some tool applications (such as timers), the terminal device 100 may not use the heartbeat wake-up method of the application embodiments of the present application to wake up this type of application, but Wake up the application according to the system heartbeat clock.
  • the terminal device 100 may also be preset with a list of special applications, and for the applications in the list, the applications can be awakened according to the system heartbeat clock.
  • the foregoing Table 1 uses 10 minutes as an example of the preset threshold, and the preset screen-off duration threshold may also be other values, which is not limited in the embodiment of the present application.
  • the duration of the screen off state of the terminal device 100 is greater than or equal to the preset threshold, when the terminal device 100 is in different scenarios, the heartbeat cycles of applications of the same application type may also be different.
  • Table 2 it is another example of the correspondence between "application type”, “screen-off time”, “scene mode” and “heartbeat cycle” preset in the terminal device 100.
  • the corresponding relationship preset in the terminal device 100 may also be the corresponding relationship between "screen off time”, “scene mode”, and “frequency of foreground operation” and “heartbeat cycle”.
  • the “frequent degree of foreground operation” is used to characterize how frequently the application runs in the foreground of the terminal device 100 within a preset time.
  • the terminal device 100 may determine how frequently the application runs in the foreground of the terminal device 100 within a preset time according to the following rules: if the number of times the application runs in the foreground of the terminal device 100 within the preset time is greater than a first threshold (such as 50 Times), it is determined that the application runs at a high frequency; if the number of times the application runs in the foreground of the terminal device 100 within the preset time is greater than the second threshold (such as 10 times) and less than or equal to the first threshold (ie 50 times), then the application is determined The application runs at low frequency; if the number of times the application runs in the foreground of the terminal device 100 within the preset time is greater than 0 and less than or equal to the second threshold (ie 10 times), it is determined that the application runs occasionally; if the application is in the terminal device within the preset time If the number of 100 foreground runs is equal to 0, it is determined that the application is not running. Alternatively, other methods may also be used to determine how frequently the application runs in the
  • the terminal device 100 determines how frequently "WeChat,”"TodayToutiao", and “Taobao” run in the foreground of the terminal device 100 within a preset time: “WeChat” runs at high frequency, “Today Toutiao” runs at low frequency, and "Taobao” Not running.
  • FIG. 5 shows a schematic diagram of heartbeat clocks of multiple applications determined by the terminal device 100 in an embodiment of the present application.
  • the “rank for the number of times of running in the foreground” is 1, which means that the application runs the most times in the foreground of the terminal device 100 within the preset time.
  • 1 to N indicate that the number of times the application runs in the foreground of the terminal device 100 within a preset time is decreasing, where N>1, and N is an integer. It is understandable that, under the same conditions, the higher the “ranking of the number of foreground runs” of the application, the higher the possibility that the application will be used frequently, and the terminal device 100 can set its heartbeat cycle to be relatively smaller, which can be more High probability to ensure that the long connection between the application client and the application server is not broken.
  • the terminal device 100 determines the number of times that "WeChat”, “Today Toutiao” and “Taobao” run in the front desk of the terminal device 100 within a preset time are ranked as follows: “Ranked No. 4.
  • the terminal device 100 can determine that the heartbeat cycle of "WeChat” is 2t step , the heartbeat cycle of "Today's Toutiao” is 3t step , and the heartbeat cycle of "Taobao” is 4t step .
  • the corresponding relationship preset in the terminal device 100 may also be the corresponding relationship between "network type", “screen off time”, “scene mode”, and “frequency of foreground operation” and “heartbeat cycle” .
  • “network type” is used to characterize the type of network to which the terminal device 100 is connected.
  • the terminal device 100 may give up performing S302, that is, the terminal device 100 may give up determining the heartbeat period of the first application. Until the terminal device 100 is connected to the network, the terminal device 100 re-acquires the application indication information and/or usage scenario information (that is, re-executes S301), and then determines the application indication information and/or usage scenario information that is re-determined. Heartbeat cycle.
  • Table 1, Table 2, Table 3, Table 4, and Table 5 are only examples of the correspondence between application indication information and usage scenario information preset in several terminal devices 100 and the heartbeat cycle.
  • the embodiment of the application does not specifically limit the corresponding relationship, that is, the corresponding relationship can be "application type”, “long screen off time”, “scene mode”, “frequency of foreground operation” (or “foreground running frequency”).
  • the terminal device 100 may also analyze the application indication information of the first application obtained by the terminal device 100 in S301 and the usage scenario information of the terminal device 100, and predict the running law of the first application in a preset time period.
  • the terminal device 100 may determine the running rule of the first application within the preset time according to the time information obtained by the terminal device 100 in S301 and running the first application in the foreground of the terminal device 100 within the preset time. For example, as described above, the terminal device 100 may determine the high-frequency time period during which "WeChat” has been operating in the foreground of the terminal device 100 in the last week according to the detailed operation time of "WeChat” in the foreground of the terminal device 100 in the last week. Between 19:00 and 22:30 in the evening. That is, the terminal device 100 can predict that the user is used to using "WeChat” between 19:00 and 22:30 in the evening. In this case, the terminal device 100 can set the heartbeat cycle of "WeChat" between 19:00-22:30 every evening to be smaller, which can guarantee the communication between the "WeChat” client and the application server with greater probability. The long connection is not disconnected.
  • the terminal device 100 may predict the possibility that the first application will run in the foreground within a preset time period according to the specific function of the first application.
  • the first application is mainly used for ordering food, and the terminal device 100 can predict the lunch time period (such as 11:00-13:00) and the dinner time period (such as 18:00) of the first application according to the specific function of the first application. ⁇ 20:00), it is more likely to run in the foreground.
  • the terminal device 100 can set the heartbeat period of the first application in the lunch time period and the dinner time period to be smaller, so as to ensure that the client of the first application will communicate with the application in the above time period with a greater probability.
  • the long connection between the servers is not disconnected.
  • the heartbeat wake-up method of the application provided by the embodiment of the present application may further include:
  • S603 The terminal device 100 determines the first heartbeat moment.
  • the first heartbeat time may be the cut-off time T1 starting from the current time t and passing the first time length.
  • the heartbeat period of the first application is T. Please refer to Figure 7. As shown in Figure 7, the current moment is time t.
  • the first heartbeat time starts from the previous heartbeat time T00 at the current time t0, and the first time period has passed. Deadline T1.
  • the first duration is equal to the heartbeat period of the first application.
  • the current time is time t.
  • the terminal device 100 determines that the heartbeat period T of the first application is greater than or equal to the duration from the previous heartbeat time T00 to the current time t, that is, T ⁇ (t-T00).
  • the first heartbeat time starts from the next heartbeat time T11 at the current time t0 and passes through the first The cut-off time T1 of the duration T.
  • the current time is time t.
  • the terminal device 100 determines that the heartbeat period T of the first application is less than the duration from the previous heartbeat time T00 to the current time t, that is, T ⁇ (t-T00).
  • the heartbeat wake-up method of the application may further include:
  • S604 Starting from the first heartbeat moment, the terminal device 100 periodically wakes up the first application according to the heartbeat period of the first application.
  • the terminal device 100 periodically wakes up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application.
  • the terminal device 100 may continuously wake up the first application periodically until the client of the first application disconnects the long connection or the terminal device 100 turns on. As shown in FIG. 7, FIG. 8A and FIG. 8B, the terminal device 100 wakes up the first application at T1, T2... and so on in sequence.
  • the client of the first application disconnects the long connection, even if the terminal device 100 wakes up the client of the first application, it is meaningless for the client of the first application to send a heartbeat packet to the application server of the first application.
  • the first application needs to transmit data with the application server of the first application, the long connection between the first application and the application server of the first application needs to be re-established.
  • the terminal device 100 when the terminal device 100 is in the on-screen state, uses the system heartbeat clock as a reference for applying the heartbeat timing. It can be understood that, when the terminal device 100 is in the bright screen state, in order to ensure the best performance of the functions of all applications, the terminal device 100 usually does not interfere too much with the heartbeat cycle of the application. Therefore, if the terminal device 100 changes from the off-screen state to the on-screen state, as shown in FIG. 8, after the terminal device 100 changes from the off-screen state to the on-screen state, the terminal device 100 can end the application provided by the embodiment of the application. Heartbeat wake-up method.
  • the system heartbeat clock is used as a reference for the application heartbeat timing to periodically wake up the first application.
  • S605 The terminal device 100 judges whether the client of the first application disconnects the long connection or whether the screen off state of the terminal device 100 changes to the on screen state. If yes, the terminal device 100 executes S606.
  • the terminal device 100 stops periodically waking up the first application according to the heartbeat cycle of the first application.
  • the heartbeat wake-up method of the application provided in the embodiment of the present application may further include:
  • the terminal device 100 aligns the first heartbeat moment to the second heartbeat moment.
  • the above-mentioned second heartbeat moment is used for the terminal device 100 to wake up the first application at the second heartbeat moment to trigger the client of the first application to send a heartbeat packet to the application server of the first application.
  • the heartbeat time of the next application of different applications may be different.
  • the heartbeat moments t1, t2, and t3 of the next application of "WeChat", “Toutiao” and “Taobao” are all different.
  • t1 t0+300s
  • t2 t0+450s
  • t3 t0+600s. That is to say, in the case shown in FIG. 10, the terminal device 100 needs to wake up "WeChat” at time t1, then wake up "Today Toutiao” at time t2, and wake up "Taobao” at time t3.
  • the terminal device 100 needs to frequently wake up the application, which is obviously not conducive to the power saving of the terminal device 100.
  • the terminal device 100 may align the heartbeat time of the first application to the previous heartbeat time or the next heartbeat time of the heartbeat time. .
  • the terminal device 100 may align the heartbeat time of the first application to the previous heartbeat time or the next heartbeat time of the heartbeat time according to a preset condition.
  • the preset condition may be a preset alignment mode.
  • the preset alignment mode may include at least left alignment, right alignment, and nearest alignment.
  • the preset condition may also be other conditions or rules, which are not limited in the embodiment of the present application.
  • the terminal device 100 may align the heartbeat time of the first application to the previous system heartbeat time or the next system heartbeat time of the heartbeat time according to a preset condition.
  • the preset alignment mode is nearest alignment
  • the terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time closest to the first heartbeat time T1 according to the nearest alignment principle.
  • the system heartbeat time closest to the first heartbeat time T1 is T22.
  • the terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time T22. That is, the terminal device 100 wakes up the first application at time T22.
  • the terminal device 100 can align the first heartbeat time T1 of the first application to the first system heartbeat time after the first heartbeat time T1 according to the right alignment principle. As shown in (b) in Figure 11, the first system heartbeat time after the first heartbeat time T1 is T22. The terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time T alarm (T22). That is, the terminal device 100 wakes up the first application at time T22.
  • the terminal device 100 can align the first heartbeat time T1 of the first application to the nearest system heartbeat time before the first heartbeat time T1 according to the left-alignment principle. As shown in (c) in Figure 11, the latest system heartbeat time before the first heartbeat time T1 is T11. The terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time T alarm (T11). That is, the terminal device 100 wakes up the first application at time T11.
  • the terminal device 100 may perform statistics on the heartbeat moments of all applications that the terminal device 100 periodically wakes up. Combining the number of applications that the terminal device 100 plans to wake up at the first heartbeat time T1, and the number of applications that the terminal device 100 plans to wake up at the previous system heartbeat time and the next system heartbeat time T1, the foregoing preset conditions are determined. Alternatively, the preset condition may also be determined according to other conditions or rules, which are not limited in the embodiment of the present application.
  • the terminal device 100 plans to wake up 5 applications at the first heartbeat moment T1, plans to wake up 3 applications at the previous system heartbeat moment of T1, and plans to wake up 8 applications at the next system heartbeat moment of T1.
  • the terminal device 100 may set the alignment of the first heartbeat moment T1 to be right-aligned. Align all applications that are scheduled to wake up at this moment to the right to wake up at the next system heartbeat moment of T1.
  • S905 The terminal device 100 determines the next heartbeat moment.
  • the terminal device 100 may determine the next heartbeat time according to the heartbeat cycle T of the first application.
  • the last heartbeat time is the first heartbeat time T1
  • the next heartbeat time is after the first heartbeat time T1, and is separated from the first heartbeat time T1 by the first applied heartbeat period T.
  • S906 The terminal device 100 uses the same method as S904 to align the next heartbeat time after the first heartbeat time of the first application to the system heartbeat time.
  • the terminal device 100 aligns the next heartbeat moment after the first heartbeat moment of the first application to the system heartbeat moment for waking up the first application at the system heartbeat moment to trigger the client of the first application to report to the first application
  • the application server sends a heartbeat packet.
  • S907 The terminal device 100 judges whether the client of the first application disconnects the long connection or whether the screen off state of the terminal device 100 changes to the on screen state.
  • the terminal device 100 executes S905, S906, and S907 again. Using the same method, determine each heartbeat moment in turn. T2 and T3 in (a) in FIG. 11, (b) in FIG. 11, and (c) in FIG. 11, etc.
  • the terminal device 100 stops periodically waking up the first application according to the heartbeat cycle of the first application.
  • the terminal device 100 can stop periodically waking up the client of the first application.
  • the terminal device 100 may end the application heartbeat wake-up method provided in the embodiment of the present application.
  • the system heartbeat clock is used as a reference for the application heartbeat timing to periodically wake up the first application.
  • the application's heartbeat wake-up method provided in the embodiments of the present application can be used to dynamically adjust the heartbeat cycle of the application according to one or more of the actual conditions of the application and the usage scenario information of the terminal device. It can also reduce the power consumption of the terminal device in the off-screen state.
  • FIG. 12 it is an example diagram of power consumption comparison between the heartbeat wake-up method and the conventional heartbeat wake-up method using the application provided by the embodiment of the application.
  • (A) in Figure 12 shows the output current statistical results of the conventional heartbeat wake-up method within a certain period of time.
  • (B) in FIG. 12 shows the output current statistics result of the heartbeat wake-up method of the application provided by the embodiment of the present application within a certain period of time.
  • the working voltage of a terminal device is fixed, and the output current can reflect the power consumption of the terminal device.
  • the terminal device wakes up the application in a disorderly manner.
  • the terminal device wakes up the application relatively regularly.
  • FIG. 12 shows the power consumption comparison result between the heartbeat wake-up method using the application provided by the embodiment of the application and the conventional heartbeat wake-up method.
  • Figure 12 (a), Figure 12 (b), and Figure 12 (c) it can be seen that adopting the heartbeat wake-up method of the application provided by the embodiment of this application greatly reduces the terminal device in the off-screen state. Power consumption.
  • the terminal device 100 may collect first data through a sensor set in the terminal device 100, and analyze the first data, so as to determine the context mode information of the terminal device 100.
  • the sensor can be at least one of an acceleration sensor, a gyro sensor, a magnetic sensor, an ambient light sensor, a distance sensor, and a proximity light sensor.
  • the terminal device 100 can determine the posture of the terminal device 100 by analyzing the data collected by the acceleration sensor and/or the magnetic sensor and the gyroscope sensor, and then determine the scene mode information of the terminal device 100 according to the posture of the terminal device 100 .
  • the posture of the terminal device 100 includes at least the direction of movement, the speed of movement of the terminal device 100, and the yaw, pitch, and roll angles of the terminal device 100 relative to the ground coordinate system.
  • the acceleration sensor includes components such as masses and sensitive components.
  • the working principle of the acceleration sensor is: the sensitive element converts the inertial force received by the mass block into an electrical signal, thereby determining the translation direction and the translation speed of the terminal device 100 according to the electrical signal converted into the force of the mass block.
  • the force condition of the mass block is expressed as: the force direction of the mass block and the acceleration of the mass block in the force direction.
  • the force direction of the mass can include: six directions along the x b axis, y b axis and z b axis of the three -dimensional coordinate system, namely +x b , -x b , +y b , -y b , +z b and -z b directions. Therefore, in the first data, the data collected by the acceleration sensor may be the translation direction of the terminal device and the translation speed of the terminal device moving along the translation direction.
  • the gyro sensor includes components such as a gyro rotor and a drive motor.
  • the working principle of the gyro sensor is to drive the motor to drive the gyro rotor to rotate around the rotation axis.
  • the rotation axis of the gyro rotor obtained by measurement and the three-dimensional coordinate system of the terminal device 100 (including the X axis, Y axis, and Z axis) are clamped. Angle, and the angular velocity of the gyro rotor, thereby determining the rotation angle of the terminal device 100 relative to the three-dimensional coordinate system and the rotation angular velocity of the terminal device 100.
  • the principle of the magnetic sensor is similar to that of a compass, which can measure the angles between the terminal device 100 and the four directions of south, east, north, and west.
  • the acceleration sensor can measure "how far the terminal device 100 travels along the X axis"
  • the gyroscope sensor can measure “the terminal device 100 has turned around”
  • the magnetic sensor can measure “the terminal device 100 moves westward.”
  • FIG. 13 is a schematic diagram of a posture of a terminal device 100 according to an embodiment of this application.
  • the x b axis, the y b axis, the z b axis and the origin O constitute the coordinate system of the terminal device 100.
  • the x g axis, y g axis, z g axis and the origin O constitute a ground coordinate system.
  • O is the center of mass of the terminal device 100
  • the x b axis is in the symmetry plane of the terminal device 100 and is parallel to the body axis of the terminal device 100 and points to the head of the terminal device 100.
  • the y b axis is perpendicular to the x b axis and points to the right of the terminal device 100.
  • the z b axis is perpendicular to the x b axis and points below the body of the terminal device 100.
  • the x g axis is in the horizontal plane and points in a certain direction.
  • the z g axis is perpendicular to the ground and points to the center of the earth.
  • the yaw angle refers to the angle between the projection of the x b axis corresponding to the terminal device 100 on the horizontal plane and the x g axis of the ground coordinate system
  • the deflection of the front end of the terminal device 100 to the right is regarded as positive.
  • the pitch angle refers to the angle ⁇ between the x b axis corresponding to the terminal device 100 and the ground plane (or horizontal plane), with the front end portion of the terminal device 100 deflecting upward as a positive.
  • Roll angle refers to the angle ⁇ between the terminal device 100 corresponding to the vertical axis z b plane through the axis of the terminal device 100x b to the right terminal 100 is positive roller.
  • the terminal device 100 determines that the movement speed of the terminal device 100 is 0 m/s by analyzing the first data collected by the acceleration sensor, the magnetic sensor, and the gyro sensor, and the pitch angle ⁇ of the terminal device 100 is 0, and the roll angle ⁇ is 0. Then the terminal device 100 can determine that it is in the desktop mode.
  • the terminal device 100 determines the westward movement of the terminal device 100 by analyzing the data collected by the acceleration sensor, and the movement speed is 6 meters per second. The terminal device 100 can determine that it is in the sports mode. In this case, in some embodiments, the terminal device can ignore the yaw angle of the terminal device 100 Pitch angle ⁇ and roll angle ⁇ .
  • the terminal device 100 may further determine whether the terminal device 100 is in a running mode, a walking mode or a riding mode according to the speed range corresponding to the running mode preset in the terminal device 100. For example, if the speed range corresponding to the running mode preset in the terminal device 100 is 3 m/sec to 12 m/sec, the terminal device 100 can determine that it is in the running mode.
  • the terminal device 100 can also determine the environmental information of the terminal device 100 by analyzing the data collected by the ambient light sensor, the distance sensor, or the proximity light sensor, and then determine the terminal device 100 according to the environmental information of the terminal device 100. Profile information.
  • the terminal device 100 uses an ambient light sensor to determine that the ambient light brightness of the terminal device 100 is very dark, and in combination with data collected by a distance sensor or a proximity light sensor, it is determined that the screen of the terminal device is blocked by other objects. Based on the above results, the terminal device 100 can determine that it is in the pocket mode.
  • the terminal device 100 may determine the user's heart rate information by analyzing data collected by the heart rate sensor, and then determine the scene mode information of the terminal device 100 according to the user's heart rate information.
  • the terminal device 100 analyzes the user's heart rate information collected by the heart rate sensor, and determines that the heart rate information conforms to a preset heart rate of the person in a sleep state. In this case, the terminal device 100 may consider that the terminal device is not used by the user, and the terminal device 100 may determine that the terminal device 100 is in a sleep mode.
  • the heart rate sensor of the terminal device 100 can collect the user's heart rate information through the bracelet.
  • the scenario mode of the terminal device 100 in the embodiment of the present application may be determined by comprehensively analyzing data collected by multiple sensors. For example, when the terminal device 100 determines that the terminal device 100 is in the exercise mode by analyzing the first data collected by the acceleration sensor, the magnetic sensor, and the gyroscope sensor, the terminal device 100 may also combine the user's heart rate and other biometric indicators detected by the heart rate sensor, and further The terminal device 100 is in a running mode, a walking mode, or a riding mode. For example, the user's heart rate and other data detected by the heart rate sensor meets the pre-configured range of conventional biometric indicators of a person during running in the terminal device 100. In this case, the terminal device 100 can determine that it is in the running mode.
  • the terminal device includes a hardware structure and/or software module corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiment of the present application may divide the terminal device into functional modules.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • the terminal device 100 may include an information acquisition unit 1410, an analysis unit 1420, and an application wake-up unit 1430.
  • the information acquiring unit 1410 is used to support the terminal device 100 to perform S301, and/or other processes used in the technology described herein.
  • the analysis unit 1420 is used to support the terminal device 100 to perform S302, S603, S605, S904, S905, S906, and S907, and/or other processes used in the technology described herein.
  • the application wake-up unit 1430 is used to support the terminal device 100 to perform S604 and S908, and/or other processes used in the technology described herein.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the steps of the method or algorithm described in the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art Medium.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the detection device.
  • the processor and the storage medium may also exist as discrete components in the detection device.
  • the disclosed user equipment and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate.
  • the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, 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 software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Abstract

The present application discloses a heartbeat-based application wakeup method and a terminal apparatus, pertaining to the field of computers, enabling dynamic adjustment of an application wakeup period of a terminal apparatus according to an actual use condition and/or an actual application condition of the terminal apparatus, and improving user experience. The solution provided by the present application comprises: enabling a terminal apparatus to determine a heartbeat period of each application according to one or more of a screen off time in a screen off state, network state information, and scenario mode information of the terminal apparatus, an application type of the application, foreground running time or count information of the application within a pre-determined time in the terminal apparatus, and the like; and periodically waking up the corresponding application according to the determined heartbeat period, so as to trigger a client of the application to send a heartbeat packet to an application server of the application. The invention ensures a keep-alive connection established between an application and an application server of the application from being disconnected, while ensuring the power consumption of a terminal apparatus for sending heartbeat packets is minimized

Description

应用的心跳唤醒方法及终端设备Heartbeat wake-up method for application and terminal equipment
本申请要求于2019年9月12日提交国家知识产权局、申请号为201910867228.3、发明名称为“应用的心跳唤醒方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on September 12, 2019, the application number is 201910867228.3, and the invention title is "Applied heartbeat wake-up method and terminal equipment", the entire content of which is incorporated into this by reference Applying.
技术领域Technical field
本申请实施例涉及计算机领域,尤其涉及一种应用的心跳唤醒方法及终端设备。The embodiments of the present application relate to the computer field, and in particular to an applied heartbeat wake-up method and terminal equipment.
背景技术Background technique
目前,终端设备(例如,手机)上安装的应用(Application,APP)的客户端越来越多。一些应用的客户端在与该应用的应用服务器建立长连接后,若应用的客户端与应用服务器在较长时间内不进行通信,该长连接可能会断开。为了避免上述长连接断开,终端设备可以周期性唤醒该应用的客户端,如图1A所示,使得该应用的客户端向应用服务器发送心跳包,用于提醒应用服务器保持与该应用的客户端的长连接。At present, there are more and more clients of applications (APP) installed on terminal devices (for example, mobile phones). After the client of some applications establishes a long connection with the application server of the application, if the client of the application does not communicate with the application server for a long time, the long connection may be disconnected. In order to avoid the above-mentioned long connection disconnection, the terminal device can periodically wake up the client of the application, as shown in Figure 1A, so that the client of the application sends a heartbeat packet to the application server to remind the application server to stay with the client of the application Long connection at the end.
常规的方法中,终端设备通常是根据固定的心跳周期,周期性唤醒在终端设备后台运行的所有建立长连接的应用的客户端(如图1B中所示的应用客户端1~N,其中,N为正整数),以触发这些应用的客户端向对应的应用服务器发送心跳包,使得应用的客户端与应用服务器保持长连接。但是,对于用户不经常使用的应用,用户再次使用该应用的可能性较小,保持长连接不断开的需求则没有那么迫切。而上述根据固定的心跳周期周期性唤醒应用的客户端的方法,会使得不被经常使用的应用被不必要的经常唤醒,浪费终端设备电量。In the conventional method, the terminal device usually wakes up all the clients of the long-connected applications running in the background of the terminal device (application clients 1 to N as shown in Fig. 1B) according to a fixed heartbeat cycle, in which, N is a positive integer) to trigger the clients of these applications to send heartbeat packets to the corresponding application server, so that the client of the application maintains a long connection with the application server. However, for applications that users do not use frequently, users are less likely to use the application again, and the need to keep a long connection unbroken is not so urgent. However, the above method of periodically waking up the client of an application according to a fixed heartbeat cycle will cause applications that are not frequently used to be awakened unnecessarily frequently, and waste the power of the terminal device.
发明内容Summary of the invention
本申请实施例提供一种应用的心跳唤醒方法,可以根据终端设备的实际使用情况和/或应用的实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。The embodiment of the present application provides a heartbeat wake-up method for an application, which can dynamically adjust the period for the terminal device to wake up the application according to the actual usage of the terminal device and/or the actual situation of the application, so as to improve the user experience.
为达到上述目的,本申请实施例采用如下技术方案:To achieve the foregoing objectives, the following technical solutions are adopted in the embodiments of the present application:
第一方面,提供一种应用的心跳唤醒方法,该方法应用于终端设备,该终端设备中安装有多个应用的客户端,该方法包括:该终端设备在熄屏状态下,获取第一应用的应用指示信息和该终端设备的使用场景信息中的一个或多个信息;其中,第一应用与第一应用的应用服务器建立了长连接;上述应用指示信息用于指示第一应用的应用类型,和/或第一应用在预设时间内在该终端设备前台运行的时间信息或次数;上述使用场景信息包括:该终端设备的熄屏时间、网络状态信息和情景模式信息中的一项或多项;上述情景模式信息用于指示该终端设备处于运动模式、睡觉模式、口袋模式或桌面模式中的任一种模式;该终端设备根据上述应用指示信息和使用场景信息,确定第一应用的心跳周期,该第一应用的心跳周期用于周期性唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包。In a first aspect, an application heartbeat wake-up method is provided. The method is applied to a terminal device in which multiple application clients are installed. The method includes: the terminal device acquires the first application when the screen is off One or more of the application indication information of and the usage scenario information of the terminal device; wherein, the first application establishes a long connection with the application server of the first application; the application indication information is used to indicate the application type of the first application , And/or the time information or number of times the first application runs in the foreground of the terminal device within a preset time; the above-mentioned usage scenario information includes: one or more of the screen off time of the terminal device, network status information, and scene mode information Item; the above-mentioned scene mode information is used to indicate that the terminal device is in any one of sports mode, sleep mode, pocket mode, or desktop mode; the terminal device determines the heartbeat of the first application according to the above-mentioned application indication information and usage scenario information Period, the heartbeat period of the first application is used to periodically wake up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application.
上述第一方面提供的技术方案,终端设备可以根据终端设备在熄屏状态下的熄屏 时间、网络状态信息和情景模式信息、第一应用的应用类型和第一应用在预设时间内在终端设备前台运行的时间信息或次数等信息中的一种或多种,确定该第一应用的心跳周期。采用该方法,终端设备可以根据终端设备的实际使用情况和/或应用的实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。According to the technical solution provided by the above-mentioned first aspect, the terminal device can be based on the off-screen time of the terminal device in the off-screen state, network state information and scene mode information, the application type of the first application, and the first application in the terminal device within a preset time. One or more of the information such as the time information or the number of times the foreground is running determines the heartbeat period of the first application. By adopting this method, the terminal device can dynamically adjust the period for the terminal device to wake up the application according to the actual use situation of the terminal device and/or the actual situation of the application, so as to improve the user experience.
在一种可能的实现方式中,终端设备中包括一个或多个传感器,该一个或多个传感器包括:陀螺仪传感器、加速度传感器、磁传感器、环境光传感器、接近光传感器、距离传感器和心率传感器中的至少一个;该终端设备通过上述一个或多个传感器采集的参数,获取情景模式信息。本方案中,终端设备可以通过传感器采集的数据,确定终端设备的情景模式,以便终端设备可以根据该终端设备的情景模式,动态调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation, the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor At least one of: The terminal device obtains scene mode information through the parameters collected by the one or more sensors. In this solution, the terminal device can determine the context mode of the terminal device based on the data collected by the sensor, so that the terminal device can dynamically adjust the period of the terminal device to wake up the application according to the context mode of the terminal device to improve user experience.
在一种可能的实现方式中,上述网络状态信息用于指示终端设备连接到网络或者未连接到网络;如果上述终端设备连接到网络,该网络状态信息还用于指示终端设备连接的网络类型,以及该终端设备的信号质量。本方案中,终端设备可以根据获取的终端设备的联网实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation manner, the aforementioned network status information is used to indicate that the terminal device is connected to the network or not connected to the network; if the aforementioned terminal device is connected to the network, the network status information is also used to indicate the type of network that the terminal device is connected to, And the signal quality of the terminal equipment. In this solution, the terminal device can dynamically adjust the period at which the terminal device wakes up the application according to the acquired actual networking situation of the terminal device, so as to improve the user experience.
在一种可能的实现方式中,上述使用场景信息至少包括:终端设备的熄屏时间;该终端设备进入熄屏状态后,周期性获取第一应用的应用指示信息和终端设备的使用场景信息中的一个或多个信息。本方案中,终端设备可以周期性获取终端设备的熄屏时间、网络状态信息和情景模式信息等使用场景信息中的一项或多项,以便终端设备可以根据该终端设备的使用场景信息,周期性调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation, the above-mentioned usage scenario information includes at least: the screen-off time of the terminal device; after the terminal device enters the screen-off state, it periodically obtains the application indication information of the first application and the usage scenario information of the terminal device. One or more of the information. In this solution, the terminal device can periodically obtain one or more of the usage scenario information of the terminal device's screen-off time, network status information, and scenario mode information, so that the terminal device can periodically obtain the usage scenario information of the terminal device according to the usage scenario information of the terminal device. Adjust the cycle of terminal devices to wake up applications to improve user experience.
在一种可能的实现方式中,上述方法还包括:终端设备确定第一心跳时刻,该第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,该第一时长等于第一应用的心跳周期;终端设备从第一心跳时刻开始,按照第一应用的心跳周期,周期性唤醒第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包,直到该第一应用的客户端断开长连接或终端设备由熄屏状态转为亮屏状态。本方案中,终端设备可以根据确定的第一应用的心跳周期,周期性唤醒该第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包。保证第一应用与第一应用的应用服务器建立的长连接不断开的同时,可以保证第一应用由于发送心跳包消耗的电量最小化。In a possible implementation manner, the above method further includes: the terminal device determines the first heartbeat moment, the first heartbeat moment starts from the current moment, and after the first time period expires, the first time period is equal to that of the first application. Heartbeat cycle; starting from the moment of the first heartbeat, the terminal device periodically wakes up the first application according to the heartbeat cycle of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application until the first application The client of an application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state. In this solution, the terminal device may periodically wake up the first application according to the determined heartbeat period of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. While ensuring that the long connection established between the first application and the application server of the first application is not disconnected, it can be ensured that the power consumption of the first application due to sending the heartbeat packet is minimized.
在一种可能的实现方式中,上述方法还包括:终端设备确定第一心跳时刻,该第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,该第一时长等于第一应用的心跳周期;终端设备在当前时刻之后,距离第一心跳时刻最近的系统心跳时刻,唤醒第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包;在终端设备确定第一心跳时刻之后,终端设备循环执行以下步骤(1)和步骤(2),直到第一应用的客户端断开上述长连接或终端设备由熄屏状态转为亮屏状态:步骤(1):终端设备根据第一应用的心跳周期确定下一个心跳时刻;步骤(2):终端设备在距离下一个心跳时刻最近的系统心跳时刻,唤醒所述第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包;其中,系 统心跳时刻是终端设备根据开机时启动的系统心跳时钟确定的。本方案中,终端设备可以将根据确定的第一应用的心跳周期确定的第一应用的心跳时刻,按照预设规则(如就近对齐原则)对其至系统心跳时刻,避免不同应用的心跳时刻分布不集中导致的功耗过大。In a possible implementation manner, the above method further includes: the terminal device determines the first heartbeat moment, the first heartbeat moment starts from the current moment, and after the first time period expires, the first time period is equal to that of the first application. Heartbeat cycle; after the current time, the terminal device wakes up the first application at the system heartbeat time closest to the first heartbeat time to trigger the client of the first application to send a heartbeat packet to the application server of the first application; the terminal device determines After the first heartbeat moment, the terminal device cyclically executes the following steps (1) and (2), until the client of the first application disconnects the above-mentioned long connection or the terminal device changes from the off-screen state to the on-screen state: Step (1) : The terminal device determines the next heartbeat time according to the heartbeat period of the first application; step (2): The terminal device wakes up the first application at the system heartbeat time closest to the next heartbeat time to trigger the client of the first application The heartbeat packet is sent to the application server of the first application; wherein, the system heartbeat time is determined by the terminal device according to the system heartbeat clock started when the terminal device is turned on. In this solution, the terminal device can adjust the heartbeat time of the first application determined according to the determined heartbeat cycle of the first application to the system heartbeat time according to preset rules (such as the principle of nearest alignment) to avoid the heartbeat time distribution of different applications Excessive power consumption caused by non-concentration.
第二方面,提供一种终端设备,该终端设备中安装有多个应用的客户端,该终端设备包括:信息获取单元,用于在终端设备处于熄屏状态下,获取第一应用的应用指示信息和该终端设备的使用场景信息中的一个或多个信息;其中,第一应用与第一应用的应用服务器建立了长连接;上述应用指示信息用于指示第一应用的应用类型,和/或第一应用在预设时间内在该终端设备前台运行的时间信息或次数;上述使用场景信息包括:该终端设备的熄屏时间、网络状态信息和情景模式信息中的一项或多项;上述情景模式信息用于指示该终端设备处于运动模式、睡觉模式、口袋模式或桌面模式中的任一种模式;分析单元,用于根据上述应用指示信息和使用场景信息,确定第一应用的心跳周期,该第一应用的心跳周期用于周期性唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包。In a second aspect, a terminal device is provided. The terminal device is installed with multiple application clients. The terminal device includes: an information acquiring unit configured to acquire an application indication of a first application when the terminal device is in the off-screen state Information and one or more pieces of information in the usage scenario information of the terminal device; wherein the first application establishes a long connection with the application server of the first application; the above application indication information is used to indicate the application type of the first application, and/ Or the time information or the number of times the first application runs in the foreground of the terminal device within a preset time; the above usage scenario information includes: one or more of the screen off time of the terminal device, network status information, and scene mode information; the above The scene mode information is used to indicate that the terminal device is in any one of sports mode, sleep mode, pocket mode or desktop mode; the analysis unit is used to determine the heartbeat cycle of the first application according to the above application indication information and usage scenario information The heartbeat period of the first application is used to periodically wake up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application.
上述第二方面提供的技术方案,终端设备可以根据终端设备在熄屏状态下的熄屏时间、网络状态信息和情景模式信息、第一应用的应用类型和第一应用在预设时间内在终端设备前台运行的时间信息或次数等信息中的一种或多种,确定该第一应用的心跳周期。采用该方法,终端设备可以根据终端设备的实际使用情况和/或应用的实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。According to the technical solution provided by the above second aspect, the terminal device can be based on the off-screen time of the terminal device in the off-screen state, network state information and scene mode information, the application type of the first application, and the first application on the terminal device within a preset time. One or more of the information such as the time information or the number of times the foreground is running determines the heartbeat period of the first application. By adopting this method, the terminal device can dynamically adjust the period for the terminal device to wake up the application according to the actual use situation of the terminal device and/or the actual situation of the application, thereby improving the user experience.
在一种可能的实现方式中,终端设备中包括一个或多个传感器,该一个或多个传感器包括:陀螺仪传感器、加速度传感器、磁传感器、环境光传感器、接近光传感器、距离传感器和心率传感器中的至少一个;上述一个或多个传感器用于采集参数,使得信息获取单元根据所述参数确定所述情景模式信息。本方案中,终端设备可以通过传感器采集的数据,确定终端设备的情景模式,以便终端设备可以根据该终端设备的情景模式,动态调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation, the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor At least one of; the above-mentioned one or more sensors are used to collect parameters, so that the information acquisition unit determines the scene mode information according to the parameters. In this solution, the terminal device can determine the context mode of the terminal device based on the data collected by the sensor, so that the terminal device can dynamically adjust the period of the terminal device to wake up the application according to the context mode of the terminal device to improve user experience.
在一种可能的实现方式中,上述网络状态信息用于指示终端设备连接到网络或者未连接到网络;如果上述终端设备连接到网络,该网络状态信息还用于指示终端设备连接的网络类型,以及该终端设备的信号质量。本方案中,终端设备可以根据获取的终端设备的联网实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation manner, the aforementioned network status information is used to indicate that the terminal device is connected to the network or not connected to the network; if the aforementioned terminal device is connected to the network, the network status information is also used to indicate the type of network that the terminal device is connected to, And the signal quality of the terminal equipment. In this solution, the terminal device can dynamically adjust the period at which the terminal device wakes up the application according to the acquired actual networking situation of the terminal device, so as to improve the user experience.
在一种可能的实现方式中,上述使用场景信息至少包括:终端设备的熄屏时间;上述信息获取单元用于,在该终端设备进入熄屏状态后,周期性获取第一应用的应用指示信息和终端设备的使用场景信息中的一个或多个信息。本方案中,终端设备可以周期性获取终端设备的熄屏时间、网络状态信息和情景模式信息等使用场景信息中的一项或多项,以便终端设备可以根据该终端设备的使用场景信息,周期性调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation manner, the above-mentioned usage scenario information includes at least: the screen-off time of the terminal device; the above-mentioned information obtaining unit is configured to periodically obtain the application indication information of the first application after the terminal device enters the screen-off state And one or more pieces of information in the usage scenario information of the terminal device. In this solution, the terminal device can periodically obtain one or more of the usage scenario information of the terminal device's screen-off time, network status information, and scenario mode information, so that the terminal device can periodically obtain the usage scenario information of the terminal device according to the usage scenario information of the terminal device. Adjust the cycle of terminal devices to wake up applications to improve user experience.
在一种可能的实现方式中,上述分析单元还用于,确定第一心跳时刻,该第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,该第一时长等于第一应用的心跳周期;该终端设备还包括:应用唤醒单元,用于从第一心跳时刻开始, 按照第一应用的心跳周期,周期性唤醒第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包,直到该第一应用的客户端断开长连接或终端设备由熄屏状态转为亮屏状态。本方案中,终端设备可以根据确定的第一应用的心跳周期,周期性唤醒该第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包。保证第一应用与第一应用的应用服务器建立的长连接不断开的同时,可以保证第一应用由于发送心跳包消耗的电量最小化。In a possible implementation manner, the above analysis unit is also used to determine the first heartbeat moment, the first heartbeat moment is from the current moment, after the first time period cut-off time, the first time period is equal to the first application Heartbeat cycle; the terminal device also includes: an application wake-up unit, configured to wake up the first application periodically according to the heartbeat cycle of the first application from the moment of the first heartbeat, so as to trigger the client of the first application to the first application The application server of the application server sends a heartbeat packet until the client of the first application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state. In this solution, the terminal device may periodically wake up the first application according to the determined heartbeat period of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. While ensuring that the long connection established between the first application and the application server of the first application is not disconnected, it can be ensured that the power consumption of the first application due to sending the heartbeat packet is minimized.
在一种可能的实现方式中,上述分析单元还用于,确定第一心跳时刻,该第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,该第一时长等于第一应用的心跳周期;终端设备还包括:应用唤醒单元,用于在上述当前时刻之后,距离第一心跳时刻最近的系统心跳时刻,唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包;在上述分析单元确定第一心跳时刻之后,该分析单元和应用唤醒单元还用于,循环执行以下步骤(1)和步骤(2),直到第一应用的客户端断开上述长连接或终端设备由熄屏状态转为亮屏状态:步骤(1):分析单元根据第一应用的心跳周期确定下一个心跳时刻;步骤(2):应用唤醒单元在距离下一个心跳时刻最近的系统心跳时刻,唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包;其中,系统心跳时刻是终端设备根据开机时启动的系统心跳时钟确定的。本方案中,终端设备可以将根据确定的第一应用的心跳周期确定的第一应用的心跳时刻,按照预设规则(如就近对齐原则)对其至系统心跳时刻,避免不同应用的心跳时刻分布不集中导致的功耗过大。In a possible implementation manner, the above analysis unit is also used to determine the first heartbeat moment, the first heartbeat moment is from the current moment, after the first time period cut-off time, the first time period is equal to the first application Heartbeat cycle; the terminal device also includes: an application wake-up unit, which is used to wake up the first application at the system heartbeat time closest to the first heartbeat time after the above-mentioned current time, so as to trigger the client of the first application to the application of the first application The server sends a heartbeat packet; after the analysis unit determines the first heartbeat moment, the analysis unit and the application wake-up unit are also used to cyclically execute the following steps (1) and (2) until the client of the first application disconnects the above The long connection or the terminal device turns from the off-screen state to the on-screen state: Step (1): The analysis unit determines the next heartbeat time according to the heartbeat cycle of the first application; Step (2): The application wake-up unit is closest to the next heartbeat time The system heartbeat time of the terminal device wakes up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application; wherein the system heartbeat time is determined by the terminal device according to the system heartbeat clock started when the terminal device is turned on. In this solution, the terminal device can adjust the heartbeat time of the first application determined according to the determined heartbeat cycle of the first application to the system heartbeat time according to preset rules (such as the principle of nearest alignment) to avoid the heartbeat time distribution of different applications Excessive power consumption caused by inconcentration.
第三方面,提供一种终端设备,该终端设备包括:存储器,用于存储一个或多个计算机程序;射频电路,用于进行无线电信号的发送和接收;处理器,用于执行存储器存储的一个或多个计算机程序,使得该终端设备在终端设备处于熄屏状态下,获取第一应用的应用指示信息和该终端设备的使用场景信息中的一个或多个信息;其中,第一应用与第一应用的应用服务器建立了长连接;上述应用指示信息用于指示第一应用的应用类型,和/或第一应用在预设时间内在该终端设备前台运行的时间信息或次数;上述使用场景信息包括:该终端设备的熄屏时间、网络状态信息和情景模式信息中的一项或多项;上述情景模式信息用于指示该终端设备处于运动模式、睡觉模式、口袋模式或桌面模式中的任一种模式;以及,根据上述应用指示信息和使用场景信息,确定第一应用的心跳周期,该第一应用的心跳周期用于周期性唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包。In a third aspect, a terminal device is provided. The terminal device includes: a memory for storing one or more computer programs; a radio frequency circuit for transmitting and receiving radio signals; and a processor for executing a memory stored in the memory. Or multiple computer programs to enable the terminal device to obtain one or more of the application indication information of the first application and the usage scenario information of the terminal device when the terminal device is in the off-screen state; wherein, the first application and the first application The application server of an application establishes a long connection; the above-mentioned application indication information is used to indicate the application type of the first application, and/or the time information or the number of times the first application runs in the foreground of the terminal device within a preset time; the above-mentioned usage scenario information Including: one or more of the screen-off time of the terminal device, network status information, and scene mode information; the above-mentioned scene mode information is used to indicate that the terminal device is in any of sports mode, sleep mode, pocket mode, or desktop mode. A mode; and, according to the above application indication information and usage scenario information, the heartbeat cycle of the first application is determined, and the heartbeat cycle of the first application is used to periodically wake up the first application to trigger the client of the first application to the first application The application server of an application sends a heartbeat packet.
上述第三方面提供的技术方案,终端设备可以根据终端设备在熄屏状态下的熄屏时间、网络状态信息和情景模式信息、第一应用的应用类型和第一应用在预设时间内在终端设备前台运行的时间信息或次数等信息中的一种或多种,确定该第一应用的心跳周期。采用该方法,终端设备可以根据终端设备的实际使用情况和/或应用的实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。According to the technical solution provided by the above third aspect, the terminal device can be based on the off time of the terminal device in the off state, network state information and scene mode information, the application type of the first application, and the first application on the terminal device within a preset time. One or more of the information such as the time information or the number of times the foreground is running determines the heartbeat period of the first application. By adopting this method, the terminal device can dynamically adjust the period for the terminal device to wake up the application according to the actual use situation of the terminal device and/or the actual situation of the application, so as to improve the user experience.
在一种可能的实现方式中,终端设备中包括一个或多个传感器,该一个或多个传感器包括:陀螺仪传感器、加速度传感器、磁传感器、环境光传感器、接近光传感器、距离传感器和心率传感器中的至少一个;上述一个或多个传感器用于采 集参数,使得信息获取单元根据所述参数确定所述情景模式信息。本方案中,终端设备可以通过传感器采集的数据,确定终端设备的情景模式,以便终端设备可以根据该终端设备的情景模式,动态调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation, the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor At least one of; the above-mentioned one or more sensors are used to collect parameters, so that the information acquisition unit determines the scene mode information according to the parameters. In this solution, the terminal device can determine the context mode of the terminal device based on the data collected by the sensor, so that the terminal device can dynamically adjust the period of the terminal device to wake up the application according to the context mode of the terminal device to improve user experience.
在一种可能的实现方式中,上述网络状态信息用于指示终端设备连接到网络或者未连接到网络;如果上述终端设备连接到网络,该网络状态信息还用于指示终端设备连接的网络类型,以及该终端设备的信号质量。本方案中,终端设备可以根据获取的终端设备的联网实际情况,动态调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation manner, the aforementioned network status information is used to indicate that the terminal device is connected to the network or not connected to the network; if the aforementioned terminal device is connected to the network, the network status information is also used to indicate the type of network that the terminal device is connected to, And the signal quality of the terminal equipment. In this solution, the terminal device can dynamically adjust the period at which the terminal device wakes up the application according to the acquired actual networking situation of the terminal device, so as to improve the user experience.
在一种可能的实现方式中,上述使用场景信息至少包括:终端设备的熄屏时间;上述处理器用于,执行存储器存储的一个或多个计算机程序,使得该终端设备在该终端设备进入熄屏状态后,周期性获取第一应用的应用指示信息和终端设备的使用场景信息中的一个或多个信息。本方案中,终端设备可以周期性获取终端设备的熄屏时间、网络状态信息和情景模式信息等使用场景信息中的一项或多项,以便终端设备可以根据该终端设备的使用场景信息,周期性调整终端设备唤醒应用的周期,提高用户体验。In a possible implementation manner, the aforementioned usage scenario information includes at least: the screen-off time of the terminal device; the aforementioned processor is configured to execute one or more computer programs stored in the memory, so that the terminal device enters the screen-off time of the terminal device. After the state, periodically obtain one or more of the application indication information of the first application and the usage scenario information of the terminal device. In this solution, the terminal device can periodically obtain one or more of the usage scenario information of the terminal device's screen-off time, network status information, and scenario mode information, so that the terminal device can periodically obtain the usage scenario information of the terminal device according to the usage scenario information of the terminal device. Adjust the cycle of terminal devices to wake up applications to improve user experience.
在一种可能的实现方式中,上述处理器还用于,执行存储器存储的一个或多个计算机程序,使得该终端设备确定第一心跳时刻,该第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,该第一时长等于第一应用的心跳周期;以及,从第一心跳时刻开始,按照第一应用的心跳周期,周期性唤醒第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包,直到该第一应用的客户端断开长连接或终端设备由熄屏状态转为亮屏状态。本方案中,终端设备可以根据确定的第一应用的心跳周期,周期性唤醒该第一应用,以触发该第一应用的客户端向第一应用的应用服务器发送心跳包。保证第一应用与第一应用的应用服务器建立的长连接不断开的同时,可以保证第一应用由于发送心跳包消耗的电量最小化。In a possible implementation manner, the above-mentioned processor is further configured to execute one or more computer programs stored in the memory, so that the terminal device determines the first heartbeat moment. The first heartbeat moment starts from the current moment and passes through the first heartbeat moment. A one-time cut-off time, the first duration is equal to the heartbeat cycle of the first application; and, starting from the first heartbeat time, the first application is periodically woken up according to the heartbeat cycle of the first application to trigger the client of the first application The terminal sends a heartbeat packet to the application server of the first application until the client of the first application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state. In this solution, the terminal device may periodically wake up the first application according to the determined heartbeat period of the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. While ensuring that the long connection established between the first application and the application server of the first application is not disconnected, it can be ensured that the power consumption of the first application due to sending the heartbeat packet is minimized.
在一种可能的实现方式中,上述处理器还用于,执行存储器存储的一个或多个计算机程序,使得该终端设备确定第一心跳时刻,该第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,该第一时长等于第一应用的心跳周期;以及,在上述当前时刻之后,距离第一心跳时刻最近的系统心跳时刻,唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包;在终端设备确定第一心跳时刻之后,上述处理器还用于,执行存储器存储的一个或多个计算机程序,使得该终端设备循环执行以下步骤(1)和步骤(2),直到第一应用的客户端断开上述长连接或终端设备由熄屏状态转为亮屏状态:步骤(1):根据第一应用的心跳周期确定下一个心跳时刻;步骤(2):在距离下一个心跳时刻最近的系统心跳时刻,唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包;其中,系统心跳时刻是终端设备根据开机时启动的系统心跳时钟确定的。本方案中,终端设备可以将根据确定的第一应用的心跳周期确定的第一应用的心跳时刻,按照预设规则(如就近对齐原则)对其至系统心跳时刻,避免不同应用的心跳时刻分布不集中导致的功耗过大。In a possible implementation manner, the above-mentioned processor is further configured to execute one or more computer programs stored in the memory, so that the terminal device determines the first heartbeat moment. The first heartbeat moment starts from the current moment and passes through the first heartbeat moment. A one-time cut-off time, the first duration is equal to the heartbeat period of the first application; and, after the above current time, the system heartbeat time closest to the first heartbeat time, wake up the first application to trigger the client of the first application Send a heartbeat packet to the application server of the first application; after the terminal device determines the first heartbeat moment, the above-mentioned processor is further configured to execute one or more computer programs stored in the memory, so that the terminal device cyclically executes the following steps (1) And step (2), until the client of the first application disconnects the above-mentioned long connection or the terminal device changes from the off-screen state to the on-screen state: Step (1): Determine the next heartbeat time according to the heartbeat cycle of the first application; Step (2): At the system heartbeat moment closest to the next heartbeat moment, wake up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application; among them, the system heartbeat moment is based on the power-on of the terminal device Is determined by the system heartbeat clock that is started at the time. In this solution, the terminal device can adjust the heartbeat time of the first application determined according to the determined heartbeat cycle of the first application to the system heartbeat time according to preset rules (such as the principle of nearest alignment) to avoid the heartbeat time distribution of different applications Excessive power consumption caused by non-concentration.
第四方面,提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算 机执行指令,该计算机执行指令被处理器执行时实现如第一方面任一种可能的实现方式中的应用的心跳唤醒方法。In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, an application as in any one of the possible implementation manners of the first aspect is implemented The heartbeat wake-up method.
第五方面,提供一种芯片系统,该芯片系统可以包括存储介质,用于存储指令;处理电路,用于执行上述指令,实现如第一方面任一种可能的实现方式中的应用的心跳唤醒方法。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a fifth aspect, a chip system is provided. The chip system may include a storage medium for storing instructions; a processing circuit for executing the foregoing instructions to realize the heartbeat wake-up of the application as in any one of the possible implementation manners of the first aspect method. The chip system can be composed of chips, or it can include chips and other discrete devices.
第六方面,提供一种计算机程序产品,提供一种计算机程序产品,该计算机程序产品包括程序指令,当程序指令在计算机上运行时,以实现如第一方面任一种可能的实现方式中的应用的心跳唤醒方法。例如,该计算机可以是至少一个存储节点。In a sixth aspect, a computer program product is provided, and a computer program product is provided. The computer program product includes program instructions. When the program instructions are run on a computer, the program instructions can be implemented in any one of the possible implementation manners of the first aspect. The application's heartbeat wake-up method. For example, the computer may be at least one storage node.
附图说明Description of the drawings
图1A为本申请实施例提供的一种终端设备周期性唤醒应用的客户端的示意图;FIG. 1A is a schematic diagram of a terminal device periodically waking up a client of an application according to an embodiment of the application;
图1B为本申请实施例提供的一种常规的应用心跳技术示意图;FIG. 1B is a schematic diagram of a conventional applied heartbeat technology provided by an embodiment of this application;
图2A为本申请实施例提供的一种终端设备的硬件结构示意图;2A is a schematic diagram of the hardware structure of a terminal device provided by an embodiment of the application;
图2B为本申请实施例提供的一种系统心跳时钟示意图;2B is a schematic diagram of a system heartbeat clock provided by an embodiment of this application;
图3为本申请实施例提供的一种应用的心跳唤醒方法流程图一;FIG. 3 is a first flowchart of an application heartbeat wake-up method provided by an embodiment of this application;
图4为本申请实施例提供的一种确定心跳周期的方法原理示意图;4 is a schematic diagram of the principle of a method for determining a heartbeat cycle provided by an embodiment of the application;
图5为本申请实施例提供的一种终端设备确定出的多个应用的心跳时钟示意图;FIG. 5 is a schematic diagram of heartbeat clocks of multiple applications determined by a terminal device according to an embodiment of this application;
图6为本申请实施例提供的一种应用的心跳唤醒方法流程图二;FIG. 6 is a second flowchart of an application heartbeat wake-up method provided by an embodiment of this application;
图7为本申请实施例提供的一种确定第一心跳时刻的示例图一;FIG. 7 is an example diagram 1 for determining the first heartbeat moment provided by an embodiment of the application; FIG.
图8A为本申请实施例提供的一种确定第一心跳时刻的示例图二;FIG. 8A is an example diagram 2 for determining the first heartbeat moment provided by an embodiment of the application; FIG.
图8B为本申请实施例提供的一种确定第一心跳时刻的示例图三;FIG. 8B is an example diagram 3 for determining the first heartbeat moment provided by an embodiment of the application; FIG.
图9为本申请实施例提供的一种应用的心跳唤醒方法流程图三;FIG. 9 is a third flowchart of an application heartbeat wake-up method provided by an embodiment of this application;
图10为本申请实施例提供的一种应用心跳时钟示意图;FIG. 10 is a schematic diagram of an application heartbeat clock provided by an embodiment of this application;
图11为本申请实施例提供的一种心跳时刻对齐示例图;FIG. 11 is an example diagram of a heartbeat time alignment provided by an embodiment of the application;
图12为本申请实施例提供的应用的心跳唤醒方法与常规心跳唤醒方法的功耗对比示例图;FIG. 12 is an example diagram of power consumption comparison between the heartbeat wake-up method of the application provided by the embodiment of the application and the conventional heartbeat wake-up method;
图13为本申请实施例提供的一种终端设备的姿态示意图;FIG. 13 is a schematic diagram of a posture of a terminal device provided by an embodiment of the application;
图14为本申请实施例提供的一种终端设备的结构示意图。FIG. 14 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
具体实施方式detailed description
本申请实施例提供一种应用的心跳唤醒方法,该方法应用于终端设备在熄屏状态下,周期性唤醒后台运行的应用的客户端的过程中。其中,终端设备周期性唤醒后台运行的应用的客户端,用于触发该应用的客户端向与其建立了长连接的应用服务器发送心跳包,使得该应用的客户端可以保持与应用服务器的长连接。The embodiment of the present application provides a heartbeat wake-up method of an application, which is applied to a process of periodically waking up a client of an application running in the background when a terminal device is in an off-screen state. Among them, the terminal device periodically wakes up the client of the application running in the background, and is used to trigger the client of the application to send a heartbeat packet to the application server with which it has established a long connection, so that the client of the application can maintain a long connection with the application server .
在本申请实施例中,前台运行指的是应用当前在终端设备中运行,占用终端设备的系统资源,且当前在终端设备屏幕上显示该应用的窗口界面。后台运行指的是应用当前终端设备中运行,占用端设备的系统资源,但是当前在终端设备屏幕上不显示相关界面。In the embodiments of the present application, the foreground operation refers to that the application is currently running in the terminal device, occupies the system resources of the terminal device, and the window interface of the application is currently displayed on the screen of the terminal device. Background running refers to the application running in the current terminal device, occupying the system resources of the terminal device, but the relevant interface is not currently displayed on the terminal device screen.
在本申请实施例中,长连接是基于传输控制协议/网络通讯协议(Transmission Control Protocol/Internet Protocol,TCP/IP)的,又称TCP连接。可以理解的是,在TCP连接的连接建立阶段,应用的客户端需要与应用服务器进行三次握手(包括第一次握 手、第二次握手和第三次握手)。用于与应用服务器的指定端口连接,建立TCP连接,以及同步TCP连接双方的序列号((Sequence Number,SN)、确认序号(Acknowledgement Number,AN)和TCP窗口信息等。在TCP连接的连接拆除阶段,应用的客户端与应用服务器进行四次挥手(包括第一次挥手、第二次挥手、第三次挥手和第四次挥手)。用于解除应用的客户端与应用服务器之间的TCP连接。其中,该四次挥手可以由应用的客户端发起,也可以由应用服务器发起。In the embodiment of this application, the long connection is based on the Transmission Control Protocol/Internet Protocol (TCP/IP), which is also called a TCP connection. It is understandable that in the connection establishment phase of the TCP connection, the client of the application needs to perform a three-way handshake with the application server (including the first handshake, the second handshake, and the third handshake). It is used to connect to the designated port of the application server, establish a TCP connection, and synchronize the sequence number ((Sequence Number, SN), Acknowledgement Number (AN) and TCP window information of both sides of the TCP connection. The TCP connection is disconnected In the stage, the client of the application and the application server waved four times (including the first wave, the second wave, the third wave, and the fourth wave). Used to release the TCP between the application client and the application server Connection. Among them, the four waves of hands can be initiated by the client of the application or by the application server.
在一些情况下,TCP连接是按需建立连接,若收发双方的数据或信令传输完成,则断开收发双方之间的TCP连接。待下一次有数据或信令传输需求时,再重新建立TCP连接,该连接称为短连接。但是,由于TCP连接的连接建立阶段和连接拆除阶段过程较为复杂,如果该TCP连接经常断开,那么在下次进行数据包传输时,便需要再次进行三次握手建立该TCP连接,这会浪费一定的时间以及系统开销。因此,为了节省时间以及系统开销,可以保持应用的客户端与应用服务器之间的长连接。即,即使收发双方之间结束数据或信令传输,该TCP连接也不会断开。这样,在下一次需要传输数据包时,便可以直接通过该长连接传输数据包。In some cases, the TCP connection is to establish a connection on demand. If the data or signaling transmission between the sender and receiver is completed, the TCP connection between the sender and receiver is disconnected. When there is a demand for data or signaling transmission next time, the TCP connection is re-established. This connection is called a short connection. However, because the connection establishment phase and connection removal phase of the TCP connection are more complicated, if the TCP connection is often disconnected, then the next time the data packet is transmitted, the three-way handshake will be required to establish the TCP connection again, which will waste a certain amount of time. Time and system overhead. Therefore, in order to save time and system overhead, a long connection between the client of the application and the application server can be maintained. That is, even if the data or signaling transmission between the sender and receiver ends, the TCP connection will not be disconnected. In this way, when the data packet needs to be transmitted next time, the data packet can be directly transmitted through the long connection.
在一些情况下,在应用的客户端与应用服务器保持长连接时,若应用的客户端与应用服务器在较长的时间内未传输数据或者信令,出于节省网络资源的目的,应用服务器会断开与客户端之间的长连接,将更多的网络资源留给其他有传输需求的设备。示例性的,通常情况下,若应用的客户端与应用服务器在5分钟之内未传输数据或者信令,应用服务器会断开上述长连接。因此,为了使得应用的客户端与应用服务器之间长连接不断开,终端设备可以周期性唤醒应用,使得该应用的客户端周期性向应用服务器发送心跳包,以保证应用服务器始终认为上述长连接是活跃状态,从而避免上述长连接被拆链。In some cases, when the client of the application maintains a long connection with the application server, if the client of the application and the application server do not transmit data or signaling for a long time, for the purpose of saving network resources, the application server will Disconnect the long connection with the client, leaving more network resources to other devices with transmission requirements. Exemplarily, under normal circumstances, if the client of the application and the application server do not transmit data or signaling within 5 minutes, the application server will disconnect the aforementioned long connection. Therefore, in order to keep the long connection between the client of the application and the application server unbroken, the terminal device can periodically wake up the application so that the client of the application periodically sends a heartbeat packet to the application server to ensure that the application server always considers the long connection to be Active state, so as to prevent the above-mentioned long connection from being disconnected.
在本申请实施例提供的应用的心跳唤醒方法中,终端设备可以是上网本、平板电脑、智能手表等。或者,终端设备还可以是其他具有无线电通信功能的桌面型设备、膝上型设备、手持型设备、可穿戴设备、智能家居设备和车载型设备等,例如超级移动个人计算机(Ultra-mobile Personal Computer,UMPC)、智能相机、上网本、个人数字助理(Personal Digital Assistant,PDA)、便携式多媒体播放器(Portable Multimedia Player,PMP)、AR(增强现实)/VR(虚拟现实)设备、飞行器、机器人等。本申请实施例对终端设备的具体类型和结构等不作限定。In the heartbeat wake-up method of the application provided in the embodiment of the present application, the terminal device may be a netbook, a tablet computer, a smart watch, and the like. Or, the terminal device can also be other desktop devices, laptop devices, handheld devices, wearable devices, smart home devices, and vehicle-mounted devices with radio communication functions, such as Ultra-mobile Personal Computers (Ultra-mobile Personal Computer). , UMPC), smart cameras, netbooks, personal digital assistants (Personal Digital Assistant, PDA), portable multimedia players (Portable Multimedia Player, PMP), AR (augmented reality)/VR (virtual reality) equipment, aircraft, robots, etc. The embodiment of the present application does not limit the specific type and structure of the terminal device.
请参考图2A,如图2A所示,为本申请实施例提供的一种终端设备的硬件结构示意图。如图2A所示,终端设备100可以包括处理器210,存储器(包括外部存储器接口220和内部存储器221),通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。其中,传感器模块280可以包括压力传感器280A,陀螺仪传感器280B,加速度传感器280C,磁传感器280D,环境光传感器280E,距离传感器280F,接近光传感器280G,心率传感器280H,气压传感器,指纹传感器,温度传感器,触摸传感器,骨传导传感器等。Please refer to FIG. 2A, as shown in FIG. 2A, a schematic diagram of the hardware structure of a terminal device provided by an embodiment of this application. As shown in FIG. 2A, the terminal device 100 may include a processor 210, a memory (including an external memory interface 220 and an internal memory 221), a universal serial bus (USB) interface 230, a charging management module 240, and a power management module 241, battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, earphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. Among them, the sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an acceleration sensor 280C, a magnetic sensor 280D, an ambient light sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a heart rate sensor 280H, an air pressure sensor, a fingerprint sensor, and a temperature sensor. , Touch sensor, bone conduction sensor, etc.
可以理解的是,本发明实施例示意的结构并不构成对终端设备100的具体限定。在本申请另一些实施例中,终端设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. Among them, the different processing units may be independent devices or integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 210. If the processor 210 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 210 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 210 may include one or more interfaces. The interface can include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备100的结构限定。在本申请另一些实施例中,终端设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。The charging management module 240 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger.
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 294, the camera 293, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 241 may also be provided in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
终端设备100的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。终端设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开 关结合使用。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna can be used in conjunction with a tuning switch.
移动通信模块250可以提供应用在终端设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。The mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the terminal device 100. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 250 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210. In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 may be provided in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块250或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through the display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be provided in the same device as the mobile communication module 250 or other functional modules.
无线通信模块260可以提供应用在终端设备100上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 260 can provide applications on the terminal device 100 including wireless local area networks (wireless local area networks, WLAN) (such as Wi-Fi networks), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS). ), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 may also receive a signal to be sent from the processor 210, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
在一些实施例中,终端设备100的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得终端设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。In some embodiments, the antenna 1 of the terminal device 100 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
终端设备100通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device 100 implements a display function through a GPU, a display screen 294, and an application processor. The GPU is an image processing microprocessor, which is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏294用于显示图像,视频等。显示屏294包括显示面板。在一些实施例中,终端设备100可以包括1个或N个显示屏294,N为大于1的正整数。The display screen 294 is used to display images, videos, and the like. The display screen 294 includes a display panel. In some embodiments, the terminal device 100 may include one or N display screens 294, and N is a positive integer greater than one.
终端设备100可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及 应用处理器等实现拍摄功能。ISP用于处理摄像头293反馈的数据。摄像头293用于捕获静态图像或视频。在一些实施例中,终端设备100可以包括1个或N个摄像头293,N为大于1的正整数。数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。The terminal device 100 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor. The ISP is used to process the data fed back by the camera 293. The camera 293 is used to capture still images or videos. In some embodiments, the terminal device 100 may include 1 or N cameras 293, and N is a positive integer greater than 1. Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the terminal device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备100的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function.
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器210通过运行存储在内部存储器221的指令,和/或存储在设置于处理器中的存储器的指令,执行终端设备100的各种功能应用以及数据处理。The internal memory 221 may be used to store computer executable program code, where the executable program code includes instructions. The internal memory 221 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the terminal device 100. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 210 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 221 and/or instructions stored in a memory provided in the processor.
终端设备100可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如,音乐播放,录音等。The terminal device 100 can implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, and an application processor. For example, music playback, recording, etc.
压力传感器280A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器280A可以设置于显示屏294。压力传感器280A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器280A,电极之间的电容改变。终端设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏294,终端设备100根据压力传感器280A检测所述触摸操作强度。终端设备100也可以根据压力传感器280A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 280A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 280A may be provided on the display screen 294. There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors and so on. The capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 280A, the capacitance between the electrodes changes. The terminal device 100 determines the strength of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 280A. The terminal device 100 may also calculate the touched position based on the detection signal of the pressure sensor 280A. In some embodiments, touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example, when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
陀螺仪传感器280B可以用于确定终端设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器280B确定终端设备100围绕三个轴(即,x,y和z轴)的角速度。The gyro sensor 280B may be used to determine the movement posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (ie, x, y, and z axes) can be determined by the gyro sensor 280B.
加速度传感器280C可检测终端设备100在各个方向上(一般为三轴)加速度的大小。当终端设备100静止时可检测出重力的大小及方向。还可以用于识别终端设备100的姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 280C can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device 100, and is used in applications such as horizontal and vertical screen switching, pedometers and so on.
磁传感器280D是把磁场、电流、应力应变、温度、光等外界因素引起敏感元件磁性能变化转换成电信号,以这种方式来检测相应物理量的器件。在一些实施例中,通过磁传感器280D可以测量出终端设备100与东南西北四个方向的夹角。The magnetic sensor 280D is a device that converts the change in the magnetic properties of the sensitive element caused by external factors such as magnetic field, current, stress and strain, temperature, light, etc., into an electrical signal, and detects the corresponding physical quantity in this way. In some embodiments, the angles between the terminal device 100 and the four directions of south, east, north, and west can be measured by the magnetic sensor 280D.
环境光传感器280E用于感知环境光亮度。终端设备100可以根据感知的环境光亮度自适应调节显示屏294亮度。环境光传感器280E也可用于拍照时自动调节白平衡。 在一些实施例中,环境光传感器280E还可以与接近光传感器配合,检测终端设备100是否在口袋里,以防误触。The ambient light sensor 280E is used to sense the brightness of the ambient light. The terminal device 100 can adaptively adjust the brightness of the display screen 294 according to the perceived brightness of the ambient light. The ambient light sensor 280E can also be used to automatically adjust the white balance when taking pictures. In some embodiments, the ambient light sensor 280E can also cooperate with the proximity light sensor to detect whether the terminal device 100 is in a pocket to prevent accidental touch.
距离传感器280F,用于测量距离。终端设备100可以通过红外或激光测量距离。在一些实施例中,距离传感器280F可以用于检测终端设备100周围是否有障碍物遮挡或者覆盖。Distance sensor 280F, used to measure distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, the distance sensor 280F may be used to detect whether there is obstruction or coverage around the terminal device 100.
接近光传感器280G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端设备100通过发光二极管向外发射红外光。终端设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端设备100附近有物体。当检测到不充分的反射光时,终端设备100可以确定终端设备100附近没有物体。The proximity light sensor 280G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light to the outside through the light emitting diode. The terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100.
心率传感器280H用于测量用户心率及其他生物计量指标。例如,心率传感器280H可以是光学心率传感器。在一些实施例中,心率传感器280H可以通过用户穿戴的手环等可穿戴设备测量用户心率及其他生物计量指标。The heart rate sensor 280H is used to measure the user's heart rate and other biometric indicators. For example, the heart rate sensor 280H may be an optical heart rate sensor. In some embodiments, the heart rate sensor 280H can measure the user's heart rate and other biometric indicators through a wearable device such as a wristband worn by the user.
指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 292 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。马达291可以产生振动提示。指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和终端设备100的接触和分离。The button 290 includes a power-on button, a volume button, and so on. The button 290 may be a mechanical button. It can also be a touch button. The motor 291 can generate vibration prompts. The indicator 292 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on. The SIM card interface 295 is used to connect to the SIM card. The SIM card can be inserted into the SIM card interface 295 or pulled out from the SIM card interface 295 to achieve contact and separation with the terminal device 100.
如上文所述,常规的方法中,终端设备可以根据固定的心跳周期,周期性唤醒在终端设备后台运行的,与应用服务器建立长连接的所有应用的客户端。示例性的,终端设备可以根据系统心跳时钟指示的心跳时刻,周期性唤醒应用的客户端。As mentioned above, in the conventional method, the terminal device can periodically wake up all application clients that are running in the background of the terminal device and establish a long connection with the application server according to a fixed heartbeat cycle. Exemplarily, the terminal device may periodically wake up the client of the application according to the heartbeat time indicated by the system heartbeat clock.
其中,系统心跳时钟是在终端设备100开机时,终端设备100的操作系统设置并启动的,以固定时长作为周期的心跳时钟。该系统心跳时钟可以适用于终端设备100中安装的所有应用的客户端。例如,小米红米的操作系统以系统心跳周期8分钟来设置并启动系统心跳时钟,乐金LG G2的操作系统以系统心跳周期8分钟来设置系统心跳时钟,三星note3以系统心跳周期5分钟来设置并启动系统心跳时钟。如图2B所示,以终端设备100的系统心跳周期为5分钟,终端设备100在9:00AM开机为例,介绍本申请实施例提供的一种系统心跳时钟示意图。The system heartbeat clock is set and started by the operating system of the terminal device 100 when the terminal device 100 is turned on, and a fixed duration is used as the periodic heartbeat clock. The system heartbeat clock can be applied to clients of all applications installed in the terminal device 100. For example, Xiaomi Redmi's operating system uses a system heartbeat cycle of 8 minutes to set and activates the system heartbeat clock, LG G2's operating system uses a system heartbeat cycle of 8 minutes to set the system heartbeat clock, and Samsung note3 uses a system heartbeat cycle of 5 minutes. Set and start the system heartbeat clock. As shown in FIG. 2B, the system heartbeat cycle of the terminal device 100 is 5 minutes, and the terminal device 100 is turned on at 9:00 AM as an example, to introduce a schematic diagram of a system heartbeat clock provided by an embodiment of the present application.
但是,如上文中所述,上述常规的方法会导致不被经常使用的应用被不必要的经常唤醒,浪费终端设备电量。However, as described above, the above-mentioned conventional methods may cause applications that are not frequently used to be awakened unnecessarily frequently, and waste the power of the terminal device.
为了解决上述问题,本申请实施例提供一种应用的心跳唤醒方法,采用该方法,终端设备可以根据终端设备100中安装的至少一个应用的实际情况和终端设备的使用场景信息中的一个或多个信息,确定上述至少一个应用的心跳周期。In order to solve the above-mentioned problem, the embodiment of the present application provides a heartbeat wake-up method for an application. With this method, the terminal device can be based on one or more of the actual situation of at least one application installed in the terminal device 100 and the usage scenario information of the terminal device. This information determines the heartbeat period of at least one of the above-mentioned applications.
本申请实施例提供的应用的心跳唤醒方法可以应用于具有如图2A所示硬件结构的终端设备或者具有类似结构的终端设备。或者还可以应用于其他结构的终端设备中,本申请实施例对此不作限定。以下结合图2A所示的终端设备100,具体介绍本申请实施例提供的应用的心跳唤醒方法。其中,该终端设备100中安装有多个应用的客户端。 该终端设备100处于熄屏状态。The heartbeat wake-up method of the application provided by the embodiment of the present application can be applied to a terminal device having a hardware structure as shown in FIG. 2A or a terminal device having a similar structure. Or it can also be applied to terminal devices of other structures, which is not limited in the embodiment of the present application. Hereinafter, in conjunction with the terminal device 100 shown in FIG. 2A, the heartbeat wake-up method of the application provided in the embodiment of the present application is specifically introduced. Wherein, the terminal device 100 has multiple application clients installed. The terminal device 100 is in the off-screen state.
如图3所示,本申请实施例提供的应用的心跳唤醒方法可以包括:As shown in FIG. 3, the heartbeat wake-up method of the application provided by the embodiment of the present application may include:
S301、终端设备100获取第一应用的应用指示信息和终端设备100的使用场景信息中的一个或多个信息。S301. The terminal device 100 obtains one or more pieces of information among the application indication information of the first application and the usage scenario information of the terminal device 100.
其中,终端设备100中安装有多个应用的客户端。例如,“微信”、“foxmail邮箱”、“QQ音乐”、“共享单车”、“支付宝”和百度地图”等应用的客户端。第一应用是上述多个应用中的一个应用。该第一应用在终端设备100后台运行,与第一应用的应用服务器建立长连接。Among them, the terminal device 100 has multiple application clients installed. For example, clients of applications such as "WeChat", "foxmail", "QQ Music", "Bicycle Sharing", "Alipay" and Baidu Maps. The first application is one of the above multiple applications. The first The application runs in the background of the terminal device 100 and establishes a long connection with the application server of the first application.
在本申请实施例中,第一应用的应用指示信息用于指示:(A)第一应用的应用类型;和/或,(B)第一应用在预设时间内在终端设备前台运行的时间信息或次数。In the embodiment of the present application, the application indication information of the first application is used to indicate: (A) the application type of the first application; and/or, (B) the time information of the first application running in the foreground of the terminal device within a preset time Or times.
(A)、第一应用的应用类型。(A). The application type of the first application.
在一些实施例中,第一应用的应用类型可以是预先配置的。终端设备100可以通过分析第一应用的功能确定第一应用的应用类型。In some embodiments, the application type of the first application may be pre-configured. The terminal device 100 may determine the application type of the first application by analyzing the function of the first application.
其中,应用的应用类型至少可以为即时消息类、社交类、影音类、办公类、新闻类、工具类、出行类、生活类和阅读类中的任一种。示例性的,社交类应用可以包括“微信”、“微博”和“腾讯QQ”等。影音类应用可以包括“优酷”和“QQ音乐”等。办公类应用可以包括“微软office”和“foxmail邮箱”等。新闻类应用可以包括“今日头条”和“央视新闻”等。工具类应用可以包括“闹钟”、“日历”和“天气”等。出行类应用可以包括“百度地图”和“12306”等。生活类应用可以包括“饿了么”、“支付宝”、“共享单车”和“淘宝”等。阅读类应用可以包括“豆瓣阅读”、“南方周末”、“三联生活周刊”和“世界文学名著”等。其中,应用的应用类型包括但不限于上述几种应用类型示例,本申请实施例对此不作限定。Among them, the application type of the application can be at least any one of instant messaging, social, audio and video, office, news, tools, travel, life, and reading. Exemplarily, social applications may include "WeChat", "Weibo", and "Tencent QQ". Audio-visual applications can include "Youku" and "QQ Music". Office applications can include "Microsoft office" and "foxmail mailbox". News applications can include "Today's Toutiao" and "CCTV News". Tool applications can include "alarm clock", "calendar", and "weather". Travel applications can include "Baidu Maps" and "12306". Life applications can include "Are you hungry", "Alipay", "Bicycle sharing" and "Taobao". Reading applications can include "Douban Reading", "Southern Weekend", "Sanlian Life Weekly" and "World Literary Masterpieces". Among them, the application types of applications include but are not limited to the foregoing several application type examples, which are not limited in the embodiment of the present application.
(B)、第一应用在预设时间内在终端设备100前台运行的时间信息或次数。(B). Time information or number of times the first application runs in the foreground of the terminal device 100 within a preset time.
在本申请实施例中,第一应用在预设时间内在终端设备100前台运行的时间信息用于表征第一应用在预设时间内在终端设备100前台运行的时间长短。In the embodiment of the present application, the time information of the first application running in the foreground of the terminal device 100 within the preset time is used to characterize the length of time the first application is running in the foreground of the terminal device 100 within the preset time.
在一些实施例中,第一应用在预设时间内在终端设备100前台运行的时间信息可以包括第一应用在预设时间内(如最近一周时间内),在终端设备100前台运行的详细运行时间信息。In some embodiments, the time information of the first application running in the foreground of the terminal device 100 within the preset time may include the detailed running time of the first application running in the foreground of the terminal device 100 within the preset time (such as the last week). information.
可以理解的是,终端设备100可以根据第一应用的上述详细运行时间信息,确定第一应用在预设时间内在终端设备100前台运行的时间长短。例如,“微信”在最近一周时间内在终端设备100前台运行的详细运行时间信息包括:2019/8/1 20:30~2019/8/1 21:30,2019/8/2 19:45~2019/8/2 21:00,2019/8/3 19:30~2019/8/3 21:45,2019/8/4 19:00~2019/8/4 20:30,2019/8/5 19:30~2019/8/5 21:45,2019/8/6 19:00~2019/8/6 20:30和2019/8/7 21:00~2019/8/7 22:12。终端设备100可以确定“微信”在预设时间内在终端设备100前台运行的时间为11小时。It is understandable that the terminal device 100 can determine the length of time that the first application runs in the foreground of the terminal device 100 within the preset time according to the above-mentioned detailed running time information of the first application. For example, the detailed operating time information of "WeChat" running at the front desk of the terminal device 100 in the last week includes: 2019/8/1 20:30~2019/8/1 21:30, 2019/8/2 19:45~2019 /8/2 21:00, 8/3/2019 19:30~2019/8/3 21:45, 2019/8/4 19:00~2019/8/4 20:30, 2019/8/5 19 :30~2019/8/5 21:45, 2019/8/6 19:00~2019/8/6 20:30 and 2019/8/7 21:00~2019/8/7 22:12. The terminal device 100 may determine that the time that "WeChat" runs in the front desk of the terminal device 100 within the preset time is 11 hours.
或者,终端设备100可以根据第一应用的上述详细运行时间信息,确定第一应用的运行时间规律和/或用户使用第一应用的习惯。例如,终端设备100可以根据上述“微信”的详细运行时间信息,确定“微信”在预设时间内,通常在晚上 19:00~22:30之间运行。由此,终端设备100可以推断用户习惯在晚上19:00~22:30之间使用“微信”。Alternatively, the terminal device 100 may determine the running time rule of the first application and/or the user's habit of using the first application according to the foregoing detailed running time information of the first application. For example, the terminal device 100 may determine that the "WeChat" is running within a preset time, usually between 19:00 and 22:30 in the evening, according to the detailed operation time information of the aforementioned "WeChat". Thus, the terminal device 100 can infer that the user is accustomed to using "WeChat" between 19:00 and 22:30 in the evening.
在本申请实施例中,第一应用的使用场景信息可以包括:(a)终端设备100的熄屏时间;(b)终端设备100的网络状态信息;(c)终端设备100的情景模式信息中的至少一种:In the embodiment of the present application, the usage scenario information of the first application may include: (a) the screen-off time of the terminal device 100; (b) the network status information of the terminal device 100; (c) the scenario mode information of the terminal device 100 At least one of:
(a)、终端设备100的熄屏时间。(a) The screen-off time of the terminal device 100.
在本申请实施例中,终端设备100的熄屏时间是指终端设备100进入熄屏状态的时刻;或者终端设备100从进入熄屏状态开始,到当前时刻的时长。In the embodiment of the present application, the screen-off time of the terminal device 100 refers to the time when the terminal device 100 enters the screen-off state; or the length of time from when the terminal device 100 enters the screen-off state to the current moment.
例如,终端设备100的熄屏时间为“10分钟”,则表示该终端设备100从进入熄屏状态开始,到当前时刻的时长为10分钟(即终端设备100已持续熄屏状态10分钟)。又例如,终端设备100的熄屏时间为“11:30”,则表示该终端设备100在11:30进入熄屏状态。For example, if the screen-off time of the terminal device 100 is "10 minutes", it means that the terminal device 100 has entered the screen-off state to the current time for 10 minutes (that is, the terminal device 100 has been in the screen-off state for 10 minutes). For another example, the screen-off time of the terminal device 100 is "11:30", which means that the terminal device 100 enters the screen-off state at 11:30.
可以理解的是,若终端设备100已持续熄屏状态的时长越长,则表示终端设备100中安装的应用当前被使用的可能性越小。以及,终端设备100可以根据终端设备100进入熄屏状态的时刻,确定终端设备100被用户使用的规律和/或用户使用终端设备10的习惯。It is understandable that if the terminal device 100 has been in the off-screen state for a longer period of time, it means that the application installed in the terminal device 100 is less likely to be currently used. And, the terminal device 100 may determine the rule of the terminal device 100 being used by the user and/or the user's habit of using the terminal device 10 according to the moment when the terminal device 100 enters the screen-off state.
(b)、终端设备100的网络状态信息。(b) Network status information of the terminal device 100.
其中,终端设备100的网络状态信息用于指示终端设备100连接到网络或者未连接到网络。如果终端设备100连接到网络,终端设备100的网络状态信息还用于指示终端设备100连接的网络类型,以及终端设备100连接至网络的信号质量。其中,终端设备100连接的网络类型可以包括但不限于2G网络、3G网络、4G网络、5G网络和无线保真(Wireless Fidelity,WiFi)中的至少一种。Among them, the network status information of the terminal device 100 is used to indicate that the terminal device 100 is connected to the network or not connected to the network. If the terminal device 100 is connected to the network, the network status information of the terminal device 100 is also used to indicate the type of network that the terminal device 100 is connected to, and the signal quality of the terminal device 100 connected to the network. The type of network to which the terminal device 100 is connected may include, but is not limited to, at least one of a 2G network, a 3G network, a 4G network, a 5G network, and a wireless fidelity (Wireless Fidelity, WiFi).
可以理解的是,若终端设备100未连接到网络,第一应用的客户端不可能保持与应用服务器之间的长连接。在这种情况下,终端设备100便没有必要周期性唤醒第一应用的客户端。It is understandable that if the terminal device 100 is not connected to the network, the client of the first application cannot maintain a long connection with the application server. In this case, the terminal device 100 does not need to periodically wake up the client of the first application.
另外,若终端设备100连接到网络,终端设备100连接到不同网络类型的网络时,第一应用被周期性唤醒的心跳周期不同,对用户造成的影响不同。例如,若终端设备100连接至2G网络,第一应用的客户端通过该2G网络向应用服务器发送心跳包。若该心跳周期设置过小,则会由于频繁发送心跳包,给用户造成额外的流量花费。若终端设备100连接至WiFi,第一应用的客户端通过WiFi向应用服务器发送心跳包。若该心跳周期设置过大,则可能由于周期过大,导致应用的客户端与应用服务器之间的长连接断开,影响用户体验。In addition, if the terminal device 100 is connected to a network, and the terminal device 100 is connected to a network of a different network type, the heartbeat period at which the first application is periodically awakened is different, and the impact on the user is different. For example, if the terminal device 100 is connected to a 2G network, the client of the first application sends a heartbeat packet to the application server through the 2G network. If the heartbeat period is set too small, frequent heartbeat packets will be sent, causing additional traffic costs to the user. If the terminal device 100 is connected to WiFi, the client of the first application sends a heartbeat packet to the application server via WiFi. If the heartbeat period is set too large, it may cause the long connection between the application client and the application server to be disconnected due to the too large period, which affects the user experience.
(c)、终端设备100的情景模式信息。(c) The scene mode information of the terminal device 100.
在本申请实施例中,终端设备100的情景模式信息用于指示终端设备100处于运动模式、睡觉模式、口袋模式或桌面模式中的任一种模式。其中,终端设备100处于运动模式是指终端设备100处于运动状态,例如,终端设备100处于走路状态或跑步状态等。终端设备100处于睡觉模式是指终端设备100检测到用户正处于睡眠状态。终端设备100处于口袋模式是指终端设备100被置于口袋、包袋或抽屉等收纳物体当中。终端设备100处于桌面模式是指终端设备100被静置于桌面等固定位置。In the embodiment of the present application, the scene mode information of the terminal device 100 is used to indicate that the terminal device 100 is in any of the sports mode, the sleep mode, the pocket mode, or the desktop mode. Wherein, that the terminal device 100 is in a sports mode means that the terminal device 100 is in a sports state, for example, the terminal device 100 is in a walking state or a running state. The terminal device 100 being in the sleep mode means that the terminal device 100 detects that the user is in the sleep state. When the terminal device 100 is in the pocket mode, it means that the terminal device 100 is placed in a storage object such as a pocket, a bag, or a drawer. When the terminal device 100 is in the desktop mode, it means that the terminal device 100 is statically placed in a fixed position such as a desktop.
可以理解的是,终端设备100处于运动模式、睡觉模式、口袋模式或桌面模式,则终端设备100中安装的应用当前被使用的可能性越小。在这种情况下,终端设备100便没有必要太过频繁地性唤醒第一应用的客户端。在本申请一些实施例中,终端设备100可以通过分析终端设备100中设置的传感器采集的数据,确定终端设备100的情景模式信息。其中,该传感器至少可以是加速度传感器、陀螺仪传感器、磁传感器、环境光传感器、距离传感器和接近光传感器中的至少一种。对于终端设备100通过分析终端设备100中设置的传感器采集的数据,确定终端设备100的情景模式信息的方法和过程,将在下文中具体介绍。It can be understood that if the terminal device 100 is in a sports mode, a sleep mode, a pocket mode, or a desktop mode, the application installed in the terminal device 100 is less likely to be currently used. In this case, the terminal device 100 does not need to wake up the client of the first application too frequently. In some embodiments of the present application, the terminal device 100 may determine the context mode information of the terminal device 100 by analyzing data collected by sensors provided in the terminal device 100. Wherein, the sensor may be at least one of an acceleration sensor, a gyroscope sensor, a magnetic sensor, an ambient light sensor, a distance sensor, and a proximity light sensor. The method and process for the terminal device 100 to determine the scene mode information of the terminal device 100 by analyzing the data collected by the sensor set in the terminal device 100 will be described in detail below.
需要说明的是,第一应用的应用指示信息并不限于第一应用的应用类型或第一应用在预设时间内在终端设备前台运行的时间信息或次数。第一应用的使用场景信息也并不限于上述终端设备100的熄屏时间,终端设备100的网络状态信息或终端设备100的情景模式信息。第一应用的应用指示信息和第一应用的使用场景信息还可以包括其他信息,对此,本申请实施例不作限定。It should be noted that the application indication information of the first application is not limited to the application type of the first application or the time information or number of times the first application runs in the foreground of the terminal device within a preset time. The usage scenario information of the first application is also not limited to the screen-off time of the terminal device 100 described above, the network status information of the terminal device 100, or the scenario mode information of the terminal device 100. The application indication information of the first application and the usage scenario information of the first application may also include other information, which is not limited in the embodiment of the present application.
在一些实施例中,终端设备100可以在终端设备100进入熄屏状态后,周期性获取第一应用的应用指示信息和终端设备100的使用场景信息中的一个或多个信息。In some embodiments, the terminal device 100 may periodically obtain one or more of the application indication information of the first application and the usage scenario information of the terminal device 100 after the terminal device 100 enters the screen-off state.
S302、终端设备100根据应用指示信息和使用场景信息,确定第一应用的心跳周期。S302. The terminal device 100 determines the heartbeat period of the first application according to the application indication information and the usage scenario information.
其中,第一应用的心跳周期用于终端设备100周期性唤醒该第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包,从而保持第一应用的客户端与第一应用的应用服务器之间的长连接。The heartbeat period of the first application is used by the terminal device 100 to periodically wake up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application, thereby keeping the client of the first application and the first application A long connection between application servers of an application.
在一些实施例中,终端设备100中可以预先设置有应用指示信息和/或使用场景信息与心跳周期的对应关系。终端设备100可以通过查找该对应关系,确定第一应用的心跳周期。In some embodiments, the terminal device 100 may be preset with a correspondence between application indication information and/or usage scenario information and a heartbeat cycle. The terminal device 100 can determine the heartbeat period of the first application by searching for the corresponding relationship.
如图4所示,为本申请实施例提供的一种确定应用心跳周期的方法的原理示意图。如图4所示,终端设备100可以综合考虑第一应用的应用类型、终端设备100在预设时间内在终端设备100前台运行第一应用的时间信息或次数、终端设备100的熄屏时间、终端设备100的网络状态信息和终端设备100的情景模式信息,确定第一应用的心跳周期。当然,图4仅作为一种示例。事实上,如上文所述,终端设备100可以根据上述(A)、(B)、(a)、(b)和(c)中的任意一种或多种,确定第一应用的心跳周期。其中,应用指示信息和/或使用场景信息与心跳周期的对应关系可以以表格形式预先设置在终端设备100中,也可以以其他形式预先设置在终端设备100中,本发明实施例不进行限定。As shown in FIG. 4, it is a schematic diagram of the principle of a method for determining an application heartbeat cycle provided by an embodiment of this application. As shown in FIG. 4, the terminal device 100 can comprehensively consider the application type of the first application, the time information or the number of times the terminal device 100 runs the first application in the foreground of the terminal device 100 within a preset time, the screen off time of the terminal device 100, and the terminal device 100 The network status information of the device 100 and the scene mode information of the terminal device 100 determine the heartbeat period of the first application. Of course, Figure 4 is only an example. In fact, as described above, the terminal device 100 can determine the heartbeat period of the first application according to any one or more of (A), (B), (a), (b), and (c) above. The correspondence relationship between the application indication information and/or usage scenario information and the heartbeat cycle may be preset in the terminal device 100 in the form of a table, or may be preset in the terminal device 100 in other forms, which is not limited in the embodiment of the present invention.
例如,以下表1以一种表格形式进行说明,以终端设备100中预先设置有“应用类型”、“熄屏时间”和“情景模式”与“心跳周期”的对应关系为例,介绍预先设置在终端设备100中的应用指示信息和/或使用场景信息与心跳周期的对应关系。该表格也可以是其他形式,本发明实施例对表格的形式不进行限定。For example, the following Table 1 is described in a form of a table, taking the corresponding relationship between "application type", "screen off time", and "scene mode" and "heartbeat cycle" preset in the terminal device 100 as an example to introduce the preset The corresponding relationship between the application indication information and/or usage scenario information in the terminal device 100 and the heartbeat cycle. The table may also be in other forms, and the embodiment of the present invention does not limit the form of the table.
表1Table 1
Figure PCTCN2020114596-appb-000001
Figure PCTCN2020114596-appb-000001
Figure PCTCN2020114596-appb-000002
Figure PCTCN2020114596-appb-000002
其中,t step为心跳步长,例如,t step=150秒(s)。如表1所示,若终端设备100持续熄屏状态的时长小于预设门限(例如10分钟),终端设备100可以不考虑终端设备100的情景模式,将社交类应用的心跳周期设置为1t step,将生活类应用的心跳周期设置为2t step,将工具类应用的心跳周期设置为1t stepAmong them, t step is the heartbeat step length, for example, t step =150 seconds (s). As shown in Table 1, if the duration of the screen-off state of the terminal device 100 is less than the preset threshold (for example, 10 minutes), the terminal device 100 may set the heartbeat period of the social application to 1t step regardless of the context mode of the terminal device 100 , Set the heartbeat cycle of life applications to 2t step , and set the heartbeat cycle of tool applications to 1t step .
如表1所示,若终端设备100持续熄屏状态的时长大于或等于预设门限(例如10分钟),且终端设备100的情景模式信息指示终端设备100处于运动模式、睡觉模式、口袋模式或桌面模式中的任意一种,终端设备100可以将社交类应用的心跳周期设置为2t step,将生活类应用的心跳周期设置为4t step,将工具类应用的心跳周期设置为2t step。而若终端设备100的情景模式信息指示终端设备100处于除运动模式、睡觉模式、口袋模式或桌面模式以外的其他情景模式,终端设备100可以将社交类应用的心跳周期设置为1t step,将生活类应用的心跳周期设置为2t step,将工具类应用的心跳周期设置为1t stepAs shown in Table 1, if the duration of the screen-off state of the terminal device 100 is greater than or equal to the preset threshold (for example, 10 minutes), and the scene mode information of the terminal device 100 indicates that the terminal device 100 is in exercise mode, sleep mode, pocket mode, or In any of the desktop modes, the terminal device 100 can set the heartbeat cycle of social applications to 2t step , the heartbeat cycle of life applications to 4t step , and the heartbeat cycle of tool applications to 2t step . And if the context mode information of the terminal device 100 indicates that the terminal device 100 is in a context mode other than sports mode, sleep mode, pocket mode, or desktop mode, the terminal device 100 can set the heartbeat cycle of the social application to 1t step to set life The heartbeat cycle of the class application is set to 2t step , and the heartbeat cycle of the tool class application is set to 1t step .
可以理解的是,若终端设备100持续熄屏状态的时长大于或等于预设门限,且终端设备100的情景模式为运动模式、睡觉模式、口袋模式或桌面模式中的任意一种,终端设备100预测该终端设备100在较长的一段时间内不被用户关注或者使用的可能性比较大。在这种情况下,终端设备100可以以相对较大的心跳周期唤醒该应用。It is understandable that if the duration of the screen off state of the terminal device 100 is greater than or equal to the preset threshold, and the scene mode of the terminal device 100 is any one of sports mode, sleep mode, pocket mode, or desktop mode, the terminal device 100 It is predicted that the terminal device 100 will not be noticed or used by the user for a relatively long period of time. In this case, the terminal device 100 can wake up the application with a relatively large heartbeat cycle.
另外,若第一应用为即时消息类应用,鉴于用户使用终端设备进行即时沟通的使用较为广泛,终端设备100预测该第一应用相比于其他工具类应用或者生活类应用等,在较长的一段时间内被用户关注或者使用的可能性比较大。因此,可以以相对较小的心跳周期唤醒第一应用以及该类型的应用。需要说明的是,上述表1仅作为一种示例。在一些实施例中,为了避免心跳周期过大对一些工具类应用(如定时器)造成影响,终端设备100还可以不采用本申请实施例的应用的心跳唤醒方法唤醒该类型的应用,而是根据系统心跳时钟唤醒该应用。In addition, if the first application is an instant messaging application, in view of the wider use of users to use terminal devices for instant communication, the terminal device 100 predicts that the first application will be longer than other tool applications or life applications, etc. It is more likely to be followed or used by users within a period of time. Therefore, the first application and this type of application can be awakened with a relatively small heartbeat cycle. It should be noted that the above Table 1 is only an example. In some embodiments, in order to avoid excessive heartbeat cycles from affecting some tool applications (such as timers), the terminal device 100 may not use the heartbeat wake-up method of the application embodiments of the present application to wake up this type of application, but Wake up the application according to the system heartbeat clock.
在一些实施例中,终端设备100中还可以预先设置有特殊应用的列表,对于该列表中的应用,可以根据系统心跳时钟唤醒该应用。In some embodiments, the terminal device 100 may also be preset with a list of special applications, and for the applications in the list, the applications can be awakened according to the system heartbeat clock.
另外,上述表1是以10分钟作为预设门限举例的,该预设熄屏时长门限还可以是其他值,本申请实施例对此不作限定。另外,若终端设备100持续熄屏状态的时长大于或等于预设门限,当终端设备100处于不同的情景模式时,同一应用类型的应用的心跳周期也可以不同。如表2所示,为终端设备100中预先设置的另一种“应用类型”、“熄屏时间”和“情景模式”与“心跳周期”的对应关系示例。In addition, the foregoing Table 1 uses 10 minutes as an example of the preset threshold, and the preset screen-off duration threshold may also be other values, which is not limited in the embodiment of the present application. In addition, if the duration of the screen off state of the terminal device 100 is greater than or equal to the preset threshold, when the terminal device 100 is in different scenarios, the heartbeat cycles of applications of the same application type may also be different. As shown in Table 2, it is another example of the correspondence between "application type", "screen-off time", "scene mode" and "heartbeat cycle" preset in the terminal device 100.
表2Table 2
Figure PCTCN2020114596-appb-000003
Figure PCTCN2020114596-appb-000003
或者,如表3所示,终端设备100中预先设置的对应关系还可以是“熄屏时间”、“情景模式”和“前台运行频繁程度”与“心跳周期”的对应关系。其中,“前台运行频繁程度”用于表征应用在预设时间内在终端设备100前台运行的频繁程度。Or, as shown in Table 3, the corresponding relationship preset in the terminal device 100 may also be the corresponding relationship between "screen off time", "scene mode", and "frequency of foreground operation" and "heartbeat cycle". Among them, the “frequent degree of foreground operation” is used to characterize how frequently the application runs in the foreground of the terminal device 100 within a preset time.
表3table 3
Figure PCTCN2020114596-appb-000004
Figure PCTCN2020114596-appb-000004
Figure PCTCN2020114596-appb-000005
Figure PCTCN2020114596-appb-000005
在一些实施例中,终端设备100可以根据如下规则确定应用在预设时间内在终端设备100前台运行的频繁程度:若应用在预设时间内在终端设备100前台运行的次数大于第一阈值(如50次),则确定该应用高频运行;若应用在预设时间内在终端设备100前台运行的次数大于第二阈值(如10次)且小于或等于第一阈值(即50次),则确定该应用低频运行;若应用在预设时间内在终端设备100前台运行的次数大于0,且小于或等于第二阈值(即10次),则确定该应用偶尔运行;若应用在预设时间内在终端设备100前台运行的次数等于0,则确定该应用未运行。或者,还可以使用其他方法确定应用在预设时间内在终端设备100前台运行的频繁程度,本申请实施例对此不作限定。In some embodiments, the terminal device 100 may determine how frequently the application runs in the foreground of the terminal device 100 within a preset time according to the following rules: if the number of times the application runs in the foreground of the terminal device 100 within the preset time is greater than a first threshold (such as 50 Times), it is determined that the application runs at a high frequency; if the number of times the application runs in the foreground of the terminal device 100 within the preset time is greater than the second threshold (such as 10 times) and less than or equal to the first threshold (ie 50 times), then the application is determined The application runs at low frequency; if the number of times the application runs in the foreground of the terminal device 100 within the preset time is greater than 0 and less than or equal to the second threshold (ie 10 times), it is determined that the application runs occasionally; if the application is in the terminal device within the preset time If the number of 100 foreground runs is equal to 0, it is determined that the application is not running. Alternatively, other methods may also be used to determine how frequently the application runs in the foreground of the terminal device 100 within a preset time, which is not limited in the embodiment of the present application.
示例性的,假设终端设备100处于运动模式,该终端设备100当前处于熄屏状态,且持续该熄屏状态的时长为12分钟。另外,终端设备100确定“微信”、“今日头条”和“淘宝”在预设时间内在终端设备100前台运行的频繁程度为:“微信”高频运行,“今日头条”低频运行,“淘宝”未运行。通过查询表3,终端设备100可以确定“微信”的心跳周期为2t step,“今日头条”的心跳周期为3t step,“淘宝”的心跳周期为4t step。假设t step=150s,图5示出了本申请实施例中,终端设备100确定出的多个应用的心跳时钟示意图。 Exemplarily, it is assumed that the terminal device 100 is in a sports mode, the terminal device 100 is currently in the off-screen state, and the duration of the off-screen state is 12 minutes. In addition, the terminal device 100 determines how frequently "WeChat,""TodayToutiao", and "Taobao" run in the foreground of the terminal device 100 within a preset time: "WeChat" runs at high frequency, "Today Toutiao" runs at low frequency, and "Taobao" Not running. By querying Table 3, the terminal device 100 can determine that the heartbeat cycle of "WeChat" is 2t step , the heartbeat cycle of "Today's Toutiao" is 3t step , and the heartbeat cycle of "Taobao" is 4t step . Assuming t step =150s, FIG. 5 shows a schematic diagram of heartbeat clocks of multiple applications determined by the terminal device 100 in an embodiment of the present application.
在一些实施例中,上述表3中的“前台运行频繁程度”还可以用“前台运行次数排名”替换,如表4所示。In some embodiments, "Foreground running frequency" in Table 3 above can also be replaced with "Foreground running frequency ranking", as shown in Table 4.
表4Table 4
Figure PCTCN2020114596-appb-000006
Figure PCTCN2020114596-appb-000006
Figure PCTCN2020114596-appb-000007
Figure PCTCN2020114596-appb-000007
其中,“前台运行次数排名”为1,表示应用在预设时间内在终端设备100前台运行的次数最多。由1到N表示应用在预设时间内在终端设备100前台运行的次数越来越少,其中,N>1,N为整数。可以理解的是,在同等条件下,应用的“前台运行次数排名”越高,则该应用被经常使用的可能性越高,终端设备100可以将其心跳周期设置的相对较小一点,可以更大概率的保证应用的客户端与应用服务器之间的长连接不断开。Among them, the “rank for the number of times of running in the foreground” is 1, which means that the application runs the most times in the foreground of the terminal device 100 within the preset time. 1 to N indicate that the number of times the application runs in the foreground of the terminal device 100 within a preset time is decreasing, where N>1, and N is an integer. It is understandable that, under the same conditions, the higher the “ranking of the number of foreground runs” of the application, the higher the possibility that the application will be used frequently, and the terminal device 100 can set its heartbeat cycle to be relatively smaller, which can be more High probability to ensure that the long connection between the application client and the application server is not broken.
示例性的,假设终端设备100处于运动模式,该终端设备100当前处于熄屏状态,且持续该熄屏状态的时长为8分钟。另外,终端设备100确定“微信”、“今日头条”和“淘宝”在预设时间内在终端设备100前台运行的次数排名为:“微信”排名第3,“今日头条”排名第3,“淘宝”排名第4。通过查询表4,终端设备100可以确定“微信”的心跳周期为2t step,“今日头条”的心跳周期为3t step,“淘宝”的心跳周期为4t stepExemplarily, it is assumed that the terminal device 100 is in a sports mode, the terminal device 100 is currently in the off-screen state, and the duration of the off-screen state is 8 minutes. In addition, the terminal device 100 determines the number of times that "WeChat", "Today Toutiao" and "Taobao" run in the front desk of the terminal device 100 within a preset time are ranked as follows: "Ranked No. 4. By querying Table 4, the terminal device 100 can determine that the heartbeat cycle of "WeChat" is 2t step , the heartbeat cycle of "Today's Toutiao" is 3t step , and the heartbeat cycle of "Taobao" is 4t step .
或者,上述表3中的“前台运行频繁程度”还可以用“前台运行时长排名”替换。对于“前台运行时长排名”的具体解释和说明,可以参考上文中对“前台运行次数排名”的具体介绍,这里不再赘述。Alternatively, the "Foreground Running Frequency" in Table 3 above can also be replaced with "Foreground Running Time Ranking". For the specific explanation and description of "Foreground Running Time Ranking", you can refer to the specific introduction of "Foreground Running Times Ranking" above, which will not be repeated here.
或者,如表5所示,终端设备100中预先设置的对应关系还可以是“网络类型”、“熄屏时间”、“情景模式”和“前台运行频繁程度”与“心跳周期”的对应关系。其中,“网络类型”用于表征终端设备100连接的网络的类型。Or, as shown in Table 5, the corresponding relationship preset in the terminal device 100 may also be the corresponding relationship between "network type", "screen off time", "scene mode", and "frequency of foreground operation" and "heartbeat cycle" . Among them, "network type" is used to characterize the type of network to which the terminal device 100 is connected.
表5table 5
Figure PCTCN2020114596-appb-000008
Figure PCTCN2020114596-appb-000008
Figure PCTCN2020114596-appb-000009
Figure PCTCN2020114596-appb-000009
在一些实施例中,若终端设备100的网络状态信息指示该终端设备100未连接 到网络,终端设备100可以放弃执行S302,即终端设备100放弃确定第一应用的心跳周期。直至终端设备100连接到网络,终端设备100再重新获取应用指示信息和/或使用场景信息(即重新执行S301),进而根据重新确定的应用指示信息和/或使用场景信息确定该第一应用的心跳周期。In some embodiments, if the network status information of the terminal device 100 indicates that the terminal device 100 is not connected to the network, the terminal device 100 may give up performing S302, that is, the terminal device 100 may give up determining the heartbeat period of the first application. Until the terminal device 100 is connected to the network, the terminal device 100 re-acquires the application indication information and/or usage scenario information (that is, re-executes S301), and then determines the application indication information and/or usage scenario information that is re-determined. Heartbeat cycle.
需要说明的是,上述表1、表2、表3、表4和表5仅作为几种终端设备100中预先设置的应用指示信息和使用场景信息与心跳周期的对应关系示例。本申请实施例对该对应关系并不作具体限定,也就是说,该对应关系可以是“应用类型”、“熄屏时间长”、“情景模式”、“前台运行频繁程度”(或“前台运行时间排名”/“前台运行次数排名”)、“网络类型”与其他应用指示信息和使用场景信息中的任意一个或多个与“心跳周期”的对应关系。It should be noted that the foregoing Table 1, Table 2, Table 3, Table 4, and Table 5 are only examples of the correspondence between application indication information and usage scenario information preset in several terminal devices 100 and the heartbeat cycle. The embodiment of the application does not specifically limit the corresponding relationship, that is, the corresponding relationship can be "application type", "long screen off time", "scene mode", "frequency of foreground operation" (or "foreground running frequency"). The corresponding relationship between any one or more of “time ranking”/”front-end running times ranking”), “network type” and other application indication information and usage scenario information and “heartbeat cycle”.
在一些实施例中,终端设备100还可以分析终端设备100在S301获取的第一应用的应用指示信息和终端设备100的使用场景信息,预测第一应用在预设时间段内的运行规律。In some embodiments, the terminal device 100 may also analyze the application indication information of the first application obtained by the terminal device 100 in S301 and the usage scenario information of the terminal device 100, and predict the running law of the first application in a preset time period.
示例性的,终端设备100可以根据终端设备100在S301获取的,在预设时间内在终端设备100前台运行第一应用的时间信息确定第一应用在该预设时间内的运行规律。例如,如上文所述,终端设备100可以根据“微信”在最近一周时间内在终端设备100前台运行的详细运行时间,确定“微信”在最近一周时间内在终端设备100前台运行的高频时间段。为晚上19:00~22:30之间。即终端设备100可以预测用户习惯在晚上19:00~22:30之间使用“微信”。在这种情况下,终端设备100可以将“微信”在每天晚上19:00~22:30之间的心跳周期设置得较小,可以更大概率的保证“微信”客户端与应用服务器之间的长连接不断开。Exemplarily, the terminal device 100 may determine the running rule of the first application within the preset time according to the time information obtained by the terminal device 100 in S301 and running the first application in the foreground of the terminal device 100 within the preset time. For example, as described above, the terminal device 100 may determine the high-frequency time period during which "WeChat" has been operating in the foreground of the terminal device 100 in the last week according to the detailed operation time of "WeChat" in the foreground of the terminal device 100 in the last week. Between 19:00 and 22:30 in the evening. That is, the terminal device 100 can predict that the user is used to using "WeChat" between 19:00 and 22:30 in the evening. In this case, the terminal device 100 can set the heartbeat cycle of "WeChat" between 19:00-22:30 every evening to be smaller, which can guarantee the communication between the "WeChat" client and the application server with greater probability. The long connection is not disconnected.
又一示例性的,终端设备100可以根据第一应用的具体功能,预测第一应用在预设时间段内在前台运行的可能性。例如,第一应用主要用于订购外卖,终端设备100可以根据第一应用的该具体功能预测第一应用在午饭时间段(如11:00~13:00)和晚饭时间段(如18:00~20:00)内,在前台运行的可能性较大。在这种情况下,终端设备100可以将第一应用在午饭时间段和晚饭时间段内的心跳周期设置得较小,以更大概率的保证第一应用的客户端在上述时间段内与应用服务器之间的长连接不断开。In another example, the terminal device 100 may predict the possibility that the first application will run in the foreground within a preset time period according to the specific function of the first application. For example, the first application is mainly used for ordering food, and the terminal device 100 can predict the lunch time period (such as 11:00-13:00) and the dinner time period (such as 18:00) of the first application according to the specific function of the first application. ~20:00), it is more likely to run in the foreground. In this case, the terminal device 100 can set the heartbeat period of the first application in the lunch time period and the dinner time period to be smaller, so as to ensure that the client of the first application will communicate with the application in the above time period with a greater probability. The long connection between the servers is not disconnected.
进一步的,如图6所示,本申请实施例提供的应用的心跳唤醒方法还可以包括:Further, as shown in FIG. 6, the heartbeat wake-up method of the application provided by the embodiment of the present application may further include:
S603、终端设备100确定第一心跳时刻。S603: The terminal device 100 determines the first heartbeat moment.
在一些实施例中,第一心跳时刻可以是从当前时刻t开始,经过第一时长的截止时刻T1。In some embodiments, the first heartbeat time may be the cut-off time T1 starting from the current time t and passing the first time length.
假设第一应用的心跳周期为T。请参考图7,如图7所示,当前时刻是t时刻。终端设备100确定第一心跳时刻T1为从时刻t开始,经过时长T的截止时刻T1。其中,T1=t+T。Assume that the heartbeat period of the first application is T. Please refer to Figure 7. As shown in Figure 7, the current moment is time t. The terminal device 100 determines that the first heartbeat time T1 is the cut-off time T1 starting from the time t and the time period T has elapsed. Among them, T1=t+T.
在另一些实施例中,若第一应用的心跳周期大于或等于前一次心跳时刻T00到当前时刻的时长,第一心跳时刻是从当前时刻t0的前一次心跳时刻T00开始,经过第一时长的截止时刻T1。其中,第一时长等于第一应用的心跳周期。在终端设备100熄屏后首次执行S601、S602和S603确定第一心跳时刻时,前一次心跳 时刻T00是系统心跳时钟指示的心跳时刻。In other embodiments, if the heartbeat period of the first application is greater than or equal to the time period from the previous heartbeat time T00 to the current time, the first heartbeat time starts from the previous heartbeat time T00 at the current time t0, and the first time period has passed. Deadline T1. Among them, the first duration is equal to the heartbeat period of the first application. When the terminal device 100 performs S601, S602, and S603 for the first time after the screen is turned off to determine the first heartbeat time, the previous heartbeat time T00 is the heartbeat time indicated by the system heartbeat clock.
请参考图8A,如图8A所示,当前时刻是t时刻。在t时刻,终端设备100确定第一应用的心跳周期T大于或等于前一次心跳时刻T00到当前时刻t的时长,即T≥(t-T00)。终端设备100确定第一心跳时刻为从t时刻的前一次心跳时刻T00开始,经过时长T的截止时刻T1。其中,T1=T00+T。Please refer to FIG. 8A. As shown in FIG. 8A, the current time is time t. At time t, the terminal device 100 determines that the heartbeat period T of the first application is greater than or equal to the duration from the previous heartbeat time T00 to the current time t, that is, T≥(t-T00). The terminal device 100 determines that the first heartbeat time is the cut-off time T1 for the duration T starting from the previous heartbeat time T00 at time t. Among them, T1=T00+T.
若第一应用的心跳周期T小于前一次心跳时刻T00到当前时刻t的时长,即T<(t-T00),第一心跳时刻是从当前时刻t0的下一次心跳时刻T11开始,经过第一时长T的截止时刻T1。请参考图8B,如图8B所示,当前时刻是t时刻。在t时刻,终端设备100确定第一应用的心跳周期T小于前一次心跳时刻T00到当前时刻t的时长,即T<(t-T00)。终端设备100确定第一心跳时刻为从t时刻的后一次心跳时刻T11开始,经过时长T的截止时刻T1。其中,T1=T11+T。If the heartbeat period T of the first application is less than the duration from the previous heartbeat time T00 to the current time t, that is, T<(t-T00), the first heartbeat time starts from the next heartbeat time T11 at the current time t0 and passes through the first The cut-off time T1 of the duration T. Please refer to FIG. 8B. As shown in FIG. 8B, the current time is time t. At time t, the terminal device 100 determines that the heartbeat period T of the first application is less than the duration from the previous heartbeat time T00 to the current time t, that is, T<(t-T00). The terminal device 100 determines that the first heartbeat time is the cut-off time T1 that starts at the next heartbeat time T11 at the time t and elapses the duration T. Among them, T1=T11+T.
在一些实施例中,如图6所示,在终端设备100执行完S603之后,本申请实施例提供的应用的心跳唤醒方法还可以包括:In some embodiments, as shown in FIG. 6, after the terminal device 100 performs S603, the heartbeat wake-up method of the application provided in the embodiment of the present application may further include:
S604、终端设备100从第一心跳时刻开始,按照第一应用的心跳周期,周期性唤醒第一应用。S604: Starting from the first heartbeat moment, the terminal device 100 periodically wakes up the first application according to the heartbeat period of the first application.
其中,终端设备100周期性唤醒第一应用用于触发第一应用的客户端向第一应用的应用服务器发送心跳包。终端设备100可以不断周期性唤醒第一应用,直到第一应用的客户端断开长连接或终端设备100亮屏。如图7、图8A和图8B所示,终端设备100依次在T1、T2……等时刻唤醒第一应用。The terminal device 100 periodically wakes up the first application to trigger the client of the first application to send a heartbeat packet to the application server of the first application. The terminal device 100 may continuously wake up the first application periodically until the client of the first application disconnects the long connection or the terminal device 100 turns on. As shown in FIG. 7, FIG. 8A and FIG. 8B, the terminal device 100 wakes up the first application at T1, T2... and so on in sequence.
可以理解的是,如果第一应用的客户端断开长连接,即使终端设备100唤醒第一应用的客户端,第一应用的客户端向第一应用的应用服务器发送心跳包也是没有意义的。在第一应用需要与第一应用的应用服务器传输数据时,需要重新建立第一应用与第一应用的应用服务器之间的长连接。It is understandable that if the client of the first application disconnects the long connection, even if the terminal device 100 wakes up the client of the first application, it is meaningless for the client of the first application to send a heartbeat packet to the application server of the first application. When the first application needs to transmit data with the application server of the first application, the long connection between the first application and the application server of the first application needs to be re-established.
另外,在一些实施例中,在终端设备100处于亮屏状态时,终端设备100以系统心跳时钟作为应用心跳时机的参考。可以理解的是,在终端设备100处于亮屏状态时,为了保证所有应用的功能的最佳体现,终端设备100通常不过多的干涉应用的心跳周期。因此,如果终端设备100由熄屏状态转为亮屏状态,如图8所示,在终端设备100由熄屏状态转为亮屏状态后,终端设备100可以结束本申请实施例提供的应用的心跳唤醒方法。采用系统心跳时钟作为应用心跳时机的参考,周期性唤醒第一应用。In addition, in some embodiments, when the terminal device 100 is in the on-screen state, the terminal device 100 uses the system heartbeat clock as a reference for applying the heartbeat timing. It can be understood that, when the terminal device 100 is in the bright screen state, in order to ensure the best performance of the functions of all applications, the terminal device 100 usually does not interfere too much with the heartbeat cycle of the application. Therefore, if the terminal device 100 changes from the off-screen state to the on-screen state, as shown in FIG. 8, after the terminal device 100 changes from the off-screen state to the on-screen state, the terminal device 100 can end the application provided by the embodiment of the application. Heartbeat wake-up method. The system heartbeat clock is used as a reference for the application heartbeat timing to periodically wake up the first application.
S605、终端设备100判断第一应用的客户端是否断开长连接或终端设备100是否熄屏状态转为亮屏状态。若是,终端设备100执行S606。S605: The terminal device 100 judges whether the client of the first application disconnects the long connection or whether the screen off state of the terminal device 100 changes to the on screen state. If yes, the terminal device 100 executes S606.
S606、终端设备100停止按照第一应用的心跳周期,周期性唤醒第一应用。S606. The terminal device 100 stops periodically waking up the first application according to the heartbeat cycle of the first application.
在另一些实施例中,如图9所示,在终端设备100执行完S603之后,本申请实施例提供的应用的心跳唤醒方法还可以包括:In other embodiments, as shown in FIG. 9, after the terminal device 100 performs S603, the heartbeat wake-up method of the application provided in the embodiment of the present application may further include:
S904、终端设备100将第一心跳时刻对齐至第二心跳时刻。S904. The terminal device 100 aligns the first heartbeat moment to the second heartbeat moment.
其中,上述第二心跳时刻用于终端设备100在该第二心跳时刻唤醒第一应用,以触发第一应用的客户端向第一应用的应用服务器发送心跳包。The above-mentioned second heartbeat moment is used for the terminal device 100 to wake up the first application at the second heartbeat moment to trigger the client of the first application to send a heartbeat packet to the application server of the first application.
可以理解的是,由于不同的应用的心跳周期可能不同,因此不同的应用的下 一次应用心跳时刻可能不同。示例性的,如图10所示,“微信”、“今日头条”和“淘宝”的下一次应用心跳时刻t1、t2和t3均不相同。其中,t1=t0+300s,t2=t0+450s,t3=t0+600s。也就是说,在如图10所示的情况下,终端设备100需要在t1时刻唤醒“微信”,接着在t2时刻唤醒“今日头条”,以及在t3时刻唤醒“淘宝”。终端设备100需要频繁的作唤醒应用的操作,这显然是不利于终端设备100节省电量的。It is understandable that since the heartbeat cycles of different applications may be different, the heartbeat time of the next application of different applications may be different. Exemplarily, as shown in FIG. 10, the heartbeat moments t1, t2, and t3 of the next application of "WeChat", "Toutiao" and "Taobao" are all different. Among them, t1=t0+300s, t2=t0+450s, and t3=t0+600s. That is to say, in the case shown in FIG. 10, the terminal device 100 needs to wake up "WeChat" at time t1, then wake up "Today Toutiao" at time t2, and wake up "Taobao" at time t3. The terminal device 100 needs to frequently wake up the application, which is obviously not conducive to the power saving of the terminal device 100.
因此,为了平衡终端设备100的节省功耗和用户体验等,在本申请一些实施例中,终端设备100可以将第一应用的心跳时刻对齐至该心跳时刻的前一次心跳时刻或者后一次心跳时刻。Therefore, in order to balance the power saving and user experience of the terminal device 100, in some embodiments of the present application, the terminal device 100 may align the heartbeat time of the first application to the previous heartbeat time or the next heartbeat time of the heartbeat time. .
在一些实施例中,终端设备100可以根据预设条件,将第一应用的心跳时刻对齐至该心跳时刻的前一次心跳时刻或者后一次心跳时刻。其中,该预设条件可以是预先设置的对齐方式。其中,预先设置的对齐方式至少可以包括向左对齐、向右对齐和就近对齐。或者,该预设条件还可以是其他条件或规则,本申请实施例对此不作限定。In some embodiments, the terminal device 100 may align the heartbeat time of the first application to the previous heartbeat time or the next heartbeat time of the heartbeat time according to a preset condition. Wherein, the preset condition may be a preset alignment mode. Wherein, the preset alignment mode may include at least left alignment, right alignment, and nearest alignment. Alternatively, the preset condition may also be other conditions or rules, which are not limited in the embodiment of the present application.
在一些实施例中,终端设备100可以根据预设条件,将第一应用的心跳时刻对齐至该心跳时刻的前一次系统心跳时刻或者后一次系统心跳时刻。In some embodiments, the terminal device 100 may align the heartbeat time of the first application to the previous system heartbeat time or the next system heartbeat time of the heartbeat time according to a preset condition.
示例性的,预先设置的对齐方式为就近对齐,终端设备100可以将第一应用的第一心跳时刻T1按照该就近对齐原则,对齐至距离该第一心跳时刻T1最近的系统心跳时刻。如图11中的(a)所示,距离该第一心跳时刻T1最近的系统心跳时刻为T22。终端设备100可以将第一应用的第一心跳时刻T1对齐至系统心跳时刻T22。即,终端设备100在T22时刻唤醒第一应用。Exemplarily, the preset alignment mode is nearest alignment, and the terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time closest to the first heartbeat time T1 according to the nearest alignment principle. As shown in Fig. 11(a), the system heartbeat time closest to the first heartbeat time T1 is T22. The terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time T22. That is, the terminal device 100 wakes up the first application at time T22.
若预先设置的对齐方式为向右对齐,终端设备100可以将第一应用的第一心跳时刻T1按照该向右对齐原则,对齐至第一心跳时刻T1之后的第一个系统心跳时刻。如图11中的(b)所示,第一心跳时刻T1之后的第一个系统心跳时刻为T22。终端设备100可以将第一应用的第一心跳时刻T1对齐至系统心跳时刻T alarm(T22)。即,终端设备100在T22时刻唤醒第一应用。 If the preset alignment is right alignment, the terminal device 100 can align the first heartbeat time T1 of the first application to the first system heartbeat time after the first heartbeat time T1 according to the right alignment principle. As shown in (b) in Figure 11, the first system heartbeat time after the first heartbeat time T1 is T22. The terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time T alarm (T22). That is, the terminal device 100 wakes up the first application at time T22.
若对齐方式为向左对齐,终端设备100可以将第一应用的第一心跳时刻T1按照该向左对齐原则,对齐至第一心跳时刻T1之前的最近一个系统心跳时刻。如图11中的(c)所示,第一心跳时刻T1之前的最近一个系统心跳时刻为T11。终端设备100可以将第一应用的第一心跳时刻T1对齐至系统心跳时刻T alarm(T11)。即,终端设备100在T11时刻唤醒第一应用。 If the alignment is left-aligned, the terminal device 100 can align the first heartbeat time T1 of the first application to the nearest system heartbeat time before the first heartbeat time T1 according to the left-alignment principle. As shown in (c) in Figure 11, the latest system heartbeat time before the first heartbeat time T1 is T11. The terminal device 100 may align the first heartbeat time T1 of the first application to the system heartbeat time T alarm (T11). That is, the terminal device 100 wakes up the first application at time T11.
在一些实施例中,终端设备100可以对终端设备100周期性唤醒的所有应用的心跳时刻进行统计。结合终端设备100在第一心跳时刻T1计划唤醒的应用数量,以及T1前一次系统心跳时刻和后一次系统心跳时刻,终端设备100计划唤醒的应用数量,确定上述预设条件。或者,该预设条件还可以根据其他条件或规则确定,本申请实施例对此不作限定。In some embodiments, the terminal device 100 may perform statistics on the heartbeat moments of all applications that the terminal device 100 periodically wakes up. Combining the number of applications that the terminal device 100 plans to wake up at the first heartbeat time T1, and the number of applications that the terminal device 100 plans to wake up at the previous system heartbeat time and the next system heartbeat time T1, the foregoing preset conditions are determined. Alternatively, the preset condition may also be determined according to other conditions or rules, which are not limited in the embodiment of the present application.
示例性的,终端设备100计划在第一心跳时刻T1唤醒5个应用,在T1的前一次系统心跳时刻计划唤醒3个应用,在T1的后一次系统心跳时刻计划唤醒8个应用。在这种情况下,终端设备100可以设置第一心跳时刻T1的对齐方式为向右对齐。将所有计划在该时刻唤醒的应用,向右对齐至在T1的后一次系统心跳时刻 唤醒。Exemplarily, the terminal device 100 plans to wake up 5 applications at the first heartbeat moment T1, plans to wake up 3 applications at the previous system heartbeat moment of T1, and plans to wake up 8 applications at the next system heartbeat moment of T1. In this case, the terminal device 100 may set the alignment of the first heartbeat moment T1 to be right-aligned. Align all applications that are scheduled to wake up at this moment to the right to wake up at the next system heartbeat moment of T1.
S905、终端设备100确定下一个心跳时刻。S905: The terminal device 100 determines the next heartbeat moment.
其中,终端设备100可以根据第一应用的心跳周期T确定下一个心跳时刻。The terminal device 100 may determine the next heartbeat time according to the heartbeat cycle T of the first application.
示例性的,若上一个心跳时刻是第一心跳时刻T1,那么下一个心跳时刻在第一心跳时刻T1之后,与第一心跳时刻T1间隔第一应用的心跳周期T。Exemplarily, if the last heartbeat time is the first heartbeat time T1, then the next heartbeat time is after the first heartbeat time T1, and is separated from the first heartbeat time T1 by the first applied heartbeat period T.
S906、终端设备100采用S904同样的方法,将第一应用第一心跳时刻之后的下一个心跳时刻对齐至系统心跳时刻。S906: The terminal device 100 uses the same method as S904 to align the next heartbeat time after the first heartbeat time of the first application to the system heartbeat time.
其中,终端设备100将第一应用第一心跳时刻之后的下一个心跳时刻对齐至系统心跳时刻,用于在该系统心跳时刻唤醒第一应用,以触发所第一应用的客户端向第一应用的应用服务器发送心跳包。Wherein, the terminal device 100 aligns the next heartbeat moment after the first heartbeat moment of the first application to the system heartbeat moment for waking up the first application at the system heartbeat moment to trigger the client of the first application to report to the first application The application server sends a heartbeat packet.
S907、终端设备100判断第一应用的客户端是否断开长连接或终端设备100是否熄屏状态转为亮屏状态。S907: The terminal device 100 judges whether the client of the first application disconnects the long connection or whether the screen off state of the terminal device 100 changes to the on screen state.
若是,终端设备100执行S908。If yes, the terminal device 100 executes S908.
若否,终端设备100重新执行S905、S906和S907。采用同样的方法,依次确定每一个心跳时刻。如图11中的(a)、图11中的(b)和图11中的(c)中的T2和T3等。If not, the terminal device 100 executes S905, S906, and S907 again. Using the same method, determine each heartbeat moment in turn. T2 and T3 in (a) in FIG. 11, (b) in FIG. 11, and (c) in FIG. 11, etc.
S908、终端设备100停止按照第一应用的心跳周期,周期性唤醒第一应用。S908. The terminal device 100 stops periodically waking up the first application according to the heartbeat cycle of the first application.
如上文所述,可以理解的是,在第一应用的客户端断开长连接时,第一应用的客户端无法向第一应用的应用服务器发送心跳包。因此,终端设备100可以停止周期性唤醒第一应用的客户端。而在终端设备100由熄屏状态转为亮屏状态时,为了保证第一应用功能的最佳体现,终端设备100可以结束本申请实施例提供的应用的心跳唤醒方法。采用系统心跳时钟作为应用心跳时机的参考,周期性唤醒第一应用。As described above, it can be understood that when the client of the first application disconnects the long connection, the client of the first application cannot send the heartbeat packet to the application server of the first application. Therefore, the terminal device 100 can stop periodically waking up the client of the first application. When the terminal device 100 changes from the off-screen state to the on-screen state, in order to ensure the best performance of the first application function, the terminal device 100 may end the application heartbeat wake-up method provided in the embodiment of the present application. The system heartbeat clock is used as a reference for the application heartbeat timing to periodically wake up the first application.
采用本申请实施例提供的应用的心跳唤醒方法,即可以满足根据应用的实际情况和终端设备的使用场景信息等实际情况中的一个或多个,动态调整应用的心跳周期。还可以减小终端设备在熄屏状态下的功耗。如图12所示,为采用本申请实施例提供的应用的心跳唤醒方法与常规心跳唤醒方法的功耗对比示例图。图12中的(a)示出了一定时间内常规心跳唤醒方法的输出电流统计结果。图12中的(b)示出了一定时间内采用本申请实施例提供的应用的心跳唤醒方法的输出电流统计结果。可以理解的是,一个终端设备的工作电压是固定的,输出电流的大小就可以反映出该终端设备的功耗。如图12中的(a)所示,采用常规的心跳唤醒方法,终端设备唤醒应用时杂乱无章的。而采用本申请实施例提供的应用的心跳唤醒方法,终端设备唤醒应用相对规律了很多。图12中的(c)示出了采用本申请实施例提供的应用的心跳唤醒方法与常规心跳唤醒方法的功耗对比结果。根据图12中的(a)、图12中的(b)和图12中的(c)可知,采用本申请实施例提供的应用的心跳唤醒方法,大大减小了终端设备在熄屏状态下的功耗。The application's heartbeat wake-up method provided in the embodiments of the present application can be used to dynamically adjust the heartbeat cycle of the application according to one or more of the actual conditions of the application and the usage scenario information of the terminal device. It can also reduce the power consumption of the terminal device in the off-screen state. As shown in FIG. 12, it is an example diagram of power consumption comparison between the heartbeat wake-up method and the conventional heartbeat wake-up method using the application provided by the embodiment of the application. (A) in Figure 12 shows the output current statistical results of the conventional heartbeat wake-up method within a certain period of time. (B) in FIG. 12 shows the output current statistics result of the heartbeat wake-up method of the application provided by the embodiment of the present application within a certain period of time. It is understandable that the working voltage of a terminal device is fixed, and the output current can reflect the power consumption of the terminal device. As shown in Figure 12 (a), using the conventional heartbeat wake-up method, the terminal device wakes up the application in a disorderly manner. However, by adopting the heartbeat wake-up method of the application provided in the embodiment of the present application, the terminal device wakes up the application relatively regularly. (C) in FIG. 12 shows the power consumption comparison result between the heartbeat wake-up method using the application provided by the embodiment of the application and the conventional heartbeat wake-up method. According to Figure 12 (a), Figure 12 (b), and Figure 12 (c), it can be seen that adopting the heartbeat wake-up method of the application provided by the embodiment of this application greatly reduces the terminal device in the off-screen state. Power consumption.
在本申请一些实施例中,终端设备100可以通过终端设备100中设置的传感器采集第一数据,对该第一数据进行分析,从而确定终端设备100的情景模式信息。其中,该传感器至少可以是加速度传感器、陀螺仪传感器、磁传感器、环境光传感器、距 离传感器和接近光传感器中的至少一种。In some embodiments of the present application, the terminal device 100 may collect first data through a sensor set in the terminal device 100, and analyze the first data, so as to determine the context mode information of the terminal device 100. Wherein, the sensor can be at least one of an acceleration sensor, a gyro sensor, a magnetic sensor, an ambient light sensor, a distance sensor, and a proximity light sensor.
在一种实现方式中,终端设备100可以通过分析加速度传感器和/或磁传感器,以及陀螺仪传感器采集的数据确定终端设备100的姿态,进而根据终端设备100的姿态确定终端设备100的情景模式信息。其中,终端设备100的姿态至少包括终端设备100的运动方向、运动速度以及终端设备100相对于地面坐标系的偏航角(yaw),俯仰角(pitch)和横滚角(roll)。In an implementation manner, the terminal device 100 can determine the posture of the terminal device 100 by analyzing the data collected by the acceleration sensor and/or the magnetic sensor and the gyroscope sensor, and then determine the scene mode information of the terminal device 100 according to the posture of the terminal device 100 . Wherein, the posture of the terminal device 100 includes at least the direction of movement, the speed of movement of the terminal device 100, and the yaw, pitch, and roll angles of the terminal device 100 relative to the ground coordinate system.
其中,加速度传感器包括质量块和敏感元件等组件。加速度传感器的工作原理是:敏感元件将质量块所受惯性力转换为电信号,从而根据质量块的受力情况转换成的电信号,判断终端设备100的平移方向和平移速度。其中,质量块的受力情况表现为:质量块的受力方向,和质量块在受力方向上的加速度大小。质量块的受力方向可以包括:沿着三维坐标系的x b轴、y b轴和z b轴三个轴上的六个方向,即+x b,-x b,+y b,-y b,+z b和-z b方向。因此,第一数据中,由加速度传感器采集的数据可以是终端设备的平移方向和终端设备沿着该平移方向运动的平移速度。 Among them, the acceleration sensor includes components such as masses and sensitive components. The working principle of the acceleration sensor is: the sensitive element converts the inertial force received by the mass block into an electrical signal, thereby determining the translation direction and the translation speed of the terminal device 100 according to the electrical signal converted into the force of the mass block. Among them, the force condition of the mass block is expressed as: the force direction of the mass block and the acceleration of the mass block in the force direction. The force direction of the mass can include: six directions along the x b axis, y b axis and z b axis of the three -dimensional coordinate system, namely +x b , -x b , +y b , -y b , +z b and -z b directions. Therefore, in the first data, the data collected by the acceleration sensor may be the translation direction of the terminal device and the translation speed of the terminal device moving along the translation direction.
陀螺仪传感器包括陀螺转子和驱动电机等组件组成。陀螺仪传感器的工作原理是驱动电机驱动陀螺转子绕着旋转轴旋转,通过测量得到的陀螺转子的旋转轴与终端设备100的三维坐标系(包括X轴,Y轴,Z轴)之间的夹角,以及陀螺转子的角速度,从而确定终端设备100相对于三维坐标系的旋转角度以及终端设备100的旋转角速度。The gyro sensor includes components such as a gyro rotor and a drive motor. The working principle of the gyro sensor is to drive the motor to drive the gyro rotor to rotate around the rotation axis. The rotation axis of the gyro rotor obtained by measurement and the three-dimensional coordinate system of the terminal device 100 (including the X axis, Y axis, and Z axis) are clamped. Angle, and the angular velocity of the gyro rotor, thereby determining the rotation angle of the terminal device 100 relative to the three-dimensional coordinate system and the rotation angular velocity of the terminal device 100.
磁传感器的原理跟指南针类似,可以测量出终端设备100与东南西北四个方向上的夹角。The principle of the magnetic sensor is similar to that of a compass, which can measure the angles between the terminal device 100 and the four directions of south, east, north, and west.
也就是说,加速度传感器可以测量到“终端设备100沿X轴走了多远”,陀螺仪传感器可以测量到“终端设备100转了个身”,磁传感器可以测量到“终端设备100向西运动”。In other words, the acceleration sensor can measure "how far the terminal device 100 travels along the X axis", the gyroscope sensor can measure "the terminal device 100 has turned around", and the magnetic sensor can measure "the terminal device 100 moves westward." ".
请参考图13,如图13所示,为本申请实施例提供的一种终端设备100的姿态示意图。如图13所示,x b轴、y b轴、z b轴和原点O组成了终端设备100的坐标系。x g轴、y g轴、z g轴和原点O组成了地面坐标系。其中,O为终端设备100的质心,x b轴在终端设备100对称平面内并平行于终端设备100的机身轴线指向终端设备100头部。y b轴垂直于x b轴指向终端设备100右侧。z b轴垂直于x b轴,并指向终端设备100机身下方。x g轴在水平面内并指向某一方向。z g轴垂直于地面并指向地心。y g轴在水平面内垂直于x g轴,其指向按照右手定则确定。 Please refer to FIG. 13, as shown in FIG. 13, which is a schematic diagram of a posture of a terminal device 100 according to an embodiment of this application. As shown in FIG. 13, the x b axis, the y b axis, the z b axis and the origin O constitute the coordinate system of the terminal device 100. The x g axis, y g axis, z g axis and the origin O constitute a ground coordinate system. Among them, O is the center of mass of the terminal device 100, and the x b axis is in the symmetry plane of the terminal device 100 and is parallel to the body axis of the terminal device 100 and points to the head of the terminal device 100. The y b axis is perpendicular to the x b axis and points to the right of the terminal device 100. The z b axis is perpendicular to the x b axis and points below the body of the terminal device 100. The x g axis is in the horizontal plane and points in a certain direction. The z g axis is perpendicular to the ground and points to the center of the earth. y g in a horizontal plane perpendicular to the axis x g-axis, which is determined in accordance with the right-hand point.
如图13所示,偏航角是指终端设备100对应的x b轴在水平面上的投影与地面坐标系x g轴之间的夹角
Figure PCTCN2020114596-appb-000010
以终端设备100前端部分向右偏转为正。俯仰角是指终端设备100对应的x b轴与地平面(或水平面)之间的夹角θ,以终端设备100前端部分向上偏转为正。横滚角是指终端设备100对应的z b轴与通过终端设备100x b轴的铅垂面间的夹角φ,以终端设备100右滚为正。
As shown in Figure 13, the yaw angle refers to the angle between the projection of the x b axis corresponding to the terminal device 100 on the horizontal plane and the x g axis of the ground coordinate system
Figure PCTCN2020114596-appb-000010
The deflection of the front end of the terminal device 100 to the right is regarded as positive. The pitch angle refers to the angle θ between the x b axis corresponding to the terminal device 100 and the ground plane (or horizontal plane), with the front end portion of the terminal device 100 deflecting upward as a positive. Roll angle refers to the angle φ between the terminal device 100 corresponding to the vertical axis z b plane through the axis of the terminal device 100x b to the right terminal 100 is positive roller.
示例性的,终端设备100通过分析加速度传感器、磁传感器和陀螺仪传感器采集的第一数据确定终端设备100的运动速度为0米/秒,且终端设备100的俯仰角θ为0,横滚角φ为0。则终端设备100可以确定其处于桌面模式。Exemplarily, the terminal device 100 determines that the movement speed of the terminal device 100 is 0 m/s by analyzing the first data collected by the acceleration sensor, the magnetic sensor, and the gyro sensor, and the pitch angle θ of the terminal device 100 is 0, and the roll angle φ is 0. Then the terminal device 100 can determine that it is in the desktop mode.
又一示例性的,在终端设备100通过分析加速度传感器采集的数据确定终端设备100的向西运动,运动速度为6米/秒。终端设备100可以确定其处于运动模式。在这 种情况下,在一些实施例中,终端设备可以忽略终端设备100的偏航角
Figure PCTCN2020114596-appb-000011
俯仰角θ和横滚角φ。
In another example, the terminal device 100 determines the westward movement of the terminal device 100 by analyzing the data collected by the acceleration sensor, and the movement speed is 6 meters per second. The terminal device 100 can determine that it is in the sports mode. In this case, in some embodiments, the terminal device can ignore the yaw angle of the terminal device 100
Figure PCTCN2020114596-appb-000011
Pitch angle θ and roll angle φ.
进一步的,终端设备100还可以根据终端设备100中预先设置的跑步模式对应的速度范围,进一步终端设备100处于跑步模式、走路模式还是骑行模式。例如,终端设备100中预先设置的跑步模式对应的速度范围为3米/秒-12米/秒,则终端设备100可以确定其处于跑步模式。Further, the terminal device 100 may further determine whether the terminal device 100 is in a running mode, a walking mode or a riding mode according to the speed range corresponding to the running mode preset in the terminal device 100. For example, if the speed range corresponding to the running mode preset in the terminal device 100 is 3 m/sec to 12 m/sec, the terminal device 100 can determine that it is in the running mode.
在另一种实现方式中,终端设备100还可以通过分析环境光传感器、距离传感器或接近光传感器采集的数据确定终端设备100所处的环境信息,进而根据终端设备100的环境信息确定终端设备100的情景模式信息。In another implementation manner, the terminal device 100 can also determine the environmental information of the terminal device 100 by analyzing the data collected by the ambient light sensor, the distance sensor, or the proximity light sensor, and then determine the terminal device 100 according to the environmental information of the terminal device 100. Profile information.
例如,终端设备100通过环境光传感器确定终端设备100所处的环境光亮度非常暗,另外,结合距离传感器或者接近光传感器采集到的数据,确定终端设备屏幕被其他物体遮挡。综合上述结果,终端设备100可以确定其处于口袋模式。For example, the terminal device 100 uses an ambient light sensor to determine that the ambient light brightness of the terminal device 100 is very dark, and in combination with data collected by a distance sensor or a proximity light sensor, it is determined that the screen of the terminal device is blocked by other objects. Based on the above results, the terminal device 100 can determine that it is in the pocket mode.
在另一些实施例中,终端设备100可以通过分析心率传感器采集的数据确定用户的心率信息,进而根据用户的心率信息确定终端设备100的情景模式信息。In other embodiments, the terminal device 100 may determine the user's heart rate information by analyzing data collected by the heart rate sensor, and then determine the scene mode information of the terminal device 100 according to the user's heart rate information.
例如,终端设备100分析心率传感器采集到的用户的心率信息,确定该心率信息符合预设的人在睡眠状态下的心率。在这种情况下,终端设备100可以认为终端设备不被用户使用,终端设备100则可以确定终端设备100处于休眠模式。其中,终端设备100的心率传感器可以通过手环采集用户的心率信息。For example, the terminal device 100 analyzes the user's heart rate information collected by the heart rate sensor, and determines that the heart rate information conforms to a preset heart rate of the person in a sleep state. In this case, the terminal device 100 may consider that the terminal device is not used by the user, and the terminal device 100 may determine that the terminal device 100 is in a sleep mode. The heart rate sensor of the terminal device 100 can collect the user's heart rate information through the bracelet.
需要说明的是,本申请实施例中终端设备100的情景模式可以是通过综合分析多个传感器采集的数据确定的。例如,在终端设备100通过分析加速度传感器、磁传感器和陀螺仪传感器采集的第一数据确定终端设备100处于运动模式时,终端设备100还可以结合心率传感器检测到的用户心率等生物计量指标,进一步终端设备100处于跑步模式、走路模式还是骑行模式。例如,心率传感器检测到的用户心率等数据符合终端设备100中预先配置的常规的人在跑步时的生物计量指标范围,在这种情况下,则终端设备100可以确定其处于跑步模式。It should be noted that the scenario mode of the terminal device 100 in the embodiment of the present application may be determined by comprehensively analyzing data collected by multiple sensors. For example, when the terminal device 100 determines that the terminal device 100 is in the exercise mode by analyzing the first data collected by the acceleration sensor, the magnetic sensor, and the gyroscope sensor, the terminal device 100 may also combine the user's heart rate and other biometric indicators detected by the heart rate sensor, and further The terminal device 100 is in a running mode, a walking mode, or a riding mode. For example, the user's heart rate and other data detected by the heart rate sensor meets the pre-configured range of conventional biometric indicators of a person during running in the terminal device 100. In this case, the terminal device 100 can determine that it is in the running mode.
可以理解的是,终端设备为了实现上述任一个实施例的功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to implement the function of any one of the foregoing embodiments, the terminal device includes a hardware structure and/or software module corresponding to each function. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
本申请实施例可以对终端设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the terminal device into functional modules. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
比如,以采用集成的方式划分各个功能模块为例,如图14所示,为本申请实施例提供的一种终端设备的结构示意图。该终端设备100可以包括信息获取单元1410,分析单元1420和应用唤醒单元1430。For example, taking as an example of dividing various functional modules in an integrated manner, as shown in FIG. 14, a schematic structural diagram of a terminal device provided in an embodiment of this application. The terminal device 100 may include an information acquisition unit 1410, an analysis unit 1420, and an application wake-up unit 1430.
其中,信息获取单元1410用于支持终端设备100执行S301,和/或用于本文所描述的技术的其他过程。分析单元1420用于支持终端设备100执行S302、S603、S605、S904、S905、S906和S907,和/或用于本文所描述的技术的其他过程。应用唤醒单元1430用于支持终端设备100执行S604和S908,和/或用于本文所描述的技术的其他过程。Wherein, the information acquiring unit 1410 is used to support the terminal device 100 to perform S301, and/or other processes used in the technology described herein. The analysis unit 1420 is used to support the terminal device 100 to perform S302, S603, S605, S904, S905, S906, and S907, and/or other processes used in the technology described herein. The application wake-up unit 1430 is used to support the terminal device 100 to perform S604 and S908, and/or other processes used in the technology described herein.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that all relevant content of the steps involved in the foregoing method embodiments can be cited in the functional description of the corresponding functional module, and will not be repeated here.
在一种可选的方式中,当使用软件实现数据传输时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地实现本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In an optional manner, when software is used to implement data transmission, it may be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions described in the embodiments of the present application are realized. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
结合本申请实施例所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于探测装置中。当然,处理器和存储介质也可以作为分立组件存在于探测装置中。The steps of the method or algorithm described in the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, which can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art Medium. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in the ASIC. In addition, the ASIC may be located in the detection device. Of course, the processor and the storage medium may also exist as discrete components in the detection device.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的用户设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed user equipment and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分 布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate parts may or may not be physically separate. The parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, 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 software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application shall be covered by the protection scope of this application. . Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (16)

  1. 一种应用的心跳唤醒方法,其特征在于,所述方法应用于终端设备,所述终端设备中安装有多个应用的客户端,所述方法包括:An application heartbeat wake-up method, characterized in that the method is applied to a terminal device in which multiple application clients are installed, and the method includes:
    所述终端设备在熄屏状态下,获取第一应用的应用指示信息和所述终端设备的使用场景信息中的一个或多个信息;其中,所述第一应用与所述第一应用的应用服务器建立了长连接;所述应用指示信息用于指示所述第一应用的应用类型,和/或所述第一应用在预设时间内在所述终端设备前台运行的时间信息或次数;所述使用场景信息包括:所述终端设备的熄屏时间、网络状态信息和情景模式信息中的一项或多项;所述情景模式信息用于指示所述终端设备处于运动模式、睡觉模式、口袋模式或桌面模式中的任一种模式;The terminal device obtains one or more of the application indication information of the first application and the usage scenario information of the terminal device when the screen is turned off; wherein, the first application and the application of the first application The server establishes a long connection; the application indication information is used to indicate the application type of the first application, and/or the time information or the number of times the first application runs in the foreground of the terminal device within a preset time; The usage scenario information includes: one or more of the screen off time of the terminal device, network status information, and scenario mode information; the scenario mode information is used to indicate that the terminal device is in exercise mode, sleep mode, or pocket mode Or any of the desktop modes;
    所述终端设备根据所述应用指示信息和所述使用场景信息,确定所述第一应用的心跳周期,所述第一应用的心跳周期用于周期性唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包。The terminal device determines the heartbeat cycle of the first application according to the application indication information and the usage scenario information, and the heartbeat cycle of the first application is used to periodically wake up the first application to trigger the The client of the first application sends a heartbeat packet to the application server of the first application.
  2. 根据权利要求1所述的方法,其特征在于,所述终端设备中包括一个或多个传感器,所述一个或多个传感器包括:陀螺仪传感器、加速度传感器、磁传感器、环境光传感器、接近光传感器、距离传感器和心率传感器中的至少一个;The method according to claim 1, wherein the terminal device includes one or more sensors, and the one or more sensors include: a gyroscope sensor, an acceleration sensor, a magnetic sensor, an ambient light sensor, and a proximity light sensor. At least one of a sensor, a distance sensor, and a heart rate sensor;
    所述终端设备通过所述一个或多个传感器采集的参数,获取所述情景模式信息。The terminal device obtains the scenario mode information through the parameters collected by the one or more sensors.
  3. 根据权利要求1或2所述的方法,其特征在于,所述网络状态信息用于指示所述终端设备连接到网络或者未连接到网络;The method according to claim 1 or 2, wherein the network status information is used to indicate that the terminal device is connected to the network or not connected to the network;
    如果所述终端设备连接到网络,所述网络状态信息还用于指示所述终端设备连接的网络类型,以及所述终端设备的信号质量。If the terminal device is connected to the network, the network status information is also used to indicate the network type to which the terminal device is connected, and the signal quality of the terminal device.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述使用场景信息至少包括:所述终端设备的熄屏时间;The method according to any one of claims 1-3, wherein the usage scenario information includes at least: the screen-off time of the terminal device;
    所述终端设备进入所述熄屏状态后,周期性获取所述第一应用的应用指示信息和所述终端设备的使用场景信息中的一个或多个信息。After the terminal device enters the screen-off state, it periodically acquires one or more pieces of information among the application indication information of the first application and the usage scenario information of the terminal device.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-4, wherein the method further comprises:
    所述终端设备确定第一心跳时刻,所述第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,所述第一时长等于所述第一应用的心跳周期;Determining, by the terminal device, a first heartbeat moment, where the first heartbeat moment is a cut-off time starting from the current moment and after a first duration, and the first duration is equal to the heartbeat period of the first application;
    所述终端设备从所述第一心跳时刻开始,按照所述第一应用的心跳周期,周期性唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包,直到所述第一应用的客户端断开所述长连接或所述终端设备由熄屏状态转为亮屏状态。Starting from the first heartbeat moment, the terminal device periodically wakes up the first application according to the heartbeat period of the first application to trigger the client of the first application to apply to the first application The server sends a heartbeat packet until the client of the first application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state.
  6. 根据权利要求1-4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-4, wherein the method further comprises:
    所述终端设备确定第一心跳时刻,所述第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,所述第一时长等于所述第一应用的心跳周期;Determining, by the terminal device, a first heartbeat moment, where the first heartbeat moment is a cut-off time starting from the current moment and after a first duration, and the first duration is equal to the heartbeat period of the first application;
    所述终端设备在所述当前时刻之后,距离所述第一心跳时刻最近的系统心跳时刻,唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包;After the current time, the terminal device wakes up the first application at the system heartbeat time closest to the first heartbeat time to trigger the client of the first application to send to the application server of the first application Send a heartbeat packet;
    在所述终端设备确定第一心跳时刻之后,所述终端设备循环执行以下步骤(1)和步骤(2),直到所述第一应用的客户端断开所述长连接或所述终端设备由熄屏状态转为亮屏状态:After the terminal device determines the first heartbeat moment, the terminal device cyclically executes the following steps (1) and (2) until the client of the first application disconnects the long connection or the terminal device is Turn off the screen to the bright screen:
    步骤(1):所述终端设备根据第一应用的心跳周期确定下一个心跳时刻;Step (1): The terminal device determines the next heartbeat time according to the heartbeat period of the first application;
    步骤(2):所述终端设备在距离所述下一个心跳时刻最近的系统心跳时刻,唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包;其中,所述系统心跳时刻是所述终端设备根据开机时启动的系统心跳时钟确定的。Step (2): The terminal device wakes up the first application at the system heartbeat time closest to the next heartbeat time to trigger the client of the first application to send to the application server of the first application Heartbeat package; wherein, the system heartbeat time is determined by the terminal device according to the system heartbeat clock started when it is turned on.
  7. 一种终端设备,其特征在于,所述终端设备中安装有多个应用的客户端,所述终端设备包括:A terminal device, characterized in that multiple application clients are installed in the terminal device, and the terminal device includes:
    信息获取单元,用于在所述终端设备处于熄屏状态下,获取第一应用的应用指示信息和所述终端设备的使用场景信息中的一个或多个信息;其中,所述第一应用与所述第一应用的应用服务器建立了长连接;所述应用指示信息用于指示所述第一应用的应用类型,和/或所述第一应用在预设时间内在所述终端设备前台运行的时间信息或次数;所述使用场景信息包括:所述终端设备的熄屏时间、网络状态信息和情景模式信息中的一项或多项;所述情景模式信息用于指示所述终端设备处于运动模式、睡觉模式、口袋模式或桌面模式中的任一种模式;The information acquiring unit is configured to acquire one or more of the application indication information of the first application and the usage scenario information of the terminal device when the terminal device is in the off-screen state; wherein, the first application and The application server of the first application establishes a persistent connection; the application indication information is used to indicate the application type of the first application, and/or the first application is running in the foreground of the terminal device within a preset time Time information or times; the usage scenario information includes: one or more of the screen off time of the terminal device, network status information, and scenario mode information; the scenario mode information is used to indicate that the terminal device is in motion Any one of mode, sleep mode, pocket mode or desktop mode;
    分析单元,用于根据所述应用指示信息和所述使用场景信息,确定所述第一应用的心跳周期,所述第一应用的心跳周期用于周期性唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包。The analysis unit is configured to determine the heartbeat cycle of the first application according to the application indication information and the usage scenario information, and the heartbeat cycle of the first application is used to periodically wake up the first application to trigger all The client of the first application sends a heartbeat packet to the application server of the first application.
  8. 根据权利要求7所述的终端设备,其特征在于,所述终端设备还包括传感器单元,所述传感器单元包括一个或多个传感器,所述一个或多个传感器包括:陀螺仪传感器、加速度传感器、磁传感器、环境光传感器、接近光传感器、距离传感器和心率传感器中的至少一个;The terminal device according to claim 7, wherein the terminal device further comprises a sensor unit, the sensor unit comprises one or more sensors, and the one or more sensors comprise: a gyroscope sensor, an acceleration sensor, At least one of a magnetic sensor, an ambient light sensor, a proximity light sensor, a distance sensor, and a heart rate sensor;
    所述一个或多个传感器用于采集参数,使得所述信息获取单元根据所述参数确定所述情景模式信息。The one or more sensors are used to collect parameters, so that the information acquisition unit determines the scene mode information according to the parameters.
  9. 根据权利要求7或8所述的终端设备,其特征在于,所述网络状态信息用于指示所述终端设备连接到网络或者未连接到网络;The terminal device according to claim 7 or 8, wherein the network state information is used to indicate that the terminal device is connected to the network or not connected to the network;
    如果所述终端设备连接到网络,所述网络状态信息还用于指示所述终端设备连接的网络类型,以及所述终端设备的信号质量。If the terminal device is connected to the network, the network status information is also used to indicate the network type to which the terminal device is connected, and the signal quality of the terminal device.
  10. 根据权利要求7-9任一项所述的终端设备,其特征在于,所述使用场景信息至少包括:所述终端设备的熄屏时间;The terminal device according to any one of claims 7-9, wherein the usage scenario information includes at least: the screen-off time of the terminal device;
    所述信息获取单元用于,在所述终端设备进入所述熄屏状态后,周期性获取所述第一应用的应用指示信息和所述终端设备的使用场景信息中的一个或多个信息。The information acquiring unit is configured to periodically acquire one or more pieces of information among application indication information of the first application and usage scenario information of the terminal device after the terminal device enters the screen-off state.
  11. 根据权利要求7-10任一项所述的终端设备,其特征在于,所述分析单元还用于,确定第一心跳时刻,所述第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,所述第一时长等于所述第一应用的心跳周期;The terminal device according to any one of claims 7-10, wherein the analysis unit is further configured to determine a first heartbeat moment, the first heartbeat moment starting from the current moment, and the first time period has passed. At the cut-off time, the first duration is equal to the heartbeat period of the first application;
    所述终端设备还包括:应用唤醒单元,用于从所述第一心跳时刻开始,按照 所述第一应用的心跳周期,周期性唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包,直到所述第一应用的客户端断开所述长连接或所述终端设备由熄屏状态转为亮屏状态。The terminal device further includes: an application wake-up unit, configured to periodically wake up the first application according to the heartbeat period of the first application from the first heartbeat moment to trigger the client of the first application The terminal sends a heartbeat packet to the application server of the first application until the client of the first application disconnects the long connection or the terminal device changes from the off-screen state to the on-screen state.
  12. 根据权利要求7-10任一项所述的终端设备,其特征在于,所述分析单元还用于,确定第一心跳时刻,所述第一心跳时刻是从当前时刻开始,经过第一时长的截止时刻,所述第一时长等于所述第一应用的心跳周期;The terminal device according to any one of claims 7-10, wherein the analysis unit is further configured to determine a first heartbeat moment, the first heartbeat moment starting from the current moment, and the first time period has passed. At the cut-off time, the first duration is equal to the heartbeat period of the first application;
    所述终端设备还包括:应用唤醒单元,用于在所述当前时刻之后,距离所述第一心跳时刻最近的系统心跳时刻,唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包;The terminal device further includes: an application wake-up unit, configured to wake up the first application at the system heartbeat time closest to the first heartbeat time after the current time to trigger the client of the first application Sending a heartbeat packet to the application server of the first application;
    在所述分析单元确定第一心跳时刻之后,所述分析单元和所述应用唤醒单元还用于,循环执行以下步骤(1)和步骤(2),直到所述第一应用的客户端断开所述长连接或所述终端设备由熄屏状态转为亮屏状态:After the analysis unit determines the first heartbeat moment, the analysis unit and the application wake-up unit are also used to cyclically execute the following steps (1) and (2) until the client of the first application is disconnected The long connection or the terminal device changes from the off-screen state to the on-screen state:
    步骤(1):所述分析单元根据第一应用的心跳周期确定下一个心跳时刻;Step (1): The analysis unit determines the next heartbeat time according to the heartbeat cycle of the first application;
    步骤(2):所述应用唤醒单元在距离所述下一个心跳时刻最近的系统心跳时刻,唤醒所述第一应用,以触发所述第一应用的客户端向所述第一应用的应用服务器发送心跳包;其中,所述系统心跳时刻是所述终端设备根据开机时启动的系统心跳时钟确定的。Step (2): The application wake-up unit wakes up the first application at the system heartbeat moment closest to the next heartbeat moment, so as to trigger the client of the first application to send to the application server of the first application Sending a heartbeat packet; wherein the system heartbeat time is determined by the terminal device according to the system heartbeat clock activated when the terminal device is turned on.
  13. 一种终端设备,其特征在于,所述终端设备包括:A terminal device, characterized in that, the terminal device includes:
    存储器,用于存储一个或多个计算机程序;Memory, used to store one or more computer programs;
    射频电路,用于进行无线电信号的发送和接收;Radio frequency circuit, used for sending and receiving radio signals;
    处理器,用于执行所述存储器存储的一个或多个计算机程序,使得所述终端设备实现如权利要求1-6任一项所述的应用的心跳唤醒方法。The processor is configured to execute one or more computer programs stored in the memory, so that the terminal device implements the heartbeat wake-up method of the application according to any one of claims 1-6.
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机执行指令,所述计算机执行指令被执行时,实现如权利要求1-6任一项所述的应用的心跳唤醒方法。A computer-readable storage medium, characterized in that a computer-executable instruction is stored on the computer-readable storage medium, and when the computer-executable instruction is executed, it realizes the application of any one of claims 1 to 6 Heartbeat wake-up method.
  15. 一种芯片系统,其特征在于,所述芯片系统包括:A chip system, characterized in that, the chip system includes:
    存储介质,用于存储指令;Storage medium, used to store instructions;
    处理电路,用于执行所述指令,实现如权利要求1-6任一项所述的应用的心跳唤醒方法。The processing circuit is configured to execute the instruction to implement the heartbeat wake-up method of the application according to any one of claims 1-6.
  16. 一种计算机程序产品,其特征在于,所述计算机程序产品包括程序指令,所述程序指令在计算机上运行时,以实现如权利要求1-6任一项所述的应用的心跳唤醒方法。A computer program product, characterized in that the computer program product includes program instructions, when the program instructions are run on a computer, to implement the heartbeat wake-up method of the application according to any one of claims 1-6.
PCT/CN2020/114596 2019-09-12 2020-09-10 Heartbeat-based application wakeup method, and terminal apparatus WO2021047611A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910867228.3A CN110753086A (en) 2019-09-12 2019-09-12 Heartbeat awakening method for application and terminal equipment
CN201910867228.3 2019-09-12

Publications (1)

Publication Number Publication Date
WO2021047611A1 true WO2021047611A1 (en) 2021-03-18

Family

ID=69276402

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/114596 WO2021047611A1 (en) 2019-09-12 2020-09-10 Heartbeat-based application wakeup method, and terminal apparatus

Country Status (2)

Country Link
CN (1) CN110753086A (en)
WO (1) WO2021047611A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110753086A (en) * 2019-09-12 2020-02-04 华为技术有限公司 Heartbeat awakening method for application and terminal equipment
CN113691930B (en) * 2020-05-19 2023-08-22 京东方科技集团股份有限公司 Mobile terminal, control method thereof, internet of things system and storage medium
CN112532264B (en) * 2020-11-27 2022-10-21 石家庄市善理通益科技有限公司 Power consumption optimization method of talkback terminal and execution device thereof
CN114640978A (en) * 2020-12-16 2022-06-17 华为技术有限公司 Heartbeat synchronization method, electronic equipment and system
CN115884208A (en) * 2021-09-28 2023-03-31 华为技术有限公司 Communication method and communication device
CN114390072B (en) * 2021-12-17 2023-09-29 武汉慧联无限科技有限公司 Information processing method, device and storage medium
CN114338389B (en) * 2021-12-28 2023-05-30 中国联合网络通信集团有限公司 Heartbeat packet sending method and device, electronic equipment and storage medium
CN117135729A (en) * 2023-01-20 2023-11-28 荣耀终端有限公司 Multi-device cooperation method, system and terminal device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120110173A1 (en) * 2010-11-01 2012-05-03 Michael Luna Distributed management of keep-alive message signaling for mobile network resource conservation and optimization
US20120331087A1 (en) * 2010-11-01 2012-12-27 Michael Luna Timing of keep-alive messages used in a system for mobile network resource conservation and optimization
WO2014200631A1 (en) * 2013-06-11 2014-12-18 Seven Networks, Inc. Optimizing keepalive and other background traffic in a wireless network
CN105893129A (en) * 2016-03-30 2016-08-24 北京小米移动软件有限公司 Processing method and device for application programs in terminal
CN106341908A (en) * 2016-08-24 2017-01-18 福州瑞芯微电子股份有限公司 Method and system for maintaining long connection of mobile network
CN110753086A (en) * 2019-09-12 2020-02-04 华为技术有限公司 Heartbeat awakening method for application and terminal equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561179B (en) * 2013-10-31 2016-06-08 宇龙计算机通信科技(深圳)有限公司 The method and apparatus that intelligent terminal's wakeup time adjusts
EP3142423B1 (en) * 2014-06-18 2019-03-13 Huawei Technologies Co., Ltd. Heartbeat adjustment method, device and terminal
CN107517136B (en) * 2016-06-16 2022-08-16 中兴通讯股份有限公司 Method, device and system for realizing heartbeat keep-alive
CN107645529B (en) * 2016-07-21 2020-06-30 腾讯科技(深圳)有限公司 Heartbeat packet sending method and device
CN107135518B (en) * 2017-06-09 2020-05-19 深圳市沃特沃德股份有限公司 Method and device for maintaining heartbeat connection and terminal equipment
CN109660584A (en) * 2017-10-12 2019-04-19 阿里巴巴集团控股有限公司 A kind of method and communication means and communication system of client and the long connection of server foundation
CN108768763A (en) * 2018-05-04 2018-11-06 北京小米移动软件有限公司 Heartbeat message sending method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120110173A1 (en) * 2010-11-01 2012-05-03 Michael Luna Distributed management of keep-alive message signaling for mobile network resource conservation and optimization
US20120331087A1 (en) * 2010-11-01 2012-12-27 Michael Luna Timing of keep-alive messages used in a system for mobile network resource conservation and optimization
WO2014200631A1 (en) * 2013-06-11 2014-12-18 Seven Networks, Inc. Optimizing keepalive and other background traffic in a wireless network
CN105893129A (en) * 2016-03-30 2016-08-24 北京小米移动软件有限公司 Processing method and device for application programs in terminal
CN106341908A (en) * 2016-08-24 2017-01-18 福州瑞芯微电子股份有限公司 Method and system for maintaining long connection of mobile network
CN110753086A (en) * 2019-09-12 2020-02-04 华为技术有限公司 Heartbeat awakening method for application and terminal equipment

Also Published As

Publication number Publication date
CN110753086A (en) 2020-02-04

Similar Documents

Publication Publication Date Title
WO2021047611A1 (en) Heartbeat-based application wakeup method, and terminal apparatus
WO2020168965A1 (en) Method for controlling electronic device having folding screen, and electronic device
CN113038577B (en) Control information transmission method and equipment
US11337269B2 (en) Cell processing method, terminal device, and network device
US10299210B2 (en) Method and apparatus for reducing power consumption of electronic device
US11451946B2 (en) Method for establishing wireless communication connection, and device
WO2021115007A1 (en) Network switching method and electronic device
EP3525417A1 (en) Data processing method, device, storage medium, electronic device and server
WO2020168968A1 (en) Control method for electronic device having foldable screen, and electronic device
WO2021052279A1 (en) Foldable screen display method and electronic device
WO2021052245A1 (en) Data transceiving method, electronic device, and computer-readable storage medium
WO2021052410A1 (en) Application management method and apparatus
AU2017435235B2 (en) Application management method and terminal
US20230297414A1 (en) Task Processing Method and Related Apparatus
US20220231792A1 (en) Data transmission method and apparatus, storage medium, and device
WO2020088542A1 (en) Data management method, apparatus and system, and server, terminal and storage medium
EP4171135A1 (en) Device control method, and related apparatus
WO2020134868A1 (en) Connection establishment method, and terminal apparatus
US20160309485A1 (en) Method and device for supporting communication of electronic device
WO2019191996A1 (en) Data transmission method and device
WO2021043250A1 (en) Bluetooth communication method, and related device
EP3159818B1 (en) Portable device control method and device
CN114785766B (en) Control method, terminal and server of intelligent equipment
US11147058B2 (en) Communication method and related device
CN110389879B (en) Method and device for acquiring performance data

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: 20862619

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20862619

Country of ref document: EP

Kind code of ref document: A1