CN109388487B - Application program processing method and device, electronic equipment and computer readable storage medium - Google Patents

Application program processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN109388487B
CN109388487B CN201811204974.6A CN201811204974A CN109388487B CN 109388487 B CN109388487 B CN 109388487B CN 201811204974 A CN201811204974 A CN 201811204974A CN 109388487 B CN109388487 B CN 109388487B
Authority
CN
China
Prior art keywords
freezing
application
time
application program
list
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
CN201811204974.6A
Other languages
Chinese (zh)
Other versions
CN109388487A (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.)
Zeku Technology Shanghai 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 CN201811204974.6A priority Critical patent/CN109388487B/en
Publication of CN109388487A publication Critical patent/CN109388487A/en
Application granted granted Critical
Publication of CN109388487B publication Critical patent/CN109388487B/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/485Task life-cycle, e.g. stopping, restarting, resuming execution

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)
  • Telephone Function (AREA)

Abstract

The application provides an application program method, an application program device, electronic equipment and a computer readable storage medium. The method comprises the following steps: the method comprises the steps of obtaining a freezing list, wherein the freezing list is used for storing application identifications of background application programs and corresponding freezing moments; acquiring an application identifier corresponding to a freezing moment closest to the current moment from the freezing list as a target application identifier; and freezing the background application program corresponding to the target application identifier when the current time reaches the freezing time corresponding to the target application identifier. The application program method, the application program device, the electronic equipment and the computer readable storage medium can more accurately process the application program.

Description

