CN109992376B - Application freezing method, device, terminal and computer readable storage medium - Google Patents

Application freezing method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109992376B
CN109992376B CN201711488951.8A CN201711488951A CN109992376B CN 109992376 B CN109992376 B CN 109992376B CN 201711488951 A CN201711488951 A CN 201711488951A CN 109992376 B CN109992376 B CN 109992376B
Authority
CN
China
Prior art keywords
application program
application
freezing
terminal
working state
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
CN201711488951.8A
Other languages
Chinese (zh)
Other versions
CN109992376A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711488951.8A priority Critical patent/CN109992376B/en
Priority to PCT/CN2018/116717 priority patent/WO2019128562A1/en
Publication of CN109992376A publication Critical patent/CN109992376A/en
Application granted granted Critical
Publication of CN109992376B publication Critical patent/CN109992376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

The application relates to an application freezing method, an application freezing device, a terminal and a computer readable storage medium. The method comprises the following steps: acquiring a first application program running on the terminal, and detecting whether a second application program under the same user identity with the first application program exists or not; detecting whether the second application program is in a normal working state or not when the second application program exists; when the first application program needs to be frozen, if the second application program is in a normal working state, a corresponding preset freezing strategy is adopted to freeze the first application program according to the working state of the second application program. By the method, intelligent freezing operation can be realized according to the working states of different applications under the same user identity, freezing is guaranteed not to be abnormal, and user experience is improved.

Description

