WO2019128562A1 - Application freezing method and apparatus, and terminal and computer-readable storage medium - Google Patents

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

Info

Publication number
WO2019128562A1
WO2019128562A1 PCT/CN2018/116717 CN2018116717W WO2019128562A1 WO 2019128562 A1 WO2019128562 A1 WO 2019128562A1 CN 2018116717 W CN2018116717 W CN 2018116717W WO 2019128562 A1 WO2019128562 A1 WO 2019128562A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
freezing
preset
terminal
frozen
Prior art date
Application number
PCT/CN2018/116717
Other languages
French (fr)
Chinese (zh)
Inventor
陈岩
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019128562A1 publication Critical patent/WO2019128562A1/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
    • 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

Definitions

  • 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.
  • the embodiment of the present application provides an application freezing method, device, terminal, and computer readable storage medium, which can implement an intelligent freezing operation according to working states of different applications under the identity of the same user.
  • An application freezing method for freezing an application running on a terminal comprising:
  • the corresponding preset freezing policy is adopted according to the working state of the second application to the first application. Freeze.
  • An application freezing device includes:
  • An acquiring module configured to acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application;
  • a detecting module configured to detect, when the second application exists, whether the second application is in a normal working state
  • a freezing module configured to: when the second application is in a normal working state, when the first application is required to be frozen, adopt a corresponding preset freezing policy pair according to the working state of the second application The first application is frozen.
  • a terminal comprising a memory and a processor, the memory storing computer readable instructions, the instructions being executed by the processor to cause the processor to perform the steps of the method.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the method.
  • the application freezing method by acquiring the first application running on the terminal, detecting whether there is a second application under the same user identity as the first application
  • the second application When the second application is present, detecting whether the second application is in a normal working state, and when the first application is required to be frozen, if the second application is in a normal working state, according to the The working state in which the second application is located adopts a corresponding preset freezing policy to freeze the first application, and can implement an intelligent freezing operation according to the working state of different applications under the same user identity to ensure that the freezing is not performed. Anomalies occur to improve user experience.
  • FIG. 1 is a schematic diagram showing the internal structure of a terminal in an embodiment
  • FIG. 2 is a partial schematic diagram of a system in a terminal in an embodiment
  • FIG. 3 is a schematic flow chart of an application freezing method in an embodiment
  • FIG. 4 is a schematic flow chart of an application freezing method in another embodiment
  • FIG. 5 is a schematic flow chart of an application freezing method in another embodiment
  • FIG. 6 is a schematic flow chart of an application freezing method in another embodiment
  • FIG. 7 is a schematic flow chart of an application freezing method in another embodiment
  • Figure 8 is a block diagram showing the structure of an application freezing device in an embodiment
  • FIG. 9 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present application.
  • FIG. 1 a schematic diagram of an internal structure of a terminal is provided.
  • the terminal includes a processor, memory, and display connected via a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire terminal.
  • the memory is used to store data, programs, and/or instruction codes, etc., and the memory stores at least one computer program, which can be executed by the processor to implement the application-free application freezing method provided in the embodiments of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random storage memory (Random-Access-Memory, RAM).
  • the memory includes a non-volatile storage medium and an internal memory.
  • Non-volatile storage media stores operating systems, databases, and computer programs.
  • the database stores data related to an application freezing method provided by the foregoing various embodiments, for example, information such as a name of each application or process, an occupied memory size, and the like may be stored.
  • the computer program can be executed 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 operating systems, databases, and computer programs in non-volatile storage media.
  • the display screen can be a touch screen, such as a capacitive screen or an electronic screen, for displaying interface information of an application corresponding to the first process, and can also be used for detecting a touch operation applied to the display screen, and generating corresponding instructions, such as before execution. Switching instructions for background applications, etc.
  • FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied.
  • the specific terminal may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
  • the terminal further includes a network interface connected through a system bus, and the network interface may be an Ethernet card or a wireless network card, etc., for communicating with an external terminal, for example, for communicating with a server.
  • a partial architectural diagram of a terminal is provided.
  • the architecture system of the terminal includes a JAVA spatial layer 210, a local framework layer 220, and a kernel (Kernel) spatial layer 230.
  • the freeze and thaw application 212 can be included on the JAVA spatial layer 210.
  • the freeze and thaw application 212 can be used by the terminal to implement a freeze policy for each application, and freeze the related application of the background power consumption.
  • the resource priority and restriction management module 222 and the platform freeze management module 224 are included in the local framework layer 220.
  • the terminal can maintain different applications in different priorities and different resource organizations through the resource priority and limit management module 222, and adjust the resource group of the application according to the requirements of the upper layer to achieve optimized performance and save power. .
  • the terminal freezes the task that can be frozen in the background by the platform freeze management module 224, and allocates the freeze layer to the preset different levels according to the length of the entry freeze time.
  • the freeze layer may include three, respectively: CPU limit Sleep mode, CPU freeze sleep mode, process deep freeze mode.
  • the CPU restricts the sleep mode to limit the CPU resources occupied by the related processes, so that the related processes occupy less CPU resources, and the free CPU resources are tilted to other unfrozen processes, thereby limiting the occupation of CPU resources.
  • the kernel space layer 230 includes a UID management module 231, a Cgroup module 232, a Binder management module 233, a process memory recovery module 234, and a freeze timeout exit module 235.
  • the UID management module 231 is configured to implement an application-based User Identifier (UID) to manage resources of a third-party application or freeze. Compared with the Process Identifier (PID) for process management and control, it is easier to uniformly manage the resources of a user's application through UID.
  • the Cgroup module 232 is used to provide a complete set of Central Processing Unit (CPU), CPUSET, memory, input/output (I/O), and Net related resource restriction mechanisms.
  • the Binder management module 233 is used to implement the priority control of the background binder communication.
  • the interface module of the local framework layer 220 includes a binder interface developed to the upper layer, and the upper layer framework or application sends a resource restriction or frozen instruction to the resource priority and restriction management module 222 and the platform freeze management module 224 through the provided binder interface.
  • the process memory recovery module 234 is configured to implement the process deep freeze mode, so that when a third-party application is in a frozen state for a long time, the file area of the process is mainly released, thereby saving the memory module and speeding up the application next time. The speed at startup.
  • the freeze timeout exit module 235 is configured to resolve an exception generated by the freeze timeout scenario.
  • an application freeze method for freezing an application running on a terminal. This embodiment is described by applying the method to the terminal shown in FIG. 1 as an example.
  • the application freezing method includes steps 302-306. among them,
  • Step 302 Acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application.
  • the application refers to a computer program for accomplishing one or more specific tasks. It runs in user mode and can interact with the user and has a visual user interface.
  • an Android operating system (Android OS) is taken as an example.
  • each application has a user identification (Uid), and only two applications with the same Uid can share data.
  • Uid user identification
  • application A and application B can be set to the same Uid by setting shared Uid, and application A and application B can call each other during the running process.
  • Data if the application A is not the same as the Uid of the application B, then the application A and the application B cannot call the data arbitrarily. Understandably, in other operating systems, such as IOS, Symbian, etc., the same or corresponding data calling principles exist between different applications.
  • the first application running on the terminal can be a foreground application or a background application.
  • Obtaining the Uid of the first application detecting whether there is a second application that is the same as the Uid of the first application, so that it can determine whether the first application has a mutual calling relationship with another application, and thus can directly determine that the first application is directly frozen. Whether the application will affect other applications.
  • the second application that is the same as the Uid of the first application may exist one or more.
  • the second application may be a foreground application or a background application.
  • Step 304 When the second application exists, detecting whether the second application is in a normal working state.
  • the terminal may detect the process of the second application according to a preset frequency or according to the detected user operation instruction, and obtain the current running state of the second application by detecting the process state of the second application.
  • the running of an application is usually reflected by the operation of multiple related processes.
  • the process involved in the running of the foreground application is the foreground process
  • the process involved in the running of the background application is the background process.
  • the process identifier of the second application may be obtained, where the process identifier is used to uniquely identify the corresponding process, and may be composed of a combination of one or more of a preset number of digits, letters, or other characters.
  • the process ID "0001" can be used to indicate the process A
  • the "1234" is the process B, and the like
  • the process status of the processes identified by the different processes can be detected, so that the second application is working in the background or in the foreground. status.
  • Step 306 When the first application is required to be frozen, if the second application is in a normal working state, the corresponding preset freezing policy is adopted according to the working state of the second application. An application freezes.
  • the normal working state includes, but is not limited to, a foreground running state and a background holding state.
  • the application corresponding to the operation page of the application displayed by the current display interface of the terminal is the foreground application currently running by the terminal.
  • 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.
  • To determine whether the target application is a foreground application obtain a window object corresponding to the target application, and determine whether the window object is located at the top of the stack of the operating system's window stack, and if so, the target application is a foreground application.
  • the application is running in the background as a background application.
  • the foreground application works in the foreground running state
  • the background application works in the background running state;
  • the background holding state refers to an application working in the background running state, but the user has the use requirement for the application, and the application needs to keep the background
  • the running state such as the music player, usually enters other program operation interface after the user starts the music playing. At this time, the music player works in the background to keep the state, and the concert continues to play.
  • the terminal may determine, according to the working state of the first application, whether the first application needs to be frozen. If the first application works in the background running state, and the user does not need to use the first application temporarily, the first application may be frozen. If it is detected that the second application is in a normal working state at this time, since the first application is the same as the Uid of the second application, directly freezing the first application may affect the operation of the second application, and according to the preset freezing policy Freezing the first application ensures that the first application and the second application do not work abnormally.
  • the application freezing method by acquiring the first application running on the terminal, detecting whether there is a second application under the same user identity as the first application, when the second application exists Detecting whether the second application is in a normal working state, and when the first application is required to be frozen, if the second application is in a normal working state, according to the working state of the second application
  • the first application is frozen by adopting a corresponding preset freezing policy, and the intelligent freezing operation can be implemented according to the working state of different applications under the identity of the same user, ensuring that no abnormality occurs during freezing, and the user experience is improved.
  • the detecting whether there is a second application under the same user identity as the first application includes the following steps 402-424. among them,
  • Step 402 Acquire a user identity assigned by the operating system to the first application.
  • the Android operating system assigns each application a Uid with a different common level. If different applications need to call each other, only the Uids of different applications are the same, which makes different applications The shared data between them has certain security. Data cannot be obtained randomly between each application, and each application has only one Uid.
  • the terminal reads the Uid of the first application and determines whether there is a second application that is the same as the Uid of the first application.
  • Step 404 When there is an application that shares data with the first application and has the same user identity, an application that can be called with the first application is used as the second application.
  • the terminal detects whether there is an application that shares data with the first application, and when it detects that another application shares data with the first application, acquires the Uid of the application, if the Uid and the application of the application If the Uid of an application is the same, the application is considered to be a second application that can be called with the first application.
  • This situation often occurs in different applications developed by the same company. For example, if a company makes two products and only wants to call each other, then you can use the shared Uid to force the Uid of the two software to be the same. In this case, you must use a signed document with the company's signature for data sharing. Optionally, it may also be a different application under the Shared Uid of the system's own software.
  • the application freezing method by detecting whether there is a second application that is under the same user identity as the first application, and when the second application is present, may be combined with the running state of the second application for the first application.
  • the program freezes, avoiding the second application from being unable to run normally due to directly freezing the first application, saving memory resources while ensuring that the application is not affected and improving the user experience.
  • the second application detecting whether the second application is in a normal working state, if the second application is in the foreground running state, freezing the first application, and maintaining the second application The running state is unchanged.
  • the first application needs to be frozen, and the second application that is the same as the Uid of the first application is detected to be in the foreground running state, if the first application is directly frozen at this time, the user Uid registered with the first application is the same.
  • the second application B is also frozen based on the user group, so the freeze policy needs to be changed so that other applications that are the same as the user Uid logged in by the background application are no longer frozen based on the user group.
  • the freezing the first application, keeping the running state of the second application unchanged includes steps 502-506. among them,
  • Step 502 Acquire all process identifiers under the user identity.
  • the process identification (Pid) represents the process ID
  • the process (process) is a running activity of the program in the computer on a certain data set, which is the basic unit of the system for resource allocation and scheduling, and is the basis of the operating system structure.
  • the running of an application is usually reflected by the operation of multiple related processes.
  • the process identifier includes a process identifier of the first application and a process identifier of the second application.
  • This embodiment reads all process IDs under the same Uid. For example, when the application "Jingdong” runs, two processes are generated: the first process 12041 and the second process 12607, and the path in the file library /proc/12041/cmdline The file content of the first process is displayed as “com.jingdong.app.mall”, and the file content of the second process is displayed in the path of the file library /proc/12607/cmdline as "com.jingdong.app.mall:jdpush" Both processes contain the package name "com.jingdong.app.mall" of "Jingdong". By obtaining the process related to the package name "com.jingdong.app.mall", you can find the application "Jingdong” at runtime. All processes.
  • Step 504 Filter out the process identifier of the first application according to the file package name of the first application.
  • the file package name of the application is recorded in the file library, and the file package name of different applications can be queried by reading the file package name in the file library.
  • the path containing the "package name: process" form can be read by the path kernel /proc/pid/cmdline.
  • the process identifier containing only the first application file package name can be filtered, thereby obtaining the process identifier of the first application.
  • Step 506 Freeze the background process of the first application according to the process identifier of the first application.
  • the background process of the first application may be frozen according to the process identifier of the first application, for example, all /proc/pid/cmdline pids containing the first application package name are frozen.
  • the related process of the first application is frozen by freezing the process without affecting the running state of the second application that is the same as the Uid of the first application.
  • the second application during the freezing of the first application, detecting whether the second application is in a normal working state, if the second application is in a foreground running state, and the second application is dependent on the first application , keeping the running state of the first application and the second application unchanged.
  • the dependency representation indicates that an application needs to utilize data of another application or multiple applications in order to smoothly implement the relationship of execution of the one application.
  • the first application is dependent by the second application under the same Uid, the first application and the second application are not frozen.
  • the application A depends on the application B, or the application B is dependent on the application A, that is, the application A needs to utilize the data of the application B to implement the execution of the application A.
  • the application A is the second application that depends on, and application B is the first application.
  • the dependent application may also be the first application, and the second application may be the background application.
  • the terminal can detect from the background application collection to query whether there is an application that is dependent on the first application.
  • the freezing of the first application detecting whether the second application is in a normal working state, and if the second application is in an abnormal working state, freezing when the first application needs to be frozen
  • the first application and the second application under the same user identity.
  • the application freezing method when the second application is in the foreground running state, freezes the first application, and keeps the running state of the second application unchanged; if the second application is in the foreground Running state, and the second application keeps the running state of the first application and the second application unchanged when the first application depends on the first application; if the second application is in an abnormal working state, the first application needs to be frozen When the program is frozen, the first application and the second application under the same user identity are frozen. It can intelligently combine the working states of different applications under the same user identity to achieve the freezing method of the application, increase the freezing range, and better optimize the system resources.
  • Step 602 Detect operation information acting on the first application; the operation information includes an operation mode and an operation time point.
  • the application When the application is opened on the terminal, the application will listen to the operation information input by the user.
  • the operation information includes the operation mode and operation time point input by the user.
  • the operation mode includes at least an input operation mode such as a button, a voice, a touch, a fingerprint, and a scan.
  • the current input operation time point is also obtained.
  • an application when an application is opened, it monitors all input information of the user, such as voice, touch, and other input modes, when the user is using the application, and also records the input corresponding to the current input mode. Time point, such as voice input - 20:00: 00; touch input - 20:00: 01 and so on.
  • Step 604 Determine, according to the operation information, whether the current time needs to freeze the first application.
  • Each application corresponds to one or more freeze conditions, and the corresponding freeze condition can be determined according to the operation mode of receiving the user input.
  • the operation mode corresponds to a freeze condition.
  • the freeze condition corresponding to the touch operation mode is the first freeze condition
  • the freeze condition corresponding to the voice operation mode is the second freeze condition
  • the freeze condition corresponding to the scan operation mode is The third freezing condition and so on. That is, each operation mode that each application can reach can correspond to a freeze condition.
  • the freezing condition is a time condition, and a time freezing condition corresponding to each operation mode may be set, and the time freezing condition may be understood to be that when a certain operation information is not monitored within the preset time period, the time freezing condition is considered to be satisfied. .
  • the operation mode of each application is different, and the freezing conditions corresponding to the same operation mode of different applications may be the same or different.
  • the preset mapping relationship according to the operation information of the monitoring, it can be determined whether the current application needs to freeze the first application.
  • the determining, according to the operation information, whether the current time needs to freeze the first application includes the following steps 702-704. among them,
  • Step 702 Acquire the operation information that is closest to the current time, and record the time interval of the operation time point of the operation information from the current time.
  • the terminal monitors the operation information input by the user, and the operation mode includes at least an input operation mode such as a button, a voice, a touch, a fingerprint, and a scan.
  • the operation information input by the user is received, the current input operation time point is also obtained.
  • the latest operation information may be operation information corresponding to the operation time point of the shortest time interval between the current time and the operation information input by the user from the start of the current application.
  • the terminal will obtain the operation information (operation mode and operation time point) that was last monitored from the current time (20:30:00). If the latest operation information is used, the operation mode For the touch operation mode, the operation time point is 20:20:00, and the time interval from the current time can be obtained, and the time interval is 10 minutes.
  • Step 704 When the time interval meets the preset freeze condition, the first application needs to be frozen.
  • the preset freeze condition may be a time condition, and each application runs in the foreground with a different historical running time, and the operation mode of receiving the user input may also be different, and the corresponding freezing condition may be set for each application.
  • the first application works in the foreground running state, and the freezing condition can be divided according to the received operation mode. If the first application does not hear the touch operation within the first preset duration, the first freezing is satisfied.
  • the first preset duration is related to the frequency of use in the historical operation record, and when the first preset duration is greater than a preset multiple of the usage frequency of the touch operation mode (120 times/minute), it may be determined that Within a preset duration, the touch operation mode will not be generated again, and it can be determined that the user is not currently using the first application currently running, and the first application needs to be frozen.
  • the second freezing condition is met.
  • the second preset duration is related to the frequency of use in the historical operation record.
  • the second preset duration is greater than the preset multiple of the voice operation mode (1 time/5 minutes), it may be determined that the second During the preset duration, the voice operation mode will not be generated again, indicating that the user is not currently using the first application currently running, and the first application needs to be frozen.
  • first preset duration and the second preset duration may be set according to user requirements, and are not further limited herein.
  • the preset freeze condition may further include detecting whether there is a user, and when the time interval satisfies the preset freeze condition, it may be determined that the user does not operate the application, and the terminal detects the current Whether the visible area of the terminal is a face image can determine whether there is a user in front of the current terminal.
  • the visible area can be understood as the area where the user can normally use the terminal, and can also be understood as the distance between the user and the terminal, which is the comfortable distance of the user using the terminal.
  • the face recognition technology can be used to detect whether a person exists before the terminal.
  • Face recognition is a biometric recognition technology based on human facial feature information for identification. Using a camera or camera (front camera) to capture an image or video stream containing a face image, and automatically detect and track the face image in the image, and then perform a series of related techniques on the face of the detected face image, usually Also known as portrait recognition, face recognition. If the face image is recognized by the terminal, it indicates that the user is viewing the display area of the terminal, but the user does not operate the terminal; if there is no face image, it indicates that no user is currently using the terminal, and the user can freeze the An application. When there is no face image, it indicates that the current user has been away from the terminal, and the currently running first application can be frozen to save power.
  • the application freezing method further includes: obtaining a defrosting instruction for thawing the first application; detecting whether biometric information in the defrosting instruction matches a preset biometric; When the biometric information in the thawing instruction matches the preset biometric, the first application is thawed.
  • the defrosting command includes biometric information, wherein the biometric information may be fingerprint information, iris information, voiceprint information, facial information, and the like.
  • the background application is thawed.
  • the defrosting operation of the first application may also be implemented according to the freezing strategy to set the corresponding defrosting strategy.
  • FIGS. 3-7 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-7 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
  • an application freeze device includes an acquisition module 810, a detection module 820, and a freeze module 830. among them,
  • the obtaining module 810 is configured to acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application.
  • the detecting module 820 is configured to detect, when the second application is present, whether the second application is in a normal working state
  • the freezing module 830 is configured to: when the second application is in a normal working state, when the first application is required to be frozen, adopt a corresponding preset freezing policy pair according to the working state of the second application The first application freezes.
  • the obtaining module 810 is further configured to acquire a user identity assigned by the operating system to the first application; when there is an application that shares data with the first application and has the same user identity An application that can be called with the first application as a second application.
  • the freezing module 830 is further configured to freeze the first application when the second application is in a foreground running state, and keep the running state of the second application unchanged.
  • the freezing module 830 is further configured to acquire all process identifiers under the user identity; the process identifier includes a process identifier of the first application and a process identifier of the second application; according to the first application
  • the file package name filters out the process identifier of the first application; and freezes the background process of the first application according to the process identifier of the first application.
  • the freezing module 830 is further configured to: when the second application is in a foreground running state, and the second application is dependent on the first application, keep the first application and the first The running status of the application is unchanged.
  • the application freezing device acquires the first application running on the terminal by the obtaining module 810, and detects whether there is a second application under the same user identity as the first application, when the second application exists.
  • the detecting module 820 detects whether the second application is in a normal working state. If the second application is in a normal working state, when the first application needs to be frozen, the freezing module 830 is configured according to the preset.
  • the freeze policy freezes the first application, and implements an intelligent freeze operation according to the working status of different applications under the identity of the same user, ensuring that no abnormality occurs during freezing, and the user experience is improved.
  • each module in the application freezing device is for illustrative purposes only. In other embodiments, the application freezing device may be divided into different modules as needed to complete all or part of the functions of the application freezing device.
  • the embodiment of the present 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 processor to perform as in the various embodiments described above The application freeze method described.
  • the embodiment of the present application also provides a computer program product.
  • a computer program product comprising instructions that, when run on a computer, cause the computer to perform the application freeze method described in the various embodiments above.
  • the embodiment of the present application further provides a terminal.
  • a terminal As shown in FIG. 9 , for the convenience of description, only the parts related to the embodiments of the present application are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment 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 terminal is a mobile phone as an example:
  • FIG. 9 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present application.
  • the mobile phone includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, and a processor 980. And power supply 990 and other components.
  • RF radio frequency
  • the RF circuit 910 can be used for receiving and transmitting signals during the transmission and reception of information or during a call.
  • the downlink information of the base station can be received and processed by the processor 980.
  • the uplink data can also be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • RF circuitry 910 can also communicate with the network and other devices via wireless communication.
  • the above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General
  • the memory 920 can be used to store software programs and modules, and the processor 980 executes various functional applications and data processing of the mobile phone by running 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, an application required for at least one function (such as an application of a sound playing function, an application of an image playing function, etc.);
  • the data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone.
  • memory 920 can include high speed random access memory, and can 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 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset 900.
  • the input unit 930 may include a touch panel 931 and other input devices 932.
  • the touch panel 931 also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 931 or near the touch panel 931. Operation) and drive the corresponding connection device according to a preset program.
  • the touch panel 931 can include two portions of a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 980 is provided and can receive commands from the processor 980 and execute them.
  • the touch panel 931 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 930 may also include other input devices 932.
  • other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.).
  • the display unit 940 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 940 can include a display panel 941.
  • the display panel 941 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 931 can cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, the touch panel 931 transmits to the processor 980 to determine the type of the touch event, and then the processor 980 is The type of touch event provides a corresponding visual output on display panel 941.
  • touch panel 931 and the display panel 941 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 9, in some embodiments, the touch panel 931 and the display panel 941 may be integrated. Realize the input and output functions of the phone.
  • the handset 900 can also include at least one type of sensor 950, such as a light sensor, motion sensor, and other sensors.
  • 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 the ambient light, and the proximity sensor may close the display panel 941 and/or when the mobile phone moves to the ear. Or backlight.
  • the motion sensor may include an acceleration sensor, and the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
  • the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
  • Audio circuitry 960, speaker 961, and microphone 962 can provide an audio interface between the user and the handset.
  • the audio circuit 960 can transmit the converted electrical data of the received audio data to the speaker 961, and convert it into a sound signal output by the speaker 961.
  • the microphone 962 converts the collected sound signal into an electrical signal, and the audio circuit 960 After receiving, it is converted into audio data, and after being processed by the audio data output processor 980, it can be sent to another mobile phone via the RF circuit 910, or the audio data can be output to the memory 920 for subsequent processing.
  • WiFi is a short-range wireless transmission technology
  • the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 970, which provides users with wireless broadband Internet access.
  • FIG. 9 shows the WiFi module 970, it can be understood that it does not belong to the essential configuration of the mobile phone 900 and can be omitted as needed.
  • the processor 980 is the control center of the handset, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 920, and invoking data stored in the memory 920, executing The phone's various functions and processing data, so that the overall monitoring of the phone.
  • processor 980 can include one or more processing units.
  • processor 980 can integrate an application processor and a modem, where the application processor primarily processes an operating system, user pages, applications, and the like; the modem primarily processes wireless communications. It will be appreciated that the above described modems may also not be integrated into the processor 980.
  • the processor 980 can integrate an application processor and a baseband processor, and the baseband processor and other peripheral chips can form a modem.
  • the mobile phone 900 also includes a power source 990 (such as a battery) that supplies power to various components.
  • the power source can be logically coupled to the processor 980 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the handset 900 can also include a camera, a Bluetooth module, and the like.
  • the processor included in the mobile phone implements the application freezing method described in the foregoing embodiments when executing a computer program stored in the memory.
  • the intelligent freezing operation can be implemented according to the working state of different applications under the identity of the same user, ensuring that no abnormality occurs during freezing, and the user experience is improved.
  • Non-volatile 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 an external cache.
  • RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM Link (Synchlink) DRAM
  • SLDRAM Memory Bus
  • Rambus Direct RAM
  • RDRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

The present application relates to an application freezing method and apparatus, and a terminal and a computer-readable storage medium. The method comprises: acquiring a first application program running on a terminal, and detecting whether there is a second application program under the same user identity identifier as the first application program; when there is a second application program, detecting whether the second application program is in a normal operation state; and when the first application program needs to be frozen, if the second application program is in the normal operation state, according to the operation state of the second application program, using a corresponding pre-set freezing policy to freeze the first application program.

Description

应用冻结方法、装置、终端及计算机可读存储介质Application freezing method, device, terminal and computer readable storage medium
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年12月29日提交中国专利局、申请号为CN 201711488951.8、申请名称为“应用冻结方法、装置、终端及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on Dec. 29, 2017, the Chinese Patent Application No. CN 201711488951.8, the application name is "application freezing method, device, terminal and computer readable storage medium", the entire contents thereof This is incorporated herein by reference.
技术领域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 technique
随着移动通信技术的发展,移动操作系统中往往都提供了对应用的进程进行资源限制的方法。为了避免不需要的应用在后台运行、或未被用户合理使用的应用在前台运行,占用系统内存、消耗终端设备的电量,一般会冻结不需要或未被用户合理使用的应用。当多个应用存在相关联的用户标识时,若冻结该用户标识下的一个应用,则该用户标识下的所有应用都会被冻结,这样可能导致正在处于前台运行或其他正常工作状态的应用无法正常工作,影响用户体验。With the development of mobile communication technologies, mobile operating systems often provide methods for resource limitation of application processes. In order to prevent unwanted applications from running in the background, or applications that are not reasonably used by users, running in the foreground, occupying system memory and consuming power of terminal devices, applications that are not needed or are not reasonably used by users are generally frozen. When an application has an associated user ID, if an application under the user ID is frozen, all applications under the user ID will be frozen, which may cause the application that is in the foreground or other normal working state to be abnormal. Work, affecting the user experience.
发明内容Summary of the invention
本申请实施例提供一种应用冻结方法、装置、终端及计算机可读存储介质,能够根据同一用户身份标识下的不同应用的工作状态实现智能化的冻结操作。The embodiment of the present application provides an application freezing method, device, terminal, and computer readable storage medium, which can implement an intelligent freezing operation according to working states of different applications under the identity of the same user.
一种应用冻结方法,用于冻结终端上运行的应用程序,所述方法包括:An application freezing method for freezing an application running on a terminal, the method comprising:
获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序;Obtaining, by the first application running on the terminal, detecting whether there is a second application that is under the same user identity as the first application;
当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态;Detecting whether the second application is in a normal working state when the second application is present;
在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结。When the first application is required to be frozen, if the second application is in a normal working state, the corresponding preset freezing policy is adopted according to the working state of the second application to the first application. Freeze.
一种应用冻结装置,包括:An application freezing device includes:
获取模块,用于获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序;An acquiring module, configured to acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application;
检测模块,用于当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态;a detecting module, configured to detect, when the second application exists, whether the second application is in a normal working state;
冻结模块,用于在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结。a freezing module, configured to: when the second application is in a normal working state, when the first application is required to be frozen, adopt a corresponding preset freezing policy pair according to the working state of the second application The first application is frozen.
一种终端,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行所述的方法的步骤。A terminal comprising a memory and a processor, the memory storing computer readable instructions, the instructions being executed by the processor to cause the processor to perform the steps of the method.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现所述的方法的步骤。A computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of the method.
上述应用冻结方法、装置、终端及计算机可读存储介质,通过获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序,当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态,在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结,能够根据同一用户身份标识下的不同应用的工作状态实现智能化的冻结操作,保证冻结不出现异常,提升用户体验度。The application freezing method, the device, the terminal, and the computer readable storage medium, by acquiring the first application running on the terminal, detecting whether there is a second application under the same user identity as the first application When the second application is present, detecting whether the second application is in a normal working state, and when the first application is required to be frozen, if the second application is in a normal working state, according to the The working state in which the second application is located adopts a corresponding preset freezing policy to freeze the first application, and can implement an intelligent freezing operation according to the working state of different applications under the same user identity to ensure that the freezing is not performed. Anomalies occur to improve user experience.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为一个实施例中终端的内部结构示意图;1 is a schematic diagram showing the internal structure of a terminal in an embodiment;
图2为一个实施例中终端中的系统的部分框架示意图;2 is a partial schematic diagram of a system in a terminal in an embodiment;
图3为一个实施例中应用冻结方法的流程示意图;3 is a schematic flow chart of an application freezing method in an embodiment;
图4为另一个实施例中应用冻结方法的流程示意图;4 is a schematic flow chart of an application freezing method in another embodiment;
图5为另一个实施例中应用冻结方法的流程示意图;5 is a schematic flow chart of an application freezing method in another embodiment;
图6为另一个实施例中应用冻结方法的流程示意图;6 is a schematic flow chart of an application freezing method in another embodiment;
图7为另一个实施例中应用冻结方法的流程示意图;7 is a schematic flow chart of an application freezing method in another embodiment;
图8为一个实施例中应用冻结装置的结构框图;Figure 8 is a block diagram showing the structure of an application freezing device in an embodiment;
图9为与本申请实施例提供的终端相关的手机的部分结构的框图。FIG. 9 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在限制本申请。可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一应用程序称为第二应用程序,且类似地,可将第二进应用程序为第一应用程序。第一应用程序和第二应用程序两者都是应用程序,但其不是同一应用程序。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 invention applies, unless otherwise defined. The terminology used herein is for the purpose of describing particular embodiments, and is not intended to be limiting. It will be understood that the terms "first", "second" and the like, 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. For example, the first application may be referred to as a second application without departing from the scope of the present application, and similarly, the second incoming application may be the first application. Both the first application and the second application are applications, but they are not the same application.
在一个实施例中,如图1所示,提供了一种终端的内部结构示意图。该终端包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个终端的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于终端的应用冻结方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统、数据库和计算机程序。该数据库中存储有用于实现以上各个实施例所提供的一种应用冻结方法相关的数据,比如可存储有每个应用或进程的名称、占用内存大小等信息。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种应用冻结方法。内存储器为非易失性存储介质中的操作系统、数据库和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示第一进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。In one embodiment, as shown in FIG. 1, a schematic diagram of an internal structure of a terminal is provided. The terminal includes a processor, memory, and display connected via a system bus. The processor is used to provide computing and control capabilities to support the operation of the entire terminal. The memory is used to store data, programs, and/or instruction codes, etc., and the memory stores at least one computer program, which can be executed by the processor to implement the application-free application freezing method provided in the embodiments of the present application. The memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random storage memory (Random-Access-Memory, RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. Non-volatile storage media stores operating systems, databases, and computer programs. The database stores data related to an application freezing method provided by the foregoing various embodiments, for example, information such as a name of each application or process, an occupied memory size, and the like may be stored. The computer program can be executed 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 operating systems, databases, and computer programs in non-volatile storage media. The display screen can be a touch screen, such as a capacitive screen or an electronic screen, for displaying interface information of an application corresponding to the first process, and can also be used for detecting a touch operation applied to the display screen, and generating corresponding instructions, such as before execution. Switching instructions for background applications, etc.
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的 部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体的终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该终端还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用于与外部的终端进行通信,比如可用于同服务器进行通信。A person skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal to which the solution of the present application is applied. The specific terminal may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements. For example, the terminal further includes a network interface connected through a system bus, and the network interface may be an Ethernet card or a wireless network card, etc., for communicating with an external terminal, for example, for communicating with a server.
在一个实施例中,如图2所示,提供了一种终端的部分架构图。其中,该终端的架构系统中包括JAVA空间层210、本地框架层220以及内核(Kernel)空间层230。JAVA空间层210上可包含冻结和解冻应用212,终端可通过该冻结和解冻应用212来实现对各个应用的冻结策略,对后台耗电的相关应用做冻结操作。本地框架层220中包含资源优先级和限制管理模块222和平台冻结管理模块224。终端可通过资源优先级和限制管理模块222实时维护不同的应用处于不同优先级和不同资源的组织中,并根据上层的需求来调整应用程序的资源组别从而达到优化性能,节省功耗的作用。终端可通过平台冻结管理模块224将后台可以冻结的任务按照进入冻结时间的长短,分配到对应预设的不同层次的冻结层,可选地,该冻结层可包括三个,分别是:CPU限制睡眠模式、CPU冻结睡眠模式、进程深度冻结模式。其中,CPU限制睡眠模式是指对相关进程所占用的CPU资源进行限制,使相关进程占用较少的CPU资源,将空余的CPU资源向其它未被冻结的进程倾斜,限制了对CPU资源的占用,也相应限制了进程对网络资源以及I/O接口资源的占用;CPU冻结睡眠模式是指禁止相关进程使用CPU,而保留对内存的占用,当禁止使用CPU资源时,相应的网络资源以及I/O接口资源也被禁止使用;进程深度冻结模式是指除禁止使用CPU资源之外,进一步对相关进程所占用的内存资源进行回收,回收的内存可供其它进程使用。内核空间层230中包括UID管理模块231、Cgroup模块232、Binder管控模块233、进程内存回收模块234以及冻结超时退出模块235。其中,UID管理模块231用于实现基于应用的用户身份标识(User Identifier,UID)来管理第三方应用的资源或进行冻结。相比较于基于进程身份标识(Process Identifier,PID)来进行进程管控,通过UID更便于统一管理一个用户的应用的资源。Cgroup模块232用于提供一套完善的中央处理器(Central Processing Unit,CPU)、CPUSET、内存(memory)、输入/输出(input/output,I/O)和Net相关的资源限制机制。Binder管控模块233用于实现后台binder通信的优先级的控制。其中,本地框架层220的接口模块包含开发给上层的binder接口,上层的框架或者应用通过提供的binder接口来发送资源限制或者冻结的指令给资源优先级和限制管理模块222和平台冻结管理模块224。进程内存 回收模块234用于实现进程深度冻结模式,这样能当某个第三方应用长期处于冻结状态的时候,会主要释放掉进程的文件区,从而达到节省内存的模块,也加快该应用在下次启动时的速度。冻结超时退出模块235用于解决出现冻结超时场景产生的异常。通过上述的架构,可实现本申请各个实施例中的应用冻结方法。In one embodiment, as shown in FIG. 2, a partial architectural diagram of a terminal is provided. The architecture system of the terminal includes a JAVA spatial layer 210, a local framework layer 220, and a kernel (Kernel) spatial layer 230. The freeze and thaw application 212 can be included on the JAVA spatial layer 210. The freeze and thaw application 212 can be used by the terminal to implement a freeze policy for each application, and freeze the related application of the background power consumption. The resource priority and restriction management module 222 and the platform freeze management module 224 are included in the local framework layer 220. The terminal can maintain different applications in different priorities and different resource organizations through the resource priority and limit management module 222, and adjust the resource group of the application according to the requirements of the upper layer to achieve optimized performance and save power. . The terminal freezes the task that can be frozen in the background by the platform freeze management module 224, and allocates the freeze layer to the preset different levels according to the length of the entry freeze time. Optionally, the freeze layer may include three, respectively: CPU limit Sleep mode, CPU freeze sleep mode, process deep freeze mode. The CPU restricts the sleep mode to limit the CPU resources occupied by the related processes, so that the related processes occupy less CPU resources, and the free CPU resources are tilted to other unfrozen processes, thereby limiting the occupation of CPU resources. It also limits the occupation of network resources and I/O interface resources by the process; CPU freeze sleep mode refers to prohibiting related processes from using the CPU, while preserving the occupation of memory, when prohibiting the use of CPU resources, the corresponding network resources and I The /O interface resource is also forbidden; the process deep freeze mode means that in addition to prohibiting the use of CPU resources, the memory resources occupied by the related processes are 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 recovery module 234, and a freeze timeout exit module 235. The UID management module 231 is configured to implement an application-based User Identifier (UID) to manage resources of a third-party application or freeze. Compared with the Process Identifier (PID) for process management and control, it is easier to uniformly manage the resources of a user's application through UID. The Cgroup module 232 is used to provide a complete set of Central Processing Unit (CPU), CPUSET, memory, input/output (I/O), and Net related resource restriction mechanisms. The Binder management module 233 is used to implement the priority control of the background binder communication. The interface module of the local framework layer 220 includes a binder interface developed to the upper layer, and the upper layer framework or application sends a resource restriction or frozen instruction to the resource priority and restriction management module 222 and the platform freeze management module 224 through the provided binder interface. . The process memory recovery module 234 is configured to implement the process deep freeze mode, so that when a third-party application is in a frozen state for a long time, the file area of the process is mainly released, thereby saving the memory module and speeding up the application next time. The speed at startup. The freeze timeout exit module 235 is configured to resolve an exception generated by the freeze timeout scenario. Through the above architecture, the application freezing method in various embodiments of the present application can be implemented.
在一个实施例中,如图3所示,提供了一种应用冻结方法,用于冻结终端上运行的应用程序。本实施例以该方法应用于如图1所示的终端为例进行说明。该应用冻结方法,包括步骤302-步骤306。其中,In one embodiment, as shown in FIG. 3, an application freeze method is provided for freezing an application running on a terminal. This embodiment is described by applying the method to the terminal shown in FIG. 1 as an example. The application freezing method includes steps 302-306. among them,
步骤302:获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序。Step 302: Acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application.
其中,应用程序(Application,APP)指为完成某项或多项特定工作的计算机程序,它运行在用户模式,可以和用户进行交互,具有可视的用户界面。本实施例以安卓操作系统(Android OS)为例,在安卓操作系统中,每个应用程序都有一个用户身份标识(User identification,Uid),只有Uid相同的两个应用程序才可以共享数据。例如,为了共享两个不同应用程序的数据,通过设置shared Uid(共享Uid)可以将应用程序A和应用程序B设置为同一Uid,则应用程序A和应用程序B在运行的过程中可以互相调用数据,若反之,应用程序A与应用程序B的Uid不相同,则应用程序A与应用程序B不能随意调用数据。可以理解的是,在其他操作系统中,例如IOS、Symbian等,不同应用程序之间也有相同或相应的数据调用原则。The application (Application, APP) refers to a computer program for accomplishing one or more specific tasks. It runs in user mode and can interact with the user and has a visual user interface. In this embodiment, an Android operating system (Android OS) is taken as an example. In the Android operating system, each application has a user identification (Uid), and only two applications with the same Uid can share data. For example, in order to share data of two different applications, application A and application B can be set to the same Uid by setting shared Uid, and application A and application B can call each other during the running process. Data, if the application A is not the same as the Uid of the application B, then the application A and the application B cannot call the data arbitrarily. Understandably, in other operating systems, such as IOS, Symbian, etc., the same or corresponding data calling principles exist between different applications.
终端上运行的第一应用程序可以是前台应用程序,也可以是后台应用程序。获取第一应用程序的Uid,检测是否存在与该第一应用程序的Uid相同的第二应用程序,从而可以判断第一应用程序是否与其他应用程序存在相互调用关系,进而可以判断直接冻结第一应用程序是否会对其他应用程序产生影响。可以理解,与第一应用程序的Uid相同的第二应用程序可以存在一个或多个,同样的,第二应用程序可以是前台应用程序,也可以是后台应用程序。The first application running on the terminal can be a foreground application or a background application. Obtaining the Uid of the first application, detecting whether there is a second application that is the same as the Uid of the first application, so that it can determine whether the first application has a mutual calling relationship with another application, and thus can directly determine that the first application is directly frozen. Whether the application will affect other applications. It can be understood that the second application that is the same as the Uid of the first application may exist one or more. Similarly, the second application may be a foreground application or a background application.
步骤304:当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态。Step 304: When the second application exists, detecting whether the second application is in a normal working state.
若存在与第一应用程序的Uid相同的第二应用程序,则表示第一应用程序与其他应用程序存在相互调用的关系,此时若要冻结第一应用程序,需检测与该第一应用程序共享数据的第二应用程序的运行状态,结合第二应用程序的运行状态来对第一应用程序进行冻结。If there is a second application that is the same as the Uid of the first application, it indicates that the first application has a mutual calling relationship with other applications, and if the first application is to be frozen, the first application needs to be detected. The running state of the second application sharing the data is combined with the running state of the second application to freeze the first application.
在一个实施例中,终端可以按照预设的频率或者根据检测到的用户操作指令来检测第二应用程序的进程,通过检测第二应用程序的进程状态得到第二应用程序的当前运行状态。一个应用程序的运行通常是由相关的多个进程的运行而体现的。前台应用程序运行时涉及的进程即为前台进程,后台应用程序运行时涉及的进程即为后台进程。可选地,可获取第二应用程序的进程标识,进程标识用于唯一标识对应的进程,可由预设位数的数字、字母或者其他字符中的一种或几种的组合所构成。比如,可以以进程标识“0001”表示进程A,以“1234”表示进程B等,检测不同进程标识的进程所处的运行状态,从而可以知道第二应用程序是工作在后台运行状态还是前台运行状态。In an embodiment, the terminal may detect the process of the second application according to a preset frequency or according to the detected user operation instruction, and obtain the current running state of the second application by detecting the process state of the second application. The running of an application is usually reflected by the operation of multiple related processes. The process involved in the running of the foreground application is the foreground process, and the process involved in the running of the background application is the background process. Optionally, the process identifier of the second application may be obtained, where the process identifier is used to uniquely identify the corresponding process, and may be composed of a combination of one or more of a preset number of digits, letters, or other characters. For example, the process ID "0001" can be used to indicate the process A, the "1234" is the process B, and the like, and the process status of the processes identified by the different processes can be detected, so that the second application is working in the background or in the foreground. status.
步骤306:在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结。Step 306: When the first application is required to be frozen, if the second application is in a normal working state, the corresponding preset freezing policy is adopted according to the working state of the second application. An application freezes.
其中,正常工作状态包括但不限于前台运行状态、后台保持状态。具体地,终端当前的显示界面展示的应用程序的操作页面对应的应用程序为终端当前运行的前台应用程序。在本实施例中,只有输入焦点对应的应用程序才是前台应用程序,或者,只有位于操作系统的窗口栈的栈顶的窗口对象对应的应用程序才是终端当前对应的前台应用程序。要确定目标应用程序是否为前台应用程序,获取与目标应用程序对应的窗口对象,并判断该窗口对象是否位于操作系统的窗口栈的栈顶,若是,则说明该目标应用程序为前台应用程序,若否,则说明该应用程序在后台运行,为后台应用程序。前台应用程序工作在前台运行状态,后台应用程序工作在后台运行状态;后台保持状态指的是一个应用程序工作在后台运行状态,但用户对该应用程序有使用需求,需要该应用程序保持着后台运行状态,例如音乐播放器,通常用户开启音乐播放后会进入其他程序操作界面,此时音乐播放器工作在后台保持状态,音乐会继续播放。The normal working state includes, but is not limited to, a foreground running state and a background holding state. Specifically, the application corresponding to the operation page of the application displayed by the current display interface of the terminal is the foreground application currently running 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. To determine whether the target application is a foreground application, obtain a window object corresponding to the target application, and determine whether the window object is located at the top of the stack of the operating system's window stack, and if so, the target application is a foreground application. If not, the application is running in the background as a background application. The foreground application works in the foreground running state, the background application works in the background running state; the background holding state refers to an application working in the background running state, but the user has the use requirement for the application, and the application needs to keep the background The running state, such as the music player, usually enters other program operation interface after the user starts the music playing. At this time, the music player works in the background to keep the state, and the concert continues to play.
终端可以根据第一应用程序的工作状态判断是否需要冻结第一应用程序,若第一应用程序工作在后台运行状态,且用户暂时不需要使用第一应用程序时,可以将第一应用程序冻结,若此时检测到第二应用程序处于正常工作状态,由于第一应用程序与第二应用程序的Uid相同,直接冻结第一应用程序会影响第二应用程序的运行,此时根据预设冻结策略对第一应用程序进行冻结,可以保证第一应用程序和第二应用程序的工作不出现异常。The terminal may determine, according to the working state of the first application, whether the first application needs to be frozen. If the first application works in the background running state, and the user does not need to use the first application temporarily, the first application may be frozen. If it is detected that the second application is in a normal working state at this time, since the first application is the same as the Uid of the second application, directly freezing the first application may affect the operation of the second application, and according to the preset freezing policy Freezing the first application ensures that the first application and the second application do not work abnormally.
上述应用冻结方法,通过获取在所述终端上运行的第一应用程序,检测是否 存在与所述第一应用程序处于同一用户身份标识下的第二应用程序,当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态,在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结,能够根据同一用户身份标识下的不同应用的工作状态实现智能化的冻结操作,保证冻结不出现异常,提升用户体验度。The application freezing method, by acquiring the first application running on the terminal, detecting whether there is a second application under the same user identity as the first application, when the second application exists Detecting whether the second application is in a normal working state, and when the first application is required to be frozen, if the second application is in a normal working state, according to the working state of the second application The first application is frozen by adopting a corresponding preset freezing policy, and the intelligent freezing operation can be implemented according to the working state of different applications under the identity of the same user, ensuring that no abnormality occurs during freezing, and the user experience is improved.
在一个实施例中,如图4所示,所述检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序,包括以下步骤402-步骤404。其中,In one embodiment, as shown in FIG. 4, the detecting whether there is a second application under the same user identity as the first application includes the following steps 402-424. among them,
步骤402:获取操作系统分配给所述第一应用程序的用户身份标识。Step 402: Acquire a user identity assigned by the operating system to the first application.
默认情况下,安卓操作系统会给每个应用程序分配一个普通级别互不相同的Uid,如果不同应用程序需要互相调用,只能是不同应用程序的Uid相同才行,这就使得不同应用程序之间的共享数据具有了一定安全性,每个应用程序之间是不能随意获得数据的,并且每个应用程序对应只有一个Uid。终端读取第一应用程序的Uid,判断是否存在与第一应用程序的Uid相同的第二应用程序。By default, the Android operating system assigns each application a Uid with a different common level. If different applications need to call each other, only the Uids of different applications are the same, which makes different applications The shared data between them has certain security. Data cannot be obtained randomly between each application, and each application has only one Uid. The terminal reads the Uid of the first application and determines whether there is a second application that is the same as the Uid of the first application.
步骤404:当存在与所述第一应用程序有共享数据、并且用户身份标识相同的应用程序时,将能够与所述第一应用程序相互调用的应用程序作为第二应用程序。Step 404: When there is an application that shares data with the first application and has the same user identity, an application that can be called with the first application is used as the second application.
进一步地,终端检测是否存在与第一应用程序有共享数据的应用程序,当检测到有其他应用程序与第一应用程序共享数据时,获取该应用程序的Uid,若该应用程序的Uid与第一应用程序的Uid相同,则认为该应用程序是能够与第一应用程序相互调用的第二应用程序。这样的情况多出现于同一公司研发的不同应用中,例如一个公司做了两个产品,只想这两个产品之间可互相调用,那么可以使用shared Uid将两个软件的Uid强制设置为一样的,这种情况下必须使用具有该公司签名的签名文档才能进行数据共享。可选地,还可以是系统自带软件的Shared Uid下的不同应用。Further, the terminal detects whether there is an application that shares data with the first application, and when it detects that another application shares data with the first application, acquires the Uid of the application, if the Uid and the application of the application If the Uid of an application is the same, the application is considered to be a second application that can be called with the first application. This situation often occurs in different applications developed by the same company. For example, if a company makes two products and only wants to call each other, then you can use the shared Uid to force the Uid of the two software to be the same. In this case, you must use a signed document with the company's signature for data sharing. Optionally, it may also be a different application under the Shared Uid of the system's own software.
上述应用冻结方法,通过检测是否存在与第一应用程序处于同一用户身份标识下的第二应用程序,当存在所述第二应用程序时,可以结合第二应用程序的运行状态来对于第一应用程序进行冻结,避免了由于直接冻结第一应用程序而导致第二应用程序无法正常运行,在节省内存资源的同时保证应用程序的运行不受影响,提升用户体验。The application freezing method, by detecting whether there is a second application that is under the same user identity as the first application, and when the second application is present, may be combined with the running state of the second application for the first application. The program freezes, avoiding the second application from being unable to run normally due to directly freezing the first application, saving memory resources while ensuring that the application is not affected and improving the user experience.
在一个实施例中,对第一应用程序进行冻结的过程中,检测第二应用程序是 否处于正常工作状态,若第二应用程序处于前台运行状态,则冻结第一应用程序,保持第二应用程序的运行状态不变。当需要冻结第一应用程序,且检测到与第一应用程序的Uid相同的第二应用程序处于前台运行状态,若此时直接冻结第一应用程序,与第一应用程序登录的用户Uid相同的第二应用程序B也会基于用户组冻结,因此需要改变冻结策略,使得与后台应用登录的用户Uid相同的其他应用不再基于用户组冻结。In an embodiment, during the freezing of the first application, detecting whether the second application is in a normal working state, if the second application is in the foreground running state, freezing the first application, and maintaining the second application The running state is unchanged. When the first application needs to be frozen, and the second application that is the same as the Uid of the first application is detected to be in the foreground running state, if the first application is directly frozen at this time, the user Uid registered with the first application is the same. The second application B is also frozen based on the user group, so the freeze policy needs to be changed so that other applications that are the same as the user Uid logged in by the background application are no longer frozen based on the user group.
具体地,如图5所示,所述冻结所述第一应用程序,保持所述第二应用程序的运行状态不变,包括步骤502-步骤506。其中,Specifically, as shown in FIG. 5, the freezing the first application, keeping the running state of the second application unchanged, includes steps 502-506. among them,
步骤502:获取所述用户身份标识下的所有进程标识。Step 502: Acquire all process identifiers under the user identity.
其中,进程标识(Process identification;Pid)表示进程ID,进程(process)是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。一个应用的运行通常是由相关的多个进程的运行而体现的。进程标识包括第一应用程序的进程标识和第二应用程序的进程标识。The process identification (Pid) represents the process ID, and the process (process) is a running activity of the program in the computer on a certain data set, which is the basic unit of the system for resource allocation and scheduling, and is the basis of the operating system structure. . The running of an application is usually reflected by the operation of multiple related processes. The process identifier includes a process identifier of the first application and a process identifier of the second application.
本实施例读取同一Uid下的所有进程标识,举例说明,应用程序“京东”运行时产生了两个进程:第一进程12041与第二进程12607,在文件库/proc/12041/cmdline的路径中显示第一进程的文件内容为“com.jingdong.app.mall”,在文件库/proc/12607/cmdline的路径中显示第二进程的文件内容为“com.jingdong.app.mall:jdpush”,两个进程都包含“京东”的包名“com.jingdong.app.mall”,通过获取包名“com.jingdong.app.mall”相关的进程就能找到应用程序“京东”在运行时的所有进程。This embodiment reads all process IDs under the same Uid. For example, when the application "Jingdong" runs, two processes are generated: the first process 12041 and the second process 12607, and the path in the file library /proc/12041/cmdline The file content of the first process is displayed as "com.jingdong.app.mall", and the file content of the second process is displayed in the path of the file library /proc/12607/cmdline as "com.jingdong.app.mall:jdpush" Both processes contain the package name "com.jingdong.app.mall" of "Jingdong". By obtaining the process related to the package name "com.jingdong.app.mall", you can find the application "Jingdong" at runtime. All processes.
步骤504:根据第一应用程序的文件包名筛选出所述第一应用程序的进程标识。Step 504: Filter out the process identifier of the first application according to the file package name of the first application.
应用程序的文件包名记录在文件库中,通过读取文件库中文件包名可查询到不同应用程序的文件包名。例如通过路径内核/proc/pid/cmdline可读取到包含“包名:进程”形式的文件。根据第一应用程序的文件包名可以筛选出只包含第一应用程序文件包名的进程标识,从而得到第一应用程序的进程标识。The file package name of the application is recorded in the file library, and the file package name of different applications can be queried by reading the file package name in the file library. For example, the path containing the "package name: process" form can be read by the path kernel /proc/pid/cmdline. According to the file package name of the first application, the process identifier containing only the first application file package name can be filtered, thereby obtaining the process identifier of the first application.
步骤506:根据所述第一应用程序的进程标识冻结所述第一应用程序的后台进程。Step 506: Freeze the background process of the first application according to the process identifier of the first application.
具体地,获取第一应用程序的进程标识后,可以根据第一应用程序的进程标识冻结第一应用程序的后台进程,例如冻结所有/proc/pid/cmdline包含第一应用 程序包名的pid。通过冻结进程的方式冻结了第一应用程序的相关进程,而不影响与第一应用程序的Uid相同的第二应用程序的运行状态。Specifically, after obtaining the process identifier of the first application, the background process of the first application may be frozen according to the process identifier of the first application, for example, all /proc/pid/cmdline pids containing the first application package name are frozen. The related process of the first application is frozen by freezing the process without affecting the running state of the second application that is the same as the Uid of the first application.
在一个实施例中,对第一应用程序进行冻结的过程中,检测第二应用程序是否处于正常工作状态,若第二应用程序处于前台运行状态、且第二应用程序依赖于第一应用程序时,保持第一应用程序和第二应用程序的运行状态不变。In an embodiment, during the freezing of the first application, detecting whether the second application is in a normal working state, if the second application is in a foreground running state, and the second application is dependent on the first application , keeping the running state of the first application and the second application unchanged.
其中,依赖表示表示一个应用程序需要利用于另一个或多个应用程序的数据才能顺利实现对该一个应用程序的执行的关系。存在依赖关系的两个应用程序,分别为被依赖的应用程序和依赖的应用程序,终端将检测出的将被第一应用程序依赖的后台应用程序作为第二应用程序。当第一应用程序被同一Uid下的第二应用程序依赖时,不对第一应用程序和第二应用程序进行冻结。Among them, the dependency representation indicates that an application needs to utilize data of another application or multiple applications in order to smoothly implement the relationship of execution of the one application. There are two applications with dependencies, namely the dependent application and the dependent application, and the terminal will detect the background application to be used by the first application as the second application. When the first application is dependent by the second application under the same Uid, the first application and the second application are not frozen.
举例来说,应用程序A依赖于应用程序B,或应用程序B被应用程序A依赖,即表示应用程序A需要利用应用程序B的数据才能实现对该应用程序A的执行,此时,应用程序A即为依赖的第二应用程序,应用程序B即为第一应用程序。可以理解地,依赖的应用程序还可能为第一应用程序,第二应用程序可能为后台应用程序。终端可从后台应用程序集合中进行检测,以查询出是否存在被第一应用程序依赖的应用程序。For example, the application A depends on the application B, or the application B is dependent on the application A, that is, the application A needs to utilize the data of the application B to implement the execution of the application A. At this time, the application A is the second application that depends on, and application B is the first application. Understandably, the dependent application may also be the first application, and the second application may be the background application. The terminal can detect from the background application collection to query whether there is an application that is dependent on the first application.
在一个实施例中,对第一应用程序进行冻结的过程中,检测第二应用程序是否处于正常工作状态,若第二应用程序处于非正常工作状态,则在需要冻结第一应用程序时,冻结处于同一用户身份标识下的第一应用程序和第二应用程序。In an embodiment, during the freezing of the first application, detecting whether the second application is in a normal working state, and if the second application is in an abnormal working state, freezing when the first application needs to be frozen The first application and the second application under the same user identity.
本实施例提供的应用冻结方法,当所述第二应用程序处于前台运行状态时,冻结所述第一应用程序,保持所述第二应用程序的运行状态不变;若第二应用程序处于前台运行状态、且第二应用程序依赖于第一应用程序时,保持第一应用程序和第二应用程序的运行状态不变;若第二应用程序处于非正常工作状态,则在需要冻结第一应用程序时,冻结处于同一用户身份标识下的第一应用程序和第二应用程序。能够智能化的结合处于同一用户身份标识下的不同应用的工作状态来实现对应用的冻结方式,增加了冻结范围,更好地优化系统资源。The application freezing method provided by the embodiment, when the second application is in the foreground running state, freezes the first application, and keeps the running state of the second application unchanged; if the second application is in the foreground Running state, and the second application keeps the running state of the first application and the second application unchanged when the first application depends on the first application; if the second application is in an abnormal working state, the first application needs to be frozen When the program is frozen, the first application and the second application under the same user identity are frozen. It can intelligently combine the working states of different applications under the same user identity to achieve the freezing method of the application, increase the freezing range, and better optimize the system resources.
在一个实施例中,如图6所示,在所述根据预设冻结策略对所述第一应用程序进行冻结之前,还包括以下步骤602-步骤604。其中,In an embodiment, as shown in FIG. 6, before the freezing of the first application according to the preset freeze policy, the following steps 602-604 are further included. among them,
步骤602:检测作用于所述第一应用程序的操作信息;所述操作信息包括操作方式和操作时间点。Step 602: Detect operation information acting on the first application; the operation information includes an operation mode and an operation time point.
当终端上开启应用程序时,应用程序会监听到用户输入的操作信息。需要说 明的是,该操作信息包括用户输入的操作方式和操作时间点。其中,操作方式至少包括按键、语音、触摸、指纹、扫描等输入操作方式。同时,当接收到用户输入的操作信息时,也会获取当前输入的操作时间点。例如,当一个应用程序开启时,其监听到用户在使用该应用程序时,所接收到用户的所有输入信息,例如语音、触摸等不同操作方式的输入,同时也会记录当前输入方式对应的输入时间点,如语音输入--20:00:00;触摸输入--20:00:01等。When the application is opened on the terminal, the application will listen to the operation information input by the user. It should be noted that the operation information includes the operation mode and operation time point input by the user. The operation mode includes at least an input operation mode such as a button, a voice, a touch, a fingerprint, and a scan. At the same time, when the operation information input by the user is received, the current input operation time point is also obtained. For example, when an application is opened, it monitors all input information of the user, such as voice, touch, and other input modes, when the user is using the application, and also records the input corresponding to the current input mode. Time point, such as voice input - 20:00: 00; touch input - 20:00: 01 and so on.
步骤604:根据所述操作信息确定当前时刻是否需要冻结所述第一应用程序。Step 604: Determine, according to the operation information, whether the current time needs to freeze the first application.
每个应用程序都对应一种或多种冻结条件,其对应的冻结条件可以根据接收用户输入的操作方式来决定。其中,可以设定,一个操作方式对应一个冻结条件,例如,触摸操作方式对应的冻结条件为第一冻结条件,语音操作方式对应的冻结条件为第二冻结条件,扫描操作方式对应的冻结条件为第三冻结条件等等。也即,每个应用可以到的每一种操作方式都可以对应一种冻结条件。Each application corresponds to one or more freeze conditions, and the corresponding freeze condition can be determined according to the operation mode of receiving the user input. The operation mode corresponds to a freeze condition. For example, the freeze condition corresponding to the touch operation mode is the first freeze condition, the freeze condition corresponding to the voice operation mode is the second freeze condition, and the freeze condition corresponding to the scan operation mode is The third freezing condition and so on. That is, each operation mode that each application can reach can correspond to a freeze condition.
进一步的,冻结条件为时间条件,可以设定每个操作方式对应的时间冻结条件,该时间冻结条件可以理解为当预设时长内未监听到某一操作信息时,则认为满足该时间冻结条件。Further, the freezing condition is a time condition, and a time freezing condition corresponding to each operation mode may be set, and the time freezing condition may be understood to be that when a certain operation information is not monitored within the preset time period, the time freezing condition is considered to be satisfied. .
需要说明的是,每个应用的操作方式不同,其不同应用的同种操作方式对应的冻结条件可能相同,也可能不同。It should be noted that the operation mode of each application is different, and the freezing conditions corresponding to the same operation mode of different applications may be the same or different.
根据预先设定的映射关系,根据监听的操作信息就可以判断当前时刻是否需要对第一应用程序进行冻结操作。According to the preset mapping relationship, according to the operation information of the monitoring, it can be determined whether the current application needs to freeze the first application.
在一个实施例中,如图7所示,所述根据所述操作信息确定当前时刻是否需要冻结所述第一应用程序,包括以下步骤702-步骤704。其中,In an embodiment, as shown in FIG. 7, the determining, according to the operation information, whether the current time needs to freeze the first application includes the following steps 702-704. among them,
步骤702:获取距离当前时刻最近的所述操作信息,并记录所述操作信息的操作时间点距离当前时刻的时间间隔。Step 702: Acquire the operation information that is closest to the current time, and record the time interval of the operation time point of the operation information from the current time.
当终端上的应用程序运行时,终端会监听到用户输入的操作信息,其中,操作方式至少包括按键、语音、触摸、指纹、扫描等输入操作方式。同时,当接收到用户输入的操作信息时,也会获取当前输入的操作时间点。When the application on the terminal is running, the terminal monitors the operation information input by the user, and the operation mode includes at least an input operation mode such as a button, a voice, a touch, a fingerprint, and a scan. At the same time, when the operation information input by the user is received, the current input operation time point is also obtained.
其中,最近的操作信息可以为应用程序从本次启动开始,所有的接收用户输入的操作信息中,与当前时刻的时间间隔最短的操作时间点所对应的操作信息。The latest operation information may be operation information corresponding to the operation time point of the shortest time interval between the current time and the operation information input by the user from the start of the current application.
若当前时刻为晚上20:30:00,此时终端的前台正在运行第一应用程序,用户在使用第一应用程序的过程中,会对该应用程序的显示页面进行操作,终端会实时监听用户输入的操作信息。在当前时刻(20:30:00),终端会获取距离当前时刻 (20:30:00)最近一次监听到的操作信息(操作方式和操作时间点),若该最近的操作信息中,操作方式为触摸操作方式,操作时间点为20:20:00,则可以获取距离当前时刻的时间间隔,该时间间隔为10分钟。If the current time is 20:30:00 in the evening, the foreground application of the terminal is running the first application, and the user operates the display page of the application during the process of using the first application, and the terminal monitors the user in real time. Input operation information. At the current time (20:30:00), the terminal will obtain the operation information (operation mode and operation time point) that was last monitored from the current time (20:30:00). If the latest operation information is used, the operation mode For the touch operation mode, the operation time point is 20:20:00, and the time interval from the current time can be obtained, and the time interval is 10 minutes.
步骤704:当所述时间间隔满足预设冻结条件时,则需要冻结所述第一应用程序。Step 704: When the time interval meets the preset freeze condition, the first application needs to be frozen.
具体地,预设冻结条件可以是时间条件,每个应用在前台运行的历史运行时长不同,其接收用户输入的操作方式也可能不同,可以针对每个应用来设定对应的冻结条件。例如,第一应用程序工作在前台运行状态,其冻结条件可以根据接收的操作方式来进行划分,若第一应用程序在第一预设时长内未监听到触摸操作时,则满足该第一冻结条件;其中,第一预设时长与历史操作记录中的使用频率相关,当第一预设时长大于触摸操作方式的使用频率(120次/分钟)的预设倍数时,则可以认定,在第一预设时长内,该触摸操作方式不会再产生,可以认定用户当前未使用当前正在运行的第一应用程序,需要冻结该第一应用程序。Specifically, the preset freeze condition may be a time condition, and each application runs in the foreground with a different historical running time, and the operation mode of receiving the user input may also be different, and the corresponding freezing condition may be set for each application. For example, the first application works in the foreground running state, and the freezing condition can be divided according to the received operation mode. If the first application does not hear the touch operation within the first preset duration, the first freezing is satisfied. a condition, wherein the first preset duration is related to the frequency of use in the historical operation record, and when the first preset duration is greater than a preset multiple of the usage frequency of the touch operation mode (120 times/minute), it may be determined that Within a preset duration, the touch operation mode will not be generated again, and it can be determined that the user is not currently using the first application currently running, and the first application needs to be frozen.
可选地,当第一应用程序工作在前台运行状态时,若在第二预设时长内未监听到语音操作时,则满足该第二冻结条件。其中,第二预设时长与历史操作记录中的使用频率相关,当第二预设时长大于语音操作方式的使用频率(1次/5分钟)的预设倍数时,则可以认定,在第二预设时长内,该语音操作方式不会再产生,表明认定用户当前未使用当前正在运行的第一应用程序,需要冻结该第一应用程序。Optionally, when the first application works in the foreground running state, if the voice operation is not monitored within the second preset duration, the second freezing condition is met. The second preset duration is related to the frequency of use in the historical operation record. When the second preset duration is greater than the preset multiple of the voice operation mode (1 time/5 minutes), it may be determined that the second During the preset duration, the voice operation mode will not be generated again, indicating that the user is not currently using the first application currently running, and the first application needs to be frozen.
需要说明的是,第一预设时长、第二预设时长可以根据用户的需求来设定,在此不做进一步的限定。It should be noted that the first preset duration and the second preset duration may be set according to user requirements, and are not further limited herein.
在一个实施例中,预设冻结条件还可以进一步包括检测是否存在用户,当时间间隔满足该预设冻结条件时,即可认定,此时用户未对该应用程序进行操作,通过终端来检测当前终端的可视区域是否人脸图像就可以判断当前终端前是否存在用户。其中,可视区域可以理解为,用户可以正常使用终端的区域,也可以理解为用户与终端之间的距离,该距离为用户使用终端的舒适距离。In an embodiment, the preset freeze condition may further include detecting whether there is a user, and when the time interval satisfies the preset freeze condition, it may be determined that the user does not operate the application, and the terminal detects the current Whether the visible area of the terminal is a face image can determine whether there is a user in front of the current terminal. The visible area can be understood as the area where the user can normally use the terminal, and can also be understood as the distance between the user and the terminal, which is the comfortable distance of the user using the terminal.
具体的,可以通过人脸识别技术来检测终端前是否存在人。人脸识别,是基于人的脸部特征信息进行身份识别的一种生物识别技术。用摄像机或摄像头(前置摄像头)采集含有人脸图像的图像或视频流,并自动在图像中检测和跟踪人脸图像,进而对检测到的人脸图像进行脸部的一系列相关技术,通常也叫做人像识别、面部识别。通过终端处理,若识别出人脸图像,则表明用户正在观看终端的 显示区域,只是该用户未对终端进行操作;若不存在人脸图像,则表明当前没有用户在使用终端,可以冻结该第一应用程序。当不存在人脸图像时,表明当前用户已远离该终端,当前正在运行的第一应用程序可以冻结,以节省功耗。Specifically, the face recognition technology can be used to detect whether a person exists before the terminal. Face recognition is a biometric recognition technology based on human facial feature information for identification. Using a camera or camera (front camera) to capture an image or video stream containing a face image, and automatically detect and track the face image in the image, and then perform a series of related techniques on the face of the detected face image, usually Also known as portrait recognition, face recognition. If the face image is recognized by the terminal, it indicates that the user is viewing the display area of the terminal, but the user does not operate the terminal; if there is no face image, it indicates that no user is currently using the terminal, and the user can freeze the An application. When there is no face image, it indicates that the current user has been away from the terminal, and the currently running first application can be frozen to save power.
在一个实施例中,该应用冻结方法还包括:获取对所述第一应用程序进行解冻的解冻指令;检测所述解冻指令中的生物特征信息是否与预设的生物特征相匹配;当所述解冻指令中的生物特征信息与预设的生物特征相匹配时,对所述第一应用程序进行解冻操作。In one embodiment, the application freezing method further includes: obtaining a defrosting instruction for thawing the first application; detecting whether biometric information in the defrosting instruction matches a preset biometric; When the biometric information in the thawing instruction matches the preset biometric, the first application is thawed.
也即,当第一应用程序被冻结后,需要对第一应用程序进行解冻处理时,需要获取用户输入的解冻指令。解冻指令中包括生物特征信息,其中,生物特征信息可以为指纹信息、虹膜信息、声纹信息、面部信息等等。That is, when the first application is required to be thawed after the first application is frozen, it is necessary to acquire a thaw instruction input by the user. The defrosting command includes biometric information, wherein the biometric information may be fingerprint information, iris information, voiceprint information, facial information, and the like.
需要说明的是,不同的应用可以设定不同的生物特征信息,也可以设定相同的生物特征信息,可以根据用户的需求进行自定义设置。It should be noted that different applications can set different biometric information, and can also set the same biometric information, and can be customized according to the needs of the user.
当解冻指令中的生物特征信息与预设的生物特征信息相匹配时,则对后台应用程序进行解冻操作。解冻操作时,也可以根据与冻结策略来设定相应的解冻策略,实现对第一应用程序的解冻操作。When the biometric information in the thaw instruction matches the preset biometric information, the background application is thawed. During the thawing operation, the defrosting operation of the first application may also be implemented according to the freezing strategy to set the corresponding defrosting strategy.
应该理解的是,虽然图3-7的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-7中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowcharts of FIGS. 3-7 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 3-7 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
在一个实施例中,如图8所示,提供了一种应用冻结装置,该装置包括获取模块810、检测模块820和冻结模块830。其中,In one embodiment, as shown in FIG. 8, an application freeze device is provided that includes an acquisition module 810, a detection module 820, and a freeze module 830. among them,
获取模块810,用于获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序;The obtaining module 810 is configured to acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application.
检测模块820,用于当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态;The detecting module 820 is configured to detect, when the second application is present, whether the second application is in a normal working state;
冻结模块830,用于在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结。The freezing module 830 is configured to: when the second application is in a normal working state, when the first application is required to be frozen, adopt a corresponding preset freezing policy pair according to the working state of the second application The first application freezes.
在一个实施例中,获取模块810还用于获取操作系统分配给所述第一应用程序的用户身份标识;当存在与所述第一应用程序有共享数据、并且用户身份标识相同的应用程序时,将能够与所述第一应用程序相互调用的应用程序作为第二应用程序。In an embodiment, the obtaining module 810 is further configured to acquire a user identity assigned by the operating system to the first application; when there is an application that shares data with the first application and has the same user identity An application that can be called with the first application as a second application.
在一个实施例中,冻结模块830还用于当所述第二应用程序处于前台运行状态时,冻结所述第一应用程序,保持所述第二应用程序的运行状态不变。In an embodiment, the freezing module 830 is further configured to freeze the first application when the second application is in a foreground running state, and keep the running state of the second application unchanged.
在一个实施例中,冻结模块830还用于获取所述用户身份标识下的所有进程标识;所述进程标识包括第一应用程序的进程标识和第二应用程序的进程标识;根据第一应用程序的文件包名筛选出所述第一应用程序的进程标识;根据所述第一应用程序的进程标识冻结所述第一应用程序的后台进程。In an embodiment, the freezing module 830 is further configured to acquire all process identifiers under the user identity; the process identifier includes a process identifier of the first application and a process identifier of the second application; according to the first application The file package name filters out the process identifier of the first application; and freezes the background process of the first application according to the process identifier of the first application.
在一个实施例中,冻结模块830还用于当所述第二应用程序处于前台运行状态、且所述第二应用程序依赖于所述第一应用程序时,保持所述第一应用程序和第二应用程序的运行状态不变。In an embodiment, the freezing module 830 is further configured to: when the second application is in a foreground running state, and the second application is dependent on the first application, keep the first application and the first The running status of the application is unchanged.
上述应用冻结装置,通过获取模块810获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序,当存在所述第二应用程序时,检测模块820检测所述第二应用程序是否处于正常工作状态,若所述第二应用程序处于正常工作状态,则在需要冻结所述第一应用程序时,冻结模块830根据预设冻结策略对所述第一应用程序进行冻结,能够根据同一用户身份标识下的不同应用的工作状态实现智能化的冻结操作,保证冻结不出现异常,提升用户体验度。The application freezing device acquires the first application running on the terminal by the obtaining module 810, and detects whether there is a second application under the same user identity as the first application, when the second application exists. When the application is in use, the detecting module 820 detects whether the second application is in a normal working state. If the second application is in a normal working state, when the first application needs to be frozen, the freezing module 830 is configured according to the preset. The freeze policy freezes the first application, and implements an intelligent freeze operation according to the working status of different applications under the identity of the same user, ensuring that no abnormality occurs during freezing, and the user experience is improved.
上述应用冻结装置中各个模块的划分仅用于举例说明,在其他实施例中,可将应用冻结装置按照需要划分为不同的模块,以完成上述应用冻结装置的全部或部分功能。The division of each module in the application freezing device is for illustrative purposes only. In other embodiments, the application freezing device may be divided into different modules as needed to complete all or part of the functions of the application freezing device.
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行如上述各实施例中所描述的应用冻结方法。The embodiment of the present 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 processor to perform as in the various embodiments described above The application freeze method described.
本申请实施例还提供了一种计算机程序产品。一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各实施例中所描述的应用冻结方法。The embodiment of the present application also provides a computer program product. A computer program product comprising instructions that, when run on a computer, cause the computer to perform the application freeze method described in the various embodiments above.
本申请实施例还提供了一种终端。如图9所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备,以终端为手机为例:The embodiment of the present application further provides a terminal. As shown in FIG. 9 , for the convenience of description, only the parts related to the embodiments of the present application are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment 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 terminal is a mobile phone as an example:
图9为与本申请实施例提供的终端相关的手机的部分结构的框图。参考图9,手机包括:射频(Radio Frequency,RF)电路910、存储器920、输入单元930、显示单元940、传感器950、音频电路960、无线保真(wireless fidelity,WiFi)模块970、处理器980、以及电源990等部件。本领域技术人员可以理解,图9所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 9 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present application. Referring to FIG. 9, the mobile phone includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, and a processor 980. And power supply 990 and other components. It will be understood by those skilled in the art that the structure of the handset shown in FIG. 9 does not constitute a limitation to the handset, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
其中,RF电路910可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器980处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路910还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 910 can be used for receiving and transmitting signals during the transmission and reception of information or during a call. The downlink information of the base station can be received and processed by the processor 980. The uplink data can also be sent to the base station. Generally, RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 910 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.
存储器920可用于存储软件程序以及模块,处理器980通过运行存储在存储器920的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器920可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器920可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 920 can be used to store software programs and modules, and the processor 980 executes various functional applications and data processing of the mobile phone by running 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, an application required for at least one function (such as an application of a sound playing function, an application of an image playing function, etc.); The data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone. Moreover, memory 920 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
输入单元930可用于接收输入的数字或字符信息,以及产生与手机900 的用户设置以及功能控制有关的键信号输入。具体地,输入单元930可包括触控面板931以及其他输入设备932。触控面板931,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板931上或在触控面板931附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板931可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器980,并能接收处理器980发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板931。除了触控面板931,输入单元930还可以包括其他输入设备932。具体地,其他输入设备932可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。The input unit 930 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset 900. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 931 or near the touch panel 931. Operation) and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 931 can include two portions of a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information. The processor 980 is provided and can receive commands from the processor 980 and execute them. In addition, the touch panel 931 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 931, the input unit 930 may also include other input devices 932. Specifically, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.).
显示单元940可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元940可包括显示面板941。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板941。在一个实施例中,触控面板931可覆盖显示面板941,当触控面板931检测到在其上或附近的触摸操作后,传送给处理器980以确定触摸事件的类型,随后处理器980根据触摸事件的类型在显示面板941上提供相应的视觉输出。虽然在图9中,触控面板931与显示面板941是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板931与显示面板941集成而实现手机的输入和输出功能。The display unit 940 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone. The display unit 940 can include a display panel 941. In one embodiment, the display panel 941 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. In one embodiment, the touch panel 931 can cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, the touch panel 931 transmits to the processor 980 to determine the type of the touch event, and then the processor 980 is The type of touch event provides a corresponding visual output on display panel 941. Although the touch panel 931 and the display panel 941 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 9, in some embodiments, the touch panel 931 and the display panel 941 may be integrated. Realize the input and output functions of the phone.
手机900还可包括至少一种传感器950,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板941的亮度,接近传感器可在手机移动到耳边时,关闭显示面板941和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。The handset 900 can also include at least one type of 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 the ambient light, and the proximity sensor may close the display panel 941 and/or when the mobile phone moves to the ear. Or backlight. The motion sensor may include an acceleration sensor, and the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
音频电路960、扬声器961和传声器962可提供用户与手机之间的音频接口。音频电路960可将接收到的音频数据转换后的电信号,传输到扬声器961,由扬声器961转换为声音信号输出;另一方面,传声器962将收集的声音信号转换为电信号,由音频电路960接收后转换为音频数据,再将音频数据输出处理器980处理后,经RF电路910可以发送给另一手机,或者将音频数据输出至存储器920以便后续处理。 Audio circuitry 960, speaker 961, and microphone 962 can provide an audio interface between the user and the handset. The audio circuit 960 can transmit the converted electrical data of the received audio data to the speaker 961, and convert it into a sound signal output by the speaker 961. On the other hand, the microphone 962 converts the collected sound signal into an electrical signal, and the audio circuit 960 After receiving, it is converted into audio data, and after being processed by the audio data output processor 980, it can be sent to another mobile phone via the RF circuit 910, or the audio data can be output to the memory 920 for subsequent processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块970可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图9示出了WiFi模块970,但是可以理解的是,其并不属于手机900的必须构成,可以根据需要而省略。WiFi is a short-range wireless transmission technology, and the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 970, which provides users with wireless broadband Internet access. Although FIG. 9 shows the WiFi module 970, it can be understood that it does not belong to the essential configuration of the mobile phone 900 and can be omitted as needed.
处理器980是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器920内的软件程序和/或模块,以及调用存储在存储器920内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器980可包括一个或多个处理单元。在一个实施例中,处理器980可集成应用处理器和调制解调器,其中,应用处理器主要处理操作系统、用户页面和应用程序等;调制解调器主要处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器980中。比如,该处理器980可集成应用处理器和基带处理器,基带处理器与和其它外围芯片等可组成调制解调器。手机900还包括给各个部件供电的电源990(比如电池),优选的,电源可以通过电源管理系统与处理器980逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The processor 980 is the control center of the handset, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 920, and invoking data stored in the memory 920, executing The phone's various functions and processing data, so that the overall monitoring of the phone. In one embodiment, processor 980 can include one or more processing units. In one embodiment, processor 980 can integrate an application processor and a modem, where the application processor primarily processes an operating system, user pages, applications, and the like; the modem primarily processes wireless communications. It will be appreciated that the above described modems may also not be integrated into the processor 980. For example, the processor 980 can integrate an application processor and a baseband processor, and the baseband processor and other peripheral chips can form a modem. The mobile phone 900 also includes a power source 990 (such as a battery) that supplies power to various components. Preferably, the power source can be logically coupled to the processor 980 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
在一个实施例中,手机900还可以包括摄像头、蓝牙模块等。In one embodiment, the handset 900 can also include a camera, a Bluetooth module, and the like.
在本申请实施例中,该手机所包括的处理器执行存储在存储器上的计算机程序时实现上述各实施例中所描述的应用冻结方法。In the embodiment of the present application, the processor included in the mobile phone implements the application freezing method described in the foregoing embodiments when executing a computer program stored in the memory.
在处理器上运行的计算机程序的执行时,能够根据同一用户身份标识下的不同应用的工作状态实现智能化的冻结操作,保证冻结不出现异常,提升用户体验度。When the computer program running on the processor is executed, the intelligent freezing operation can be implemented according to the working state of different applications under the identity of the same user, ensuring that no abnormality occurs during freezing, and the user experience is improved.
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作 外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database or other medium used herein may include non-volatile and/or volatile memory. Suitable non-volatile memories 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 an external cache. 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), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization. Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the claims. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (16)

  1. 一种应用冻结方法,用于冻结终端上运行的应用程序,所述方法包括:An application freezing method for freezing an application running on a terminal, the method comprising:
    获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序;Obtaining, by the first application running on the terminal, detecting whether there is a second application that is under the same user identity as the first application;
    当存在所述第二应用程序时,检测所述第二应用程序是否处于正常工作状态;Detecting whether the second application is in a normal working state when the second application is present;
    在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结。When the first application is required to be frozen, if the second application is in a normal working state, the corresponding preset freezing policy is adopted according to the working state of the second application to the first application. Freeze.
  2. 根据权利要求1所述的方法,其中,所述检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序,包括:The method of claim 1, wherein the detecting whether there is a second application under the same user identity as the first application comprises:
    获取操作系统分配给所述第一应用程序的用户身份标识;其中,每个应用程序对应有一个用户身份标识;Obtaining a user identity assigned by the operating system to the first application; wherein each application corresponds to a user identity;
    当存在与所述第一应用程序有共享数据、并且用户身份标识相同的应用程序时,将能够与所述第一应用程序相互调用的应用程序作为第二应用程序。When there is an application that shares data with the first application and the user identity is the same, an application that can be called with the first application as a second application.
  3. 根据权利要求1所述的方法,其中,所述根据预设冻结策略对所述第一应用程序进行冻结,包括:The method of claim 1, wherein the freezing the first application according to a preset freeze policy comprises:
    当所述第二应用程序处于前台运行状态时,冻结所述第一应用程序,保持所述第二应用程序的运行状态不变。When the second application is in the foreground running state, the first application is frozen, and the running state of the second application is kept unchanged.
  4. 根据权利要求3所述的方法,其中,所述冻结所述第一应用程序,保持所述第二应用程序的运行状态不变,包括:The method of claim 3, wherein the freezing the first application to keep the running state of the second application unchanged comprises:
    获取所述用户身份标识下的所有进程标识;所述进程标识包括第一应用程序的进程标识和第二应用程序的进程标识;Obtaining, by the process identifier, the process identifier of the first application, and the process identifier of the second application;
    根据第一应用程序的文件包名筛选出所述第一应用程序的进程标识;Filtering out the process identifier of the first application according to the file package name of the first application;
    根据所述第一应用程序的进程标识冻结所述第一应用程序的后台进程。The background process of the first application is frozen according to the process identifier of the first application.
  5. 根据权利要求4所述的方法,其中,所述第一应用程序的文件包名记录在文件库中;其中,通过读取所述文件库中的文件包名以查询到所述第一应用程序的文件包名。The method of claim 4, wherein the file package name of the first application is recorded in a file library; wherein the first application is queried by reading a file package name in the file library The name of the package.
  6. 根据权利要求1所述的方法,其中,在所述根据预设冻结策略对所述第一应用程序进行冻结之前,进一步包括:The method of claim 1, wherein before the freezing of the first application according to the preset freeze policy, the method further comprises:
    检测作用于所述第一应用程序的操作信息;所述操作信息包括操作方式和操作时间点;Detecting operation information acting on the first application; the operation information includes an operation mode and an operation time point;
    根据所述操作信息确定当前时刻是否需要冻结所述第一应用程序。Determining, according to the operation information, whether the current time needs to freeze the first application.
  7. 根据权利要求6所述的方法,其中,所述根据所述操作信息确定当前时刻是否需要冻结所述第一应用程序,包括:The method according to claim 6, wherein the determining, according to the operation information, whether the current time needs to freeze the first application comprises:
    获取距离当前时刻最近的所述操作信息,并记录所述操作信息的操作时间点距离当前时刻的时间间隔;Obtaining the operation information that is closest to the current time, and recording a time interval from the operation time point of the operation information to the current time;
    当所述时间间隔满足预设冻结条件时,则需要冻结所述第一应用程序。When the time interval satisfies a preset freeze condition, the first application needs to be frozen.
  8. 根据权利要求7所述的方法,其中,当所述第一应用程序工作在前台运行状态,若在第一预设时长内未监听到触摸操作时,则满足所述预设冻结条件;其中,所述第一预设时长大于触摸操作方式的使用频率的预设倍数。The method according to claim 7, wherein when the first application is operating in a foreground running state, if the touch operation is not monitored within the first preset duration, the preset freezing condition is satisfied; wherein The first preset duration is greater than a preset multiple of the usage frequency of the touch operation mode.
  9. 根据权利要求7所述的方法,其中,当第一应用程序工作在前台运行状态时,若在第二预设时长内未监听到语音操作时,则满足所述预设冻结条件,其中,所述第二预设时长大于语音操作方式的使用频率的预设倍数。The method according to claim 7, wherein when the first application is operating in the foreground running state, if the voice operation is not monitored within the second preset duration, the preset freezing condition is satisfied, wherein The second preset duration is greater than a preset multiple of the frequency of use of the voice mode of operation.
  10. 根据权利要求7所述的方法,其中,所述方法进一步包括:The method of claim 7 wherein the method further comprises:
    检测终端的可视区域是否存在用户;Detecting whether there is a user in the visible area of the terminal;
    当未存在用户时,满足所述预设冻结条件。The preset freeze condition is satisfied when there is no user.
  11. 根据权利要求1所述的方法,其中,进一步包括:The method of claim 1 further comprising:
    获取对所述第一应用程序进行解冻的解冻指令;Obtaining a thaw instruction for thawing the first application;
    检测所述解冻指令中的生物特征信息是否与预设的生物特征相匹配;Detecting whether biometric information in the thaw instruction matches a preset biometric;
    当所述解冻指令中的生物特征信息与预设的生物特征相匹配时,对所述第一应用程序进行解冻操作。When the biometric information in the thaw instruction matches the preset biometric, the first application is subjected to a thaw operation.
  12. 根据权利要求1所述的方法,其中,进一步包括:The method of claim 1 further comprising:
    当所述第二应用程序处于前台运行状态、且所述第二应用程序依赖于所述第一应用程序时,保持所述第一应用程序和所述第二应用程序的运行状态不变。And maintaining 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 is dependent on the first application.
  13. 根据权利要求1所述的方法,其中,进一步包括:The method of claim 1 further comprising:
    在需要冻结所述第一应用程序时,当所述第二应用程序处于非正常工作状态时,冻结处于同一用户身份标识下的所述第一应用程序和所述第二应用程序。When the first application needs to be frozen, when the second application is in an abnormal working state, the first application and the second application under the same user identity are frozen.
  14. 一种应用冻结装置,包括:An application freezing device includes:
    获取模块,用于获取在所述终端上运行的第一应用程序,检测是否存在与所述第一应用程序处于同一用户身份标识下的第二应用程序;An acquiring module, configured to acquire a first application running on the terminal, and detect whether there is a second application that is in the same user identity as the first application;
    检测模块,用于当存在所述第二应用程序时,检测所述第二应用程序是 否处于正常工作状态;a detecting module, configured to detect, when the second application is present, whether the second application is in a normal working state;
    冻结模块,用于在需要冻结所述第一应用程序时,若所述第二应用程序处于正常工作状态,则根据所述第二应用程序所处的工作状态采取对应的预设冻结策略对所述第一应用程序进行冻结。a freezing module, configured to: when the second application is in a normal working state, when the first application is required to be frozen, adopt a corresponding preset freezing policy pair according to the working state of the second application The first application is frozen.
  15. 一种终端,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至13中任一项所述的方法的步骤。A terminal comprising a memory and a processor, the memory storing computer readable instructions, the instructions being executed by the processor, causing the processor to perform the method of any one of claims 1 to 13 The steps of the method.
  16. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至13中任一项所述的方法的步骤。A computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the method of any one of claims 1 to 13.
PCT/CN2018/116717 2017-12-29 2018-11-21 Application freezing method and apparatus, and terminal and computer-readable storage medium WO2019128562A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2019128562A1 true WO2019128562A1 (en) 2019-07-04

Family

ID=67063062

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/116717 WO2019128562A1 (en) 2017-12-29 2018-11-21 Application freezing method and apparatus, and 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
CN109992376A (en) 2019-07-09
CN109992376B (en) 2023-11-10

Similar Documents

Publication Publication Date Title
KR102148948B1 (en) Multi tasking method of electronic apparatus and electronic apparatus thereof
US9766690B2 (en) Method for controlling a sleep mode and electronic device thereof
WO2019128540A1 (en) Resource management method, mobile terminal and computer readable storage medium
WO2019128546A1 (en) Application program processing method, electronic device, and computer readable storage medium
CN109144232B (en) Process processing method and device, electronic equipment and computer readable storage medium
WO2019128549A1 (en) Method and apparatus for freezing application, and terminal and computer-readable storage medium
KR102151135B1 (en) Method for managing power and electronic device thereof
CN110032321B (en) Application 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
CN107045383B (en) System and method for extending battery life by monitoring activity of mobile applications
CN112703714A (en) Application program processing method and device, computer equipment and computer readable storage medium
WO2019128537A1 (en) Application freezing method, and computer device and computer-readable storage medium
WO2019128588A1 (en) Process processing method and apparatus, electronic device, computer readable storage medium
WO2019128573A1 (en) Information processing method, apparatus, computer device and computer-readable storage medium
CN109992380B (en) Application program processing method and device, electronic equipment and computer readable storage medium
WO2019128571A1 (en) Resource management method and device, mobile terminal, as well as computer readable storage medium
WO2019137173A1 (en) Resource management method, mobile terminal and computer-readable storage medium
WO2019128574A1 (en) Information processing method and device, computer device and computer readable storage medium
WO2019128553A1 (en) Application processing method, electronic device, and computer-readable storage medium
WO2019128569A1 (en) Method and apparatus for freezing application, and storage medium and terminal
WO2019128586A1 (en) Application processing method, electronic device, and computer readable storage medium
CN109992360B (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
CN109992323B (en) Process processing method and device, electronic equipment and computer readable storage medium
WO2019128570A1 (en) Method and apparatus for freezing application, and storage medium and 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: 18894362

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18894362

Country of ref document: EP

Kind code of ref document: A1