Application program processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The electronic device can be provided with an application program, and the application program can realize various application operations. For example, shopping, listening to music, watching video, playing games, etc. may be performed through an application installed in the electronic device. When running in the electronic equipment, the application program can run in the foreground or in the background. When the application program runs in the foreground, the application program can be displayed in an interface of the electronic equipment, and a user can operate the application program through the displayed interface. When the application program runs in the background, the application program is generally not displayed in the interface of the electronic device, and the user cannot operate the application program through the interface of the electronic device.
Disclosure of Invention
The embodiment of the application provides an application program method, an application program device, electronic equipment and a computer readable storage medium, and the application program can be processed more accurately.
An application processing method, comprising:
the method comprises the steps of obtaining a freezing list, wherein the freezing list is used for storing application identifications of background application programs and corresponding freezing moments;
acquiring an application identifier corresponding to a freezing moment closest to the current moment from the freezing list as a target application identifier;
and freezing the background application program corresponding to the target application identifier when the current time reaches the freezing time corresponding to the target application identifier.
An application processing apparatus comprising:
the device comprises a list acquisition module, a freezing list acquisition module and a freezing control module, wherein the freezing list is used for storing an application identifier of a background application program and a corresponding freezing moment;
the identification acquisition module is used for acquiring an application identification corresponding to a freezing moment closest to the current moment from the freezing list as a target application identification;
and the application freezing module is used for freezing the background application program corresponding to the target application identifier when the current moment reaches the freezing moment corresponding to the target application identifier.
An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
the method comprises the steps of obtaining a freezing list, wherein the freezing list is used for storing application identifications of background application programs and corresponding freezing moments;
acquiring an application identifier corresponding to a freezing moment closest to the current moment from the freezing list as a target application identifier;
and freezing the background application program corresponding to the target application identifier when the current time reaches the freezing time corresponding to the target application identifier.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
the method comprises the steps of obtaining a freezing list, wherein the freezing list is used for storing application identifications of background application programs and corresponding freezing moments;
acquiring an application identifier corresponding to a freezing moment closest to the current moment from the freezing list as a target application identifier;
and freezing the background application program corresponding to the target application identifier when the current time reaches the freezing time corresponding to the target application identifier.
The application program method, the application program device, the electronic equipment and the computer readable storage medium can more accurately process the application program, and can store the application identifier of the background application program and the corresponding freezing moment through the freezing list. And then acquiring an application identifier corresponding to the freezing moment closest to the current moment from the acquired freezing list as a target application identifier. And when the current moment reaches the freezing moment corresponding to the target application identifier, freezing the background application program corresponding to the target application identifier. Therefore, the freezing of the application program can be accurately controlled through the freezing list, and the electronic equipment is prevented from carrying out uniform processing on the application program, so that the accuracy of processing the application program is improved, and the resource occupation of the electronic equipment is reduced.
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 description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow diagram of a method for application processing in one embodiment;
FIG. 2 is a flowchart of an application processing method in another embodiment;
FIG. 3 is a schematic diagram of a freeze list in one embodiment;
FIG. 4 is a flowchart of an application processing method in yet another embodiment;
FIG. 5 is a block diagram of an application processing device in one embodiment;
FIG. 6 is a schematic diagram of an application processing apparatus according to another embodiment;
fig. 7 is a block diagram of a partial structure of a mobile phone related to an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further 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 freeze time may be referred to as a second freeze time, and similarly, a second freeze time may be referred to as a freeze time, without departing from the scope of the present application. Both the first freeze time and the second freeze time are clients, but they are not the same freeze time.
FIG. 1 is a flow diagram that illustrates a method for processing an application in one embodiment. As shown in fig. 1, the application processing method includes steps 102 to 106. Wherein:
step 102, a freeze list is obtained, wherein the freeze list is used for storing the application identifier of the background application program and the corresponding freeze moment.
An Application (APP) is software written for a certain Application purpose in an electronic device, and the electronic device can implement a service required by a user through the APP. For example, a user may play games through a game-like application, may watch videos through a video-like application, may play music through a music-like application, and so on. The application program can be divided into a foreground application program and a background application program according to the running state.
The foreground application is an application running in the foreground of the electronic device, and the foreground application can be displayed on an interface and can interact with a user. Background applications refer to applications that run in the background of the electronic device, and background applications generally cannot be displayed on an interface, and a user cannot operate the applications through the interface of the electronic device.
Applications may be frozen and the frozen applications are not shut down but are temporarily not run. The application program in the frozen state does not occupy the processor resources of the electronic device, but still occupies the resources of the memory, hardware and the like of the electronic device. Therefore, the electronic device can freeze the application program which is not operated temporarily in the process of operating the application program, so as to reduce the resource occupation in the electronic device.
In one embodiment, a freeze list may be stored in the electronic device, the freeze list being used to manage a freeze process of the application by the electronic device. Specifically, the electronic device may include application identifiers of one or more background application programs, each application identifier stores a corresponding freeze time, and the freeze of the background application program is controlled by the application identifier and the freeze time.
And 104, acquiring an application identifier corresponding to the freezing moment closest to the current moment from the freezing list as a target application identifier.
In this embodiment of the application, the electronic device may define a thread, and read the freeze list through continuous circulation of the thread, so as to obtain an application identifier, in the freeze list, of which the freeze time is closest to the current time, as the target application identifier. And then, continuously reading a clock of the electronic equipment to obtain the current time, comparing the obtained current time with the freezing time corresponding to the target application identifier, and controlling the application program to freeze according to the comparison result.
And 106, freezing the background application program corresponding to the target application identifier when the current time reaches the freezing time corresponding to the target application identifier.
Specifically, the electronic device may read the current time once at a certain time interval, compare the current time with the freezing time corresponding to the target application program, and determine whether the current time reaches the freezing time. And when the current time reaches the freezing time, freezing the background application program corresponding to the target application program.
For example, after the freeze list is acquired, the freeze time corresponding to the target application identifier is acquired as "12: 00 "(minutes: seconds). And then the electronic equipment can read the current time every 1 second, compare the read current time with the freezing time, and freeze the background application program corresponding to the target application identifier when the current time reaches the freezing time.
The background application program after being frozen can be unfrozen, and the background application program after being unfrozen can run normally. For example, when a frozen background application is detected to be switched to the foreground, the frozen background application is thawed. Or after the background application program is frozen for a period of time, automatically unfreezing the frozen background application program.
The application program processing method provided by the embodiment may store the application identifier of the background application program and the corresponding freezing time through the freezing list. And then acquiring an application identifier corresponding to the freezing moment closest to the current moment from the acquired freezing list as a target application identifier. And when the current moment reaches the freezing moment corresponding to the target application identifier, freezing the background application program corresponding to the target application identifier. Therefore, the freezing of the application program can be accurately controlled through the freezing list, and the electronic equipment is prevented from carrying out uniform processing on the application program, so that the accuracy of processing the application program is improved, and the resource occupation of the electronic equipment is reduced.
Fig. 2 is a flowchart of an application processing method in another embodiment. As shown in fig. 2, the application processing method includes steps 202 to 214. Wherein:
step 202, when it is detected that the first application program is switched from the foreground to the background, a switching time when the first application program is switched from the foreground to the background is obtained.
During the process of running the application program by the electronic equipment, the running state of the application program is changed in real time. For example, an application running in the foreground may switch to the background and an application running in the background may switch to the foreground. Therefore, the electronic device needs to continuously detect whether the running state of the application program changes, and when the running state of the application program is detected to change, the application identifier in the freeze list is adjusted in real time.
And 204, acquiring the freezing time corresponding to the first application program according to the switching time, and storing the application identifier and the freezing time corresponding to the first application program into a freezing list.
Specifically, the electronic device may monitor an operation condition of an application program running in a foreground, obtain a switching time when the first application program running in the foreground is switched from the foreground to the background when it is detected that the first application program running in the foreground is switched from the foreground to the background, obtain a freezing time according to the switching time, and store the obtained freezing time and an application identifier corresponding to the first application program in a freezing list. It will be appreciated that the application identifications and freeze times are inserted in the order of the applications in the freeze list so that the order of the applications in the freeze list is maintained.
For example, the duration of the interval between the time when the application switches from foreground to background and the time when the application is frozen is a predetermined constant value. Then, each time the application identifier and the freezing time are inserted, the application identifier and the freezing time can be directly inserted into the last bit of the freezing list.
In an embodiment, the step of obtaining the freezing time according to the switching time may specifically include: acquiring a preset freezing time length, and calculating to obtain a freezing time corresponding to the application program according to the switching time and the preset freezing time length; or acquiring the application level of the first application program, acquiring the corresponding freezing time length according to the application level, and calculating the freezing time corresponding to the first application program according to the switching time and the acquired freezing time length.
The freezing duration refers to a preset duration between the time when the application program is switched from the foreground to the background and the time when the application program is frozen. The freezing duration may be preset by a user, randomly selected by the electronic device, obtained according to an operating condition of the background application, or obtained by other methods, which is not limited herein.
For example, the electronic device may test the running condition of a background application running in history, and obtain that the running activity value starts to decrease to a smaller value after the background application runs for 15 seconds generally. That is, after the application program generally runs in the background for 15 seconds, the resource occupancy rate of the electronic device is reduced to a relatively small value. The preset freeze duration may be set to 15 seconds. Assuming that the switching time is "12: 00" (minutes: seconds), the freezing time is 15 seconds added to the switching time, i.e., "12: 15" (minutes: seconds).
In other embodiments provided by the present application, the freezing duration may also be obtained according to the application level of the first application program, and then the freezing time is calculated according to the freezing duration and the switching time. The application level is used to indicate the importance level of the application. For example, the application level of the system-level application is higher than the application level of the third-party application, i.e., the importance level of the system-level application is higher than the importance level of the third-party application. Specifically, the electronic device may preset a correspondence between an application level of the application program and the freezing time, then obtain the corresponding freezing time according to the application level of the first application program, and then calculate the freezing time according to the obtained freezing time and the switching time. For example, the higher the application level, the longer the corresponding freeze period.
Step 206, when it is detected that the second application program is switched from the background to the foreground or the second application program stops running, acquiring an application identifier corresponding to the second application program switched from the background to the foreground.
The electronic device monitors the running state of the application program, and when detecting that a second application program in the background application program is switched to the foreground from the background or stops running, the second application program does not need to be frozen, and the application identifier of the second application program can be deleted from the frozen list.
And step 208, deleting the application identifier and the freezing moment corresponding to the second application program from the freezing list.
Specifically, after the application identifier of the second application program is acquired, the application identifier of the second application program is searched from the freeze list, the searched application identifier and the corresponding freeze time are deleted from the freeze list, and then the searched application identifier and the corresponding freeze time are deleted from the freeze list. After the application identifier and the freezing time corresponding to the second application program are deleted from the freezing list, the second application program does not need to be frozen.
It can be understood that after the freeze list is generated, the electronic device can also adjust the freeze time in the freeze list at any time according to the operating condition. Specifically, the number of identifiers of the application identifiers included in the freezing list is counted, and the freezing time corresponding to each application identifier is adjusted according to the number of identifiers. The number of the identifiers of the application identifiers included in the freeze list reflects the number of the background application programs, and the larger the number of the identifiers of the application identifiers included in the freeze list is, the larger the number of the background application programs which are described to be run is, that is, the larger the resource occupation of the electronic device is.
The freezing moment can thus be adjusted according to the number of identifications. For example, when the number of the identifiers is large, the freezing time can be reduced, so that the background application program can be quickly frozen to reduce the resource occupation of the electronic equipment.
Specifically, the number of identifiers may be divided into a plurality of number intervals in advance, and then a corresponding relationship between each number interval and the adjustment duration is established. When the number of the identifiers of the application identifiers in the freeze list is larger than the number threshold, determining the adjusting time length corresponding to the number interval in which the number of the identifiers falls, and reducing the freezing time corresponding to the application identifiers in the freeze list according to the adjusting time length. For example, when the freeze list includes 10 application identifiers, the adjustment time duration corresponding to the number of acquired identifiers 10 is 5 seconds, and each freeze time included in the freeze list may be reduced by 5 seconds.
Step 210, a frozen list is obtained.
And storing the freeze list in the electronic equipment, and recording the application identification of the background application program to be frozen and the corresponding freezing moment through the freeze list. Specifically, the freeze list may further include a switching time at which the corresponding storage background application program switches from the foreground to the background, which is not limited herein.
And 212, sorting the application identifications stored in the freeze list according to the freezing time, and reading the application identification corresponding to the freezing time closest to the current time from the sorted freeze list as a target application identification.
One or more application identifiers and corresponding freezing moments are stored in the freezing list, and in order to search the application identifiers more conveniently, the application identifiers stored in the freezing list can be sorted according to the freezing moments. Specifically, the application identifiers may be sorted according to the order of the freezing time from far to near, or the application identifiers may be sorted according to the order of the freezing time from near to far, which is not limited herein.
After the application identifiers are sorted according to the freezing time, the application identifier corresponding to the freezing time closest to the current time can be read from the sorted freezing list to serve as the target application identifier. That is to say, after the application identifiers are sorted according to the freezing time, the time interval between the freezing time and the current time is gradually changed according to the sorting order, and then the first or last application identifier in the sorted freezing list can be directly read as the target application identifier.
For example, the application identifiers are sorted according to the freezing time, and the earlier the application identifier is sorted, the closer the corresponding freezing time is to the current time, the application identifier at the top of the sorting in the freezing list can be directly obtained and used as the target application identifier.
In one embodiment, the electronic device may implement a looper mechanism through one thread, and continuously and circularly read the freeze list "freeze _ list" through the looper mechanism. The freeze list "freeze _ list" stores one or more data structures "freeze _ unit", and each data structure "freeze _ unit" is used to store information such as UID (User Identification), packet name, switching time from foreground to background, and freeze time of a background application.
The application identifier may be identified by the UID and/or the packet name, and the "freeze _ units" in the "freeze _ list" are arranged in order from near to far from the freeze time. Thus, the looper mechanism can directly read the application identifier in the first-ranked "freeze _ unit" in the "freeze _ list" as the target application identifier.
FIG. 3 is a diagram of a freeze list in one embodiment. As shown in fig. 3, the application identifiers 302 and the freezing time 304 are recorded in the freezing list, and the application identifiers 302 are sorted according to the freezing time 304. The freezing moments 304 stored in the freezing list in fig. 3 are sorted according to time sequence "14: 00: 12" → "14: 00: 20" → "14: 00: 25" → "14: 00: 31: 12: 2018, 08 and 12: 2018" → "14: 00: 31: 12: 2018, 08 and 12: 2018", so that the application identifiers 302 can be sorted according to the sorting sequence.
And 214, freezing the background application program corresponding to the target application identifier when the current time reaches the freezing time corresponding to the target application identifier.
After the freezing time corresponding to the target application identifier is obtained, the clock in the electronic device can be continuously read through the thread, and the current time is obtained. And when the acquired current time reaches the freezing time corresponding to the target application identifier, freezing the background application program corresponding to the target application identifier. For example, the freezing time corresponding to the acquired target application identifier is "15: 20:10 at 25/9/2018", then the thread may read the current time every 1 second, and when the current time reaches "15: 20:10 at 25/9/2018", the background application program corresponding to the target application program is frozen.
In one embodiment, after the background application program corresponding to the target application identification is frozen, the target application identification and the corresponding freezing time can be deleted from the freezing list. After the background application program corresponding to the target application identification is frozen, the background application program can be awakened, and the awakened background application program can be restored to a normal running state. For example, the user may manually wake up the frozen background application, or may set a freezing duration, and wake up the frozen background application when the freezing duration of the background application reaches the freezing duration.
The application program processing method provided by the embodiment may store the application identifier of the background application program and the corresponding freezing time through the freezing list. And then acquiring an application identifier corresponding to the freezing moment closest to the current moment from the acquired freezing list as a target application identifier. And when the current moment reaches the freezing moment corresponding to the target application identifier, freezing the background application program corresponding to the target application identifier. Therefore, the freezing of the application program can be accurately controlled through the freezing list, and the electronic equipment is prevented from carrying out uniform processing on the application program, so that the accuracy of processing the application program is improved, and the resource occupation of the electronic equipment is reduced.
In an embodiment, as shown in fig. 4, the freeze time may include a first freeze time and a second freeze time, where the first freeze time is smaller than the second freeze time, and the step of freezing the background application may specifically include:
step 402, when the current time reaches a first freezing time corresponding to the target application identifier, controlling the background application program corresponding to the target application identifier to enter a resource restriction state, wherein the resource occupancy rate of the application program in the resource restriction state to the electronic device is smaller than an occupancy rate threshold value.
In the embodiment provided by the application, the application identifier, the first freeze time and the second freeze time may be correspondingly stored, where the first freeze time is used to control the application program to enter the resource restriction state, and the second freeze time is used to control the application program to freeze. Specifically, the resource refers to software or hardware resources that are necessary for the electronic device to process the application event, such as a Central Processing Unit (CPU), a Memory (Memory), hardware, a network resource, and an Input-Output (IO) of the electronic device.
The application in the frozen state is not shut down and is not running for a while. If the application program is in the frozen state, the application program does not occupy the processor resources, but still occupies the resources of the electronic device, such as the memory, the hardware and the like. The resource limitation state refers to a state of limiting resources of the electronic device used by the application program during running, and the resource occupancy rate of the application program in the resource limitation state to the electronic device is smaller than the occupancy rate threshold value. For example, the CPU occupancy rate used by the control application at runtime cannot exceed 5%.
When detecting that the current time reaches the first freezing time corresponding to the target application identifier, the electronic device may control the background application program corresponding to the target application identifier to enter a resource restriction state. The resource occupancy rate of the background application program in the resource limiting state to the electronic device is small, so that the resources of the electronic device can be prevented from being excessively occupied.
And step 404, freezing the background application program corresponding to the target application identifier when the current time reaches a second freezing time corresponding to the target application identifier.
After the background application enters the resource restricted state, the current time is compared with the second freeze time. And freezing the background application program corresponding to the target application identifier when the current time reaches a second freezing time.
In an embodiment, when the freezing time includes a first freezing time and a second freezing time, the application identifiers stored in the freezing list may be sorted according to the first freezing time, and then the application identifier corresponding to the first freezing time closest to the current time is read from the sorted freezing list as the target application identifier. And when the current time reaches the first freezing time, controlling the target application program to enter a resource limitation state, and adding the target application identifier and the corresponding second freezing time into a new freezing list.
And sequencing the target application programs stored in the new freezing list according to the second freezing time, and then acquiring the target application identifier corresponding to the second freezing time closest to the current time as the application identifier to be frozen. And the electronic equipment monitors whether the current moment reaches a second freezing moment corresponding to the application identifier to be frozen in real time. And freezing the background application program corresponding to the application identifier to be frozen when the current time reaches a second freezing time corresponding to the application identifier to be frozen.
It should be understood that although the steps in the flowcharts of fig. 1, 2, and 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1, 2, and 4 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
FIG. 5 is a block diagram of an application processing device according to an embodiment. As shown in fig. 5, the application processing device 500 includes a list acquisition module 502, an identification acquisition module 504, and an application freezing module 506. Wherein:
the list obtaining module 502 is configured to obtain a freeze list, where the freeze list is used to store an application identifier of a background application program and a corresponding freeze time.
An identifier obtaining module 504, configured to obtain, from the freeze list, an application identifier corresponding to a freeze time closest to the current time as a target application identifier.
And an application freezing module 506, configured to freeze the background application program corresponding to the target application identifier when the current time reaches a freezing time corresponding to the target application identifier.
The application processing apparatus provided in the foregoing embodiment may store the application identifier of the background application and the corresponding freeze time through the freeze list. And then acquiring an application identifier corresponding to the freezing moment closest to the current moment from the acquired freezing list as a target application identifier. And when the current moment reaches the freezing moment corresponding to the target application identifier, freezing the background application program corresponding to the target application identifier. Therefore, the freezing of the application program can be accurately controlled through the freezing list, and the electronic equipment is prevented from carrying out uniform processing on the application program, so that the accuracy of processing the application program is improved, and the resource occupation of the electronic equipment is reduced.
Fig. 6 is a schematic structural diagram of an application processing apparatus according to another embodiment. As shown in fig. 6, the application processing apparatus 600 includes a list generation module 602, a list acquisition module 604, an identification acquisition module 606, and an application freezing module 608. Wherein:
a list generating module 602, configured to, when it is detected that a first application is switched from a foreground to a background, obtain a switching time at which the first application is switched from the foreground to the background; and acquiring the freezing moment corresponding to the first application program according to the switching moment, and storing the application identifier and the freezing moment corresponding to the first application program into the freezing list.
The list obtaining module 604 is configured to obtain a freeze list, where the freeze list is used to store an application identifier of a background application program and a corresponding freeze time.
An identifier obtaining module 606, configured to obtain, from the freeze list, an application identifier corresponding to a freeze time closest to the current time as a target application identifier.
And an application freezing module 608, configured to freeze the background application program corresponding to the target application identifier when the current time reaches a freezing time corresponding to the target application identifier.
The application processing apparatus provided in the above embodiment can accurately control the freezing of the application through the freezing list, and avoid the electronic device from performing unified processing on the application, thereby improving the accuracy of processing the application and reducing the resource occupation of the electronic device.
In an embodiment, the list generating module 602 is further configured to obtain a preset freezing time, and calculate a freezing time corresponding to the application according to the switching time and the preset freezing time; or acquiring the application level of the first application program, acquiring the corresponding freezing time length according to the first application level, and calculating the freezing time corresponding to the first application program according to the switching time and the acquired freezing time length.
In one embodiment, the list generating module 602 is further configured to, when it is detected that the second application program switches from the background to the foreground or the second application program stops running, obtain an application identifier corresponding to the second application program that switches from the background to the foreground; and deleting the application identifier and the freezing moment corresponding to the second application program from the freezing list.
In an embodiment, the list generating module 602 is further configured to count the number of identifiers of the application identifiers included in the freeze list, and adjust the freeze time corresponding to each application identifier according to the number of identifiers.
In an embodiment, the identifier obtaining module 606 is further configured to sort the application identifiers stored in the freeze list according to the freeze moments, and read, from the sorted freeze list, an application identifier corresponding to a freeze moment closest to the current moment, as a target application identifier.
In one embodiment, the application freezing module 608 is further configured to control the background application program corresponding to the target application identifier to enter a resource restriction state when the current time reaches a first freezing time corresponding to the target application identifier, where resource occupancy rate of the application program in the resource restriction state to the electronic device is smaller than an occupancy rate threshold;
and freezing the background application program corresponding to the target application identifier when the current time reaches a second freezing time corresponding to the target application identifier.
The division of the modules in the application processing apparatus is only for illustration, and in other embodiments, the application processing apparatus may be divided into different modules as needed to complete all or part of the functions of the application processing apparatus.
For specific limitations of the application processing device, reference may be made to the above limitations of the application processing method, which are not described herein again. The respective modules in the above application processing apparatus may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The implementation of each module in the application processing apparatus provided in the embodiments of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program modules constituted by the computer program may be stored on the memory of the terminal or the server. Which when executed by a processor, performs the steps of the method described in the embodiments of the present application.
The embodiment of the application also provides the electronic equipment. As shown in fig. 7, 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 electronic device 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 electronic device as the mobile phone as an example:
fig. 7 is a block diagram of a partial structure of a mobile phone related to an electronic device provided in an embodiment of the present application. Referring to fig. 7, the handset includes: radio Frequency (RF) circuit 710, memory 720, input unit 730, display unit 740, sensor 750, audio circuit 760, wireless fidelity (WiFi) module 770, processor 780, and power supply 790. Those skilled in the art will appreciate that the handset configuration shown in fig. 7 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 710 may be used for receiving and transmitting signals during information transmission or communication, and may receive downlink information of a base station and then process the downlink information to the processor 780; 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 710 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 720 may be used to store software programs and modules, and the processor 780 may execute various functional applications and data processing of the cellular phone by operating the software programs and modules stored in the memory 720. The memory 720 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, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 720 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 730 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 700. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, which may also be referred to as a touch screen, can collect touch operations of a user (e.g., operations of the user on or near the touch panel 731 by using a finger, a stylus, or any other suitable object or accessory) thereon or nearby, and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 731 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 it to touch point coordinates, and sends the touch point coordinates to the processor 780, and can receive and execute commands from the processor 780. In addition, the touch panel 731 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 730 may include other input devices 732 in addition to the touch panel 731. In particular, other input devices 732 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 740 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 740 may include a display panel 741. In one embodiment, the Display panel 741 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the touch panel 731 can cover the display panel 741, and when the touch panel 731 detects a touch operation on or near the touch panel 731, the touch operation is transmitted to the processor 780 to determine the type of the touch event, and then the processor 780 provides a corresponding visual output on the display panel 741 according to the type of the touch event. Although the touch panel 731 and the display panel 741 are two independent components in fig. 7 to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 731 and the display panel 741 may be integrated to implement the input and output functions of the mobile phone.
The cell phone 700 may also include at least one sensor 750, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 741 and/or a 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; 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 760, speaker 761, and microphone 762 may provide an audio interface between a user and a cell phone. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 and output; on the other hand, the microphone 762 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 760, and then outputs the audio data to the processor 780 for processing, and then the processed audio data may be transmitted to another mobile phone through the RF circuit 710, or outputs the audio data to the memory 720 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 770, and provides wireless broadband Internet access for the user. Although fig. 7 shows WiFi module 770, it is understood that it does not belong to the essential components of handset 700 and may be omitted as desired.
The processor 780 is a control center of the mobile phone, connects various parts of the entire mobile phone by 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 720 and calling data stored in the memory 720, thereby integrally monitoring the mobile phone. In one embodiment, processor 780 may include one or more processing units. In one embodiment, processor 780 may integrate an application processor and a modem processor, where the application processor primarily handles operating systems, user interfaces, applications, and the like; the modem processor handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 780.
The handset 700 also includes a power supply 790 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 780 via a power management system that may be used to manage charging, discharging, and power consumption.
In one embodiment, the cell phone 700 may also include a camera, a bluetooth module, and the like.
In the embodiment of the present application, the electronic device includes a processor 780 that implements the steps of the application processing method when executing the computer program stored in the memory.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the application processing method.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform an application processing method.
Any reference to memory, storage, database, or other medium used herein may include non-volatile and/or volatile memory. 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 (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not 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 (10)

1. An application processing method, comprising:
the method comprises the steps of obtaining a freezing list, wherein the freezing list is used for storing application identifications of background application programs and corresponding freezing moments;
acquiring an application identifier corresponding to a freezing moment closest to the current moment from the freezing list as a target application identifier;
reading the current time once every certain time interval, comparing the current time with the freezing time of the background application program corresponding to the target application identifier, and judging whether the current time reaches the freezing time; the freezing time comprises a first freezing time and a second freezing time, and the first freezing time is smaller than the second freezing time;
when the current time reaches a first freezing time corresponding to the target application identifier, controlling a background application program corresponding to the target application identifier to enter a resource limiting state, wherein the resource occupancy rate of the application program in the resource limiting state to the electronic equipment is smaller than an occupancy rate threshold value;
and freezing the background application program corresponding to the target application identifier when the current time reaches a second freezing time corresponding to the target application identifier.
2. The method according to claim 1, wherein the obtaining, from the freeze list, an application identifier corresponding to a freeze time closest to a current time as a target application identifier includes:
and sorting the application identifications stored in the freezing list according to the freezing time, and reading the application identification corresponding to the freezing time closest to the current time from the sorted freezing list as a target application identification.
3. The method of claim 1, further comprising:
when detecting that a first application program is switched from a foreground to a background, acquiring the switching time of the first application program from the foreground to the background;
and acquiring the freezing moment corresponding to the first application program according to the switching moment, and storing the application identifier and the freezing moment corresponding to the first application program into the freezing list.
4. The method according to claim 3, wherein the obtaining the freezing time corresponding to the first application according to the switching time comprises:
acquiring a preset freezing time length, and calculating to obtain a freezing time corresponding to the application program according to the switching time and the preset freezing time length; or
And acquiring the application level of the first application program, acquiring the corresponding freezing time according to the first application level, and calculating the freezing time corresponding to the first application program according to the switching time and the acquired freezing time.
5. The method of claim 1, further comprising:
when detecting that the second application program is switched from a background to a foreground or the second application program stops running, acquiring an application identifier corresponding to the second application program switched from the background to the foreground;
and deleting the application identifier and the freezing moment corresponding to the second application program from the freezing list.
6. The method according to any one of claims 1 to 5, further comprising:
counting the number of the identifiers of the application identifiers contained in the freezing list, and adjusting the freezing time corresponding to each application identifier according to the number of the identifiers.
7. An application processing apparatus, comprising:
the device comprises a list acquisition module, a freezing list acquisition module and a freezing control module, wherein the freezing list is used for storing an application identifier of a background application program and a corresponding freezing moment;
the identification acquisition module is used for acquiring an application identification corresponding to a freezing moment closest to the current moment from the freezing list as a target application identification;
the application freezing module is used for reading the current time once at a certain time interval, comparing the current time with the freezing time of the background application program corresponding to the target application identifier and judging whether the current time reaches the freezing time; the freezing time comprises a first freezing time and a second freezing time, and the first freezing time is smaller than the second freezing time; when the current time reaches a first freezing time corresponding to the target application identifier, controlling a background application program corresponding to the target application identifier to enter a resource limiting state, wherein the resource occupancy rate of the application program in the resource limiting state to the electronic equipment is smaller than an occupancy rate threshold value; and freezing the background application program corresponding to the target application identifier when the current time reaches a second freezing time corresponding to the target application identifier.
8. The apparatus according to claim 7, wherein the list generating module is further configured to, when it is detected that the first application switches from the foreground to the background, obtain a switching time when the first application switches from the foreground to the background; acquiring a preset freezing time length, and calculating to obtain a freezing time corresponding to the application program according to the switching time and the preset freezing time length; or acquiring the application level of the first application program, acquiring the corresponding freezing time length according to the first application level, and calculating the freezing time corresponding to the first application program according to the switching time and the acquired freezing time length.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 6.
10. 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 6.
CN201811204974.6A 2018-10-16 2018-10-16 Application program processing method and device, electronic equipment and computer readable storage medium Active CN109388487B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811204974.6A CN109388487B (en) 2018-10-16 2018-10-16 Application program processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811204974.6A CN109388487B (en) 2018-10-16 2018-10-16 Application program processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109388487A CN109388487A (en) 2019-02-26
CN109388487B true CN109388487B (en) 2020-12-22

Family

ID=65427420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811204974.6A Active CN109388487B (en) 2018-10-16 2018-10-16 Application program processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109388487B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256119A (en) * 2019-07-02 2021-01-22 中兴通讯股份有限公司 Application program freezing control method and device, terminal and readable storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4700104B2 (en) * 2006-03-17 2011-06-15 富士通株式会社 Server management method, program and apparatus
CN107436805A (en) * 2016-05-27 2017-12-05 宇龙计算机通信科技(深圳)有限公司 A kind of method and device for freezing application
CN106125882B (en) * 2016-06-15 2019-04-26 深圳市万普拉斯科技有限公司 A kind of management method and electronic equipment of application program
CN106155788A (en) * 2016-06-28 2016-11-23 宇龙计算机通信科技(深圳)有限公司 A kind of application program freezing method and terminal unit
CN106201683A (en) * 2016-06-30 2016-12-07 宇龙计算机通信科技(深圳)有限公司 A kind of manage the method for application, device and terminal
CN106547615B (en) * 2016-11-25 2020-12-22 珠海市魅族科技有限公司 Management method and management module for background application
CN107329772B (en) * 2017-05-16 2020-08-28 广东小天才科技有限公司 Application program management method and device of mobile terminal
CN107943571B (en) * 2017-11-14 2020-03-10 Oppo广东移动通信有限公司 Background application control method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN109388487A (en) 2019-02-26

Similar Documents

Publication Publication Date Title
CN107272872B (en) Power saving control method and related product
CN109144232B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN108320744B (en) Voice processing method and device, electronic equipment and computer readable storage medium
CN106250223B (en) Background process management method and terminal equipment
CN112703714B (en) Application processing method and device, computer equipment and computer readable storage medium
WO2019128546A1 (en) Application program processing method, electronic device, and computer readable storage medium
CN108616653B (en) Information processing method, device, mobile terminal and computer readable storage medium
CN108541013B (en) Information processing method, device, mobile terminal and computer readable storage medium
CN107562539B (en) Application program processing method and device, computer equipment and storage medium
CN109445917B (en) Application processing method and device, electronic equipment and computer readable storage medium
JP2020537213A (en) Methods for reducing terminal power consumption, and terminals
CN108334345B (en) Application processing method and device, readable storage medium and mobile terminal
CN109992380B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN108668016B (en) Information processing method, device, mobile terminal and computer readable storage medium
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
CN109992360B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN109992309B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992323B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN109511139B (en) WIFI control method and device, mobile device and computer-readable storage medium
CN106454953B (en) Flow control method, device and terminal
CN109388487B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN112997507B (en) Audio system control method, device, terminal and computer readable storage medium
CN109375995B (en) Application freezing method and device, storage medium and electronic equipment
CN110046033B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN109992395B (en) Application freezing method and device, terminal 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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210609

Address after: Room 01, 8th floor, No.1 Lane 61, shengxia Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Patentee after: Zheku Technology (Shanghai) Co., Ltd

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

Patentee before: OPPO Guangdong Mobile Communications Co.,Ltd.