Application freezing method, device, terminal and computer readable storage medium
Technical Field
The present application relates to the field of data processing, and in particular, to an application freezing method, apparatus, terminal, and computer readable storage medium.
Background
With the development of mobile communication technology, methods for limiting resources of processes of applications are often provided in mobile operating systems. In order to avoid that an unnecessary application runs in the background or an application which is not reasonably used by a user runs in the foreground, the system memory is occupied, the electric quantity of the terminal equipment is consumed, and the application which is not required or is not reasonably used by the user is generally frozen. When a plurality of applications have associated user identifications, if one application under the user identification is frozen, all the applications under the user identification are frozen, so that the applications running in the foreground or in other normal working states can not work normally, and the user experience is affected.
Disclosure of Invention
The embodiment of the application provides an application freezing method, an application freezing device, a terminal and a computer readable storage medium, which can realize intelligent freezing operation according to the working states of different applications under the same user identity.
An application freezing method for freezing an application running on a terminal, the method comprising:
acquiring a first application program running on the terminal, and detecting whether a second application program under the same user identity with the first application program exists or not;
Detecting whether the second application program is in a normal working state or not when the second application program exists;
when the first application program needs to be frozen, if the second application program is in a normal working state, a corresponding preset freezing strategy is adopted to freeze the first application program according to the working state of the second application program.
An application freezing apparatus comprising:
the acquisition module is used for acquiring a first application program running on the terminal and detecting whether a second application program under the same user identity with the first application program exists or not;
the detection module is used for detecting whether the second application program is in a normal working state or not when the second application program exists;
and the freezing module is used for freezing the first application program by adopting a corresponding preset freezing strategy according to the working state of the second application program if the second application program is in a normal working state when the first application program is required to be frozen.
A terminal comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method.
According to the application freezing method, device, terminal and computer readable storage medium, whether the second application program which is in the same user identity with the first application program exists is detected by acquiring the first application program which runs on the terminal, when the second application program exists, whether the second application program is in a normal working state is detected, when the first application program needs to be frozen, if the second application program is in the normal working state, a corresponding preset freezing strategy is adopted to freeze the first application program according to the working state of the second application program, intelligent freezing operation can be realized according to the working states of different applications under the same user identity, the situation that the freezing is abnormal is avoided, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of the internal structure of a terminal in one embodiment;
FIG. 2 is a partial frame schematic of a system in a terminal in one embodiment;
FIG. 3 is a flow diagram of an application of a freezing method in one embodiment;
FIG. 4 is a flow chart of another embodiment of applying a freezing method;
FIG. 5 is a flow chart of another embodiment of applying a freezing method;
FIG. 6 is a flow chart of another embodiment of applying a freezing method;
FIG. 7 is a flow chart of another embodiment of a freezing method;
FIG. 8 is a block diagram of an embodiment employing a freezing device;
fig. 9 is a block diagram of a part of a structure of a mobile phone related to a terminal provided in an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It will be understood that the terms first, second, etc. as used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first application may be referred to as a second application, and similarly, a second application may be referred to as a first application without departing from the scope of the present application. The first application and the second application are both applications, but they are not the same application.
In one embodiment, as shown in fig. 1, a schematic diagram of the internal structure of a terminal is provided. The terminal includes a processor, a memory and a display screen connected by a system bus. Wherein the processor is configured to provide computing and control capabilities to support operation of the entire terminal. The memory is used for storing data, programs, instruction codes and the like, and at least one computer program is stored in the memory and can be executed by the processor, so that the application freezing method suitable for the terminal provided by the embodiment of the application is realized. The Memory may include a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random-Access Memory (RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The nonvolatile storage medium stores an operating system, a database, and a computer program. The database stores data related to an application freezing method provided by the above embodiments, for example, information such as a name of each application or process, an occupied memory size, etc. The computer program is executable by a processor for implementing an application freezing method provided by various embodiments of the present application. The internal memory provides a cached operating environment for the operating system, databases, and computer programs in the non-volatile storage medium. The display screen may be a touch screen, such as a capacitive screen or an electronic screen, and is used for displaying interface information of an application corresponding to the first process, and may also be used for detecting a touch operation acting on the display screen, and generating a corresponding instruction, such as a switching instruction of a foreground application and a background application.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the terminal to which the present inventive arrangements are applied, and that a particular terminal may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components. The terminal may further comprise a network interface connected via a system bus, which may be an ethernet card or a wireless network card, etc., for communicating with an external terminal, such as a server.
In one embodiment, as shown in fig. 2, a partial architecture diagram of a terminal is provided. The architecture system of the terminal includes a JAVA space layer 210, a local framework layer 220, and a Kernel (Kernel) space layer 230. The JAVA space layer 210 may include a freezing and thawing application 212, and the terminal may implement a freezing policy for each application through the freezing and thawing application 212, and perform a freezing operation for a related application consuming power in the background. The local framework layer 220 includes a resource priority and constraint management module 222 and a platform freeze management module 224. The terminal can maintain different applications in organizations of different priorities and different resources in real time through the resource priority and limit management module 222, and adjust the resource group of the application program according to the requirement of an upper layer, so as to achieve the effects of optimizing performance and saving power consumption. The terminal may distribute tasks that can be frozen in the background to corresponding preset frozen layers of different levels according to the length of the freezing time through the platform freezing management module 224, and optionally, the frozen layers may include three layers, which are respectively: the CPU limits the sleep mode, the CPU freezes the sleep mode, the process depth freezes the mode. The CPU sleep limiting mode is used for limiting CPU resources occupied by related processes, so that the related processes occupy less CPU resources, and the spare CPU resources are inclined to other unfrozen processes, so that the occupation of the CPU resources is limited, and the occupation of network resources and I/O interface resources by the processes is correspondingly limited; the CPU freezing sleep mode means that the related process is prohibited from using the CPU, while the memory is reserved, when the CPU resource is prohibited from being used, the corresponding network resource and I/O interface resource are also prohibited from being used; the process depth freezing mode refers to that besides the CPU resource is forbidden to be used, the memory resource occupied by the related process is further recovered, and the recovered memory can be used by other processes. The kernel space layer 230 includes a UID management module 231, a Cgroup module 232, a Binder management module 233, a process memory reclamation module 234, and a freeze timeout exit module 235. The UID management module 231 is configured to manage resources of the third party application or perform freezing based on a User Identifier (UID) of the application. By UID it is more convenient to uniformly manage resources of one user's application than to perform process management based on process identity (Process Identifier, PID). The Cgroup module 232 is used to provide a complete set of central processing units (Central Processing Unit, CPU), CPUSET, memory, input/output (I/O) and Net related resource limiting mechanisms. The Binder management module 233 is configured to implement control of priority of background Binder communications. The interface module of the local framework layer 220 includes a binder interface opened to an upper layer, and an upper layer framework or application sends a resource restriction or freezing instruction to the resource priority and restriction management module 222 and the platform freezing management module 224 through the provided binder interface. The process memory reclamation module 234 is configured to implement a process deep freeze mode, so that when a certain third party application is in a frozen state for a long time, a file area of the process is mainly released, thereby achieving a memory saving module, and also accelerating the speed of the application when the application is started next time. The freeze timeout exit module 235 is configured to solve an exception generated by the occurrence of the freeze timeout scenario. Through the architecture described above, the application freezing method in the various embodiments of the present application can be implemented.
In one embodiment, as shown in fig. 3, an application freezing method is provided for freezing an application running on a terminal. The present embodiment will be described by taking an example in which the method is applied to a terminal as shown in fig. 1. The application freezing method comprises the following steps:
step 302: and acquiring a first application program running on the terminal, and detecting whether a second application program under the same user identity with the first application program exists.
An Application (APP) is a computer program that operates in a user mode to interact with a user and has a visual user interface for performing a particular task or tasks. In this embodiment, an Android operating system (Android OS) is taken as an example, in the Android operating system, each application program has a user identity (User identification, uid), only two application programs with the same Uid can share data, for example, in order to share data of two different application programs, by setting shared Uid (sharing Uid), an application program a and an application program B can be set to the same Uid, and if the application programs a and B can call data mutually in the running process, otherwise, if the Uid of the application program a and the Uid of the application program B are different, the application program a and the application program B cannot call data at will. It will be appreciated that in other operating systems, such as IOS, symbian, etc., there are also the same or corresponding data call principles between different applications.
The first application program running on the terminal can be a foreground application program or a background application program, the UID of the first application program is obtained, whether a second application program which is the same as the UID of the first application program exists or not is detected, whether the first application program and other application programs have a mutual calling relationship or not can be judged, and whether the first application program is directly frozen or not can be judged to influence other application programs or not. It will be appreciated that there may be one or more second applications that are identical to the Uid of the first application, and as such, the second application may be a foreground application or a background application.
Step 304: and detecting whether the second application program is in a normal working state or not when the second application program exists.
If there is a second application program which is the same as the UId of the first application program, the first application program and other application programs are related to each other in calling, and if the first application program is to be frozen, the running state of the second application program sharing data with the first application program needs to be detected, and the first application program is frozen by combining the running state of the second application program.
In one embodiment, the terminal may detect the process of the second application according to a preset frequency or according to a detected user operation instruction, and obtain the current running state of the second application by detecting the process state of the second application. The operation of an application is typically embodied by the operation of a plurality of processes in association. The process related to the running of the foreground application program is the foreground process, and the process related to the running of the background application program is the background process. Alternatively, a process identifier of the second application program may be acquired, where the process identifier is used to uniquely identify a corresponding process, and may be formed by one or a combination of several digits, letters, or other characters with a preset number of digits. For example, the process identifier "0001" may be used to represent the process a, the process "1234" may be used to represent the process B, and the running states of the processes identified by the different processes may be detected, so that it may be known whether the second application operates in the background running state or the foreground running state.
Step 306: when the first application program needs to be frozen, if the second application program is in a normal working state, a corresponding preset freezing strategy is adopted to freeze the first application program according to the working state of the second application program.
The normal working state includes, but is not limited to, a foreground running state and a background holding state. Specifically, an application program corresponding to an operation page of an application program displayed on a current display interface of the terminal is a foreground application program currently operated by the terminal. In this embodiment, only the application corresponding to the input focus is the foreground application, or only the application corresponding to the window object located at the top of the window stack of the operating system is the foreground application currently corresponding to the terminal. Whether the target application program is a foreground application program is determined, a window object corresponding to the target application program is obtained, whether the window object is positioned at the stack top of a window stack of an operating system is judged, if yes, the target application program is the foreground application program, if not, the application program is operated in the background, and the application program is the background application program. The foreground application program works in a foreground running state, and the background application program works in a background running state; the background holding state refers to that an application program works in a background running state, but a user has a requirement on the application program, and needs that the application program keeps the background running state, for example, a music player, usually, after the user starts the music playing, the user enters other program operation interfaces, and at the moment, the music player works in the background holding state, and the concert continues playing.
The terminal can judge whether the first application program needs to be frozen or not according to the working state of the first application program, if the first application program works in a background working state and a user temporarily does not need to use the first application program, the first application program can be frozen, if the second application program is detected to be in a normal working state at the moment, the first application program is directly frozen to influence the operation of the second application program because the UId of the first application program is the same as that of the second application program, and the first application program is frozen according to a preset freezing strategy at the moment, so that the working of the first application program and the second application program is ensured not to be abnormal.
According to the application freezing method, whether the second application program which is in the same user identity with the first application program exists is detected by acquiring the first application program which runs on the terminal, when the second application program exists, whether the second application program is in a normal working state is detected, and when the first application program needs to be frozen, if the second application program is in the normal working state, the corresponding preset freezing strategy is adopted to freeze the first application program according to the working state of the second application program, intelligent freezing operation can be realized according to the working states of different applications under the same user identity, abnormal freezing is avoided, and user experience is improved.
In one embodiment, as shown in fig. 4, the detecting whether there is a second application program under the same user identity as the first application program includes the following steps:
step 402: and acquiring the user identity identifier allocated to the first application program by the operating system.
Under the default condition, the android operating system can allocate a Uid with different common levels to each application program, if different application programs need to be called mutually, only the Uids of different application programs can be called mutually, so that shared data among different application programs has certain security, data cannot be obtained randomly among each application program, and only one Uid corresponds to each application program. The terminal reads the UID of the first application program and judges whether a second application program which is the same as the UID of the first application program exists or not.
Step 404: and when the application programs which share data with the first application program and have the same user identity are present, the application program which can be mutually called with the first application program is taken as a second application program.
Further, the terminal detects whether an application program sharing data with the first application program exists, when detecting that other application programs share data with the first application program, the terminal obtains the UID of the application program, and if the UID of the application program is identical to the UID of the first application program, the application program is considered to be a second application program which can be mutually called with the first application program. Such a situation occurs in many different applications developed by the same company, for example, when one company makes two products, only if two products can be called each other, shared Uid can be used to set Uid of two software to be identical, in which case a signature document with the company signature must be used to share data. Alternatively, it may be a different application under Shared UId of the system with its own software.
According to the application freezing method, whether the second application program under the same user identity with the first application program exists or not is detected, when the second application program exists, the first application program can be frozen by combining the running state of the second application program, the phenomenon that the second application program cannot normally run due to direct freezing of the first application program is avoided, memory resources are saved, meanwhile, running of the application program is not affected, and user experience is improved.
In one embodiment, during the process of freezing the first application program, detecting whether the second application program is in a normal working state, if the second application program is in a foreground running state, freezing the first application program, and keeping the running state of the second application program unchanged. When the first application program needs to be frozen and the second application program which is identical to the UID of the first application program is detected to be in a foreground running state, if the first application program is directly frozen at the moment, the second application program B which is identical to the UID of the user logged in by the first application program is frozen based on the user group, so that the freezing strategy needs to be changed, and other applications which are identical to the UID of the user logged in by the background application are not frozen based on the user group.
Specifically, as shown in fig. 5, the freezing the first application program, and keeping the running state of the second application program unchanged, includes:
step 502: and acquiring all process identifiers under the user identity identifier.
The process identifier (Process identification; pid) represents a process ID, and the process (process) is a running activity of a program in a computer on a certain data set, is a basic unit for resource allocation and scheduling of a system, and is a basis of an operating system structure. The operation of an application is typically embodied by the operation of a plurality of processes in association. The process identification includes a process identification of the first application and a process identification of the second application.
In this embodiment, all process identifiers under the same Uid are read, and for example, two processes are generated when the application program "jindong" runs: the first process 12041 and the second process 12607, in which the file content of the first process is "com.jingdong.app.mall" is displayed in the path of the file library/proc/12041/cmdline, and the file content of the second process is "com.jingdong.app.mall:jdpush" is displayed in the path of the file library/proc/12607/cmdline, and both processes include the package name "com.jingdong.app.mall" of "jingdong", so that all processes of the application program "dong" in operation can be found by acquiring the related processes of the package name "com.jingdong.app.mall".
Step 504: and screening out the process identification of the first application program according to the file package name of the first application program.
The file package names of the application programs are recorded in the file library, and the file package names of different application programs can be inquired by reading the file package names in the file library. Files containing the form "package name: process" may be read, for example, by path kernel/proc/pid/cmdline. And screening the process identification only comprising the file package name of the first application program according to the file package name of the first application program, thereby obtaining the process identification of the first application program.
Step 506: and freezing a background process of the first application program according to the process identification of the first application program.
Specifically, after the process identifier of the first application program is obtained, a background process of the first application program can be frozen according to the process identifier of the first application program, for example, all/proc/pid/cmdline pids containing the package name of the first application program are frozen. The related process of the first application program is frozen by the freezing process mode, and the running state of the second application program which is the same as the UID of the first application program is not affected.
In one embodiment, during the process of freezing the first application program, whether the second application program is in a normal working state is detected, and if the second application program is in a foreground working state and the second application program depends on the first application program, the working states of the first application program and the second application program are kept unchanged.
Wherein the dependency represents a relationship that represents data that one application needs to utilize for another application or applications to successfully implement execution of the one application. The two application programs with the dependency relationship are a dependent application program and a dependent application program respectively, and the terminal takes the detected background application program which is to be depended on by the first application program as a second application program. When the first application is relied on by the second application under the same UId, the first application and the second application are not frozen.
For example, the application a depends on the application B, or the application B depends on the application a, that is, the application a needs to use the data of the application B to implement the execution of the application a, and at this time, the application a is the dependent second application, and the application B is the first application. It will be appreciated that the dependent application may also be a first application and the second application may be a background application. The terminal may detect from the set of background applications to query whether there are applications that are relied upon by the first application.
In one embodiment, during the process of freezing the first application program, detecting whether the second application program is in a normal working state, and if the second application program is in an abnormal working state, freezing the first application program and the second application program under the same user identity when the first application program needs to be frozen.
According to the application freezing method provided by the embodiment, when the second application program is in the foreground running state, the first application program is frozen, and the running state of the second application program is kept unchanged; if the second application program is in a foreground running state and the second application program depends on the first application program, keeping the running states of the first application program and the second application program unchanged; and if the second application program is in an abnormal working state, when the first application program needs to be frozen, the first application program and the second application program under the same user identity are frozen. The freezing mode of the application can be realized by intelligently combining the working states of different applications under the same user identity, the freezing range is increased, and the system resources are better optimized.
In one embodiment, as shown in fig. 6, before the freezing the first application program according to the preset freezing policy, the method further includes the following steps:
Step 602: detecting operation information acting on the first application program; the operation information includes an operation mode and an operation time point.
When the application program is started on the terminal, the application program can monitor the operation information input by the user. The operation information includes an operation mode and an operation time point input by a user. The operation modes at least comprise input operation modes such as keys, voice, touch, fingerprint, scanning and the like. Meanwhile, when operation information input by a user is received, the currently input operation time point is also acquired. For example, when an application program is started, it monitors all input information of the user, such as input of different operation modes of voice, touch, etc., when the user uses the application program, and at the same time, the input time point corresponding to the current input mode, such as voice input-20:00:00, is recorded; touch input-20:00:01, etc.
Step 604: and determining whether the first application program needs to be frozen at the current moment according to the operation information.
Each application corresponds to one or more freeze conditions, which may be determined based on the manner of operation in which the user input is received. In this case, it is possible to set one freezing condition for one operation mode, for example, the first freezing condition for the touch operation mode, the second freezing condition for the voice operation mode, the third freezing condition for the scan operation mode, and so on. That is, each mode of operation that each application can reach may correspond to a freeze condition.
Further, the freezing condition is a time condition, and a time freezing condition corresponding to each operation mode can be set, and the time freezing condition can be understood as that when certain operation information is not monitored within a preset duration, the time freezing condition is considered to be met.
The operation modes of each application are different, and freezing conditions corresponding to the same operation mode of different applications may be the same or different.
According to the preset mapping relation, whether the first application program needs to be frozen or not at the current moment can be judged according to the monitored operation information.
In one embodiment, as shown in fig. 7, the determining whether the first application program needs to be frozen at the current moment according to the operation information includes the following steps:
step 702: and acquiring the operation information closest to the current moment, and recording the time interval between the operation time point of the operation information and the current moment.
When an application program on the terminal runs, the terminal monitors operation information input by a user, wherein the operation modes at least comprise input operation modes such as keys, voice, touch, fingerprint, scanning and the like. Meanwhile, when operation information input by a user is received, the currently input operation time point is also acquired.
The latest operation information may be operation information corresponding to an operation time point with the shortest time interval at the current moment, among all operation information received from the user input, from the current start of the application program.
If the current time is 20:30:00 a night, the foreground of the terminal is running the first application program, the user can operate the display page of the application program in the process of using the first application program, and the terminal can monitor the operation information input by the user in real time. At the current time (20:30:00), the terminal acquires the operation information (operation mode and operation time point) which is monitored last time from the current time (20:30:00), if the operation mode is a touch operation mode in the latest operation information and the operation time point is 20:20:00, the terminal can acquire the time interval from the current time, and the time interval is 10 minutes.
Step 704: and when the time interval meets a preset freezing condition, the first application program needs to be frozen.
Specifically, the preset freezing condition may be a time condition, a historical operation duration of each application running in the foreground may be different, an operation manner of receiving the user input may be different, and the corresponding freezing condition may be set for each application. For example, when the first application program works in a foreground running state, the freezing condition of the first application program can be divided according to the received operation mode, and if the first application program does not monitor touch operation within a first preset duration, the first freezing condition is met; when the first preset time period is longer than a preset multiple of the use frequency (120 times/min) of the touch operation mode, it can be determined that the touch operation mode is not generated any more in the first preset time period, and it can be determined that the user does not use the first application program currently running and needs to freeze the first application program.
Optionally, when the first application program works in the foreground running state, if no voice operation is monitored within a second preset time period, the second freezing condition is satisfied. The second preset duration is related to the use frequency in the history operation record, and when the second preset duration is longer than a preset multiple of the use frequency (1 time/5 minutes) of the voice operation mode, the voice operation mode can be determined not to be regenerated in the second preset duration, which indicates that the user is determined not to use the first application program currently running and needs to freeze the first application program.
It should be noted that the first preset duration and the second preset duration may be set according to the needs of the user, which is not limited herein.
In one embodiment, the preset freezing condition may further include detecting whether a user exists, and when the time interval satisfies the preset freezing condition, it may be determined that the user does not operate the application program at this time, and whether the user exists in front of the current terminal may be determined by detecting whether the face image exists in the visual area of the current terminal through the terminal. The visual area may be understood as an area where the user can normally use the terminal, or may be understood as a distance between the user and the terminal, which is a comfortable distance for the user to use the terminal.
Specifically, whether a person exists in front of the terminal can be detected through a face recognition technology. Face recognition is a biological recognition technology for carrying out identity recognition based on facial feature information of people. An image or video stream containing a face image is acquired by a camera or a camera (front camera), and the face image is automatically detected and tracked in the image, so that a series of related technologies of face recognition, commonly called face recognition, and face recognition, are performed on the detected face image. Through terminal processing, if the face image is identified, the user is shown to watch the display area of the terminal, and the user does not operate the terminal; if the face image does not exist, the fact that the user is not using the terminal currently is indicated, and the first application program can be frozen. When no face image exists, the current user is far away from the terminal, and the first application program running currently can be frozen, so that power consumption is saved.
In one embodiment, the application freezing method further comprises: obtaining a defrosting instruction for defrosting the first application program; detecting whether the biological characteristic information in the thawing instruction is matched with a preset biological characteristic; and when the biological characteristic information in the thawing instruction is matched with the preset biological characteristic, thawing the first application program.
That is, when the first application program needs to be thawed after being frozen, a thawing instruction input by the user needs to be acquired. The defrosting instruction includes biometric information, wherein the biometric information may be fingerprint information, iris information, voiceprint information, face information, and the like.
It should be noted that different applications may set different biometric information, or may set the same biometric information, and may be set in a user-defined manner according to a user's requirement.
And when the biological characteristic information in the thawing instruction is matched with the preset biological characteristic information, thawing the background application program. During the defrosting operation, a corresponding defrosting strategy can be set according to the freezing strategy, so that the defrosting operation of the first application program can be realized.
In one embodiment, as shown in fig. 8, there is provided an application freezing apparatus comprising:
an obtaining module 810, configured to obtain a first application running on the terminal, and detect whether a second application that is under the same user identity as the first application exists;
a detection module 820, configured to detect whether the second application program is in a normal working state when the second application program exists;
And the freezing module 830 is configured to, when the first application program needs to be frozen, if the second application program is in a normal working state, freeze the first application program by adopting a corresponding preset freezing policy according to the working state in which the second application program is located.
In one embodiment, the obtaining module 810 is further configured to obtain a user identifier assigned to the first application program by the operating system; and when the application programs which share data with the first application program and have the same user identity are present, the application program which can be mutually called with the first application program is taken as a second application program.
In one embodiment, the freezing module 830 is further configured to freeze the first application when the second application is in the foreground running state, and keep the running state of the second application unchanged.
In one embodiment, the freezing module 830 is further configured to obtain all process identifiers under the user identifier; the process identification comprises a process identification of the first application program and a process identification of the second application program; screening out the process identification of the first application program according to the file package name of the first application program; and freezing a background process of the first application program according to the process identification of the first application program.
In one embodiment, the freezing module 830 is further configured to keep the running states of the first application and the second application unchanged when the second application is in a foreground running state and the second application depends on the first application.
In the application freezing device, the acquiring module 810 acquires the first application program running on the terminal, detects whether the second application program under the same user identity as the first application program exists, when the second application program exists, the detecting module 820 detects whether the second application program is in a normal working state, if the second application program is in the normal working state, the freezing module 830 freezes the first application program according to a preset freezing policy when the first application program needs to be frozen, and can realize intelligent freezing operation according to working states of different applications under the same user identity, so that the freezing is ensured not to be abnormal, and the user experience degree is improved.
The above-described division of the individual modules in the application freezing device is for illustration only, and in other embodiments, the application freezing device may be divided into different modules as needed to perform all or part of the functions of the application freezing device.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the application freezing method as described in the embodiments above.
The embodiment of the application also provides a computer program product. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the application freezing method described in the above embodiments.
The embodiment of the application also provides a terminal. As shown in fig. 9, for convenience of explanation, only the portions related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present application. The terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant ), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the terminal as an example of the mobile phone:
fig. 9 is a block diagram of a part of a structure of a mobile phone related to a terminal provided in an embodiment of the present application. Referring to fig. 9, the mobile phone includes: radio Frequency (RF) circuitry 910, memory 920, input unit 930, display unit 940, sensor 950, audio circuitry 960, wireless fidelity (wireless fidelity, wiFi) module 970, processor 980, power source 990, and so forth. It will be appreciated by those skilled in the art that the handset construction shown in fig. 9 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The RF circuit 910 may be configured to receive and send information or receive and send signals during a call, and may receive downlink information of a base station and process the downlink information for the processor 980; the uplink data may be transmitted to the base station. Typically, RF circuitry includes, but is not limited to, antennas, at least one amplifier, transceivers, couplers, low noise amplifiers (Low Noise Amplifier, LNAs), diplexers, and the like. In addition, the RF circuitry 910 may also communicate with networks and other devices via wireless communications. The wireless communications may use any communication standard or protocol including, but not limited to, global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE)), email, short message service (Short Messaging Service, SMS), and the like.
The memory 920 may be used to store software programs and modules, and the processor 980 performs various functional applications and data processing by operating the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for at least one function (such as an application program of a sound playing function, an application program of an image playing function, etc.), and the like; the data storage area may store data (such as audio data, address book, etc.) created according to the use of the cellular phone, etc. In addition, memory 920 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 volatile solid-state storage device.
The input unit 930 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset 900. In particular, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, which may also be referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 931 or thereabout using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a predetermined program. In one embodiment, the touch panel 931 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 980, and can receive commands from the processor 980 and execute them. In addition, the touch panel 931 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 930 may include other input devices 932 in addition to the touch panel 931. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), and the like.
The display unit 940 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941. In one embodiment, the display panel 941 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the touch panel 931 may overlay the display panel 941, and when a touch operation is detected on or near the touch panel 931, the touch operation is transmitted to the processor 980 to determine the type of touch event, and the processor 980 then provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in fig. 9, the touch panel 931 and the display panel 941 are implemented as two separate components for the input and output functions of the mobile phone, in some embodiments, the touch panel 931 may be integrated with the display panel 941 to implement the input and output functions of the mobile phone.
The handset 900 may also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 941 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 941 and/or the backlight when the mobile phone moves to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the acceleration in all directions, the gravity and the direction can be detected when the motion sensor is static, and the motion sensor can be used for identifying the application of the gesture of a mobile phone (such as switching of a transverse screen and a vertical screen), vibration identification related functions (such as a pedometer and knocking) and the like; in addition, the mobile phone can be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor and the like.
Audio circuitry 960, speaker 961, and microphone 962 may provide an audio interface between a user and a cell phone. Audio circuit 960 may transmit the received electrical signal converted from audio data to speaker 961, where it is converted to a sound signal by speaker 961 for output; on the other hand, microphone 962 converts the collected sound signals into electrical signals, which are received by audio circuit 960 and converted into audio data, which are processed by audio data output processor 980, and then transmitted to another mobile phone via RF circuit 910, or the audio data are output to memory 920 for subsequent processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 970, so that wireless broadband Internet access is provided for the user. Although fig. 9 shows a WiFi module 970, it is understood that it is not a necessary component of the handset 900 and may be omitted as desired.
The processor 980 is a control center of the handset, connecting various parts of the entire handset using various interfaces and lines, performing various functions and processing data of the handset by running or executing software programs and/or modules stored in the memory 920, and invoking data stored in the memory 920, thereby performing overall monitoring of the handset. In one embodiment, processor 980 may include one or more processing units. In one embodiment, processor 980 may integrate an application processor and modem, wherein the application processor primarily handles operating systems, user pages, application programs, and the like; the modem primarily handles wireless communications. It will be appreciated that the modem may not be integrated into the processor 980. For example, the processor 980 may integrate an application processor with a baseband processor, which may form a modem with other peripheral chips, etc. The handset 900 further includes a power supply 990 (e.g., a battery) for powering the various components, which may be logically connected to the processor 980 by a power management system, such as for performing charge, discharge, and power management functions by the power management system.
In one embodiment, the handset 900 may also include a camera, bluetooth module, etc.
In the embodiment of the application, the application freezing method described in each embodiment is implemented when the processor included in the mobile phone executes the computer program stored in the memory.
When the computer program running on the processor is executed, intelligent freezing operation can be realized according to the working states of different applications under the same user identity, so that freezing is ensured not to be abnormal, and the user experience is improved.
Any reference to memory, storage, database, or other medium used in the present application may include non-volatile and/or volatile memory. Suitable nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (11)

1. An application freezing method for freezing an application running on a terminal, the method comprising:
acquiring a first application program running on the terminal, and acquiring a user identity identifier allocated to the first application program by an operating system; wherein, each application program is correspondingly provided with a user identity mark; when the application programs which share data with the first application program and have the same user identity are present, the application program which can be mutually called with the first application program is used as a second application program;
detecting whether the second application program is in a normal working state or not when the second application program exists;
when the first application program needs to be frozen, if the second application program is in a normal working state, a corresponding preset freezing strategy is adopted to freeze the first application program according to the working state of the second application program;
And if the second application program is in a normal working state, adopting a corresponding preset freezing strategy to freeze the first application program according to the working state of the second application program, wherein the method comprises the following steps:
if the normal working state of the second application program is in a foreground running state, acquiring all process identifiers under the user identity identifier; the process identification comprises a process identification of the first application program and a process identification of the second application program; and screening out the process identification of the first application program according to the file package name of the first application program, freezing the background process of the first application program according to the process identification of the first application program, and keeping the running state of the second application program unchanged.
2. The method according to claim 1, wherein the method further comprises:
and if the second application program is in an abnormal working state, freezing the first application program and the second application program under the same user identity.
3. The method of claim 1, further comprising, prior to the freezing the first application with the corresponding preset freezing policy according to the operating state of the second application:
Detecting operation information acting on the first application program; the operation information comprises an operation mode and an operation time point;
and determining whether the first application program needs to be frozen at the current moment according to the operation information.
4. A method according to claim 3, wherein said determining from said operation information whether or not the first application program needs to be frozen at the present moment comprises:
acquiring the operation information closest to the current moment, and recording the time interval between the operation time point of the operation information and the current moment;
and when the time interval meets a preset freezing condition, the first application program needs to be frozen.
5. The method as recited in claim 1, further comprising:
obtaining a defrosting instruction for defrosting the first application program;
detecting whether the biological characteristic information in the thawing instruction is matched with a preset biological characteristic;
and when the biological characteristic information in the thawing instruction is matched with the preset biological characteristic, thawing the first application program.
6. An application freezing apparatus, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring a first application program running on a terminal and acquiring a user identity identifier distributed to the first application program by an operating system; wherein, each application program is correspondingly provided with a user identity mark; when the application programs which share data with the first application program and have the same user identity are present, the application program which can be mutually called with the first application program is used as a second application program;
The detection module is used for detecting whether the second application program is in a normal working state or not when the second application program exists;
the freezing module is used for freezing the first application program according to a corresponding preset freezing strategy when the second application program is in a normal working state when the first application program is required to be frozen; if the normal working state of the second application program is in a foreground running state, acquiring all process identifiers under the user identity identifier; the process identification comprises a process identification of the first application program and a process identification of the second application program; screening out the process identification of the first application program according to the file package name of the first application program; and freezing a background process of the first application program according to the process identification of the first application program, and keeping the running state of the second application program unchanged.
7. The apparatus of claim 6, wherein the freezing module is further configured to freeze the first application and the second application under the same user identity if the second application is in an abnormal operating state.
8. The apparatus of claim 6, wherein the freezing module is further configured to detect operational information acting on the first application; the operation information comprises an operation mode and an operation time point; and determining whether the first application program needs to be frozen at the current moment according to the operation information.
9. The apparatus of claim 8, wherein the freezing module is further configured to obtain the operation information closest to a current time, and record a time interval between an operation time point of the operation information and the current time; and when the time interval meets a preset freezing condition, the first application program needs to be frozen.
10. A terminal comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method of any of claims 1 to 5.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
CN201711488951.8A 2017-12-29 2017-12-29 Application freezing method, device, terminal and computer readable storage medium Active CN109992376B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711488951.8A CN109992376B (en) 2017-12-29 2017-12-29 Application freezing method, device, terminal and computer readable storage medium
PCT/CN2018/116717 WO2019128562A1 (en) 2017-12-29 2018-11-21 Application freezing method and apparatus, and terminal and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711488951.8A CN109992376B (en) 2017-12-29 2017-12-29 Application freezing method, device, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109992376A CN109992376A (en) 2019-07-09
CN109992376B true CN109992376B (en) 2023-11-10

Family

ID=67063062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711488951.8A Active CN109992376B (en) 2017-12-29 2017-12-29 Application freezing method, device, terminal and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN109992376B (en)
WO (1) WO2019128562A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111381952B (en) * 2020-03-12 2023-05-12 腾讯科技(深圳)有限公司 Process freezing method, device, terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020964A (en) * 2016-06-30 2016-10-12 宇龙计算机通信科技(深圳)有限公司 Method and device for freezing application, and terminal
CN106250185A (en) * 2016-07-29 2016-12-21 宇龙计算机通信科技(深圳)有限公司 The control method of application program, control device and terminal
CN106648767A (en) * 2016-12-08 2017-05-10 宇龙计算机通信科技(深圳)有限公司 Application freezing method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020964A (en) * 2016-06-30 2016-10-12 宇龙计算机通信科技(深圳)有限公司 Method and device for freezing application, and terminal
CN106250185A (en) * 2016-07-29 2016-12-21 宇龙计算机通信科技(深圳)有限公司 The control method of application program, control device and terminal
CN106648767A (en) * 2016-12-08 2017-05-10 宇龙计算机通信科技(深圳)有限公司 Application freezing method and apparatus

Also Published As

Publication number Publication date
WO2019128562A1 (en) 2019-07-04
CN109992376A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
CN109144232B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN112703714B (en) Application processing method and device, computer equipment and computer readable storage medium
US10956316B2 (en) Method and device for processing reclaimable memory pages, and storage medium
CN110032321B (en) Application processing method and device, electronic equipment and computer readable storage medium
CN110018902B (en) Memory processing method and device, electronic equipment and computer readable storage medium
CN110032266B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
CN109992364B (en) Application freezing method and device, computer equipment and computer readable storage medium
CN108334345B (en) Application processing method and device, readable storage medium and mobile terminal
CN109992380B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992425B (en) Information processing method, information processing device, computer equipment and computer readable storage medium
CN109992309B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992323B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN110032397B (en) Application processing method and device, electronic equipment and computer readable storage medium
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
CN110018885B (en) Application program freezing method and device, storage medium and terminal
CN109992376B (en) Application freezing method, device, terminal and computer readable storage medium
CN109992369B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992360B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN109992363B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN110046033B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109511139B (en) WIFI control method and device, mobile device and computer-readable storage medium
CN109992395B (en) Application freezing method and device, terminal and computer readable storage medium
CN109375995B (en) Application freezing method and device, storage medium and electronic equipment
CN109992322B (en) Application program unloading method and device, storage medium and terminal
CN110045811B (en) Application program processing method and device, electronic equipment and computer readable storage medium

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant