CN109992324B - Application program freezing method and device, storage medium and terminal - Google Patents

Application program freezing method and device, storage medium and terminal Download PDF

Info

Publication number
CN109992324B
CN109992324B CN201711489075.0A CN201711489075A CN109992324B CN 109992324 B CN109992324 B CN 109992324B CN 201711489075 A CN201711489075 A CN 201711489075A CN 109992324 B CN109992324 B CN 109992324B
Authority
CN
China
Prior art keywords
freezing
application
application program
instruction
floating window
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711489075.0A
Other languages
Chinese (zh)
Other versions
CN109992324A (en
Inventor
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711489075.0A priority Critical patent/CN109992324B/en
Publication of CN109992324A publication Critical patent/CN109992324A/en
Application granted granted Critical
Publication of CN109992324B publication Critical patent/CN109992324B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Landscapes

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

Abstract

The application relates to an application program freezing method, an application program freezing device, a storage medium and a terminal. The method comprises the following steps: acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification; monitoring whether an application program with an application identifier displays a floating window on a display interface; when the application program with the application identifier displays the floating window, deleting the application identifier of the target application program in the freezing instruction, wherein the target application program is the application program which has the application identifier and displays the floating window; and freezing the corresponding application program according to the application identifier reserved in the freezing instruction, so that the target application program is not frozen, the target application program is in a normal running state, the phenomenon of jamming of the normal display of the floating window is avoided, and the user experience is improved.

Description

Application program freezing method and device, storage medium and terminal
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method and an apparatus for freezing an application program, a storage medium, and a terminal.
Background
As terminal devices enter an intelligent era, large-screen (especially touch screen) terminal devices are increasingly popularized, applications (apps for short) installed on the terminal devices are more and more, and in order to meet requirements of flexible operation and the like of users, a floating window appears, and the floating window is usually suspended on a display interface in a transparent or semitransparent mode to provide expansion functions of some applications for the users.
When the application program is switched to the background, if the application program runs in the background all the time, certain resources are occupied. Generally, all applications running in the background can be frozen so that they cannot run in the background, and system resources are released. However, this approach may cause an application with a floating window to be abnormal on the display interface.
Disclosure of Invention
The embodiment of the application program freezing method and device, the storage medium and the terminal can enable the floating window to be normally displayed on a display interface, and improve user experience.
An application freezing method, comprising:
obtaining a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
monitoring whether an application program with the application identifier displays a floating window on a display interface;
when the application program with the application identifier displays the floating window, deleting the application identifier of a target application program in the freezing instruction, wherein the target application program is the application program which has the application identifier and displays the floating window;
an application freezing apparatus for freezing a corresponding application according to an application identifier retained in the freezing instruction, the apparatus comprising:
the acquisition module is used for acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
the monitoring module is used for monitoring whether the application program with the application identifier displays a floating window on a display interface;
the deleting module is used for deleting the application identifier of the target application program in the freezing instruction when the application program with the application identifier displays the floating window, wherein the target application program is the application program which has the application identifier and displays the floating window;
and the freezing module is used for freezing the corresponding application program according to the application identifier reserved in the freezing instruction.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the application freezing method in the various embodiments of the application.
A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of application freezing in various embodiments of the present application when executing the computer program.
The application program freezing method and device, the storage medium and the terminal provided by the embodiment of the application program freezing method and device comprise the following steps: acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification; monitoring whether the application program with the application identifier displays a floating window on a display interface; when the application program with the application identifier displays the floating window, deleting the application identifier of a target application program in the freezing instruction, wherein the target application program is the application program which has the application identifier and displays the floating window; freezing the corresponding application program according to the application identifier reserved in the freezing instruction, and then not freezing the target application program, so that the target application program is in a normal running state, the phenomenon of blocking of the normal display of the floating window is avoided, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic diagram of an internal structure of a terminal in one embodiment;
FIG. 2 is a schematic block diagram of a portion of a system in a terminal in one embodiment;
FIG. 3 is a flow diagram of a method for application freezing in one embodiment;
FIG. 4 is a flow diagram of a method for application freezing in another embodiment;
FIG. 5 is a flow diagram that illustrates removing an application identification of the target application from the freeze instruction, under an embodiment;
FIG. 6 is a flow diagram of a method for application freezing in yet another embodiment;
FIG. 7 is a flow diagram that illustrates freezing a process of a corresponding application in accordance with the freeze instruction, under an embodiment;
FIG. 8 is a block diagram of an application freezing apparatus in one embodiment;
fig. 9 is a block diagram of a partial structure of a cellular phone in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein 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, a first depended process may be referred to as a second depended process, and similarly, a second depended process may be referred to as a first depended process, without departing from the scope of the present invention. The first and second depended processes are both depended processes, but are not the same depended process.
In one embodiment, as shown in fig. 1, a schematic diagram of the internal structure of a terminal is provided. The terminal includes a processor, a memory, and a display screen connected by a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole terminal. The memory is used for storing data, programs, and/or instruction codes, etc., and at least one computer program is stored on the memory, and the computer program can be executed by the processor to realize the process processing method suitable for the terminal provided in the embodiment of the 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-Access-Memory (RAM). For example, in one embodiment, the memory includes non-volatile storage media and internal memory. The non-volatile storage medium stores an operating system, a database, and a computer program. The database stores data related to implementing a process processing method provided in the above embodiments, for example, information such as a name of each process or application may be stored. The computer program can be executed by a processor to implement a process handling method provided by various embodiments of the present application. The internal memory provides a cached operating environment for the operating system, databases, and computer programs in the non-volatile storage medium. The display screen may be a touch screen, for example, a capacitive screen or an electronic screen, and is configured to display interface information of an application corresponding to a foreground process, and may also be used to detect a touch operation applied to the display screen, and generate a corresponding instruction, for example, a switching instruction of a previous application program is performed.
It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is a block diagram of only a portion of the configuration associated with the present application, and does not constitute a limitation on the terminal to which the present application may be applied, and that a particular terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components. For example, the terminal further includes a network interface connected via the system bus, where the network interface may be an ethernet card or a wireless network card, and the like, and is used for communicating with an external terminal, such as communicating with a server.
In one embodiment, as shown in FIG. 2, a partial architecture diagram of a terminal is provided. The architecture system of the terminal includes a JAVA space layer 210, a local framework layer 220, and a Kernel space layer 230. The JAVA space layer may include a freezing and unfreezing application 210, and the terminal may implement a freezing policy for each application through the freezing and unfreezing application 210, and perform a freezing operation on a related application consuming power in the background. A resource priority and restriction management module 222 and a platform freeze management module 224 are contained in the local framework layer 220. The terminal can maintain different applications in organizations with different priorities and different resources in real time through the resource priority and restriction management module 222, and adjust the resource groups of the application programs according to the requirements of the upper layer, thereby achieving the effects of optimizing performance and saving power consumption. The terminal may allocate, by using the platform freezing management module 224, the task that can be frozen in the background to the freezing layers corresponding to the preset different levels according to the length of the freezing time, and optionally, the number of the freezing layers may include three, where: CPU limited sleep mode, CPU frozen sleep mode, process deep frozen mode. The CPU sleep-restricted mode is to restrict CPU resources occupied by related processes, so that the related processes occupy less CPU resources, and the vacant CPU resources are inclined to other processes which are not frozen, so that the occupation of the CPU resources is restricted, and the occupation of network resources and I/O interface resources is correspondingly restricted; the CPU freezing sleep mode means that related processes are forbidden to use the CPU, the occupation of a memory is reserved, and when CPU resources are forbidden to use, corresponding network resources and I/O interface resources are also forbidden to use; the deep freezing mode of the process is to further recycle memory resources occupied by the relevant process except for forbidding use of CPU resources, and the recycled 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 recycling module 234, and a timeout freeze exit module 235. The UID management module 231 is configured to manage or freeze resources of the third-party application based on a User Identifier (UID) of the application. Compared with the Process control based on the Process Identifier (PID), the unified management of the resources of the application of one user is facilitated through the UID. The Cgroup module 232 is used to provide a complete set of resource restriction mechanisms related to Central Processing Unit (CPU), CPU set, memory, input/output (I/O) and Net. The Binder management and control module 233 is configured to implement priority control of background Binder communication. The interface module of the local framework layer 220 includes a binder interface that is issued to an upper layer, and a framework or an application of the upper layer sends a resource restriction or freezing instruction to the resource priority and restriction management module 222 and the platform freezing management module 224 through the provided binder interface. The process memory recycling module 234 is used to implement a deep process freezing mode, so that when a third-party application is in a frozen state for a long time, a file area of a process is mainly released, thereby achieving a memory-saving module and increasing the speed of the application when the application is started next time. The timeout freeze exit module 235 is used to resolve the exception generated by the freeze timeout scenario. Through the above framework, the application program freezing method in the embodiments of the present application can be implemented.
In one embodiment, as shown in FIG. 3, an application freezing method is provided. The embodiment is described by taking the method applied to the terminal shown in fig. 1 as an example. The application program freezing method comprises the following steps:
step 302: acquiring a freezing instruction with an application identifier; the freeze instruction is used to freeze the application program having the application identification.
When the application program meets the preset freezing condition, a freezing instruction for freezing the application program is triggered, and the freezing instruction has the application identification of the application program. When the freeze condition is triggered, the terminal system receives a freeze instruction with an application identifier, specifically, the freeze instruction is used to instruct to freeze a process group of an application program with the application identifier, which may be understood as sending a freeze signal to the process group, and when a corresponding application program receives the freeze signal, the process of the application program is not run any more, and at this time, the application program is in a freeze state, so as to implement a freeze operation on the application program. The freeze instruction may include one application identifier or may include a plurality of application identifiers.
The preset freezing condition comprises at least one of a time condition, a type condition, a network environment condition, an identity condition, a resource allocation condition and a custom condition.
It should be noted that the application identifier is used to uniquely identify the corresponding application program, and may be formed by one or a combination of several of numbers, letters, or other characters with preset digits.
Step 304: and monitoring whether the application program with the application identification displays a floating window on a display interface.
When the floating window of the related application is displayed on a terminal display interface, the method is mainly realized by setting the parameters of a terminal system and adding a view on a terminal desktop. For example, taking an Android system as an example, an interface is added to a Window Manager (Window Manager) of the system, and then a corresponding layer parameter (Layout Params) attribute is set in a matching manner to perform data docking with application management on an upper layer, so that an application identifier of an application program corresponding to a floating Window in a display interface is obtained.
The floating window may be used in a console for quick control, or may be used in an interface for displaying information output, status, and the like.
An identification list may be formed according to the obtained application identifiers of the application programs corresponding to the floating window, where the identification list is used to store the application identifiers of the application programs corresponding to the floating window in the display interface, that is, one, two, or more application identifiers may be stored in the identification list, which is not limited herein.
And judging whether the application program with the application identifier displays a floating window on a display interface or not according to the application identifier and the identifier list carried by the acquired freezing instruction. That is, by comparing the freezing instruction with the identifier list, when the application identifier carried in the freezing instruction is located in the identifier list, it can be considered that the application program corresponding to the application identifier carried in the freezing instruction displays the floating window on the display interface of the terminal.
Step 306: and when the application program with the application identifier displays the floating window, deleting the application identifier of the target application program in the freezing instruction, wherein the target application program is the application program which has the application identifier and displays the floating window.
Through comparison, when the application program with the application identifier in the freezing instruction displays the floating window, the application identifier of the target application program in the freezing instruction is deleted. The target application program is the application program which is provided with the application identification and displays the floating window. When the application identifier of the target application program in the freeze instruction is deleted, that is, the freeze operation cannot be performed on the target application program.
In order to ensure the normal operation of the terminal, each terminal system is provided with a corresponding freezing mechanism. However, when a freeze operation is initiated, some system applications are typically left unfrozen, while other background applications may be frozen. In the application, when the system performs the freezing operation of the application program, it needs to first determine whether the application program that needs to be frozen displays the floating window on the display interface, and when the application program (target application program) that needs to be frozen displays the floating window, the application identifier of the target application program in the freezing instruction is deleted, that is, the target application program is not frozen, so that the target application program is in a normal operation state, the floating window is prevented from being stuck, and the user experience is improved.
Step 308: and freezing the corresponding application program according to the application identifier reserved in the freezing instruction.
According to the application freezing method, when the freezing instruction with the application identifier is obtained, whether the application program with the application identifier displays the floating window on the display interface is monitored, when the application program with the application identifier displays the floating window, the application identifier of the target application program in the freezing instruction is deleted, the target application program is not frozen, the target application program is in a normal running state, the phenomenon of blocking of the floating window in normal display is avoided, and the user experience is improved.
In one embodiment, as shown in fig. 4, before deleting the application identifier of the target application program in the freeze instruction, the method further includes:
step 402: acquiring a suspension window parameter of the suspension window;
the floating window has different floating window parameters, and the floating window has different presentation modes. Wherein, the floating window parameter includes: the size of the floating window, the color of the floating window frame, the pattern of the floating window frame, the transparency of the floating window, the position of the floating window, the identification position of the floating window, and the like.
Step 404: and determining a display space where the suspension window is located according to the suspension window parameters, wherein the display space comprises a main space and a child space.
The floating windows with different identifications corresponding to different display spaces can be set with the identifications of the floating windows in different display spaces according to a preset strategy. And the different display spaces correspond to different floating window parameters of the floating window.
For example, different floating window parameters can be respectively set for the main space and the child space, so that the floating window can be displayed in different forms, for example, the floating window can be displayed in different forms due to different sizes of the floating window, different colors of the border of the floating window, different patterns of the border of the floating window, different transparencies of the floating window, and the like. Different identification bits can be added to the floating window according to the type of the display space, for example, the floating window of the main space can be added with an identification bit of an adult head portrait; the suspended window of the child space can be added with an identification position of a 'head portrait of a child'.
It should be noted that the main space and the child space may be independent spaces. The main space is a main space, that is, the interface displayed in the main space is an interface used by a holder of the terminal, the interface displayed in the child space is an interface used by a child when the holder of the mobile terminal hands the terminal to the child, wherein only functions allowed to be used by the child are displayed on the interface used by the child, and applications unsuitable for the child are prevented from being displayed, such as game applications or video applications. Correspondingly, in different display spaces, the application program corresponding to the floating window displayed on the display interface is the application program in the space.
Step 406: and deleting the application identifier of the target application program in the freezing instruction according to the display space.
In different display spaces, white lists of the respective spaces can be set. The white list is a user-defined privileged list, that is, no matter under which condition, the application programs in the white list are not subjected to freezing operation processing. The white list set in the main space is called a first white list, and the application programs stored in the first white list can be application programs applying the floating window permission and application programs screened from the application programs applying the floating window permission. The white list set in the child space is called a second white list, and the application program stored in the first white list is the application program which is selected by parents in a self-defined mode and applies for the permission of the floating window. The first white list and the second white list may have repeated applications or may include applications that do not repeat each other.
If the display space is the main space, when the application program with the application identifier displays the floating window and the target application program is the application program of the first white list, deleting the application identifier of the target application program from the freeze instruction, that is, deleting the freeze instruction of the target application program. Correspondingly, if the display space is a child space, when the application program with the application identifier displays the floating window and the target application program is the application program of the second white list, the application identifier of the target application program is deleted from the freezing instruction, that is, the freezing instruction of the target application program can be deleted.
According to the method, the display space where the floating window is located can be determined according to the floating window parameters of the floating window, the application identification of the target application program is deleted from the freezing instruction according to the display space, the target application programs in different display spaces are enabled to be in a normal running state, the floating window is prevented from being blocked, the user experience degree is improved, meanwhile, different processing mechanisms can be set according to different display spaces, different freezing deletion mechanisms can be provided for different types of users, and the user experience degree is improved.
In one embodiment, as shown in fig. 5, the deleting the application identifier of the target application program in the freeze instruction includes:
step 502: and acquiring display information displayed by the floating window.
And acquiring display information displayed by a floating window of the target application program, wherein the display information comprises the name, the image, the characters, the functions and the like of the target application program. For example, when "healthy exercise" is the target application, the floating window displays the display information, the display information displayed by the floating window only includes the name of "healthy exercise", the data of "exercise steps" and the data of "calories", and the data of other functions of the target application of "healthy exercise" is not displayed in the floating window.
Step 504: and identifying the process used for displaying the display information in the target application program process group according to the display information.
The operation of an Application program (APP, also called an Application) is usually represented by the operation of a plurality of related processes. A process (process) is a running activity of a program in a computer on a data set, is a basic unit of resource allocation and scheduling of a system, and is the basis of an operating system structure. Generally, an application runtime corresponds to a process group, which is a collection of one or more processes, typically associated with a set of jobs, that includes all the processes that serve the application. For example, when an instant messaging application such as a wechat runs, there are a wechat host process, a push (push) process for receiving a message notification, a service (service) process, and the like, which form a process group. Each process has a unique process number (PID), process groups are identified by a process group ID, and each process group has a unique process group ID.
In an operating system, the interaction mechanism between processes is mainly divided into a synchronization mechanism and a communication mechanism. The communication mechanism includes socket, binder, shared memory, etc. Two programs on the network effect the exchange of data via a bidirectional communication link, one end of which is called a socket. Binder is an interprocess communication mechanism that provides remote procedure call functionality.
According to the display information displayed by the floating window, the function module of the target application program corresponding to the display information can be obtained, the process corresponding to the function module can be obtained according to the function module, and the corresponding process of the function module is identified.
Step 506: and deleting the freezing signal of the identified process and keeping the freezing signals of other processes.
When the application program needs to be frozen, a freezing signal for freezing the process group needs to be sent to the process group of the application program, and when the corresponding application program receives the freezing signal, all processes of the application program cannot run any more, and at this time, the application program is in a frozen state.
In this embodiment, instead of sending the freeze signal to the process used in the process group of the application program, only the freeze signal is sent to the unidentified process, that is, in the process of deleting the freeze instruction of the application program corresponding to the floating window, further, only the freeze signal of the process corresponding to the function displayed by the floating window is deleted, and thus, it is ensured that other functions are in the frozen state, thereby achieving the effect of reducing power consumption.
In one embodiment, as shown in FIG. 6, an application freezing method includes:
step 602: acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
step 604: monitoring whether an application program with the application identifier displays a floating window on a display interface;
step 606: when the application program with the application identifier displays a floating window, deleting the application identifier of the target application program in the freezing instruction;
steps 602, 604, and 606 correspond to steps 302, 304, and 306 in the foregoing embodiments one to one, and will not be further described.
Step 608: and judging whether the application program corresponding to the freezing instruction has an associated application program which has an association relation with the target application program.
The association relationship may be understood that the target application program needs to call other application programs when running, or the target application program needs to perform data interaction with other application programs during running, or the other application programs are started by calling the target application program.
For example, the association relationship between a 360-degree mobile phone guard and a "tool box" is that the 360-degree mobile phone guard calls the "tool box" to realize the anti-harassment function of the 360-degree mobile phone guard. And monitoring the association relationship between the 360-degree mobile phone guard and the 360-degree dial, wherein the process of the 360-degree dial is started only when the 360-degree mobile phone guard calls the 360-degree mobile phone guard, namely the 360-degree dial is not used by the user independently.
When the freeze instruction includes multiple application identifiers, it may be determined whether an associated application program having an association relationship with the target application program exists in the application programs corresponding to the received freeze instruction, and if yes, step 610 is executed: the application identification of the associated application program is deleted from the freeze instruction.
If the association relationship between the target application program and the associated application program is established, the application identifier of the associated application program can be deleted from the freezing instruction. When the target application program needs to be called to the associated application program, the abnormal condition caused by the fact that the associated application program is in a frozen state and cannot be called is avoided.
In one embodiment, an application freezing method includes:
acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
monitoring whether an application program with the application identifier displays a floating window on a display interface;
and when the application program with the application identifier does not display the floating window, freezing the process of the corresponding application program according to the freezing instruction.
That is, by means of judgment, when the application program with the application identifier does not display the floating window, the process of the corresponding application program is frozen according to the freezing instruction. The freezing operation may be understood as traversing the process group of the application program corresponding to the reserved application identifier, and sending a freezing instruction to the process group, where when the freezing instruction is received by the corresponding application program, the process of the application program is not run, and at this time, the application program is in a frozen state.
Further, in one embodiment, as shown in fig. 7, freezing the process of the corresponding application includes:
step 702: and acquiring the historical use frequency of the application program corresponding to the freezing instruction.
According to the freezing instruction with the application identification, the application program needing to be frozen can be obtained, and therefore the historical use frequency of the application program needing to be frozen can be obtained. The historical use frequency can be counted by taking 7 days as a period, and the use frequency in the 7-day time is seen, wherein when the application program is in the foreground operation, the application program is considered to be used by the user, and the number of times that the application program is in the foreground operation in the 7 days can be counted.
Step 704: dividing freezing grades according to the historical use frequency; the freeze level is used to indicate the maximum allowed resources that can be used to configure the application.
The freezing level is divided according to the historical frequency of use. Wherein the freeze level is used to indicate a maximum allowed resource that can be used by the configuration application. The resource that can be used represents the resource that can be used by the process at each time when the process is executed. The maximum allowed resource represents the maximum resource that a process is allowed to use at each time. The lower the frequency of use, the higher the freezing level, and the higher the freezing level, the less the maximum allowed resources can be used by the frequency of use.
The terminal has a plurality of processes in a running state, and a process (process) is a running activity of a program in a computer on a certain data set, is a basic unit for resource allocation and scheduling of a system, and is the basis of an operating system structure. The process involved in the foreground application running is the foreground process, and the process involved in the background application running is the background process.
The terminal can acquire the background process according to a preset frequency or according to a detected user operation instruction. Optionally, a process identifier of the background process may be obtained, where the process identifier is used to uniquely identify a corresponding process, and may be formed by one or a combination of several of numbers, letters, or other characters with preset digits.
Specifically, the freezing levels can be divided into a first level, a second level, a third level and a fourth level according to the historical use frequency, wherein the freezing level of the lowest level is the first level, and the freezing level of the highest level is the fourth level.
The resources may include a CPU, I/O file resources, and the like. Take resources as memory for example. If the memory required by the background process is 40Mb, and if the freezing level is one level (the lowest level), resources are allocated to the foreground according to the one-level freezing level, and the maximum allowed resource which can be used by the application program is 30Mb; if the freezing level is four levels (the highest level), resources are allocated to the background process according to the freezing level of the first level, and the maximum allowable resource which can be used by the application program is 0Mb. Wherein the highest level of freezing is a completely frozen state.
Step 706: and freezing the application program according to the freezing level.
And corresponding freezing levels can be obtained according to historical use frequency, and freezing operation on corresponding levels of the application program can be realized according to a freezing level strategy set by a user.
According to the method, the freezing grade is set according to the historical use frequency, a certain time process is required from partial freezing to complete freezing, a buffering time period is provided for a user, the user can quickly and effectively unfreeze the application program in the time period, and the user experience is improved. Meanwhile, the root freezing level limits the maximum allowed resource which can be used by the application program, and the resource can be reasonably distributed, so that the power consumption is reduced.
In one embodiment, before the obtaining the freeze instruction with the application identifier, the method further includes:
triggering the freezing instruction according to a preset strategy; the preset strategy comprises at least one of a time strategy, a type strategy, an environment strategy, an identity strategy, resource allocation and a user-defined strategy.
Specifically, some preset policies for determining whether to freeze the application program may be set in the terminal in a customized manner according to the requirements of the user, where the preset policies include at least one of a time policy, a type policy, an environment policy, an identity policy, and a customized policy.
For example, the time policy may be understood as being set according to the duration of time that the application is running in the background or the duration of time that the application is not opened by the user; a type policy may be understood to be set according to the application type of an application as if the same type of policy was used by a type of application; the environment policy may be understood to be set according to an indoor environment, an outdoor environment, a networking environment (trusted environment or untrusted environment), and the like; the identity policy can be understood as being set according to different user groups; the user-defined strategy refers to a preset strategy which is added in the terminal in a user-defined mode according to actual requirements/preferences. And when the terminal meets the preset strategy, triggering a corresponding freezing instruction.
In one embodiment, as shown in fig. 8, there is provided an application freezing apparatus, comprising:
a receiving module 810, configured to obtain a freeze instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
a monitoring module 820, configured to monitor whether the application program with the application identifier displays a floating window on a display interface;
a deleting module 830, configured to delete the application identifier of the target application program in the freeze instruction when the application program with the application identifier displays the floating window, where the target application program is the application program that has the application identifier and displays the floating window;
and the freezing module 840 is used for freezing the corresponding application program according to the application identifier reserved in the freezing instruction.
According to the application program freezing device, when the freezing instruction with the application identifier is obtained, whether the application program with the application identifier displays the floating window on the display interface is monitored, and when the application program with the application identifier displays the floating window, the application identifier of the target application program in the freezing instruction is deleted, so that the target application program is not frozen, the target application program is in a normal running state, the phenomenon of blocking of the normal display of the floating window is avoided, and the user experience is improved.
In one embodiment, the application freezing apparatus further comprises:
the space judgment module is used for acquiring the floating window parameters of the floating window; determining a display space where the suspension window is located according to the suspension window parameters, wherein the display space comprises a main space and a child space; and deleting the application identifier of the target application program in the freezing instruction according to the display space.
In one embodiment, a deletion module includes:
the display acquisition unit is used for acquiring display information displayed by the floating window;
the process identification unit is used for identifying the process used for displaying the display information in the target application program process group according to the display information;
and the deleting unit is used for deleting the freezing signal of the identified process and keeping the freezing signals of other processes.
In one embodiment, the application freezing apparatus further comprises:
the judging module is used for judging whether the application program corresponding to the freezing instruction has an associated application program which has an association relation with the target application program; and if so, deleting the application identifier of the associated application program from the freezing instruction.
Further, a freezing module, comprising:
the frequency acquisition unit is used for acquiring the historical use frequency of the application program corresponding to the freezing instruction;
a grade dividing unit for dividing freezing grades according to the historical use frequency; the freeze level is used to indicate a maximum allowed resource that can be used by the application is configured;
and the freezing unit is used for freezing the corresponding level of the application program according to the freezing level.
The division of the modules in the application freezing apparatus is merely used for illustration, and in other embodiments, the application freezing apparatus may be divided into different modules as needed to complete all or part of the functions of the application freezing apparatus.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the application freezing method provided by the above embodiments.
In one embodiment, a terminal is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the application freezing method provided in the above embodiments.
The embodiment of the application also provides a computer program product. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the application freezing method as provided by the embodiments described above.
The embodiment of the application further provides the terminal. As shown in fig. 9, for convenience of explanation, only the parts related to the embodiments of the present application are shown, and details of the technology are not disclosed, please refer to the method part of the embodiments of the present application. The terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the terminal as the mobile phone as an example:
fig. 9 is a block diagram of a part of a structure of a mobile phone related to a terminal according to an embodiment of the present application. Referring to fig. 9, the handset includes: radio Frequency (RF) circuit 910, memory 920, input unit 930, display unit 940, sensor 950, audio circuit 960, wireless fidelity (WiFi) module 970, processor 980, and power supply 990. Those skilled in the art will appreciate that the handset configuration shown in fig. 9 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The RF circuit 910 may be configured to receive and transmit signals during information transmission or communication, and may receive downlink information of a base station and then process the downlink information to the processor 980; the uplink data may also be transmitted to the base station. Typically, the RF circuitry includes, but is 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, the RF circuit 910 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), long Term Evolution (LTE)), e-mail, short Messaging Service (SMS), and the like.
The memory 920 may be used to store software programs and modules, and the processor 980 may execute various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 920 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 930 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone 900. Specifically, the input unit 930 may include an operation panel 931 and other input devices 932. The operation panel 931, which may also be referred to as a touch screen, may collect a touch operation performed by a user on or near the operation panel 931 (for example, an operation performed by the user on the operation panel 931 or near the operation panel 931 using any suitable object or accessory such as a finger or a stylus pen), and drive the corresponding connection device according to a preset program. In one embodiment, the operation panel 931 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the operation panel 931 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 930 may include other input devices 932 in addition to the operation panel 931. In particular, the other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
The display unit 940 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941. In one embodiment, the Display panel 941 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the operation panel 931 may cover the display panel 941, and when the operation panel 931 detects a touch operation on or near the operation panel, the operation panel is transmitted to the processor 990 to determine the type of the touch event, and then the processor 990 provides a corresponding visual output on the display panel 941 according to the type of the touch event. Although in fig. 9, the operation panel 931 and the display panel 941 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the operation panel 931 and the display panel 941 may be integrated to implement the input and output functions of the mobile phone.
Cell phone 900 can also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 941 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 941 and/or backlight when the mobile phone is moved to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be detected when the mobile phone is static, and the motion sensor can be used for identifying the application of the gesture of the mobile phone (such as horizontal and vertical screen switching), the vibration identification related functions (such as pedometer and knocking) and the like; in addition, the mobile phone may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
Audio circuitry 960, speaker 961 and microphone 962 may provide an audio interface between a user and a cell phone. The audio circuit 960 may transmit the electrical signal converted from the received audio data to the speaker 961, and convert the electrical signal into a sound signal for output by the speaker 961; on the other hand, the microphone 962 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by the audio circuit 960, and then outputs the audio data to the processor 980 for processing, and then the audio data can be transmitted to another mobile phone through the RF circuit 910, or the audio data can be output to the memory 920 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send electronic mails, browse webpages, access streaming media and the like through the WiFi module 970, and provides wireless broadband internet access for the user. Although fig. 9 shows WiFi module 970, it is to be understood that it does not belong to the essential components of cell phone 900 and may be omitted as desired.
The processor 980 is a control center of the mobile phone, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 920 and calling data stored in the memory 920, thereby integrally monitoring the mobile phone. In one embodiment, processor 980 may include one or more processing units. In one embodiment, the processor 980 may integrate an application processor and a modem, wherein the application processor primarily handles operating systems, user interfaces, applications, and the like; the modem handles primarily wireless communications. It is to be appreciated that the modem may not be integrated into the processor 980. For example, the processor 980 may integrate an application processor with a baseband processor, which may form a modem with other peripheral chips, etc. The handset 900 also includes a power supply 990 (e.g., a battery) for supplying power to the various components, which may preferably be logically connected to the processor 980 via a power management system, such that the power management system may be used to manage charging, discharging, and power consumption.
In one embodiment, the cell phone 900 may 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 above-described application freezing method when executing the computer program stored in the memory.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. Suitable 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 external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM).
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not to be construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. An application freezing method, comprising:
acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
monitoring whether an application program with the application identifier displays a floating window on a display interface;
when an application program with the application identifier displays a floating window, acquiring floating window parameters of the floating window;
determining a display space where the suspension window is located according to the suspension window parameters, wherein the display space comprises a main space and a child space, and the main space and the child space are respectively provided with different suspension window parameters;
deleting the application identifier of the target application program in the freezing instruction according to the display space; the target application program is an application program which is provided with the application identifier and displays the floating window;
acquiring historical use frequency of an application program corresponding to the application identifier according to the application identifier reserved in the freezing instruction;
dividing freezing grades according to the historical use frequency; the freeze level is used to indicate a maximum allowed resource that can be used to configure the application;
and freezing the application program according to the freezing grade at the corresponding grade.
2. The method of claim 1, wherein the deleting the application identifier of the target application in the freeze instruction comprises:
acquiring display information displayed by the floating window;
identifying a process used for displaying the display information in the target application program process group according to the display information;
and deleting the freezing signal of the identified process and keeping the freezing signals of other processes.
3. The method according to claim 1, further comprising, after deleting the application identifier of the target application in the freeze instruction:
judging whether the application program corresponding to the freezing instruction has an associated application program which has an association relation with the target application program;
and if so, deleting the application identifier of the associated application program from the freezing instruction.
4. The method of claim 1, further comprising:
and when the application program with the application identifier does not display the floating window, freezing the process of the corresponding application program according to the freezing instruction.
5. The method of claim 1, wherein before the obtaining the freeze instruction with the application identifier, further comprising:
triggering the freezing instruction according to a preset strategy;
the preset strategy comprises at least one of a time strategy, a type strategy, a network environment strategy, an identity strategy, resource allocation and a user-defined strategy.
6. An application freezing apparatus, comprising:
the acquisition module is used for acquiring a freezing instruction with an application identifier; the freezing instruction is used for freezing the application program with the application identification;
the monitoring module is used for monitoring whether the application program with the application identifier displays a floating window on a display interface;
the deleting module is used for acquiring the floating window parameters of the floating window when the application program with the application identifier displays the floating window; determining a display space where the suspension window is located according to the suspension window parameters, wherein the display space comprises a main space and a child space, and the main space and the child space are respectively provided with different suspension window parameters; deleting the application identifier of the target application program in the freezing instruction according to the display space; the target application program is an application program which is provided with the application identifier and displays the floating window;
the freezing module is used for acquiring the historical use frequency of the application program corresponding to the application identifier according to the application identifier reserved in the freezing instruction; dividing freezing grades according to the historical use frequency; the freeze level is used to indicate a maximum allowed resource that can be used to configure the application; and freezing the application program according to the freezing grade at the corresponding grade.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
8. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 5 when executing the computer program.
CN201711489075.0A 2017-12-29 2017-12-29 Application program freezing method and device, storage medium and terminal Active CN109992324B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711489075.0A CN109992324B (en) 2017-12-29 2017-12-29 Application program freezing method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711489075.0A CN109992324B (en) 2017-12-29 2017-12-29 Application program freezing method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN109992324A CN109992324A (en) 2019-07-09
CN109992324B true CN109992324B (en) 2022-11-04

Family

ID=67111060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711489075.0A Active CN109992324B (en) 2017-12-29 2017-12-29 Application program freezing method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN109992324B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708629A (en) * 2016-12-30 2017-05-24 深圳天珑无线科技有限公司 Mobile terminal user space adjusting method and device
CN107239210A (en) * 2017-06-27 2017-10-10 珠海市魅族科技有限公司 Terminal control method, device, computer installation and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8166464B2 (en) * 2008-06-27 2012-04-24 Microsoft Corporation Analysis and detection of soft hang responsiveness program errors
CN101504658B (en) * 2009-01-23 2011-09-28 北京搜狗科技发展有限公司 Method and system for implementing message interaction in multi-tag application program
CN106293901B (en) * 2015-05-22 2020-06-02 腾讯科技(深圳)有限公司 Process management method and device for terminal application
CN106127037A (en) * 2016-06-21 2016-11-16 依偎科技(南昌)有限公司 Method, device and the terminal processed is freezed in a kind of application
CN106778256A (en) * 2016-11-28 2017-05-31 珠海市魅族科技有限公司 The method and mobile terminal of a kind of application control
CN107092414B (en) * 2017-03-13 2023-08-18 宇龙计算机通信科技(深圳)有限公司 Information viewing method and information viewing device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708629A (en) * 2016-12-30 2017-05-24 深圳天珑无线科技有限公司 Mobile terminal user space adjusting method and device
CN107239210A (en) * 2017-06-27 2017-10-10 珠海市魅族科技有限公司 Terminal control method, device, computer installation and storage medium

Also Published As

Publication number Publication date
CN109992324A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
EP3514684B1 (en) Memory recovery method and apparatus
CN107526640B (en) Resource management method, resource management device, mobile terminal and computer-readable storage medium
CN109992398B (en) Resource management method, resource management device, mobile terminal and computer-readable storage medium
US10956316B2 (en) Method and device for processing reclaimable memory pages, and storage medium
WO2016000586A1 (en) Method and apparatus for displaying popup box message
CN109992364B (en) Application freezing method and device, computer equipment and computer readable storage medium
CN109992965B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN108334345B (en) Application processing method and device, readable storage medium and mobile terminal
CN109992399B (en) Resource management method, resource management device, mobile terminal and computer-readable storage medium
CN108632454B (en) Information processing method and device, computer readable storage medium and terminal
WO2019137173A1 (en) Resource management method, mobile terminal and computer-readable storage medium
CN115668123A (en) Audio resource allocation method and device and electronic equipment
WO2020015571A1 (en) Mobile terminal, method for running application in background, and device
CN110032430B (en) Application program processing method and device, electronic equipment and computer readable storage medium
WO2019128569A1 (en) Method and apparatus for freezing application, and storage medium and terminal
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
CN110032397B (en) Application processing method and device, electronic equipment and computer readable storage medium
CN109992360B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN109992322B (en) Application program unloading method and device, storage medium and terminal
CN109375995B (en) Application freezing method and device, storage medium and electronic equipment
CN110008007B (en) Application program freezing method and device, storage medium and terminal
CN109992395B (en) Application freezing method and device, terminal and computer readable storage medium
CN109992324B (en) Application program freezing method and device, storage medium and terminal
CN109992362B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN110045811B (en) Application program processing method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

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

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

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

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

GR01 Patent grant
GR01 Patent grant