CN107943570B - Application management method and device, storage medium and electronic equipment - Google Patents

Application management method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN107943570B
CN107943570B CN201711123669.XA CN201711123669A CN107943570B CN 107943570 B CN107943570 B CN 107943570B CN 201711123669 A CN201711123669 A CN 201711123669A CN 107943570 B CN107943570 B CN 107943570B
Authority
CN
China
Prior art keywords
application
duration
target application
time length
preset
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
CN201711123669.XA
Other languages
Chinese (zh)
Other versions
CN107943570A (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 CN201711123669.XA priority Critical patent/CN107943570B/en
Publication of CN107943570A publication Critical patent/CN107943570A/en
Application granted granted Critical
Publication of CN107943570B publication Critical patent/CN107943570B/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/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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/482Application

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides an application management method, an application management device, a storage medium and electronic equipment, wherein the application management method comprises the following steps: when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of the target application continuously running in a background; acquiring a second time length according to the historical running record of the target application; calculating a third time length according to the second time length; and judging whether the target application can be cleaned or not according to the first time length and the third time length. In the application management method, the electronic equipment can judge whether the target application can be cleaned according to the duration of the continuous operation of the target application in the background, and when the target application can be cleaned, the target application is closed in time to release system resources of the electronic equipment, so that the system resource occupation of the electronic equipment can be reduced, and the operation smoothness of the electronic equipment is improved.

Description

Application management method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to an application management method and apparatus, a storage medium, and an electronic device.
Background
With the development of electronic technology, electronic devices such as smart phones have become more and more rich in functions. People often have multiple applications installed on electronic devices. When a user opens multiple applications in the electronic device, if the user returns to a main screen of the electronic device or stays at an application interface of a certain application, the multiple applications opened by the user still run in a background of the electronic device. The application running in the background can seriously occupy the memory of the electronic equipment, and the running smoothness of the electronic equipment is reduced.
Disclosure of Invention
The embodiment of the application management method and device, the storage medium and the electronic equipment can reduce system resource occupation of the electronic equipment and improve operation smoothness of the electronic equipment.
An embodiment of the present application provides an application management method, including:
when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of a target application which is continuously in background running, wherein the target application is an application which is currently in background running;
acquiring a second time length according to the historical running record of the target application, wherein the second time length is the average time length of the target application continuously running in the background every time;
calculating a third time length according to the second time length, wherein the third time length is the maximum time length for the target application to be continuously operated in the background;
and judging whether the target application can be cleaned or not according to the first time length and the third time length.
An embodiment of the present application further provides an application management apparatus, including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first duration that a target application is continuously operated in a background when the load of the electronic equipment exceeds a preset load threshold, and the target application is an application currently operated in the background;
the second obtaining module is used for obtaining a second time length according to the historical running record of the target application, wherein the second time length is the average time length of the target application continuously running in the background every time;
the calculating module is used for calculating a third time length according to the second time length, wherein the third time length is the maximum time length for the target application to be continuously operated in the background;
and the application cleaning module is used for judging whether the target application can be cleaned according to the first time length and the third time length.
An embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer is caused to execute the application management method.
The embodiment of the application also provides an electronic device, which comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is used for executing the application management method by calling the computer program stored in the memory.
The application management method provided by the embodiment of the application comprises the following steps: when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of the target application continuously running in a background; acquiring a second time length according to the historical running record of the target application; calculating a third time length according to the second time length; and judging whether the target application can be cleaned or not according to the first time length and the third time length. In the application management method, the electronic equipment can judge whether the target application can be cleaned according to the duration of the continuous operation of the target application in the background, and when the target application can be cleaned, the target application is closed in time to release system resources of the electronic equipment, so that the system resource occupation of the electronic equipment can be reduced, and the operation smoothness of the electronic equipment is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a state diagram illustrating a user managing an application running in an electronic device.
Fig. 2 is a schematic flowchart of an application management method according to an embodiment of the present application.
Fig. 3 is another schematic flowchart of an application management method according to an embodiment of the present application.
Fig. 4 is a schematic flowchart of another application management method provided in the embodiment of the present application.
Fig. 5 is a further flowchart of the application management method according to the embodiment of the present application.
Fig. 6 is an application scenario diagram of an application management method according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an application management apparatus according to an embodiment of the present application.
Fig. 8 is another schematic structural diagram of an application management apparatus according to an embodiment of the present application.
Fig. 9 is a schematic diagram of another structure of an application management apparatus according to an embodiment of the present application.
Fig. 10 is a schematic diagram of still another structure of an application management apparatus according to an embodiment of the present application.
Fig. 11 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Fig. 12 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present application.
The terms "first," "second," "third," and the like in the description and in the claims of the present application and in the above-described drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the objects so described are interchangeable under appropriate circumstances. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, or apparatus, electronic device, system comprising a list of steps is not necessarily limited to those steps or modules or units explicitly listed, may include steps or modules or units not explicitly listed, and may include other steps or modules or units inherent to such process, method, apparatus, electronic device, or system.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a state in which a user manages an application running in an electronic device. The electronic device can run a plurality of background applications and can also run a foreground application. For example, the applications running in the background include application a, application B, and application C.
The user manages the background application running in the electronic device, for example, the background application may be managed by the task manager. Wherein the user may close application B. The background application running in the electronic device then only remains application a and application C. Thus, the electronic device can release the system resources occupied by application B.
The embodiment of the application management method can be applied to electronic equipment. The electronic device can be a smart phone, a tablet computer and the like. As shown in fig. 2, the application management method may include the following steps:
s110, when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of the target application which is continuously running in the background, wherein the target application is the application which is currently running in the background.
The load of the electronic device is understood to be a parameter that can characterize the operating condition of the electronic device. For example, the number of currently running applications, the usage of a Central Processing Unit (CPU), or the size of an occupied memory may be used. Too high a load may cause many processes to slow down, requiring a long time to open a process, causing the system to jam, and it is generally recommended not to overload the electronic device.
In some embodiments, the load comprises at least one of: CPU utilization, memory utilization, and occupancy of file IO (input output system) resources.
The CPU utilization is a CPU resource occupied by the running application, and indicates a situation that the electronic device runs the application at a certain time point. The higher the CPU usage, the more applications the electronic device runs at this point in time. Memory usage, also known as memory occupancy, refers to the memory consumed by a process. A file IO (Input-Output, Input-Output system) may be referred to as an IO without a cache, where the IO without a cache refers to that each read-write operation calls one system call in a kernel. The load can be represented by the size of any one or more of the CPU utilization rate, the memory utilization rate and the occupation rate of the file IO resources.
The preset load threshold may be a value of a load parameter preset in the electronic device. For example, the preset load threshold may be the number of applications running (e.g., 10 applications), CPU usage (e.g., 80%), memory usage (e.g., 90%), occupancy of file IO resources (e.g., 85%), and so on.
The electronic equipment can monitor the load information of the electronic equipment in real time and compare the load of the electronic equipment with the preset load threshold value. When the load of the electronic equipment exceeds the preset load threshold, the electronic equipment acquires a first duration that the target application is continuously running in the background. The target application is an application which is currently running in a background.
It is understood that the electronic device may record the operation of each application that has been installed. For example, the electronic device may record information such as a time when each application starts to run, a time when each application starts to enter the background running, a time when each application exits the background running, and a time when each application ends. When the electronic device needs to acquire the first duration of the target application, the electronic device may query the record information of the target application to acquire the first duration of the target application continuously running in the background.
In some embodiments, there may be multiple target applications in the electronic device running in the background at the same time. At this time, the electronic device may sequentially obtain the first duration that each target application running in the background is continuously running in the background, and sequentially process each target application running in the background.
In some embodiments, when there are multiple target applications running in the background in the electronic device at the same time, the electronic device may sequentially obtain the first duration that each target application is continuously running in the background according to a sequence from a high order to a low order of the size of the memory occupied by each target application, and sequentially process each target application running in the background.
And S120, acquiring a second time length according to the historical running record of the target application, wherein the second time length is the average time length of the target application continuously running in the background every time.
The electronic device can be provided with a log file. The log file is used for recording the running conditions of all the applications installed on the electronic equipment. The electronic device can obtain the historical operating record of the target application by querying the log file.
The historical running record may include the time when the target application starts running, the time when the target application starts entering the background running, the time when the target application exits the background running, and the time when the target application finishes running, and further includes information such as the total number of times that the target application has run, the total number of times that the target application has entered the background running, the total running duration, and the total running duration that the target application has entered the background running.
The electronic device may calculate an average duration of each time that the target application is continuously running in the background, that is, the second duration, according to the total duration of the target application running in the background and the total number of times of the target application running in the background.
For example, if the total duration of the target application running in the background is 300 minutes, and the total number of times of running in the background is 15 times, it may be obtained that the average duration of the target application continuously running in the background every time is 20 minutes, that is, the second duration is 20 minutes.
And S130, calculating a third time length according to the second time length, wherein the third time length is the maximum time length for the target application to be continuously operated in the background.
After the electronic device obtains the second duration of the target application, the third duration may be calculated according to the second duration. Wherein the third duration is a maximum duration that the target application can be continuously in background operation. When the current background running time of the target application is less than or equal to the third time, the current background running of the target application can be considered as normal running; when the current background running time of the target application is longer than the third time, the current background running of the target application can be considered as abnormal running. While abnormal operation may result in unnecessary consumption of system resources and battery power of the electronic device.
And S140, judging whether the target application can be cleaned according to the first time length and the third time length.
After the electronic device calculates the third duration, whether the target application can be cleaned can be determined according to the first duration and the third duration. The target application may be closed when the target application may be cleaned up. After the target application is closed, the electronic device can release system resources occupied by the target application, such as CPU, memory, file IO resources and the like, so that the system resource occupation of the electronic device can be reduced, and the operation fluency of the electronic device is improved.
When a plurality of target applications running in the background in the electronic equipment are available, the electronic equipment sequentially processes the plurality of target applications so as to close applications which can be cleaned in the plurality of target applications. As shown in fig. 6, the target applications running in the background in the electronic device include application a, application B, application C, and application D. Wherein, the application A and the application C are cleanable applications, and the application B and the application D are uncleanable applications. Subsequently, the electronic device closes application a and application C, keeping application B and application D running in the background.
In some embodiments, as shown in fig. 3, the step S130 of calculating the third time period according to the second time period includes the following steps:
s131, acquiring a preset duration calculation coefficient;
s132, calculating the product of the second time length and the preset time length calculation coefficient;
and S133, determining the product as a third duration.
And after the electronic equipment acquires the second time length of the target application, further acquiring a preset time length calculation coefficient. The preset duration calculation coefficient may be a value pre-stored in the electronic device. For example, the preset duration factor is 1.5. The preset duration calculation coefficient is used for calculating the maximum duration that the target application can be continuously operated in the background, namely the third duration.
And after the electronic equipment acquires the preset duration calculation coefficient, calculating the product of the second duration and the preset duration calculation coefficient, and then determining the product as a third duration.
For example, the second duration acquired by the electronic device is 20 minutes, the preset duration calculation coefficient is 1.5, and the calculated third duration is 30 minutes.
In some embodiments, as shown in fig. 4, the step S131 of obtaining the preset duration calculation coefficient includes the following steps:
s1311, obtaining current environment information and an application type of the target application, wherein the environment information comprises a current geographic position and a current time;
s1312, acquiring a preset duration calculation coefficient according to the environment information and the application type.
After the electronic device obtains the second duration of the target application, current environment information and the application type of the target application can be obtained, wherein the environment information comprises a current geographic position and a current time.
As can be understood, a positioning system, such as a GPS (Global positioning system), a beidou positioning system, etc., may be disposed in the electronic device. The electronic device may obtain the current geographic location through the positioning system.
On the other hand, the electronic device may analyze historical behavior data of the user, so that a common geographic location of the user may be identified. For example, the electronic device may identify the location where the user stays the longest on a weekday as a work place, the location where the user stays the longest at night as a home, and so on. In addition, the electronic equipment can also identify positions of tourist attractions, supermarkets, movie theaters and the like according to the acquired geographic position.
The application types may include social applications, shopping applications, video applications, music applications, entertainment applications, office applications, and the like. The electronic device may determine an application type of the target application from the target application.
When the electronic device is located at different geographical positions and different times, the corresponding preset duration calculation coefficients may be different. When the application types of the target applications are different, the corresponding preset duration calculation coefficients may also be different. The electronic device may pre-store a correspondence between the geographic location, the time interval, the application type, and the preset duration calculation coefficient. For example, the correspondence may be a correspondence as shown in table 1:
TABLE 1
Geographic location Time interval Application type Preset duration calculation coefficient
Home-use 8:00-12:00 Office application 1.2
Home-use 18:00-22:00 Social applications 2.0
Home-use 18:00-22:00 Entertainment applications 1.5
Work place 8:00-12:00 Office application 2.5
Work place 18:00-22:00 Social applications 1.8
Work place 18:00-22:00 Entertainment applications 1.3
…… …… …… ……
After the electronic equipment acquires the current geographic position and the current time, determining a time interval of the current time, and acquiring a preset duration calculation coefficient corresponding to a target application by combining the application type of the target application and the corresponding relation.
In some embodiments, as shown in fig. 5, after obtaining the second duration according to the historical operation record of the target application in step S120, the method further includes the following steps:
s151, judging whether the second time length is less than a preset time length;
s152, if the second duration is less than the preset duration, updating the second duration to determine the preset duration as the second duration;
and if the second time length is not less than the preset time length, calculating a third time length according to the second time length.
After the electronic equipment acquires the second time length of the target application, whether the second time length is smaller than the preset time length is judged. The preset duration may be a duration value pre-stored in the electronic device. For example, the preset time period may be 10 minutes.
It will be appreciated that a large number of applications may be installed in the electronic device. The target application may be a newly installed application. When the target application is a newly installed application, the number of times that the target application has been run is small, and the number of times that the target application enters the background running is also small, at this time, the second duration obtained according to the historical running record of the target application may not accurately reflect the situation that the target application runs in the background.
Therefore, in order to avoid inaccurate processing of the target application by the electronic device due to the fact that the obtained second time length is too small, the obtained second time length can be compared with the preset time length to judge whether the second time length is smaller than the preset time length.
And when the second duration is less than the preset duration, updating the second duration to determine the preset duration as the second duration. And then, the electronic equipment calculates a third time length according to the updated second time length. When the second duration is not less than the preset duration, that is, the second duration is greater than or equal to the preset duration, the electronic device may directly calculate a third duration according to the second duration.
In some embodiments, different preset durations may be set in the electronic device for target applications of different application types. The electronic equipment acquires the corresponding preset time length according to the application type of the target application, and then compares the second time length with the acquired preset time length. For example, the preset duration corresponding to the shopping application is 20 minutes, the preset duration corresponding to the social application is 40 minutes, the preset duration corresponding to the video application is 100 minutes, and the like.
In some embodiments, as shown in fig. 5, before the step S140 determines whether the target application can be cleaned according to the first duration and the third duration, the method further includes the following steps:
s160, judging whether the target application is a preset application or not;
and if the target application is not the preset application, judging whether the target application can be cleaned according to the first time length and the third time length.
Wherein, the user can set one or more preset applications in the electronic equipment. The preset application is an application which the user does not want to be automatically cleaned up by the electronic equipment, namely a white list application. For example, the user may set the social application as a preset application.
And after the electronic equipment calculates the third time length, comparing the target application with preset applications set by the user one by one to judge whether the target application is the preset application. And when the target application is not the preset application, the electronic equipment judges whether the target application can be cleaned according to the first time length and the third time length. When the target application is the target application, the electronic device may terminate the flow.
In some embodiments, as shown in fig. 5, the step S140 of determining whether the target application can be cleaned according to the first duration and the third duration includes the following steps:
s141, judging whether the first time length is greater than the third time length;
s142, if the first duration is longer than the third duration, judging that the target application can be cleaned;
s143, if the first duration is not greater than the third duration, the target application cannot be cleaned according to a judgment result.
After the electronic equipment calculates a third time length, the first time length is compared with the third time length to judge whether the first time length is greater than the third time length.
And when the first time length is longer than the third time length, judging that the target application can be cleaned. At this time, the current background operation of the target application may be considered as an abnormal operation, and the electronic device may close the target application to release the system resource occupied by the target application.
And when the first time length is not more than the third time length, namely the first time length is less than or equal to the third time length, judging that the target application cannot be cleaned. At this time, the current background running of the target application may be considered as normal running, and the electronic device keeps the target application running in the background continuously.
In particular implementation, the present application is not limited by the execution sequence of the described steps, and some steps may be performed in other sequences or simultaneously without conflict.
As can be seen from the above, the application management method provided in the embodiment of the present application includes: when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of the target application continuously running in a background; acquiring a second time length according to the historical running record of the target application; calculating a third time length according to the second time length; and judging whether the target application can be cleaned or not according to the first time length and the third time length. In the application management method, the electronic equipment can judge whether the target application can be cleaned according to the duration of the continuous operation of the target application in the background, and when the target application can be cleaned, the target application is closed in time to release system resources of the electronic equipment, so that the system resource occupation of the electronic equipment can be reduced, and the operation smoothness of the electronic equipment is improved.
The embodiment of the application also provides an application management device, wherein the application management device can be integrated in electronic equipment, and the electronic equipment can be equipment such as a smart phone and a tablet personal computer.
As shown in fig. 7, the application management apparatus 200 may include: a first acquisition module 201, a second acquisition module 202, a calculation module 203, and an application cleaning module 204.
The first obtaining module 201 is configured to obtain a first duration that a target application is continuously running in a background when a load of the electronic device exceeds a preset load threshold, where the target application is an application currently running in the background.
The load of the electronic device is understood to be a parameter that can characterize the operating condition of the electronic device. For example, the number of currently running applications, the usage of a Central Processing Unit (CPU), or the size of an occupied memory may be used. Too high a load may cause many processes to slow down, requiring a long time to open a process, causing the system to jam, and it is generally recommended not to overload the electronic device.
In some embodiments, the load comprises at least one of: CPU utilization, memory utilization, and occupancy of file IO (input output system) resources.
The CPU utilization is a CPU resource occupied by the running application, and indicates a situation that the electronic device runs the application at a certain time point. The higher the CPU usage, the more applications the electronic device runs at this point in time. Memory usage, also known as memory occupancy, refers to the memory consumed by a process. A file IO (Input-Output, Input-Output system) may be referred to as an IO without a cache, where the IO without a cache refers to that each read-write operation calls one system call in a kernel. The load can be represented by the size of any one or more of the CPU utilization rate, the memory utilization rate and the occupation rate of the file IO resources.
The preset load threshold may be a value of a load parameter preset in the electronic device. For example, the preset load threshold may be the number of applications running (e.g., 10 applications), CPU usage (e.g., 80%), memory usage (e.g., 90%), occupancy of file IO resources (e.g., 85%), and so on.
The electronic equipment can monitor the load information of the electronic equipment in real time and compare the load of the electronic equipment with the preset load threshold value. When the load of the electronic device exceeds the preset load threshold, the first obtaining module 201 obtains a first duration that the target application is continuously running in the background. The target application is an application which is currently running in a background.
It is understood that the electronic device may record the operation of each application that has been installed. For example, the electronic device may record information such as a time when each application starts to run, a time when each application starts to enter the background running, a time when each application exits the background running, and a time when each application ends. When the first duration of the target application needs to be obtained, the first obtaining module 201 may query the record information of the target application to obtain the first duration that the target application is continuously running in the background.
In some embodiments, there may be multiple target applications in the electronic device running in the background at the same time. At this time, the first obtaining module 201 may sequentially obtain the first duration that each target application running in the background is continuously running in the background, and sequentially process each target application running in the background.
In some embodiments, when there are multiple target applications running in the background in the electronic device at the same time, the first obtaining module 201 may sequentially obtain the first duration that each target application is continuously running in the background according to a sequence from a high size to a low size of a memory occupied by each target application, and sequentially process each target application running in the background.
A second obtaining module 202, configured to obtain a second duration according to the historical running record of the target application, where the second duration is an average duration of each time that the target application is continuously running in the background.
The electronic device can be provided with a log file. The log file is used for recording the running conditions of all the applications installed on the electronic equipment. The second obtaining module 202 may obtain the historical operation record of the target application by querying the log file.
The historical running record may include the time when the target application starts running, the time when the target application starts entering the background running, the time when the target application exits the background running, and the time when the target application finishes running, and further includes information such as the total number of times that the target application has run, the total number of times that the target application has entered the background running, the total running duration, and the total running duration that the target application has entered the background running.
The second obtaining module 202 may calculate an average duration that the target application is continuously running in the background each time, that is, the second duration, according to a total duration that the target application has entered the background to run and a total number of times the target application has entered the background to run.
For example, if the total duration of the target application running in the background is 300 minutes, and the total number of times of running in the background is 15 times, it may be obtained that the average duration of the target application continuously running in the background every time is 20 minutes, that is, the second duration is 20 minutes.
And the calculating module 203 is configured to calculate a third duration according to the second duration, where the third duration is a maximum duration that the target application can be continuously operated in the background.
After the second obtaining module 202 obtains the second duration of the target application, the calculating module 203 may calculate the third duration according to the second duration. Wherein the third duration is a maximum duration that the target application can be continuously in background operation. When the current background running time of the target application is less than or equal to the third time, the current background running of the target application can be considered as normal running; when the current background running time of the target application is longer than the third time, the current background running of the target application can be considered as abnormal running. While abnormal operation may result in unnecessary consumption of system resources and battery power of the electronic device.
And the application cleaning module 204 is configured to determine whether the target application can be cleaned according to the first duration and the third duration.
After the calculating module 203 calculates the third duration, the application cleaning module 204 may determine whether the target application can be cleaned according to the first duration and the third duration. The target application may be closed when the target application may be cleaned up. After the target application is closed, the electronic device can release system resources occupied by the target application, such as CPU, memory, file IO resources and the like, so that the system resource occupation of the electronic device can be reduced, and the operation fluency of the electronic device is improved.
When there are multiple target applications running in the background in the electronic device, the application management apparatus 200 sequentially processes the multiple target applications to close applications that can be cleaned up in the multiple target applications.
In some embodiments, as shown in fig. 8, the calculation module 203 comprises: an acquisition sub-module 2031, a calculation sub-module 2032, and a determination sub-module 2033.
An obtaining submodule 2031 for obtaining a preset duration calculation coefficient;
a calculation submodule 2032, configured to calculate a product of the second time duration and the preset time duration calculation coefficient;
a determination submodule 2033 is configured to determine the product as the third duration.
After the second obtaining module 202 obtains the second duration of the target application, the obtaining sub-module 2031 further obtains the preset duration calculation coefficient. The preset duration calculation coefficient may be a value pre-stored in the electronic device. For example, the preset duration factor is 1.5. The preset duration calculation coefficient is used for calculating the maximum duration that the target application can be continuously operated in the background, namely the third duration.
After the preset duration calculation coefficient is obtained, the calculation submodule 2032 calculates a product of the second duration and the preset duration calculation coefficient, and then the determination submodule 2033 determines the product as a third duration.
For example, if the obtained second time duration is 20 minutes, and the preset time duration calculation coefficient is 1.5, the calculated third time duration is 30 minutes.
In some embodiments, the obtaining submodule 2031 is configured to perform the following steps:
acquiring current environment information and an application type of the target application, wherein the environment information comprises a current geographic position and a current moment;
and acquiring a preset duration calculation coefficient according to the environment information and the application type.
After the second obtaining module 202 obtains the second duration of the target application, the obtaining sub-module 2031 may obtain current environment information and an application type of the target application, where the environment information includes a current geographic location and a current time.
As can be understood, a positioning system, such as a GPS (Global positioning system), a beidou positioning system, etc., may be disposed in the electronic device. The electronic device may obtain the current geographic location through the positioning system.
On the other hand, the electronic device may analyze historical behavior data of the user, so that a common geographic location of the user may be identified. For example, the electronic device may identify the location where the user stays the longest on a weekday as a work place, the location where the user stays the longest at night as a home, and so on. In addition, the electronic equipment can also identify positions of tourist attractions, supermarkets, movie theaters and the like according to the acquired geographic position.
The application types may include social applications, shopping applications, video applications, music applications, entertainment applications, office applications, and the like. The electronic device may determine an application type of the target application from the target application.
When the electronic device is located at different geographical positions and different times, the corresponding preset duration calculation coefficients may be different. When the application types of the target applications are different, the corresponding preset duration calculation coefficients may also be different. The electronic device may pre-store a correspondence between the geographic location, the time interval, the application type, and the preset duration calculation coefficient. For example, the correspondence may be a correspondence as shown in table 2:
TABLE 2
Geographic location Time interval Application type Preset duration calculation coefficient
Home-use 8:00-12:00 Office application 1.2
Home-use 18:00-22:00 Social applications 2.0
Home-use 18:00-22:00 Entertainment applications 1.5
Work place 8:00-12:00 Office application 2.5
Work place 18:00-22:00 Social applications 1.8
Work place 18:00-22:00 Entertainment applications 1.3
…… …… …… ……
The obtaining sub-module 2031 obtains the current geographic position and the current time, then determines a time interval of the current time, and obtains a preset duration calculation coefficient corresponding to the target application by combining the application type of the target application and the corresponding relationship.
In some embodiments, as shown in fig. 9, the application management apparatus 200 further includes: a first determination module 205. The first determining module 205 is configured to:
judging whether the second time length is less than a preset time length or not;
if the second duration is less than the preset duration, updating the second duration to determine the preset duration as the second duration;
the calculating module 203 is configured to:
and when the second time length is not less than the preset time length, calculating a third time length according to the second time length.
After the second obtaining module 202 obtains the second duration of the target application, the first determining module 205 determines whether the second duration is less than a preset duration. The preset duration may be a duration value pre-stored in the electronic device. For example, the preset time period may be 10 minutes.
It will be appreciated that a large number of applications may be installed in the electronic device. The target application may be a newly installed application. When the target application is a newly installed application, the number of times that the target application has been run is small, and the number of times that the target application enters the background running is also small, at this time, the second duration obtained according to the historical running record of the target application may not accurately reflect the situation that the target application runs in the background.
Therefore, in order to avoid that the acquired second duration is too small and the processing of the target application by the electronic device is inaccurate, the first determining module 205 may compare the acquired second duration with the preset duration to determine whether the second duration is less than the preset duration.
And when the second duration is less than the preset duration, updating the second duration to determine the preset duration as the second duration. Subsequently, the calculating module 203 calculates the third time period according to the updated second time period. When the second duration is not less than the preset duration, that is, the second duration is greater than or equal to the preset duration, the calculating module 203 may directly calculate a third duration according to the second duration.
In some embodiments, different preset durations may be set in the electronic device for target applications of different application types. The first determining module 205 obtains a corresponding preset duration according to the application type of the target application, and then compares the second duration with the obtained preset duration. For example, the preset duration corresponding to the shopping application is 20 minutes, the preset duration corresponding to the social application is 40 minutes, the preset duration corresponding to the video application is 100 minutes, and the like.
In some embodiments, as shown in fig. 10, the application management apparatus 200 further includes: a second decision module 206.
A second determining module 206, configured to determine whether the target application is a preset application;
the application cleaning module 204 is configured to determine whether the target application can be cleaned according to the first duration and the third duration when the target application is not the preset application.
Wherein, the user can set one or more preset applications in the electronic equipment. The preset application is an application which the user does not want to be automatically cleaned up by the electronic equipment, namely a white list application. For example, the user may set the social application as a preset application.
After the calculating module 203 calculates the third duration, the second determining module 206 compares the target application with the preset application set by the user one by one to determine whether the target application is the preset application. When the target application is not the preset application, the application cleaning module 204 determines whether the target application can be cleaned according to the first duration and the third duration. When the target application is the target application, the flow may be terminated.
In some embodiments, the application clean-up module 204 is configured to perform the following steps:
judging whether the first time length is greater than the third time length;
if the first duration is longer than the third duration, judging that the target application can be cleaned;
and if the first duration is not greater than the third duration, judging that the target application cannot be cleaned.
After the calculating module 203 calculates a third duration, the application cleaning module 204 compares the first duration with the third duration to determine whether the first duration is greater than the third duration.
And when the first time length is longer than the third time length, judging that the target application can be cleaned. At this time, it may be considered that the current background operation of the target application is abnormally operated, and the application cleaning module 204 may close the target application to release the system resources occupied by the target application.
And when the first time length is not more than the third time length, namely the first time length is less than or equal to the third time length, judging that the target application cannot be cleaned. At this time, the current background operation of the target application may be considered as normal operation, and the application cleaning module 204 keeps the target application continuing to operate in the background.
In specific implementation, the modules may be implemented as independent entities, or may be combined arbitrarily and implemented as one or several entities.
As can be seen from the above, in the application management device 200 provided in this embodiment of the application, when the load of the electronic device exceeds the preset load threshold, the first obtaining module 201 obtains the first duration that the target application is continuously running in the background; the second obtaining module 202 obtains a second duration according to the historical running record of the target application; the calculating module 203 calculates a third time length according to the second time length; the application cleaning module 204 determines whether the target application can be cleaned according to the first duration and the third duration. The application management device 200 may determine whether the target application may be cleaned according to a duration of the target application continuously running in the background, and when the target application may be cleaned, close the target application in time to release system resources of the electronic device, so that system resource occupation of the electronic device may be reduced, and running smoothness of the electronic device may be improved.
The embodiment of the application also provides the electronic equipment. The electronic device can be a smart phone, a tablet computer and the like. As shown in fig. 11, the electronic device 300 includes a processor 301 and a memory 302. The processor 301 is electrically connected to the memory 302.
The processor 301 is a control center of the electronic device 300, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling a computer program stored in the memory 302 and calling data stored in the memory 302, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 301 in the electronic device 300 loads instructions corresponding to one or more processes of the computer program into the memory 302 according to the following steps, and the processor 301 runs the computer program stored in the memory 302, so as to implement various functions:
when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of a target application which is continuously in background running, wherein the target application is an application which is currently in background running;
acquiring a second time length according to the historical running record of the target application, wherein the second time length is the average time length of the target application continuously running in the background every time;
calculating a third time length according to the second time length, wherein the third time length is the maximum time length for the target application to be continuously operated in the background;
and judging whether the target application can be cleaned or not according to the first time length and the third time length.
In some embodiments, calculating the third duration from the second duration, processor 301 performs the following steps:
acquiring a preset duration calculation coefficient;
calculating the product of the second time length and the preset time length calculation coefficient;
the product is determined as a third duration.
In some embodiments, when obtaining the preset duration calculation coefficient, the processor 301 performs the following steps:
acquiring current environment information and an application type of the target application, wherein the environment information comprises a current geographic position and a current moment;
and acquiring a preset duration calculation coefficient according to the environment information and the application type.
In some embodiments, after obtaining the second duration according to the historical operation record of the target application, the processor 301 further performs the following steps:
judging whether the second time length is less than a preset time length or not;
if the second duration is less than the preset duration, updating the second duration to determine the preset duration as the second duration;
and if the second time length is not less than the preset time length, calculating a third time length according to the second time length.
In some embodiments, before determining whether the target application can be cleaned according to the first duration and the third duration, the processor 301 further performs the following steps:
judging whether the target application is a preset application or not;
and if the target application is not the preset application, judging whether the target application can be cleaned according to the first time length and the third time length.
In some embodiments, when determining whether the target application can be cleaned according to the first duration and the third duration, the processor 301 performs the following steps:
judging whether the first time length is greater than the third time length;
if the first duration is longer than the third duration, judging that the target application can be cleaned;
and if the first duration is not greater than the third duration, judging that the target application cannot be cleaned.
Memory 302 may be used to store computer programs and data. The memory 302 stores computer programs containing instructions executable in the processor. The computer program may constitute various functional modules. The processor 301 executes various functional applications and data processing by calling a computer program stored in the memory 302.
In some embodiments, as shown in fig. 12, the electronic device 300 further comprises: radio frequency circuit 303, display screen 304, control circuit 305, input unit 306, audio circuit 307, sensor 308, and power supply 309. The processor 301 is electrically connected to the rf circuit 303, the display 304, the control circuit 305, the input unit 306, the audio circuit 307, the sensor 308, and the power source 309, respectively.
The radio frequency circuit 303 is used for transceiving radio frequency signals to communicate with a network device or other electronic devices through wireless communication.
The display screen 304 may be used to display information entered by or provided to the user as well as various graphical user interfaces of the electronic device, which may be comprised of images, text, icons, video, and any combination thereof.
The control circuit 305 is electrically connected to the display screen 304, and is used for controlling the display screen 304 to display information.
The input unit 306 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. The input unit 306 may include a fingerprint recognition module.
Audio circuitry 307 may provide an audio interface between the user and the electronic device through a speaker, microphone.
The sensor 308 is used to collect external environmental information. The sensor 308 may include one or more of an ambient light sensor, an acceleration sensor, a gyroscope, and the like.
The power supply 309 is used to power the various components of the electronic device 300. In some embodiments, the power source 309 may be logically coupled to the processor 301 through a power management system, such that functions to manage charging, discharging, and power consumption management are performed through the power management system.
Although not shown in fig. 12, the electronic device 300 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In view of the above, the embodiment of the application provides an electronic device, where when a load of the electronic device exceeds a preset load threshold, a first duration that a target application is continuously running in a background is obtained; acquiring a second time length according to the historical running record of the target application; calculating a third time length according to the second time length; and judging whether the target application can be cleaned or not according to the first time length and the third time length. The electronic equipment can judge whether the target application can be cleaned according to the continuous running time of the target application in the background, and when the target application can be cleaned, the target application is closed in time to release system resources of the electronic equipment, so that the system resource occupation of the electronic equipment can be reduced, and the running smoothness of the electronic equipment is improved.
An embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer executes the application management method according to any of the above embodiments.
It should be noted that, all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, which may include, but is not limited to: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The application management method, the application management apparatus, the storage medium, and the electronic device provided in the embodiments of the present application are described in detail above, and a specific example is applied in the description to explain the principles and implementations of the present application, and the description of the embodiments above is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (7)

1. An application management method, comprising:
when the load of the electronic equipment exceeds a preset load threshold value, acquiring a first duration of a target application which is continuously in background running, wherein the target application is an application which is currently in background running;
acquiring a second time length according to the historical running record of the target application, wherein the second time length is the average time length of the target application continuously running in the background every time;
acquiring current environment information and an application type of the target application, wherein the environment information comprises a current geographic position and a current moment;
acquiring a preset duration calculation coefficient from a preset duration calculation coefficient corresponding relation table according to the environment information and the application type;
calculating the product of the second time length and the preset time length calculation coefficient;
determining the product as a third duration, wherein the third duration is the maximum duration that the target application can be continuously operated in a background;
and judging whether the target application can be cleaned or not according to the first time length and the third time length.
2. The application management method according to claim 1, wherein after the step of obtaining the second duration according to the historical running record of the target application, the method further comprises:
judging whether the second time length is less than a preset time length or not;
if the second duration is less than the preset duration, updating the second duration to determine the preset duration as the second duration;
and if the second time length is not less than the preset time length, calculating a third time length according to the second time length.
3. The application management method according to claim 1, wherein before the step of determining whether the target application can be cleaned according to the first duration and the third duration, the method further comprises:
judging whether the target application is a preset application or not;
and if the target application is not the preset application, judging whether the target application can be cleaned according to the first time length and the third time length.
4. The application management method according to claim 1, wherein the step of determining whether the target application can be cleaned according to the first duration and the third duration comprises:
judging whether the first time length is greater than the third time length;
if the first duration is longer than the third duration, judging that the target application can be cleaned;
and if the first duration is not greater than the third duration, judging that the target application cannot be cleaned.
5. An application management apparatus, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first duration that a target application is continuously operated in a background when the load of the electronic equipment exceeds a preset load threshold, and the target application is an application currently operated in the background;
the second obtaining module is used for obtaining a second time length according to the historical running record of the target application, wherein the second time length is the average time length of the target application continuously running in the background every time;
the obtaining submodule is used for obtaining current environment information and the application type of the target application, wherein the environment information comprises a current geographic position and a current moment; acquiring a preset duration calculation coefficient from a preset duration calculation coefficient corresponding relation table according to the environment information and the application type;
the calculation submodule is used for calculating the product of the second time length and the preset time length calculation coefficient;
a determination submodule for determining the product as a third duration;
and the application cleaning module is used for judging whether the target application can be cleaned according to the first time length and the third time length.
6. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the application management method of any one of claims 1 to 4.
7. An electronic device, characterized in that the electronic device comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to execute the application management method according to any one of claims 1 to 4 by calling the computer program stored in the memory.
CN201711123669.XA 2017-11-14 2017-11-14 Application management method and device, storage medium and electronic equipment Active CN107943570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711123669.XA CN107943570B (en) 2017-11-14 2017-11-14 Application management method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711123669.XA CN107943570B (en) 2017-11-14 2017-11-14 Application management method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN107943570A CN107943570A (en) 2018-04-20
CN107943570B true CN107943570B (en) 2020-03-10

Family

ID=61932057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711123669.XA Active CN107943570B (en) 2017-11-14 2017-11-14 Application management method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN107943570B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144814B (en) * 2018-07-27 2022-02-22 Oppo广东移动通信有限公司 Information reminding method and device, storage medium and electronic equipment
CN109886542B (en) * 2019-01-15 2021-11-02 新奥数能科技有限公司 Equipment alternate rest recommendation method and device, readable medium and electronic equipment
CN111159038B (en) * 2019-12-30 2023-07-14 北京声智科技有限公司 Method for simulating CPU load and electronic equipment
CN116567132A (en) * 2022-01-28 2023-08-08 荣耀终端有限公司 Power consumption control method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445664A (en) * 2016-09-18 2017-02-22 深圳市邦华电子有限公司 Application program management method and device
CN107133094A (en) * 2017-06-05 2017-09-05 努比亚技术有限公司 Application management method, mobile terminal and computer-readable recording medium
CN107273157A (en) * 2017-06-05 2017-10-20 广东欧珀移动通信有限公司 Application control method and related product

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445664A (en) * 2016-09-18 2017-02-22 深圳市邦华电子有限公司 Application program management method and device
CN107133094A (en) * 2017-06-05 2017-09-05 努比亚技术有限公司 Application management method, mobile terminal and computer-readable recording medium
CN107273157A (en) * 2017-06-05 2017-10-20 广东欧珀移动通信有限公司 Application control method and related product

Also Published As

Publication number Publication date
CN107943570A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
EP3502889B1 (en) Method and device for preloading application, storage medium, and terminal device
CN109213539B (en) Memory recovery method and device
CN107943570B (en) Application management method and device, storage medium and electronic equipment
CN108337358B (en) Application cleaning method and device, storage medium and electronic equipment
CN107678803B (en) Application control method and device, storage medium and electronic equipment
US20190188007A1 (en) Method for Preloading Application, Storage Medium, and Terminal Device
US11403197B2 (en) Method and device for controlling application, storage medium, and electronic device
CN107734616B (en) Application program closing method and device, storage medium and electronic equipment
CN107835311B (en) Application management method and device, storage medium and electronic equipment
JP6955092B2 (en) Methods for reducing terminal power consumption, and terminals
US11249645B2 (en) Application management method, storage medium, and electronic apparatus
CN107402808B (en) Process management method, device, storage medium and electronic equipment
WO2019062405A1 (en) Application program processing method and apparatus, storage medium, and electronic device
CN107479953B (en) Process management method, device, storage medium and electronic equipment
WO2019085754A1 (en) Application cleaning method and apparatus, and storage medium and electronic device
CN107943571B (en) Background application control method and device, storage medium and electronic equipment
CN107748697B (en) Application closing method and device, storage medium and electronic equipment
CN107734618B (en) Application program closing method and device, storage medium and electronic equipment
US11082806B2 (en) Method of identifying user location, storage medium and electronic device
WO2019062462A1 (en) Application control method and apparatus, storage medium and electronic device
CN107797832B (en) Application cleaning method and device, storage medium and electronic equipment
CN112783731B (en) Abnormal device detection method, device and storage medium
CN107832131B (en) Application program closing method and device, storage medium and electronic equipment
CN107832848B (en) Application management method, device, storage medium and electronic equipment
JP2022008797A (en) Method for reducing power consumption of terminal, and terminal

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: OPPO Guangdong Mobile Communications Co., Ltd.

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

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant