CN110928586B - APP background keep-alive method and device - Google Patents

APP background keep-alive method and device Download PDF

Info

Publication number
CN110928586B
CN110928586B CN201911119682.7A CN201911119682A CN110928586B CN 110928586 B CN110928586 B CN 110928586B CN 201911119682 A CN201911119682 A CN 201911119682A CN 110928586 B CN110928586 B CN 110928586B
Authority
CN
China
Prior art keywords
survival
period
app
sending
target app
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911119682.7A
Other languages
Chinese (zh)
Other versions
CN110928586A (en
Inventor
董齐
余晓飞
仇兆峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ingeek Information Security Consulting Associates Co ltd
Original Assignee
Ingeek Information Security Consulting Associates Co ltd
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 Ingeek Information Security Consulting Associates Co ltd filed Critical Ingeek Information Security Consulting Associates Co ltd
Priority to CN201911119682.7A priority Critical patent/CN110928586B/en
Publication of CN110928586A publication Critical patent/CN110928586A/en
Application granted granted Critical
Publication of CN110928586B publication Critical patent/CN110928586B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Power Sources (AREA)

Abstract

The embodiment of the invention relates to the technical field of Internet of things and discloses an APP background keep-alive method and device. The method is applied to the iOS equipment, the iOS equipment is in communication connection with the terminal equipment, and the method comprises the following steps: receiving a wake-up notice periodically sent by the terminal equipment to wake up the target APP and monitoring the survival condition information of the target APP; determining whether the sending period of the current awakening notification needs to be adjusted or not according to the survival condition information; and when the adjustment is needed, determining the adjustment direction according to the survival condition information, and informing the terminal equipment to adjust the sending period according to the adjustment direction. The embodiment of the invention can ensure that the application can continuously survive in the background without being hung up on the premise of saving power consumption, thereby improving the convenience of use of users.

Description

APP background keep-alive method and device
Technical Field
The invention relates to the technical field of Internet of things, in particular to an APP background keep-alive method and device.
Background
In recent years, bluetooth keyless systems have become increasingly popular with the market. Digital key applications typically run in the background of the smart operating system. However, in the iOS operating system, the APP is suspended by the system soon after backing to the background, so that the application cannot work normally, the user needs to wake up the APP frequently and manually, and the operation is complex.
Disclosure of Invention
The embodiment of the invention aims to provide an APP background keep-alive method and device, which can enable an application to continuously survive in a background without being hung up on the premise of saving power consumption, and improve the convenience of use of a user.
In order to solve the above technical problem, an embodiment of the present invention provides an APP background keep-alive method, which is applied to an iOS device, where the iOS device is in communication connection with a terminal device, and the method includes:
receiving a wake-up notice periodically sent by the terminal equipment to wake up a target APP, and monitoring the survival condition information of the target APP;
determining whether the sending period of the current awakening notification needs to be adjusted or not according to the survival condition information;
and when the adjustment is needed, determining an adjustment direction according to the survival condition information, and informing the terminal equipment to adjust the sending period according to the adjustment direction.
The embodiment of the invention also provides an APP background keep-alive method, which is applied to terminal equipment in communication connection with the iOS equipment, and comprises the following steps:
periodically sending a wake-up notification to the iOS device for waking up a target APP;
responding to a sending period adjusting request sent by the iOS equipment, adjusting the sending period based on the adjusting direction indicated by the adjusting request, and sending a wake-up notice according to the adjusted sending period.
The embodiment of the present invention further provides an APP background keep-alive device, including:
the awakening module is used for receiving an awakening notice periodically sent by the terminal equipment so as to awaken the target APP;
the monitoring module is used for monitoring survival condition information of the target APP;
the adjusting module is used for determining whether the sending period of the current awakening notification needs to be adjusted or not according to the survival condition information;
and when the adjustment is needed, determining an adjustment direction according to the survival condition information, and informing the terminal equipment to adjust the sending period according to the adjustment direction.
Compared with the prior art, the embodiment of the invention has the advantages that the iOS equipment receives the awakening notification periodically sent by the terminal equipment to awaken the target APP, monitors the survival condition information of the target APP, determines the adjustment direction according to the survival condition information when the current sending period is determined to be required to be adjusted according to the survival condition information, and informs the terminal equipment to adjust the sending period according to the adjustment direction. Therefore, the embodiment of the invention not only can enable the target APP to keep alive at the background by periodically sending the awakening notification to the iOS device through the terminal device, but also can adjust the sending period of the awakening notification by monitoring the information of the survival condition of the target APP, so that the sending period is matched with the actual survival condition of the target APP, thereby reducing unnecessary awakening operation as much as possible and reducing the power consumption of the terminal.
As an embodiment, the survival status information comprises survival status information of the target APP over a monitoring period; the monitoring time period comprises N current sending periods; n is a natural number greater than or equal to 1;
the determining, according to the survival status information, whether a sending period of the current wake-up notification needs to be adjusted, and determining, according to the survival status information, an adjustment direction specifically includes:
determining whether the target APP is suspended in the monitoring time period according to the survival condition information in the monitoring time period, or determining whether the suspension condition of the target APP in the monitoring time period meets a preset condition according to the survival condition information in the monitoring time period;
and if the target APP is suspended in the monitoring time period or the suspension condition meets a preset condition, determining to reduce the sending period. Therefore, the sending period can be adjusted to be small in time, and the APP keep-alive is realized.
As an embodiment, the monitoring survival status information over the time period comprises: the survival time of the target APP in each sending period in the monitoring time period; the survival time of the target APP in each sending period in the monitoring time period is obtained by monitoring in the following mode:
controlling a timer to start timing when the current awakening notification is received, acquiring the timing duration of the timer when the next awakening notification is received, and taking the timing duration as the survival duration of the target APP in each sending period; wherein the timer stops timing when the target APP is suspended;
determining whether the target APP is suspended in the monitoring time period according to the survival condition information in the monitoring time period, specifically including:
if the survival time of the APP in one or more sending periods in the monitoring time period is less than the current sending period, determining that the target APP is suspended in the monitoring time period;
the determining, according to the survival condition information in the monitoring time period, whether a suspension condition of the target APP in the monitoring time period meets a preset condition specifically includes:
and if the difference between the survival time lengths of the current sending period and the APP in one or more sending periods in the monitoring time period is greater than a first threshold value, determining that the suspension condition meets a preset condition. By detecting the survival time of the APP, the sending period can be adjusted accurately.
As an embodiment, further comprising:
and if the sending period is determined to be reduced, determining the reduction amplitude of the current sending period according to the survival time of the target APP in each sending period in the monitoring time period, and sending the reduction amplitude to the terminal equipment.
As an embodiment, the survival status information further comprises: system resource usage information related to an actual lifetime of the APP;
the determining, according to the survival status information, whether a sending period of the current wake-up notification needs to be adjusted, and determining, according to the survival status information, an adjustment direction specifically includes:
if the target APP is not suspended in the monitoring time period or the suspension condition does not meet a preset condition, obtaining a corresponding estimated survival time according to the system resource use information and a corresponding relation between a preset estimated survival time and the system resource use information;
and if the difference between the estimated survival time and the current sending period is greater than a second threshold value, determining to increase the sending period.
As an embodiment, further comprising:
and if the system resource use change rate is determined to be in a preset change range according to the system resource use information, the terminal equipment is notified to adjust the sending period in a suspending mode until the system resource use change rate deviates from the preset change range. Therefore, frequent adjustment of the sending period can be avoided when the survival time of the APP fluctuates fast, and power consumption is saved.
As an embodiment, the adjusting, in response to a transmission cycle adjustment request sent by the iOS device, the transmission cycle based on an adjustment direction indicated by the adjustment request includes:
and if the actual survival time or the estimated survival time of the target APP is received, adjusting the sending period according to the actual survival time or the estimated survival time.
As an embodiment, the adjusting, in response to a transmission cycle adjustment request transmitted by the iOS device, the transmission cycle based on an adjustment direction indicated by the adjustment request, further includes:
and if the actual survival time or the estimated survival time of the target APP is not received, gradually adjusting the sending period according to a fixed step length or a mode that the step length is from large to small.
Drawings
FIG. 1 is a flow chart of an APP background keep-alive method according to a first embodiment of the invention;
FIG. 2 is a flowchart of an APP background keep-alive method according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an APP background keep-alive device according to a third embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an APP background keep-alive device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present invention in its various embodiments. However, the technical solution claimed in the present invention can be implemented without these technical details and various changes and modifications based on the following embodiments.
As shown in fig. 1, a first embodiment of the present invention relates to an APP background keep-alive method, which is applied to iOS devices, including but not limited to smart phones and palm computers. The iOS device is in communication connection with a terminal device, such as a vehicle-mounted Bluetooth device. The method includes steps 101 to 105.
Step 101: and receiving a wake-up notice periodically sent by the terminal equipment to wake up the target APP.
In this embodiment, the target APP is, for example, a bluetooth digital key. in the iOS device, the APP that exits the background is generally suspended in about 10 seconds, and different models and running states may affect the suspending time of the APP. For the same model, the APP hang time may vary from 5S (seconds) to 10S (seconds) in different operating states.
Before the iOS equipment and the terminal equipment are connected without establishing Bluetooth, the target APP can be opened, the iOS equipment continuously scans the terminal equipment, and after the scanning is successful, the Bluetooth connection is established with the terminal equipment. Or the iOS device sends a broadcast packet, which is scanned by the terminal device, thereby establishing a connection. After the bluetooth connection is successfully established, the terminal device periodically sends a wakeup notification to the iOS device, and the iOS device executes a wakeup application operation to wake up the target APP after receiving the wakeup notification each time. Specifically, if the target APP is suspended when the wakeup notification is received, the target APP is automatically woken up, the survival time of the target APP in the background after being woken up is recalculated, and if the target APP survives when the wakeup notification is received, the survival time of the target APP after the wakeup operation is executed is also recalculated. Therefore, the iOS device side can keep the target APP alive in the background by periodically performing the wake-up operation.
Step 102: and monitoring survival condition information of the target APP.
Survival status information for APP includes: survival status information of the target APP within the monitoring period; the monitoring time period comprises N current sending periods; n is a natural number greater than or equal to 1.
In this embodiment, the monitoring period is, for example, 1 current transmission cycle. In some examples, the monitoring period may be a plurality of transmission cycles, for example, the monitoring period may include 2 or 3 transmission cycles.
Step 103: and determining whether the sending period of the current awakening notification needs to be adjusted or not according to the survival condition information, executing the step 104 when the adjustment is needed, and returning to the step 101 if the adjustment is not needed.
Step 104: the adjustment direction is determined based on the survival status information.
Step 105: and informing the terminal equipment to adjust the sending period according to the adjusting direction.
In this embodiment, steps 103 and 104 specifically include: and determining whether the target APP is suspended in the monitoring time period according to the survival condition information in the monitoring time period, and if the target APP is suspended in the monitoring time period, determining that the sending period needs to be adjusted and the sending period needs to be reduced.
In this embodiment, the information on the survival status in the monitoring period includes: monitoring the survival time of the target APP in each sending period in a time period; the survival time of the target APP in each sending period in the monitoring time period is obtained by monitoring in the following mode:
controlling a timer to start timing when a current awakening notification is received, acquiring the timing duration of the timer when the next awakening notification is received, and taking the acquired timing duration as the survival duration of the target APP in each sending period; wherein the timer stops counting time when the target APP is suspended.
Here, a counter may be provided in the target APP, and the timing function is realized by counting. When the current wake-up notification is received, the counter is set to 0, and then the counter value is incremented by 1 per unit time, which may be 1 second, 500 milliseconds, 200 milliseconds, etc. And when the next awakening notification is received, reading the count value of the counter, and calculating the timing duration in the current sending period according to the count value and the unit time, wherein the timing duration is the survival duration of the target APP in the current sending period.
Determining whether the target APP is suspended in the monitoring time period according to the survival condition information in the monitoring time period, specifically including: and if the survival time of the APP in one or more sending periods in the monitoring time period is less than the current sending period, judging that the target APP is suspended in the monitoring time period. Specifically, if the monitoring time period is a current sending period, if the survival duration of the APP in the current sending period is less than the current sending period, determining that the target APP is suspended in the monitoring time period; and if the monitoring time period comprises a plurality of current sending cycles, determining that the target APP is suspended in the monitoring time period when the survival time of the APP in any sending cycle in the monitoring time period is less than the current sending cycle.
It should be noted that, in this embodiment, if it is determined that the transmission cycle needs to be reduced according to the survival time of the APP in each transmission cycle in the monitoring time period, the reduction amplitude of the current transmission cycle may be determined according to the survival time of the target APP in each transmission cycle in the monitoring time period, and the reduction amplitude is sent to the terminal device.
Specifically, the reduction amplitude may be equal to a difference between the current transmission period and the survival time of the corresponding APP, for example, if the current transmission period is 8S, the survival time of the corresponding APP is 7.5S, the reduction amplitude may be equal to 0.5S, and the transmission period after adjustment is the survival time of the APP at this time. Alternatively, the amplitude of the adjustment may be increased appropriately, that is, the adjusted transmission period is slightly smaller than the survival time of the APP.
In some examples, monitoring survival status information over a time period may further include: and monitoring whether the network long connection between the target APP and the background server is disconnected in each sending period in a time period. Similarly, if there is a record of disconnection between the target APP and the network long connection of the background server in any sending period in the monitoring time period, it is determined that the target APP is suspended in the monitoring time period.
In some examples, it may also be determined whether a suspension condition of the target APP in the monitoring period meets a preset condition according to the survival condition information in the monitoring period, and if the suspension condition meets the preset condition, it is determined that the transmission cycle needs to be adjusted, and the transmission cycle needs to be reduced. Specifically, if the difference between the survival time lengths of the APP and the current transmission cycle in one or more transmission cycles in the monitoring time period is greater than a first threshold, it is determined that the suspension condition satisfies the preset condition. For example, the first threshold is, for example, 0.5S, if the monitoring time period is a current sending period, the current sending period is, for example, 9S, and the survival time duration in the monitoring time period is 8.8S, at this time, the difference between the current sending period and the corresponding survival time duration is 0.2S, and since 0.2S is less than 0.5S, it is determined that the suspension condition does not satisfy the preset condition, and it is determined that the sending period does not need to be adjusted. In other words, when the difference between the current sending period and the corresponding survival time is small, the sending period may not be adjusted, and when the difference between the current sending period and the corresponding survival time is large, the terminal device is notified to execute the sending period adjustment action, so that the sending period can be prevented from being adjusted frequently without affecting the user experience.
Or, if the survival condition information includes a record of whether the network long connection between the target APP and the background server is disconnected in each sending period in the monitoring time period, and the monitoring time period includes a plurality of current sending periods, the number of times of suspension in the current monitoring time period can also be obtained, and if the number of times of suspension is greater than a set threshold, it is determined that the suspension condition meets a preset condition, and the sending period needs to be reduced.
In this embodiment, the information on the survival status of the APP further includes: system resource usage information related to the actual lifetime of the APP. The system resource usage information is, for example, system resource usage. In particular, the system resource usage may be a combined usage of system resources related to the lifetime of the application, such as a combined usage of processor and memory resources, or a usage of a single system resource.
The actual lifetime of the APP may vary with the usage of system resources. In step 103 and step 104, if the target APP is not suspended within the monitoring time period or the suspension condition of the target APP within the monitoring time period does not satisfy the preset condition, it indicates that the current transmission cycle has satisfied the APP keep-alive requirement, but the transmission cycle may need to be increased along with the change of the APP survival time, and at this time, a corresponding estimated survival time is obtained according to the system resource usage information and the preset corresponding relationship between the estimated survival time and the system resource usage information; and if the difference between the estimated survival time and the current sending period is larger than a second threshold value, determining to increase the sending period.
The correspondence between the estimated time to live and the system resource usage information is, for example, the correspondence between the estimated time to live interval and the system resource usage interval. For example, the system resource usage rate is between 80% and 90% when the survival time is between 5S and 6S. For example, the second threshold is 1S, if the current transmission period is 5S, and the estimated survival time obtained according to the system resource usage information and the preset corresponding relationship between the estimated survival time and the system resource usage information is, for example, 6.5S, it may be determined that the difference between the estimated survival time and the current transmission period is greater than the second threshold, and at this time, it is determined that the transmission period needs to be increased.
It should be noted that, in some examples, the present embodiment may further include: and if the system resource use change rate is determined to be in the preset change range according to the system resource use information, the terminal equipment is notified to adjust the sending period in a suspending mode until the system resource use change rate deviates from the preset change range. The system resource usage change rate reflects the fluctuation speed of the system resource usage rate, and also relates to the fluctuation speed of the APP survival time. The preset variation range is used for reflecting the condition that the utilization rate of the system resources fluctuates rapidly. For example, when a user uses an application with large resource consumption, the usage rate of the system resource may fluctuate rapidly. In this embodiment, when the change rate of the system resource usage is within the preset change range, the APP has a fast fluctuation of the survival time, and the terminal device is notified to adjust the transmission period in a suspension manner until the change rate of the system resource usage deviates from the preset change range, and the transmission period adjustment function is resumed. It should be noted that, during the time of suspending the notification of the terminal device to adjust the transmission period, the terminal device may be notified to adjust the transmission period to a smaller value to implement APP keep-alive. Therefore, the embodiment can avoid adjusting the sending period when the survival time of the APP fluctuates fast, thereby reducing the adjusting times of the sending period and being beneficial to reducing the power consumption.
Compared with the prior art, the method has the advantages that the target APP is awakened by the iOS device according to the awakening notification periodically sent by the terminal device, the survival condition of the APP is monitored in real time, whether the sending period of the awakening notification needs to be increased or decreased is determined according to the survival condition of the APP, the sending period is increased or decreased by the terminal device, the sending period is matched with the survival condition of the APP, the APP can be kept alive, the unnecessary awakening notification is reduced, and the power consumption of the device is saved.
The second embodiment of the invention relates to an APP background keep-alive method, which is applied to terminal equipment in communication connection with iOS equipment, wherein the terminal equipment comprises but is not limited to vehicle-mounted Bluetooth equipment. iOS devices include, but are not limited to, smart phones, palm top computers, and the like. The target APP is, for example, a bluetooth digital key. As shown in fig. 2, the method includes steps 201 to 203.
Step 201: a wake up notification to wake up the target APP is periodically sent to the iOS device.
Step 202: in response to a transmission cycle adjustment request transmitted by the iOS device, the transmission cycle is adjusted based on the adjustment direction indicated by the adjustment request.
In this embodiment, if the actual survival time or the estimated survival time of the target APP is received, the sending period is adjusted according to the actual survival time or the estimated survival time.
Here, when the adjustment direction indicated by the adjustment request is to reduce the transmission period, the i OS device may obtain the survival duration (i.e., the actual survival duration) of the APP in the current transmission period according to the method in the foregoing embodiment, and send the survival duration to the terminal device. In step 202, if the actual survival time of the APP sent by the iOS is received, the actual survival time may be used as the adjusted sending period, or the actual survival time reduced by a certain value may be used as the adjusted sending period, so that the sending period may be adjusted in one step. When the adjustment direction indicated by the adjustment request is to increase the transmission period, the iOS device may obtain the estimated survival duration of the APP in the current transmission period according to the method in the foregoing embodiment, and send the estimated survival duration to the terminal device. The terminal device may use the estimated survival time period as the adjusted transmission period.
In some examples, if the actual survival time or the estimated survival time of the target APP is not received, the transmission period is gradually adjusted according to a fixed step size or a step size from large to small.
For example, when the iOS device instructs the terminal device to turn down or turn up the transmission period, the terminal device may adjust the transmission period according to a fixed step size, where the fixed step size is, for example, 0.5S, 0.2S, and the like. In some examples, the terminal device may gradually adjust the transmission period in a step-wise manner from a large step size to a small step size. For example, when the sending period is reduced, the initial step length may be 1S, that is, the sending period is reduced by 1S to obtain the adjusted sending period, and with the increase of the adjustment times, the step length may be reduced to 0.5S or 0.2S, etc., so that not only the sending period can be adjusted quickly, but also the adjusted sending period can be made to be closer to the actual survival time of the APP, thereby achieving the balance of application keep-alive and energy consumption saving.
Step 203: and sending a wakeup notification according to the adjusted sending period.
After the adjustment of the transmission period is completed, the terminal device may notify the iOS device, and transmit a wakeup notification according to the adjusted transmission period.
Compared with the prior art, the embodiment periodically sends the awakening notification to the iOS device, and adjusts the sending period according to the indication of the iOS device, so that the APP keeps alive, the sending of the awakening notification is reduced as much as possible, and the energy consumption of the device is saved.
The third embodiment of the invention relates to an APP background keep-alive device. Referring to fig. 3, the APP background keep-alive device 300 of the present embodiment includes:
a wake-up module 301, configured to receive a wake-up notification periodically sent by a terminal device to wake up a target APP;
a monitoring module 302, configured to monitor survival status information of a target APP;
an adjusting module 303, configured to determine whether a sending period of the current wake-up notification needs to be adjusted according to the survival status information; and when the adjustment is needed, determining the adjustment direction according to the survival condition information, and informing the terminal equipment to adjust the sending period according to the adjustment direction.
Optionally, the survival status information comprises survival status information of the target APP within the monitoring period; the monitoring time period comprises N current sending periods; n is a natural number greater than or equal to 1;
the adjusting module 303 is further configured to determine whether the target APP is suspended within the monitoring time period according to the survival condition information within the monitoring time period, or determine whether a suspension condition of the target APP within the monitoring time period meets a preset condition according to the survival condition information within the monitoring time period;
and if the target APP is suspended in the monitoring time period or the suspension condition meets a preset condition, determining to reduce the sending period.
Further, monitoring the survival status information over the time period comprises: monitoring the survival time of the target APP in each sending period in a time period; the monitoring module 302 is further configured to monitor and obtain the survival duration of the target APP in each sending period in the monitoring time period by: controlling a timer to start timing when a current awakening notification is received, acquiring the timing duration of the timer when the next awakening notification is received, and taking the timing duration as the survival duration of the target APP in each sending period; wherein the timer stops timing when the target APP is suspended;
the adjusting module 303 is further configured to determine that the target APP is suspended in the monitoring time period if the survival duration of the APP in one or more sending periods in the monitoring time period is less than the current sending period; alternatively, the first and second electrodes may be,
and if the difference between the survival time lengths of the current sending period and the APP in one or more sending periods in the monitoring time period is larger than a first threshold value, determining that the suspension condition meets the preset condition.
The adjusting module 303 is further configured to determine, if the transmission period is determined to be reduced, a reduction amplitude of the current transmission period according to the survival duration of the target APP in each transmission period in the monitoring time period, and send the reduction amplitude to the terminal device.
Optionally, the survival status information further comprises: system resource usage information related to the actual lifetime of the APP; the adjusting module 303 is further configured to, if the target APP is not suspended within the monitoring time period or the suspension condition does not satisfy the preset condition, obtain a corresponding estimated survival time according to the system resource usage information and a corresponding relationship between the preset estimated survival time and the system resource usage information; and if the difference between the estimated survival time and the current sending period is larger than a second threshold value, determining to increase the sending period.
Preferably, the adjusting module 303 is further configured to, if it is determined that the system resource usage change rate is within the preset change range according to the system resource usage information, suspend notifying the terminal device to adjust the transmission period until the system resource usage change rate deviates from the preset change range.
Compared with the prior art, the embodiment has the advantages that the APP background keep-alive device wakes up the target APP according to the wake-up notification periodically sent by the terminal equipment, the survival condition of the APP is monitored in real time, whether the sending period of the wake-up notification needs to be increased or decreased is determined according to the survival condition of the APP, the sending period of the wake-up notification is increased or decreased, the sending period of the wake-up notification is notified to the terminal equipment, the sending period is matched with the survival condition of the APP, the APP keep-alive can be achieved, the sending of unnecessary wake-up notifications is reduced, and the power consumption of the.
The fourth embodiment of the invention relates to an APP background keep-alive device. Referring to fig. 4, the APP background keep-alive device 400 of the present embodiment includes:
a sending module 401, configured to periodically send a wake-up notification for waking up a target APP to the iOS device;
an adjusting module 402, configured to adjust, in response to a transmission cycle adjustment request sent by the iOS device, a transmission cycle based on an adjustment direction indicated by the adjustment request;
the sending module is further configured to send a wakeup notification according to the adjusted sending period.
Optionally, the adjusting module 402 is further configured to adjust the sending period according to the actual survival time or the estimated survival time if the actual survival time or the estimated survival time of the target APP is received; and if the actual survival time or the estimated survival time of the target APP is not received, gradually adjusting the sending period according to a fixed step length or a mode that the step length is from large to small.
Compared with the prior art, the APP background keep-alive device sends the awakening notification to the iOS device periodically, and adjusts the sending period according to the indication of the iOS device, so that the APP keep-alive device can reduce the sending of the awakening notification as much as possible, and the energy consumption of the device is saved.
A fifth embodiment of the present invention relates to an electronic apparatus. The electronic device of the embodiment can be an intelligent terminal such as a smart phone and an intelligent wearable device. As shown in fig. 5, the electronic apparatus includes: a memory 502 and a processor 501;
wherein the memory 502 stores instructions executable by the at least one processor 501, the instructions being executable by the at least one processor 501 to implement the APP background keep-alive method as described in the first or second embodiment.
The electronic device includes one or more processors 501 and a memory 502, and one processor 501 is taken as an example in fig. 5. The processor 501 and the memory 502 may be connected by a bus or other means, and fig. 5 illustrates the connection by the bus as an example. Memory 502, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor 501 executes various functional applications and data processing of the device by running the nonvolatile software programs, instructions and modules stored in the memory 502, that is, the APP background keep-alive method is implemented.
The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 502 may optionally include memory located remotely from processor 501, which may be connected to an external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in memory 502 and, when executed by the one or more processors 501, perform the APP background keep-alive method of any of the method embodiments described above.
The above-mentioned device can execute the method provided by the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method, and reference may be made to the method provided by the embodiment of the present invention for technical details that are not described in detail in the embodiment.
Compared with the prior art, the method has the advantages that the operation end adjusts the awakening period through the received survival information of the application to obtain the awakening period meeting the preset condition, so that the awakening period can be close to the survival time base of the application by periodically sending the awakening notification to awaken the APP background to keep the APP background in a survival state, the awakening period can be made to be close to the survival time base of the application, awakening times can be reduced as much as possible, and energy consumption of the terminal is saved.
A sixth embodiment of the invention is directed to a non-volatile storage medium storing a computer-readable program for causing a computer to perform some or all of the above method embodiments.
That is, those skilled in the art can understand that all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (8)

1. The APP background keep-alive method is applied to iOS equipment, the iOS equipment is in communication connection with terminal equipment, and the method comprises the following steps:
receiving a wake-up notice periodically sent by the terminal equipment to wake up a target APP, and monitoring the survival condition information of the target APP;
determining whether the sending period of the current awakening notification needs to be adjusted or not according to the survival condition information;
when the adjustment is needed, determining an adjustment direction according to the survival condition information, and informing the terminal equipment to adjust the sending period according to the adjustment direction;
the survival status information comprises survival status information of the target APP within a monitoring period; the monitoring time period comprises N current sending periods; n is a natural number greater than or equal to 1;
the determining, according to the survival status information, whether a sending period of the current wake-up notification needs to be adjusted, and determining, according to the survival status information, an adjustment direction specifically includes:
determining whether the target APP is suspended in the monitoring time period according to the survival condition information in the monitoring time period, or determining whether the suspension condition of the target APP in the monitoring time period meets a preset condition according to the survival condition information in the monitoring time period;
and if the target APP is suspended in the monitoring time period or the suspension condition meets a preset condition, determining to reduce the sending period.
2. The APP background keep-alive method of claim 1, wherein the monitoring of the survival status information over the time period comprises: the survival time of the target APP in each sending period in the monitoring time period; the survival time of the target APP in each sending period in the monitoring time period is obtained by monitoring in the following mode:
controlling a timer to start timing when the current awakening notification is received, acquiring the timing duration of the timer when the next awakening notification is received, and taking the timing duration as the survival duration of the target APP in each sending period; wherein the timer stops timing when the target APP is suspended;
determining whether the target APP is suspended in the monitoring time period according to the survival condition information in the monitoring time period, specifically including:
if the survival time of the APP in one or more sending periods in the monitoring time period is less than the current sending period, determining that the target APP is suspended in the monitoring time period;
the determining, according to the survival condition information in the monitoring time period, whether a suspension condition of the target APP in the monitoring time period meets a preset condition specifically includes:
and if the difference between the survival time lengths of the current sending period and the APP in one or more sending periods in the monitoring time period is greater than a first threshold value, determining that the suspension condition meets a preset condition.
3. The APP background keep-alive method of claim 2, further comprising:
and if the sending period is determined to be reduced, determining the reduction amplitude of the current sending period according to the survival time of the target APP in each sending period in the monitoring time period, and sending the reduction amplitude to the terminal equipment.
4. The APP background keep-alive method of claim 1, wherein the survival status information further comprises: system resource usage information related to an actual lifetime of the APP;
the determining, according to the survival status information, whether a sending period of the current wake-up notification needs to be adjusted, and determining, according to the survival status information, an adjustment direction specifically includes:
if the target APP is not suspended in the monitoring time period or the suspension condition does not meet a preset condition, obtaining a corresponding estimated survival time according to the system resource use information and a corresponding relation between a preset estimated survival time and the system resource use information;
and if the difference between the estimated survival time and the current sending period is greater than a second threshold value, determining to increase the sending period.
5. The APP background keep-alive method of claim 4, further comprising:
and if the system resource use change rate is determined to be in a preset change range according to the system resource use information, the terminal equipment is notified to adjust the sending period in a suspending mode until the system resource use change rate deviates from the preset change range.
6. The APP background keep-alive method is applied to terminal equipment in communication connection with iOS equipment, and comprises the following steps:
periodically sending a wake-up notification to the iOS device for waking up a target APP;
responding to a sending period adjusting request sent by the iOS equipment, adjusting the sending period based on an adjusting direction indicated by the adjusting request, and sending a wakeup notification according to the adjusted sending period;
the adjusting, in response to the transmission cycle adjustment request sent by the iOS device, the transmission cycle based on the adjustment direction indicated by the adjustment request includes:
and if the actual survival time or the estimated survival time of the target APP is received, adjusting the sending period according to the actual survival time or the estimated survival time.
7. The APP background keep-alive method according to claim 6, wherein the adjusting, in response to a transmission period adjustment request sent by the iOS device, the transmission period based on an adjustment direction indicated by the adjustment request further comprises:
and if the actual survival time or the estimated survival time of the target APP is not received, gradually adjusting the sending period according to a fixed step length or a mode that the step length is from large to small.
8. The utility model provides a APP backstage keep-alive device which characterized in that includes:
the awakening module is used for receiving awakening notifications periodically sent by the terminal equipment so as to awaken the target APP;
the monitoring module is used for monitoring survival condition information of the target APP;
the adjusting module is used for determining whether the sending period of the current awakening notification needs to be adjusted or not according to the survival condition information;
when the adjustment is needed, determining an adjustment direction according to the survival condition information, and informing the terminal equipment to adjust the sending period according to the adjustment direction;
the survival condition information comprises survival condition information of the target APP within a monitoring time period; the monitoring time period comprises N current sending periods; n is a natural number greater than or equal to 1;
the adjusting module is further used for determining whether the target APP is suspended within the monitoring time period according to the survival condition information within the monitoring time period, or determining whether the suspension condition of the target APP within the monitoring time period meets a preset condition according to the survival condition information within the monitoring time period; and if the target APP is suspended in the monitoring time period or the suspension condition meets a preset condition, determining to reduce the sending period.
CN201911119682.7A 2019-11-15 2019-11-15 APP background keep-alive method and device Active CN110928586B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911119682.7A CN110928586B (en) 2019-11-15 2019-11-15 APP background keep-alive method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911119682.7A CN110928586B (en) 2019-11-15 2019-11-15 APP background keep-alive method and device

Publications (2)

Publication Number Publication Date
CN110928586A CN110928586A (en) 2020-03-27
CN110928586B true CN110928586B (en) 2021-02-26

Family

ID=69853081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911119682.7A Active CN110928586B (en) 2019-11-15 2019-11-15 APP background keep-alive method and device

Country Status (1)

Country Link
CN (1) CN110928586B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860408A (en) * 2021-03-03 2021-05-28 苏州沁游网络科技有限公司 Process keep-alive method, device and system in cloud reality machine and storage medium
CN115086263B (en) * 2022-07-22 2024-04-05 康键信息技术(深圳)有限公司 IM message sending method, system, storage medium and computer equipment of IOS terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458555B (en) * 2007-12-12 2011-12-21 成都市华为赛门铁克科技有限公司 Method for adjusting clock period and calculating system
CN104298515A (en) * 2013-07-19 2015-01-21 贝壳网际(北京)安全技术有限公司 Awakening control method and device for application program in mobile terminal and mobile terminal
CN104219747B (en) * 2014-09-03 2020-05-29 湖北职升科技文化有限公司 Method, device and terminal for adjusting wake-up time according to electric quantity information
CN105388991B (en) * 2015-10-23 2018-03-02 福州瑞芯微电子股份有限公司 Timing wake-up processing system and method
CN107526603B (en) * 2017-09-20 2021-01-08 深圳天珑无线科技有限公司 Application awakening method and device

Also Published As

Publication number Publication date
CN110928586A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
US10912035B2 (en) Power management via coordination and selective operation of timer-related tasks
US10552216B2 (en) Application heartbeat period adjusting method and apparatus, and terminal
WO2015196763A1 (en) Power saving management method and device for intelligent terminal
US10091307B2 (en) Application management method and terminal
US20160048682A1 (en) Method and Apparatus for Clearing Malicious Power-Consuming Application, and User Terminal
US9319993B1 (en) Injecting active periods into scheduled inactive periods
CN110493855B (en) Communication mode control method, device, storage medium and terminal
WO2015007246A1 (en) Mobile terminal, device and method for controlling waking of application program in mobile terminal
US9069601B2 (en) Method and apparatus for controlling task execution
CN110691430B (en) Awakening method and device of Internet of things terminal, storage medium and base station
CN110928586B (en) APP background keep-alive method and device
CN111586812A (en) Method for receiving energy-saving signal by terminal and terminal
US9954787B2 (en) Intelligent terminal power-saving management method and apparatus
WO2016180132A1 (en) Dormancy method and apparatus for wireless fidelity (wi-fi) device
JP6672167B2 (en) Fast sleep systems and processes
CN110691399B (en) Internet of things terminal, awakening method and device thereof and storage medium
CN106912091B (en) Control method and device and electronic equipment
WO2016110056A1 (en) Terminal and terminal power-saving method
CN105357387A (en) Method, apparatus and system for wakening terminal
WO2019024173A1 (en) Batch management method for saving power of internet of things terminal devices, and relay device
CN108366415B (en) Method and equipment for supplying power to LPWA equipment
CN108430098B (en) Wireless communication terminal and power saving method thereof
CN115968018B (en) Terminal power saving method, terminal equipment and storage medium
CN113141626B (en) Event sending method, system, terminal equipment and related device
CN108574974B (en) Wireless access method, related equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant