WO2019233466A1 - Method and device used for application protection - Google Patents

Method and device used for application protection Download PDF

Info

Publication number
WO2019233466A1
WO2019233466A1 PCT/CN2019/090239 CN2019090239W WO2019233466A1 WO 2019233466 A1 WO2019233466 A1 WO 2019233466A1 CN 2019090239 W CN2019090239 W CN 2019090239W WO 2019233466 A1 WO2019233466 A1 WO 2019233466A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
holding
application holding
condition
retention
Prior art date
Application number
PCT/CN2019/090239
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 WO2019233466A1 publication Critical patent/WO2019233466A1/en

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • the present application relates to the field of computer technology, and in particular, to a technology for application retention.
  • the purpose of this application is to provide a method and device for application retention.
  • a method for application retention includes:
  • the application retention condition includes a system memory threshold, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes:
  • the application holding process When the application holding process detects that the current system memory reaches the system memory threshold, it notifies the system to perform memory reclamation.
  • the method further includes:
  • the running level of the application holding process is increased to prevent the application holding process from being recycled by the system.
  • the application retention condition includes an application recovery time threshold, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes:
  • an active event is triggered, so that the system gives the application a new application active period.
  • the application retention condition includes a system process list priority threshold, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes:
  • the running level of the application holding process is increased.
  • the application retention condition includes a memory consumption threshold of the application, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes :
  • the application holding process detects that the memory consumption of the application reaches the memory consumption threshold, the memory space of the application is released.
  • the method further includes:
  • the application maintaining condition is set based on a system recovery condition.
  • a computer-readable medium having computer-readable instructions stored thereon, the computer-readable instructions being executable by a processor to implement the foregoing method.
  • FIG. 1 shows a flowchart of a method for application retention according to an aspect of the present application.
  • the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
  • processors CPUs
  • input / output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media includes permanent and non-persistent, removable and non-removable media.
  • Information storage can be accomplished by any method or technology.
  • Information may be computer-readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, tape disk storage or other magnetic storage devices or any other non-transmitting medium can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
  • FIG. 1 illustrates a method for application retention provided by an aspect of the present application. The method is executed on a device 1 and includes the following steps:
  • the device 1 includes a smart device capable of running various applications.
  • the device 1 includes, but is not limited to, any mobile electronic product that can interact with a user through a touch panel, such as a smart phone, a tablet computer, and the like.
  • the mobile electronic product may use any operating system, such as an android operating system, an iOS operating system, and the like.
  • step S11 when it is detected that an application is returned to the background, an application holding process is activated.
  • the application holding process is used to avoid being recycled when the application is returned to the background, for example, even if the application Back to the background, the application retention process can also keep the application from implementing related functions without being recycled by the system.
  • the detection of the application returning to the background can be implemented directly through the device 1 or through an application holding process.
  • the application holding process is also started at the same time. During use, it can be set to the idle state without any operation, and when the application is returned to the background, the application holding process will be activated to take corresponding operations to keep the application from being recycled.
  • the method for detecting whether the application is backed up to the background may be triggered by the application.
  • the system may send an exit signal to the corresponding system of the device 1 or to the application holding process; it may also be The system or the application keeping process actively monitors, for example, whether the application is still running based on a preset time interval, and so on.
  • step S12 when the application holding process detects that an application holding condition is reached, a corresponding application holding processing operation is performed based on the application holding condition.
  • the application holding condition includes conditions set to prevent the application from being recycled after being returned to the background, and accordingly, the application holding processing operation includes an operation of preventing the application returned to the background from being recycled.
  • the application holding process monitors whether the application holding condition is met based on a preset manner, for example, it can monitor whether the application holding condition is met in real time or based on a preset time interval.
  • the application retention condition includes a system memory consumption threshold
  • the step S12 includes: when the application retention process detects that the current system memory consumption reaches the system memory consumption threshold, notifying the system to perform memory reclamation.
  • the application retention process can actively monitor the current system memory consumption and actively remind the system to perform memory recovery. For example, by setting a system memory consumption threshold, the threshold It can be slightly smaller than the preset memory consumption set by the system. When it is detected that the current system memory consumption reaches the system memory consumption threshold, the system is notified to perform memory reclamation.
  • the way in which the application keeps the process monitoring the system's memory consumption can be implemented by calling the system interface.
  • the way to notify the system to perform memory reclamation can be to actively kill useless processes or increase its own memory consumption by calling system methods. , Forcing the system to generate garbage collection and autonomously recover memory.
  • the method further includes: S13 (not shown) raises the running level of the application holding process to prevent the application holding process from being recycled by the system.
  • the application in order to prevent the system from recovering the application during the process of memory reclamation, the application may maintain the running level of the process.
  • the foreground service or UI User Interface
  • the priority of the application holding process can be increased by creating a foreground service or UI level.
  • the application retention condition includes an application recovery time threshold
  • the step S12 includes: when the application retention process detects that the application reaches the application recovery time threshold, an active event is triggered to cause all The system gives the application a new application active cycle.
  • the application recovery time threshold includes a time value set by the application maintaining process to prevent the application from being recycled after the application is returned to the background.
  • the system sets a preset application recovery time value, that is, When the time interval for the application to return to the background reaches the preset value of the application recycling time, the system will recycle the application.
  • some systems set a time threshold for application recycling to 15 minutes, that is, when the application returns to the background reaches 15 At the minute, the system will recycle the application, so in order to prevent the application from being recycled by the system, the application maintaining process triggers an active event by setting an application recycling time threshold, so that the system gives the application a new application active cycle
  • the application recovery time threshold set by the application holding process should be smaller than a preset application recovery time set by the system to avoid applications being recycled.
  • the specific application recovery time threshold setting is not described in this application. limited.
  • the method of triggering an active event can be implemented by creating a foreground service.
  • the method of triggering an active event is only an example.
  • Other existing or possible methods of triggering an active event that apply to this application are also applicable to this application. It should be included in the protection scope of this application, and is incorporated herein by reference.
  • the application maintaining condition includes a system process list priority threshold
  • the step S12 includes: when the application maintaining process detects that the process is lower than the system process list priority threshold, increasing the The application maintains the run level of the process.
  • the system monitors the running process. For example, the process is monitored by the priority of the process list. The process with a higher priority will not be recycled by the system, and the process with a lower priority will be monitored by the system. Recycling. Therefore, you can set a priority threshold for the process list. When the priority is higher than the threshold, the process will not be recycled, and the process below the threshold will be recycled. Therefore, when the application maintains process monitoring When the process is lower than the system process list priority threshold, the running level of the application holding process is increased.
  • the foreground service or UI has a higher priority. Therefore, when it is detected that the application holding process detects that the process is lower than the system process list priority threshold, the priority of the application holding process may be increased by creating a foreground service or UI.
  • the application maintaining condition includes a memory consumption threshold of the application
  • the step S12 includes: when the application maintaining process detects that the memory consumption of the application reaches the memory consumption threshold, releasing the The memory space of the application.
  • the application retention conditions include the memory of the application.
  • Consumption threshold that is, when the memory consumption of the application reaches the memory consumption threshold, the application will release a certain amount of memory space to prevent the application from being recycled.
  • the setting of the memory consumption threshold is smaller than the system recycling the application.
  • the specific memory consumption value reached can be adjusted according to different system correspondences, and is not limited here.
  • the method further includes: S14 (not shown) to raise the running level of the application holding process; and / or release the memory space of the application.
  • the running level of the application holding process may be directly increased or the memory space of the application may be released, or the application may be upgraded.
  • the application releases the memory space of the application while maintaining the running level of the process.
  • the application retention condition is set based on a system recovery condition, that is, in order to prevent the application from being recovered by the system, corresponding settings may be made for all conditions where the system may recover the application.
  • the system is in application After 15 minutes of returning to the background, the application retention process will trigger an active event to give the application a new application active cycle and so on before it reaches 15 minutes.
  • the application retention conditions and corresponding application retention processing operations mentioned in this application are merely examples. Other existing or future application retention conditions and corresponding application retention processing operations, if applicable to this application, should also be included in Within the scope of this application.
  • a device 1 for application retention comprising:
  • the second device is configured to perform a corresponding application holding processing operation based on the application holding condition when the application holding process detects that an application holding condition is reached.
  • the device 1 includes a smart device capable of running various applications.
  • the device 1 includes, but is not limited to, any mobile electronic product that can interact with a user through a touch panel, such as a smart phone, a tablet computer, and the like.
  • the mobile electronic product may use any operating system, such as an android operating system, an iOS operating system, and the like.
  • the application retention process when the first device detects that the application is returned to the background, the application retention process is activated.
  • the application retention process is used to avoid being recycled when the application is returned to the background, for example, even if the application is returned to the background.
  • the application holding process can also keep the application from implementing related functions without being recycled by the system.
  • the detection of the application returning to the background can be implemented directly by the first device of the device 1, or can also be implemented by an application holding process.
  • the application holding process also starts at the same time.
  • the process can be set to an idle state during application use, and no operation is performed.
  • the application maintaining process will be activated to take corresponding operations to keep the application from being recycled.
  • the method for detecting whether the application is backed up to the background may be triggered by the application.
  • the system may send an exit signal to the corresponding system of the device 1 or to the application holding process; it may also be The system or the application keeping process actively monitors, for example, whether the application is still running based on a preset time interval, and so on.
  • the second device is configured to perform a corresponding application holding processing operation based on the application holding condition when the application holding process detects that an application holding condition is reached.
  • the application holding condition includes conditions set to prevent the application from being recycled after being returned to the background, and accordingly, the application holding processing operation includes an operation of preventing the application returned to the background from being recycled.
  • the application holding process monitors whether the application holding condition is met based on a preset manner, for example, it can monitor whether the application holding condition is met in real time or based on a preset time interval.
  • the application retention condition includes a system memory consumption threshold
  • the second device is configured to: when the application retention process detects that the current system memory consumption reaches the system memory consumption threshold, notify the system to perform memory Recycle.
  • the application retention process can actively monitor the current system memory consumption and actively remind the system to perform memory recovery. For example, by setting a system memory consumption threshold, the threshold It can be slightly smaller than the preset memory consumption set by the system. When it is detected that the current system memory consumption reaches the system memory consumption threshold, the system is notified to perform memory reclamation.
  • the way in which the application keeps the process monitoring the system's memory consumption can be implemented by calling the system interface.
  • the way to notify the system to perform memory reclamation can be to actively kill useless processes or increase its own memory consumption by calling system methods. , Forcing the system to generate garbage collection and autonomously recover memory.
  • the device further includes: a third device (not shown), configured to improve the running level of the application holding process to prevent the application holding process from being recycled by the system.
  • a third device (not shown), configured to improve the running level of the application holding process to prevent the application holding process from being recycled by the system.
  • the application in order to prevent the system from recovering the application during the process of memory reclamation, the application may maintain the running level of the process.
  • the foreground service or UI User Interface
  • the priority of the application holding process can be increased by creating a foreground service or UI level.
  • the application retention condition includes an application recovery time threshold
  • the second device is configured to: when the application retention process detects that the application reaches the application recovery time threshold, trigger an active event to Causing the system to give the application a new application active period.
  • the application recovery time threshold includes a time value set by the application maintaining process to prevent the application from being recycled after the application is returned to the background.
  • the system sets a preset application recovery time value, that is, When the time interval for the application to return to the background reaches the preset value of the application recycling time, the system will recycle the application.
  • some systems set a time threshold for application recycling to 15 minutes, that is, when the application returns to the background reaches 15 At the minute, the system will recycle the application, so in order to prevent the application from being recycled by the system, the application maintaining process triggers an active event by setting an application recycling time threshold, so that the system gives the application a new application active cycle
  • the application recovery time threshold set by the application holding process should be smaller than a preset application recovery time set by the system to avoid applications being recycled.
  • the specific application recovery time threshold setting is not described in this application. limited.
  • the method of triggering an active event can be implemented by creating a foreground service.
  • the method of triggering an active event is only an example.
  • Other existing or possible methods of triggering an active event that apply to this application are also applicable to this application. It should be included in the protection scope of this application, and is incorporated herein by reference.
  • the application retention condition includes a system process list priority threshold
  • the second device is configured to include: when the application retention process detects that the process is lower than the system process list priority threshold, Raise the running level of the application holding process.
  • the system monitors the running process. For example, the process is monitored by the priority of the process list. The process with a higher priority will not be recycled by the system, and the process with a lower priority will be monitored by the system. Recycling. Therefore, you can set a priority threshold for the process list. When the priority is higher than the threshold, the process will not be recycled, and the process below the threshold will be recycled. Therefore, when the application maintains process monitoring When the process is lower than the system process list priority threshold, the running level of the application holding process is increased.
  • the foreground service or UI has a higher priority. Therefore, when it is detected that the application holding process detects that the process is lower than the system process list priority threshold, the priority of the application holding process may be increased by creating a foreground service or UI.
  • the application retention condition includes a memory consumption threshold of the application
  • the second device is configured to: when the application retention process monitors that the memory consumption of the application reaches the memory consumption threshold, Free up memory space of the application.
  • the application retention conditions include the memory of the application.
  • Consumption threshold that is, when the memory consumption of the application reaches the memory consumption threshold, the application will release a certain amount of memory space to prevent the application from being recycled.
  • the setting of the memory consumption threshold is smaller than the system recycling the application.
  • the specific memory consumption value reached can be adjusted according to different system correspondences, and is not limited here.
  • the device further comprises: a fourth device (not shown), configured to improve the running level of the application maintaining process; and / or release the memory space of the application.
  • a fourth device (not shown), configured to improve the running level of the application maintaining process; and / or release the memory space of the application.
  • the running level of the application holding process may be directly increased or the memory space of the application may be released, or the application may be upgraded.
  • the application releases the memory space of the application while maintaining the running level of the process.
  • the application retention condition is set based on a system recovery condition, that is, in order to prevent the application from being recovered by the system, corresponding settings may be made for all conditions where the system may recover the application.
  • the system is in application After 15 minutes of returning to the background, the application retention process will trigger an active event to give the application a new application active cycle and so on before it reaches 15 minutes.
  • the application retention conditions and corresponding application retention processing operations mentioned in this application are merely examples. Other existing or future application retention conditions and corresponding application retention processing operations, if applicable to this application, should also be included in Within the scope of this application.
  • an embodiment of the present application further provides a computer-readable medium on which computer-readable instructions are stored, and the computer-readable instructions can be executed by a processor to implement the foregoing method.
  • An embodiment of the present application further provides a device for application retention, where the device includes:
  • One or more processors are One or more processors.
  • a memory storing computer-readable instructions that, when executed, cause the processor to perform the operations of the foregoing methods.
  • computer-readable instructions when executed, cause the one or more processors: when an application is detected to be returned to the background, an application retention process is activated; when the application retention process detects that an application retention condition is reached, based on the application The hold condition performs a corresponding application hold processing operation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The purpose of the present application is to provide a method and device used for application protection. Compared to the existing technology, the present application comprises: when detected that an application withdraws to the background, activating an application protection process; and when the application protection process monitors that an application protection condition has been reached, carrying out a corresponding application protection processing operation on the basis of the application protection condition. By means of the described method, it is possible for an application to not be recovered by a system as soon as the application moves to the background, thus allowing relevant operations to still be carried out, and thereby not affecting a user using the application and improving the user experience.

Description

用于应用保持的方法与设备Method and device for application retention 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种用于应用保持的技术。The present application relates to the field of computer technology, and in particular, to a technology for application retention.
背景技术Background technique
随着智能终端的普及,人们越来越多的通过终端上的应用进行各种网络活动,通常情况下,当应用退出后台之后都会被系统依据一定的条件进行回收,从而导致应用无法继续进行相关操作,影响用户体验。With the popularity of smart terminals, people are increasingly performing various network activities through applications on the terminals. Generally, after the application exits the background, it will be recycled by the system according to certain conditions. Operation, affecting the user experience.
发明内容Summary of the Invention
本申请的目的是提供一种用于应用保持的方法与设备。The purpose of this application is to provide a method and device for application retention.
根据本申请的一个方面,提供了一种用于应用保持的方法,其中,所述方法包括:According to one aspect of the present application, a method for application retention is provided, wherein the method includes:
当检测到应用退到后台,激活应用保持进程;When the application is detected to return to the background, the application retention process is activated;
当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。When the application holding process detects that an application holding condition is reached, a corresponding application holding processing operation is performed based on the application holding condition.
进一步地,其中,所述应用保持条件包括系统内存阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:Further, the application retention condition includes a system memory threshold, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes:
当所述应用保持进程监测到当前系统内存达到所述系统内存阈值,通知系统进行内存回收。When the application holding process detects that the current system memory reaches the system memory threshold, it notifies the system to perform memory reclamation.
进一步地,其中,所述方法还包括:Further, the method further includes:
提升所述应用保持进程的运行等级,以防止所述应用保持进程被所述系统回收。The running level of the application holding process is increased to prevent the application holding process from being recycled by the system.
进一步地,其中,所述应用保持条件包括应用回收时间阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:Further, the application retention condition includes an application recovery time threshold, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes:
当所述应用保持进程监测到所述应用达到所述应用回收时间阈值,触发 活跃事件,以使所述系统赋予所述应用新的应用活跃周期。When the application maintaining process detects that the application reaches the application recycling time threshold, an active event is triggered, so that the system gives the application a new application active period.
进一步地,其中,所述应用保持条件包括系统进程列表优先级阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:Further, the application retention condition includes a system process list priority threshold, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes:
当所述应用保持进程监测到该进程达到所述系统进程列表优先级阈值,提升所述应用保持进程的运行等级。When the application holding process detects that the process reaches the system process list priority threshold, the running level of the application holding process is increased.
进一步地,其中,所述应用保持条件包括所述应用的内存消耗阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:Further, the application retention condition includes a memory consumption threshold of the application, and when the application retention process detects that the application retention condition is reached, performing a corresponding application retention processing operation based on the application retention condition includes :
当所述应用保持进程监测到所述应用的内存消耗达到所述内存消耗阈值,释放所述应用的内存空间。When the application holding process detects that the memory consumption of the application reaches the memory consumption threshold, the memory space of the application is released.
进一步地,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作之前,所述方法还包括:Further, when the application retention process detects that an application retention condition is reached, and before performing a corresponding application retention processing operation based on the application retention condition, the method further includes:
提升所述应用保持进程的运行等级;和/或Increase the running level of the application holding process; and / or
释放所述应用的内存空间。Free up memory space of the application.
进一步地,其中,所述应用保持条件基于系统回收条件进行设定。Further, the application maintaining condition is set based on a system recovery condition.
根据本申请的另一方面,还提供了一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现前述方法。According to another aspect of the present application, there is also provided a computer-readable medium having computer-readable instructions stored thereon, the computer-readable instructions being executable by a processor to implement the foregoing method.
与现有技术相比,在本申请中,当检测到应用退到后台,激活应用保持进程,当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。通过这种方式,能够使应用即使在后台也不至于被系统回收,仍旧可以进行相关操作,从而不影响用户使用应用,提高了用户体验。Compared with the prior art, in this application, when an application is detected to be returned to the background, an application holding process is activated, and when the application holding process detects that an application holding condition is reached, a corresponding application holding process is performed based on the application holding condition. operating. In this way, even if the application is not in the background, it will not be recycled by the system, and related operations can still be performed, so that it does not affect the user's use of the application and improves the user experience.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other features, objects, and advantages of the present invention will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings:
图1示出根据本申请一个方面的一种用于应用保持的方法流程图。FIG. 1 shows a flowchart of a method for application retention according to an aspect of the present application.
附图中相同或相似的附图标记代表相同或相似的部件。The same or similar reference numerals in the drawings represent the same or similar components.
具体实施方式Detailed ways
下面结合附图对本发明作进一步详细描述。The present invention is described in further detail below with reference to the drawings.
在本申请一个典型的配置中,终端、服务网络的设备和可信方均包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration of this application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes permanent and non-persistent, removable and non-removable media. Information storage can be accomplished by any method or technology. Information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, tape disk storage or other magnetic storage devices or any other non-transmitting medium can be used to store information that can be accessed by computing devices. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
为更进一步阐述本申请所采取的技术手段及取得的效果,下面结合附图及较佳实施例,对本申请的技术方案,进行清楚和完整的描述。In order to further explain the technical measures adopted and the effects achieved in the present application, the technical solutions of the present application will be clearly and completely described below with reference to the drawings and preferred embodiments.
图1示出根据本申请一个方面提供的一种用于应用保持的方法,该方法在设备1上执行,该方法包括以下步骤:FIG. 1 illustrates a method for application retention provided by an aspect of the present application. The method is executed on a device 1 and includes the following steps:
S11当检测到应用退到后台,激活应用保持进程;S11 When the application is detected to be returned to the background, the application holding process is activated;
S12当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。S12: When the application holding process detects that an application holding condition is reached, perform a corresponding application holding processing operation based on the application holding condition.
在本申请中,设备1包括能够运行各种应用的智能设备,比如,设备1包括但不限于任何一种可与用户通过触摸板进行人机交互的移动电子产品,例如智能手机、平板电脑等,所述移动电子产品可以采用任意操作系 统,如android操作系统、iOS操作系统等。In this application, the device 1 includes a smart device capable of running various applications. For example, the device 1 includes, but is not limited to, any mobile electronic product that can interact with a user through a touch panel, such as a smart phone, a tablet computer, and the like. The mobile electronic product may use any operating system, such as an android operating system, an iOS operating system, and the like.
在该实施例中,在所述步骤S11中,当检测到应用退到后台,激活应用保持进程,在此,所述应用保持进程用于避免当应用退到后台而被回收,例如,即使应用退到后台,该应用保持进程也能保持应用实现相关的功能而不被系统回收。In this embodiment, in step S11, when it is detected that an application is returned to the background, an application holding process is activated. Here, the application holding process is used to avoid being recycled when the application is returned to the background, for example, even if the application Back to the background, the application retention process can also keep the application from implementing related functions without being recycled by the system.
在本申请中,检测应用退到后台可以直接通过设备1来实现,或者是通过应用保持进程来实现,例如,当应用一开始启动时,所述应用保持进程也会同时启动,该进程在应用使用期间可以设置为空闲状态,不进行任何操作,而当应用退到后台时,所述应用保持进程会被激活,以采取相应的操作来保持应用不被回收。In this application, the detection of the application returning to the background can be implemented directly through the device 1 or through an application holding process. For example, when the application is started at the beginning, the application holding process is also started at the same time. During use, it can be set to the idle state without any operation, and when the application is returned to the background, the application holding process will be activated to take corresponding operations to keep the application from being recycled.
在此,检测应用是否退到后台的方式,可以是由所述应用来触发,例如,当应用退到后台时会向设备1对应的系统或者向所述应用保持进程发送退出信号;还可以是由系统或者所述应用保持进程主动进行监测,例如,会基于预设的时间间隔监测所述应用是否还在运行等等。Here, the method for detecting whether the application is backed up to the background may be triggered by the application. For example, when the application is backed up to the background, the system may send an exit signal to the corresponding system of the device 1 or to the application holding process; it may also be The system or the application keeping process actively monitors, for example, whether the application is still running based on a preset time interval, and so on.
继续在该实施例中,在所述步骤S12中,当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。Continuing in this embodiment, in step S12, when the application holding process detects that an application holding condition is reached, a corresponding application holding processing operation is performed based on the application holding condition.
其中,所述应用保持条件包括为了避免应用退到后台后被回收而设定的条件,相应地,所述应用保持处理操作包括避免退到后台的应用被回收的操作。所述应用保持进程会基于预设的方式来监测是否达到应用保持条件,例如,可以实时或者基于预设的时间间隔来监测是否达到应用保持条件。Wherein, the application holding condition includes conditions set to prevent the application from being recycled after being returned to the background, and accordingly, the application holding processing operation includes an operation of preventing the application returned to the background from being recycled. The application holding process monitors whether the application holding condition is met based on a preset manner, for example, it can monitor whether the application holding condition is met in real time or based on a preset time interval.
优选地,其中,所述应用保持条件包括系统内存消耗阈值,其中,所述步骤S12包括:当所述应用保持进程监测到当前系统内存消耗达到所述系统内存消耗阈值,通知系统进行内存回收。Preferably, the application retention condition includes a system memory consumption threshold, and the step S12 includes: when the application retention process detects that the current system memory consumption reaches the system memory consumption threshold, notifying the system to perform memory reclamation.
在该实施例中,由于在系统内存消耗很大时会影响系统的运行,因此,有些系统会设定系统内存消耗的预设值,当系统内存的消耗达到该预设值时会进行内存回收,而可能会导致该退到后台的应用被回收,因此,所述应用保持进程可以主动监测当前系统内存的消耗,并主动提醒系统进行内存回收,例如,通过设定系统内存消耗阈值,该阈值可以略小于系统设定的内存消耗的预设值,当监测到当前系统内存消耗达到系统内存消耗阈值,通知系统进 行内存回收。In this embodiment, since the system operation is affected when the system memory consumption is large, some systems set a preset value for the system memory consumption, and the memory is recycled when the system memory consumption reaches the preset value , Which may cause the application that is returned to the background to be recycled. Therefore, the application retention process can actively monitor the current system memory consumption and actively remind the system to perform memory recovery. For example, by setting a system memory consumption threshold, the threshold It can be slightly smaller than the preset memory consumption set by the system. When it is detected that the current system memory consumption reaches the system memory consumption threshold, the system is notified to perform memory reclamation.
具体地,所述应用保持进程监测系统内存消耗的方式可以通过调用系统接口来实现,另外,通知系统进行内存回收的方式,可以通过调用系统方法主动杀死无用进程或者不断增大自己的内存消耗,迫使系统产生垃圾回收,自主回收内存。Specifically, the way in which the application keeps the process monitoring the system's memory consumption can be implemented by calling the system interface. In addition, the way to notify the system to perform memory reclamation can be to actively kill useless processes or increase its own memory consumption by calling system methods. , Forcing the system to generate garbage collection and autonomously recover memory.
在此,所述监测系统内存消耗以及通知系统内存回收的方式仅为举例,其他现有的或者今后可能出现的监测系统内存消耗以及通知系统内存回收方式,如适用于本申请,也应包含在本申请的包含范围内,在此,以引用的方式包含于此。Here, the methods for monitoring system memory consumption and notifying system memory reclamation are merely examples. Other existing or possible monitoring system memory consumption and notification system memory reclamation methods, if applicable to this application, shall also be included The scope of this application is hereby incorporated herein by reference.
更优选地,其中,所述方法还包括:S13(未示出)提升所述应用保持进程的运行等级,以防止所述应用保持进程被所述系统回收。More preferably, the method further includes: S13 (not shown) raises the running level of the application holding process to prevent the application holding process from being recycled by the system.
在该实施例中,为了防止系统在内存回收的过程中,该应用保持进程本身被回收,可以提示所述应用保持进程的运行等级。In this embodiment, in order to prevent the system from recovering the application during the process of memory reclamation, the application may maintain the running level of the process.
具体地,不同的系统对应的进程的优先级不同,因此,可以根据不同的系统使用不同的方式来提升进程的运行等级,例如,在android系统中,前台服务或者UI(User Interface,用户界面)等拥有较高优先级,因此,当检测到所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值的时候,可以通过创建前台服务或者UI等来提高该应用保持进程的优先级。Specifically, different systems have different priorities for processes. Therefore, different methods can be used to improve the running level of processes according to different systems. For example, in the android system, the foreground service or UI (User Interface) Has a higher priority, so when it is detected that the application holding process detects that the process is lower than the system process list priority threshold, the priority of the application holding process can be increased by creating a foreground service or UI level.
优选地,其中,所述应用保持条件包括应用回收时间阈值,其中,所述步骤S12包括:当所述应用保持进程监测到所述应用达到所述应用回收时间阈值,触发活跃事件,以使所述系统赋予所述应用新的应用活跃周期。Preferably, the application retention condition includes an application recovery time threshold, and the step S12 includes: when the application retention process detects that the application reaches the application recovery time threshold, an active event is triggered to cause all The system gives the application a new application active cycle.
其中,所述应用回收时间阈值包括当应用退到后台后,所述应用保持进程为了避免应用被回收,而设定的时间值,通常情况下,系统都会设定应用回收时间预设值,即当应用退到后台的时间间隔达到应用回收时间预设值时,系统会对该应用进行回收,例如,有些系统会设定应用回收的时间阈值为15分钟,也即当应用退到后台达到15分钟时,系统会回收该应用,因此为了不让应用被系统回收,所述应用保持进程通过设定应用回收时间阈值,来触发活跃事件,以使所述系统赋予所述应用新的应用活跃周期,并且,所述应用保持进程设定的应用回收时间阈值要小于系统设定的 应用回收时间预设值,以避免应用被回收,具体的应用回收时间阈值的设定,在本申请中不做限定。The application recovery time threshold includes a time value set by the application maintaining process to prevent the application from being recycled after the application is returned to the background. Generally, the system sets a preset application recovery time value, that is, When the time interval for the application to return to the background reaches the preset value of the application recycling time, the system will recycle the application. For example, some systems set a time threshold for application recycling to 15 minutes, that is, when the application returns to the background reaches 15 At the minute, the system will recycle the application, so in order to prevent the application from being recycled by the system, the application maintaining process triggers an active event by setting an application recycling time threshold, so that the system gives the application a new application active cycle In addition, the application recovery time threshold set by the application holding process should be smaller than a preset application recovery time set by the system to avoid applications being recycled. The specific application recovery time threshold setting is not described in this application. limited.
在此,触发活跃事件的方式,可以通过创建前台服务来实现,在此,触发活跃事件的方式仅为举例,其他现有的或者今后可能出现的触发活跃事件的方式如适用于本申请,也应包含在本申请的保护范围内,以引用的方式包含于此。Here, the method of triggering an active event can be implemented by creating a foreground service. Here, the method of triggering an active event is only an example. Other existing or possible methods of triggering an active event that apply to this application are also applicable to this application. It should be included in the protection scope of this application, and is incorporated herein by reference.
优选地,其中,所述应用保持条件包括系统进程列表优先级阈值,其中,所述步骤S12包括:当所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值,提升所述应用保持进程的运行等级。Preferably, the application maintaining condition includes a system process list priority threshold, and the step S12 includes: when the application maintaining process detects that the process is lower than the system process list priority threshold, increasing the The application maintains the run level of the process.
在该实施例中,系统对于运行的进程会进行监控,例如,通过进程列表优先级的方式对进程监控,进程优先级较高的不会被系统回收,而进程优先级较低的会被系统回收,因此,可以通过设定统进程列表优先级阈值,当优先级高于该阈值时,进程不会被回收,而低于该阈值的进程会被回收,因此,当所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值,提升所述应用保持进程的运行等级。In this embodiment, the system monitors the running process. For example, the process is monitored by the priority of the process list. The process with a higher priority will not be recycled by the system, and the process with a lower priority will be monitored by the system. Recycling. Therefore, you can set a priority threshold for the process list. When the priority is higher than the threshold, the process will not be recycled, and the process below the threshold will be recycled. Therefore, when the application maintains process monitoring When the process is lower than the system process list priority threshold, the running level of the application holding process is increased.
具体地,不同的系统对应的进程的优先级不同,因此,可以根据不同的系统使用不同的方式来提升进程的运行等级,例如,在android系统中,前台服务或者UI等拥有较高优先级,因此,当检测到所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值的时候,可以通过创建前台服务或者UI等来提高该应用保持进程的优先级。Specifically, different systems have different priorities for processes. Therefore, different methods can be used to improve the running level of processes according to different systems. For example, in the android system, the foreground service or UI has a higher priority. Therefore, when it is detected that the application holding process detects that the process is lower than the system process list priority threshold, the priority of the application holding process may be increased by creating a foreground service or UI.
优选地,其中,所述应用保持条件包括所述应用的内存消耗阈值,其中,所述步骤S12包括:当所述应用保持进程监测到所述应用的内存消耗达到所述内存消耗阈值,释放所述应用的内存空间。Preferably, the application maintaining condition includes a memory consumption threshold of the application, and the step S12 includes: when the application maintaining process detects that the memory consumption of the application reaches the memory consumption threshold, releasing the The memory space of the application.
在该实施例中,若应用的内存消耗过大,会影响系统的运行,因此,有些系统会对这些内存消耗大于一定值的应用进行回收,因此,所述应用保持条件包括所述应用的内存消耗阈值,即当应用的内存消耗达到该内存消耗阈值时,会使该应用释放一定的内存空间,以避免应用被回收,在此,所述内存消耗阈值的设定要小于系统回收该应用所达到的内存消耗值,具体的设定可以依据不同的系统对应进行调整,在此,不做限定。In this embodiment, if the memory consumption of an application is too large, it will affect the operation of the system. Therefore, some systems recycle these applications whose memory consumption is greater than a certain value. Therefore, the application retention conditions include the memory of the application. Consumption threshold, that is, when the memory consumption of the application reaches the memory consumption threshold, the application will release a certain amount of memory space to prevent the application from being recycled. Here, the setting of the memory consumption threshold is smaller than the system recycling the application. The specific memory consumption value reached can be adjusted according to different system correspondences, and is not limited here.
优选地,其中,所述步骤S12之前,所述方法还包括:S14(未示出)提升所述应用保持进程的运行等级;和/或释放所述应用的内存空间。Preferably, before the step S12, the method further includes: S14 (not shown) to raise the running level of the application holding process; and / or release the memory space of the application.
在该实施例中,为了更好的避免应用被回收,在应用保持进程被激活之后,可以直接先提升所述应用保持进程的运行等级或者释放所述应用的内存空间,也可以在提升所述应用保持进程的运行等级同时,释放所述应用的内存空间。In this embodiment, in order to better prevent the application from being recycled, after the application holding process is activated, the running level of the application holding process may be directly increased or the memory space of the application may be released, or the application may be upgraded. The application releases the memory space of the application while maintaining the running level of the process.
优选地,在本申请中,所述应用保持条件基于系统回收条件进行设定,也即为了避免应用被系统回收,可以针对系统可能回收应用的所有条件进行对应的设定,例如,系统在应用退到后台15分钟后回收,所述应用保持进程会在未到达15分钟之前,触发活跃事件,来赋予应用新的应用活跃周期等等。在本申请中提到的应用保持条件及对应的应用保持处理操作仅为举例,其他现有的或者今后可能出现的应用保持条件及对应的应用保持处理操作如适用于本申请,也应包含在本申请的包含范围内。Preferably, in the present application, the application retention condition is set based on a system recovery condition, that is, in order to prevent the application from being recovered by the system, corresponding settings may be made for all conditions where the system may recover the application. For example, the system is in application After 15 minutes of returning to the background, the application retention process will trigger an active event to give the application a new application active cycle and so on before it reaches 15 minutes. The application retention conditions and corresponding application retention processing operations mentioned in this application are merely examples. Other existing or future application retention conditions and corresponding application retention processing operations, if applicable to this application, should also be included in Within the scope of this application.
与现有技术相比,在本申请中,当检测到应用退到后台,激活应用保持进程,当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。通过这种方式,能够使应用即使在后台也不至于被系统回收,仍旧可以进行相关操作,从而不影响用户使用应用,提高了用户体验。Compared with the prior art, in this application, when an application is detected to be returned to the background, an application holding process is activated, and when the application holding process detects that an application holding condition is reached, a corresponding application holding process is performed based on the application holding condition. operating. In this way, even if the application is not in the background, it will not be recycled by the system, and related operations can still be performed, so that it does not affect the user's use of the application and improves the user experience.
根据本申请的另一个方面还提供了一种用于应用保持的设备1,该设备包括:According to another aspect of the present application, there is also provided a device 1 for application retention, the device comprising:
第一装置,用于当检测到应用退到后台,激活应用保持进程;A first device for activating an application holding process when an application is detected to be returned to the background;
第二装置,用于当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。The second device is configured to perform a corresponding application holding processing operation based on the application holding condition when the application holding process detects that an application holding condition is reached.
在本申请中,设备1包括能够运行各种应用的智能设备,比如,设备1包括但不限于任何一种可与用户通过触摸板进行人机交互的移动电子产品,例如智能手机、平板电脑等,所述移动电子产品可以采用任意操作系统,如android操作系统、iOS操作系统等。In this application, the device 1 includes a smart device capable of running various applications. For example, the device 1 includes, but is not limited to, any mobile electronic product that can interact with a user through a touch panel, such as a smart phone, a tablet computer, and the like. The mobile electronic product may use any operating system, such as an android operating system, an iOS operating system, and the like.
在该实施例中,所述第一装置当检测到应用退到后台,激活应用保持进程,在此,所述应用保持进程用于避免当应用退到后台而被回收,例如,即 使应用退到后台,该应用保持进程也能保持应用实现相关的功能而不被系统回收。In this embodiment, when the first device detects that the application is returned to the background, the application retention process is activated. Here, the application retention process is used to avoid being recycled when the application is returned to the background, for example, even if the application is returned to the background. In the background, the application holding process can also keep the application from implementing related functions without being recycled by the system.
在本申请中,检测应用退到后台可以直接通过设备1的第一装置来实现,或者还可以通过应用保持进程来实现,例如,当应用一开始启动时,所述应用保持进程也会同时启动,该进程在应用使用期间可以设置为空闲状态,不进行任何操作,而当应用退到后台时,所述应用保持进程会被激活,以采取相应的操作来保持应用不被回收。In this application, the detection of the application returning to the background can be implemented directly by the first device of the device 1, or can also be implemented by an application holding process. For example, when the application starts, the application holding process also starts at the same time. The process can be set to an idle state during application use, and no operation is performed. When the application returns to the background, the application maintaining process will be activated to take corresponding operations to keep the application from being recycled.
在此,检测应用是否退到后台的方式,可以是由所述应用来触发,例如,当应用退到后台时会向设备1对应的系统或者向所述应用保持进程发送退出信号;还可以是由系统或者所述应用保持进程主动进行监测,例如,会基于预设的时间间隔监测所述应用是否还在运行等等。Here, the method for detecting whether the application is backed up to the background may be triggered by the application. For example, when the application is backed up to the background, the system may send an exit signal to the corresponding system of the device 1 or to the application holding process; it may also be The system or the application keeping process actively monitors, for example, whether the application is still running based on a preset time interval, and so on.
继续在该实施例中,所述第二装置用于当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。Continuing in this embodiment, the second device is configured to perform a corresponding application holding processing operation based on the application holding condition when the application holding process detects that an application holding condition is reached.
其中,所述应用保持条件包括为了避免应用退到后台后被回收而设定的条件,相应地,所述应用保持处理操作包括避免退到后台的应用被回收的操作。所述应用保持进程会基于预设的方式来监测是否达到应用保持条件,例如,可以实时或者基于预设的时间间隔来监测是否达到应用保持条件。Wherein, the application holding condition includes conditions set to prevent the application from being recycled after being returned to the background, and accordingly, the application holding processing operation includes an operation of preventing the application returned to the background from being recycled. The application holding process monitors whether the application holding condition is met based on a preset manner, for example, it can monitor whether the application holding condition is met in real time or based on a preset time interval.
优选地,其中,所述应用保持条件包括系统内存消耗阈值,其中,所述第二装置用于:当所述应用保持进程监测到当前系统内存消耗达到所述系统内存消耗阈值,通知系统进行内存回收。Preferably, the application retention condition includes a system memory consumption threshold, and the second device is configured to: when the application retention process detects that the current system memory consumption reaches the system memory consumption threshold, notify the system to perform memory Recycle.
在该实施例中,由于在系统内存消耗很大时会影响系统的运行,因此,有些系统会设定系统内存消耗的预设值,当系统内存的消耗达到该预设值时会进行内存回收,而可能会导致该退到后台的应用被回收,因此,所述应用保持进程可以主动监测当前系统内存的消耗,并主动提醒系统进行内存回收,例如,通过设定系统内存消耗阈值,该阈值可以略小于系统设定的内存消耗的预设值,当监测到当前系统内存消耗达到系统内存消耗阈值,通知系统进行内存回收。In this embodiment, since the system operation is affected when the system memory consumption is large, some systems set a preset value for the system memory consumption, and the memory is recycled when the system memory consumption reaches the preset value , Which may cause the application that is returned to the background to be recycled. Therefore, the application retention process can actively monitor the current system memory consumption and actively remind the system to perform memory recovery. For example, by setting a system memory consumption threshold, the threshold It can be slightly smaller than the preset memory consumption set by the system. When it is detected that the current system memory consumption reaches the system memory consumption threshold, the system is notified to perform memory reclamation.
具体地,所述应用保持进程监测系统内存消耗的方式可以通过调用系统接口来实现,另外,通知系统进行内存回收的方式,可以通过调用系统方法主动杀死无用进程或者不断增大自己的内存消耗,迫使系统产生垃圾回收, 自主回收内存。Specifically, the way in which the application keeps the process monitoring the system's memory consumption can be implemented by calling the system interface. In addition, the way to notify the system to perform memory reclamation can be to actively kill useless processes or increase its own memory consumption by calling system methods. , Forcing the system to generate garbage collection and autonomously recover memory.
在此,所述监测系统内存消耗以及通知系统内存回收的方式仅为举例,其他现有的或者今后可能出现的监测系统内存消耗以及通知系统内存回收方式,如适用于本申请,也应包含在本申请的包含范围内,在此,以引用的方式包含于此。Here, the methods for monitoring system memory consumption and notifying system memory reclamation are merely examples. Other existing or possible monitoring system memory consumption and notification system memory reclamation methods, if applicable to this application, shall also be included in The scope of this application is hereby incorporated herein by reference.
更优选地,其中,所述设备还包括:第三装置(未示出),用于提升所述应用保持进程的运行等级,以防止所述应用保持进程被所述系统回收。More preferably, the device further includes: a third device (not shown), configured to improve the running level of the application holding process to prevent the application holding process from being recycled by the system.
在该实施例中,为了防止系统在内存回收的过程中,该应用保持进程本身被回收,可以提示所述应用保持进程的运行等级。In this embodiment, in order to prevent the system from recovering the application during the process of memory reclamation, the application may maintain the running level of the process.
具体地,不同的系统对应的进程的优先级不同,因此,可以根据不同的系统使用不同的方式来提升进程的运行等级,例如,在android系统中,前台服务或者UI(User Interface,用户界面)等拥有较高优先级,因此,当检测到所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值的时候,可以通过创建前台服务或者UI等来提高该应用保持进程的优先级。Specifically, different systems have different priorities for processes. Therefore, different methods can be used to improve the running level of processes according to different systems. For example, in the android system, the foreground service or UI (User Interface) Has a higher priority, so when it is detected that the application holding process detects that the process is lower than the system process list priority threshold, the priority of the application holding process can be increased by creating a foreground service or UI level.
优选地,其中,所述应用保持条件包括应用回收时间阈值,其中,所述第二装置用于:当所述应用保持进程监测到所述应用达到所述应用回收时间阈值,触发活跃事件,以使所述系统赋予所述应用新的应用活跃周期。Preferably, the application retention condition includes an application recovery time threshold, and the second device is configured to: when the application retention process detects that the application reaches the application recovery time threshold, trigger an active event to Causing the system to give the application a new application active period.
其中,所述应用回收时间阈值包括当应用退到后台后,所述应用保持进程为了避免应用被回收,而设定的时间值,通常情况下,系统都会设定应用回收时间预设值,即当应用退到后台的时间间隔达到应用回收时间预设值时,系统会对该应用进行回收,例如,有些系统会设定应用回收的时间阈值为15分钟,也即当应用退到后台达到15分钟时,系统会回收该应用,因此为了不让应用被系统回收,所述应用保持进程通过设定应用回收时间阈值,来触发活跃事件,以使所述系统赋予所述应用新的应用活跃周期,并且,所述应用保持进程设定的应用回收时间阈值要小于系统设定的应用回收时间预设值,以避免应用被回收,具体的应用回收时间阈值的设定,在本申请中不做限定。The application recovery time threshold includes a time value set by the application maintaining process to prevent the application from being recycled after the application is returned to the background. Generally, the system sets a preset application recovery time value, that is, When the time interval for the application to return to the background reaches the preset value of the application recycling time, the system will recycle the application. For example, some systems set a time threshold for application recycling to 15 minutes, that is, when the application returns to the background reaches 15 At the minute, the system will recycle the application, so in order to prevent the application from being recycled by the system, the application maintaining process triggers an active event by setting an application recycling time threshold, so that the system gives the application a new application active cycle In addition, the application recovery time threshold set by the application holding process should be smaller than a preset application recovery time set by the system to avoid applications being recycled. The specific application recovery time threshold setting is not described in this application. limited.
在此,触发活跃事件的方式,可以通过创建前台服务来实现,在此,触发活跃事件的方式仅为举例,其他现有的或者今后可能出现的触发活跃事件的方式如适用于本申请,也应包含在本申请的保护范围内,以引用的方式包含于此。Here, the method of triggering an active event can be implemented by creating a foreground service. Here, the method of triggering an active event is only an example. Other existing or possible methods of triggering an active event that apply to this application are also applicable to this application. It should be included in the protection scope of this application, and is incorporated herein by reference.
优选地,其中,所述应用保持条件包括系统进程列表优先级阈值,其中,所述第二装置用于包括:当所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值,提升所述应用保持进程的运行等级。Preferably, the application retention condition includes a system process list priority threshold, and the second device is configured to include: when the application retention process detects that the process is lower than the system process list priority threshold, Raise the running level of the application holding process.
在该实施例中,系统对于运行的进程会进行监控,例如,通过进程列表优先级的方式对进程监控,进程优先级较高的不会被系统回收,而进程优先级较低的会被系统回收,因此,可以通过设定统进程列表优先级阈值,当优先级高于该阈值时,进程不会被回收,而低于该阈值的进程会被回收,因此,当所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值,提升所述应用保持进程的运行等级。In this embodiment, the system monitors the running process. For example, the process is monitored by the priority of the process list. The process with a higher priority will not be recycled by the system, and the process with a lower priority will be monitored by the system. Recycling. Therefore, you can set a priority threshold for the process list. When the priority is higher than the threshold, the process will not be recycled, and the process below the threshold will be recycled. Therefore, when the application maintains process monitoring When the process is lower than the system process list priority threshold, the running level of the application holding process is increased.
具体地,不同的系统对应的进程的优先级不同,因此,可以根据不同的系统使用不同的方式来提升进程的运行等级,例如,在android系统中,前台服务或者UI等拥有较高优先级,因此,当检测到所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值的时候,可以通过创建前台服务或者UI等来提高该应用保持进程的优先级。Specifically, different systems have different priorities for processes. Therefore, different methods can be used to improve the running level of processes according to different systems. For example, in the android system, the foreground service or UI has a higher priority. Therefore, when it is detected that the application holding process detects that the process is lower than the system process list priority threshold, the priority of the application holding process may be increased by creating a foreground service or UI.
优选地,其中,所述应用保持条件包括所述应用的内存消耗阈值,其中,所述第二装置用于:当所述应用保持进程监测到所述应用的内存消耗达到所述内存消耗阈值,释放所述应用的内存空间。Preferably, the application retention condition includes a memory consumption threshold of the application, and the second device is configured to: when the application retention process monitors that the memory consumption of the application reaches the memory consumption threshold, Free up memory space of the application.
在该实施例中,若应用的内存消耗过大,会影响系统的运行,因此,有些系统会对这些内存消耗大于一定值的应用进行回收,因此,所述应用保持条件包括所述应用的内存消耗阈值,即当应用的内存消耗达到该内存消耗阈值时,会使该应用释放一定的内存空间,以避免应用被回收,在此,所述内存消耗阈值的设定要小于系统回收该应用所达到的内存消耗值,具体的设定可以依据不同的系统对应进行调整,在此,不做限定。In this embodiment, if the memory consumption of an application is too large, it will affect the operation of the system. Therefore, some systems recycle these applications whose memory consumption is greater than a certain value. Therefore, the application retention conditions include the memory of the application. Consumption threshold, that is, when the memory consumption of the application reaches the memory consumption threshold, the application will release a certain amount of memory space to prevent the application from being recycled. Here, the setting of the memory consumption threshold is smaller than the system recycling the application. The specific memory consumption value reached can be adjusted according to different system correspondences, and is not limited here.
优选地,其中,所述设备还包括:第四装置(未示出),用于提升所述应用保持进程的运行等级;和/或释放所述应用的内存空间。Preferably, the device further comprises: a fourth device (not shown), configured to improve the running level of the application maintaining process; and / or release the memory space of the application.
在该实施例中,为了更好的避免应用被回收,在应用保持进程被激活之后,可以直接先提升所述应用保持进程的运行等级或者释放所述应用的内存空间,也可以在提升所述应用保持进程的运行等级同时,释放所述应用的内存空间。In this embodiment, in order to better prevent the application from being recycled, after the application holding process is activated, the running level of the application holding process may be directly increased or the memory space of the application may be released, or the application may be upgraded. The application releases the memory space of the application while maintaining the running level of the process.
优选地,在本申请中,所述应用保持条件基于系统回收条件进行设定,也即为了避免应用被系统回收,可以针对系统可能回收应用的所有条件进行对应的设定,例如,系统在应用退到后台15分钟后回收,所述应用保持进程会在未到达15分钟之前,触发活跃事件,来赋予应用新的应用活跃周期等等。在本申请中提到的应用保持条件及对应的应用保持处理操作仅为举例,其他现有的或者今后可能出现的应用保持条件及对应的应用保持处理操作如适用于本申请,也应包含在本申请的包含范围内。Preferably, in the present application, the application retention condition is set based on a system recovery condition, that is, in order to prevent the application from being recovered by the system, corresponding settings may be made for all conditions where the system may recover the application. For example, the system is in application After 15 minutes of returning to the background, the application retention process will trigger an active event to give the application a new application active cycle and so on before it reaches 15 minutes. The application retention conditions and corresponding application retention processing operations mentioned in this application are merely examples. Other existing or future application retention conditions and corresponding application retention processing operations, if applicable to this application, should also be included in Within the scope of this application.
与现有技术相比,在本申请中,当检测到应用退到后台,激活应用保持进程,当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。通过这种方式,能够使应用即使在后台也不至于被系统回收,仍旧可以进行相关操作,从而不影响用户使用应用,提高了用户体验。Compared with the prior art, in this application, when an application is detected to be returned to the background, an application holding process is activated, and when the application holding process detects that an application holding condition is reached, a corresponding application holding process is performed based on the application holding condition. operating. In this way, even if the application is not in the background, it will not be recycled by the system, and related operations can still be performed, so that it does not affect the user's use of the application and improves the user experience.
此外,本申请实施例还提供了一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现前述方法。In addition, an embodiment of the present application further provides a computer-readable medium on which computer-readable instructions are stored, and the computer-readable instructions can be executed by a processor to implement the foregoing method.
本申请实施例还提供了一种用于应用保持的设备,其中,该设备包括:An embodiment of the present application further provides a device for application retention, where the device includes:
一个或多个处理器;以及One or more processors; and
存储有计算机可读指令的存储器,所述计算机可读指令在被执行时使所述处理器执行前述方法的操作。A memory storing computer-readable instructions that, when executed, cause the processor to perform the operations of the foregoing methods.
例如,计算机可读指令在被执行时使所述一个或多个处理器:当检测到应用退到后台,激活应用保持进程;当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。For example, computer-readable instructions, when executed, cause the one or more processors: when an application is detected to be returned to the background, an application retention process is activated; when the application retention process detects that an application retention condition is reached, based on the application The hold condition performs a corresponding application hold processing operation.
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限 定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。It will be apparent to those skilled in the art that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, the embodiments are to be regarded as exemplary and non-limiting in every respect, and the scope of the present invention is defined by the appended claims rather than the above description, and therefore is intended to fall within the claims. All changes that come within the meaning and range of equivalents are encompassed by the invention. Any reference signs in the claims should not be construed as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and that the singular does not exclude the plural. A plurality of units or devices stated in a device claim may also be implemented by one unit or device through software or hardware. Words such as first and second are used to indicate names, but not in any particular order.

Claims (10)

  1. 一种用于应用保持的方法,其中,所述方法包括:A method for application retention, wherein the method includes:
    当检测到应用退到后台,激活应用保持进程;When the application is detected to return to the background, the application retention process is activated;
    当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作。When the application holding process detects that an application holding condition is reached, a corresponding application holding processing operation is performed based on the application holding condition.
  2. 根据权利要求1所述的方法,其中,所述应用保持条件包括系统内存消耗阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:The method according to claim 1, wherein the application holding condition comprises a system memory consumption threshold, wherein when the application holding process detects that an application holding condition is reached, performing a corresponding application holding based on the application holding condition Processing operations include:
    当所述应用保持进程监测到当前系统内存消耗达到所述系统内存消耗阈值,通知系统进行内存回收。When the application holding process detects that the current system memory consumption reaches the system memory consumption threshold, it notifies the system to perform memory reclamation.
  3. 根据权利要求2所述的方法,其中,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    提升所述应用保持进程的运行等级,以防止所述应用保持进程被所述系统回收。The running level of the application holding process is increased to prevent the application holding process from being recycled by the system.
  4. 根据权利要求1所述的方法,其中,所述应用保持条件包括应用回收时间阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:The method according to claim 1, wherein the application holding condition comprises an application recovery time threshold, wherein when the application holding process monitors that the application holding condition is reached, performing a corresponding application holding based on the application holding condition Processing operations include:
    当所述应用保持进程监测到所述应用达到所述应用回收时间阈值,触发活跃事件,以使所述系统赋予所述应用新的应用活跃周期。When the application keeping process detects that the application reaches the application recycling time threshold, an active event is triggered, so that the system gives the application a new application active period.
  5. 根据权利要求1所述的方法,其中,所述应用保持条件包括系统进程列表优先级阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:The method according to claim 1, wherein the application holding condition comprises a system process list priority threshold, and when the application holding process detects that the application holding condition is reached, a corresponding one is performed based on the application holding condition. Application hold processing operations include:
    当所述应用保持进程监测到该进程低于所述系统进程列表优先级阈值,提升所述应用保持进程的运行等级。When the application holding process detects that the process is lower than the system process list priority threshold, the running level of the application holding process is increased.
  6. 根据权利要求1所述的方法,其中,所述应用保持条件包括所述应用的内存消耗阈值,其中,所述当所述应用保持进程监测到达到应用保持条件,基于所述应用保持条件进行对应的应用保持处理操作包括:The method according to claim 1, wherein the application holding condition comprises a memory consumption threshold of the application, and wherein when the application holding process detects that the application holding condition is reached, corresponding is performed based on the application holding condition Application retention processing operations include:
    当所述应用保持进程监测到所述应用的内存消耗达到所述内存消耗阈值,释放所述应用的内存空间。When the application holding process detects that the memory consumption of the application reaches the memory consumption threshold, the memory space of the application is released.
  7. 根据权利要求1至6中任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises:
    提升所述应用保持进程的运行等级;和/或Increase the running level of the application holding process; and / or
    释放所述应用的内存空间。Free up memory space of the application.
  8. 根据权利要求1所述的方法,其中,所述应用保持条件基于系统回收条件进行设定。The method according to claim 1, wherein the application retention condition is set based on a system recovery condition.
  9. 一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现如权利要求1至8中任一项所述的方法。A computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the method according to any one of claims 1 to 8.
  10. 一种用于应用保持的设备,其中,该设备包括:A device for application retention, wherein the device includes:
    一个或多个处理器;以及One or more processors; and
    存储有计算机可读指令的存储器,所述计算机可读指令在被执行时使所述处理器执行如权利要求1至8中任一项所述方法的操作。A memory storing computer-readable instructions which, when executed, cause the processor to perform the operations of the method according to any one of claims 1 to 8.
PCT/CN2019/090239 2018-06-08 2019-06-06 Method and device used for application protection WO2019233466A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810589863.5 2018-06-08
CN201810589863.5A CN108920263B (en) 2018-06-08 2018-06-08 Method and apparatus for application retention

Publications (1)

Publication Number Publication Date
WO2019233466A1 true WO2019233466A1 (en) 2019-12-12

Family

ID=64418686

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/090239 WO2019233466A1 (en) 2018-06-08 2019-06-06 Method and device used for application protection

Country Status (2)

Country Link
CN (1) CN108920263B (en)
WO (1) WO2019233466A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920263B (en) * 2018-06-08 2020-10-13 上海连尚网络科技有限公司 Method and apparatus for application retention
CN111158910B (en) * 2019-12-27 2024-01-12 Oppo广东移动通信有限公司 Memory management method and device, storage medium and electronic equipment
CN112988282B (en) * 2021-04-27 2021-08-20 荣耀终端有限公司 Application keep-alive method and terminal equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1708088A1 (en) * 2005-03-31 2006-10-04 Sap Ag Allocating resources based on rules and events
CN103324536A (en) * 2012-03-23 2013-09-25 宇龙计算机通信科技(深圳)有限公司 Terminal and application program protection method
CN106648032A (en) * 2016-12-30 2017-05-10 维沃移动通信有限公司 Control method for application program operating in background and mobile terminal
CN107272869A (en) * 2017-04-27 2017-10-20 北京珠穆朗玛移动通信有限公司 Using management-control method, mobile terminal and storage medium
CN108920263A (en) * 2018-06-08 2018-11-30 上海连尚网络科技有限公司 The method and apparatus kept for application

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801101A (en) * 2006-01-17 2006-07-12 浙江大学 Thread implementation and thread state switching method in Java operation system
TW201241640A (en) * 2011-02-14 2012-10-16 Microsoft Corp Dormant background applications on mobile devices
US9250958B2 (en) * 2012-11-19 2016-02-02 Qualcomm Innovation Center, Inc. System, method, and apparatus for improving application-launch latencies
CN103092689A (en) * 2013-01-10 2013-05-08 深圳市金立通信设备有限公司 Method and terminal of process management
CN107807847B (en) * 2016-09-09 2022-04-29 华为技术有限公司 Application process management method and terminal equipment
CN106648849A (en) * 2016-10-18 2017-05-10 上海传英信息技术有限公司 Process freezing method and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1708088A1 (en) * 2005-03-31 2006-10-04 Sap Ag Allocating resources based on rules and events
CN103324536A (en) * 2012-03-23 2013-09-25 宇龙计算机通信科技(深圳)有限公司 Terminal and application program protection method
CN106648032A (en) * 2016-12-30 2017-05-10 维沃移动通信有限公司 Control method for application program operating in background and mobile terminal
CN107272869A (en) * 2017-04-27 2017-10-20 北京珠穆朗玛移动通信有限公司 Using management-control method, mobile terminal and storage medium
CN108920263A (en) * 2018-06-08 2018-11-30 上海连尚网络科技有限公司 The method and apparatus kept for application

Also Published As

Publication number Publication date
CN108920263B (en) 2020-10-13
CN108920263A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
WO2019233466A1 (en) Method and device used for application protection
JP6348989B2 (en) Firmware restoration method, apparatus, terminal, program, and recording medium
EP3399692A1 (en) Method and apparatus for upgrading distributed storage system
US10551996B2 (en) Method and apparatus for starting an application in a screen-locked state
CN106815065B (en) Background application awakening method and device and electronic equipment
US11748522B2 (en) Systems, devices, and methods for prevention of recording content
WO2018099163A1 (en) Terminal and application control method
CN107506266B (en) Data recovery method and system
CN110019502B (en) Synchronization method between primary database and backup database, database system and device
CN111552567B (en) Thread management method and device, electronic equipment and storage medium
US20180060568A1 (en) System And Method Of Dynamically Updating Stack Canaries
JP6388964B2 (en) Method and apparatus for reducing power consumption and mobile terminal
CN103957322A (en) Mobile terminal and antitheft method thereof
TWI694380B (en) Method and device for realizing dynamic graphic coding
WO2016145804A1 (en) Data processing and device
WO2019109843A1 (en) Terminal-side wifi hotspot connection processing method, device and medium
CN105574380A (en) Application authority management method and device for terminal
CN111159298A (en) Service request processing method and device, electronic equipment and storage medium
CN110769017A (en) Data request processing method and device, storage medium and processor
GB2563483A (en) Wearable electronic device alerts
CN110807158A (en) Label page control method, system, equipment and computer readable storage medium
WO2019076082A1 (en) Application self-starting control method and device
US9785529B2 (en) Lost computing resource notification
TWI757741B (en) Safety task processing method and electronic device
CN104850551B (en) Data processing method and device and mobile terminal

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.03.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19814115

Country of ref document: EP

Kind code of ref document: A1