CN115344357A - Application program processing method and device and storage medium - Google Patents

Application program processing method and device and storage medium Download PDF

Info

Publication number
CN115344357A
CN115344357A CN202110511034.7A CN202110511034A CN115344357A CN 115344357 A CN115344357 A CN 115344357A CN 202110511034 A CN202110511034 A CN 202110511034A CN 115344357 A CN115344357 A CN 115344357A
Authority
CN
China
Prior art keywords
preset
application
adjusting
starting mode
trigger threshold
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.)
Pending
Application number
CN202110511034.7A
Other languages
Chinese (zh)
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110511034.7A priority Critical patent/CN115344357A/en
Publication of CN115344357A publication Critical patent/CN115344357A/en
Pending legal-status Critical Current

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
    • G06F9/4893Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues taking into account power or heat criteria
    • 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The disclosure relates to a processing method and device of an application program and a storage medium. The method comprises the following steps: determining the number of application programs started according to a preset starting mode in a preset time period; determining that the electronic equipment enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold; executing an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of the termination process. According to the technical scheme, the application program can be triggered more timely, the possibility of closing the application program which is just started can be reduced, the triggering threshold value is set to be adjustable, the processing process of the application program is more flexible, the application program is more adaptive to the current scene, and the normal operation of the application program can be guaranteed as far as possible.

Description

Application program processing method and device and storage medium
Technical Field
The present disclosure relates to communication application technologies, and in particular, to a method and an apparatus for processing an application program, and a storage medium.
Background
Since Applications (APPs) of Android (Android) are developed based on a programming language (e.g., java language), in order to make the APPs run more smoothly, bytecodes of the programming language can be compiled into machine codes by introducing a compiler to compile the APPs.
At present, electronic devices with Android systems are more, for example, mobile phones with Android systems occupy most of the mobile phone markets. When the version of the processor of the electronic device is low or the electronic device is old, if the application program is continuously started, because each application executes a large amount of codes in the starting process, which includes allocating resources such as memory or pictures to be used for loading, the electronic device may be stuck due to the consumption of available memory.
In the related art, when the system memory is insufficient, the purpose of releasing the memory can be achieved by closing the process with the lower priority, but releasing the memory in this way increases the possibility that the application program which is just started is closed, and further causes that part of the application programs which need to be used cannot run normally.
Disclosure of Invention
The disclosure provides a processing method and device of an application program and a storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided an application processing method, applied to an electronic device, including:
determining the number of application programs started according to a preset starting mode in a preset time period;
determining that the electronic equipment enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold;
executing an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of the termination process.
Optionally, the adjusting the trigger threshold for the low-memory termination daemon of the electronic device to execute the task of terminating the process includes:
adjusting the trigger threshold of the low-memory termination daemon for executing the terminated process task from a standard trigger threshold to a target trigger threshold corresponding to the continuous starting mode;
wherein the target trigger threshold is less than the standard trigger threshold.
Optionally, the method further includes:
and under the condition that the electronic equipment exits the continuous starting mode, adjusting the trigger threshold of the low-memory termination daemon to execute the task of the termination process from the target trigger threshold to the standard trigger threshold.
Optionally, the adjusting policy further includes: adjusting an application memory page of the application program running in the background; the adjusting the application memory page of the application program running in the background comprises:
the application memory pages of the first type are recycled to a preset cache region; and/or the presence of a gas in the gas,
and compressing the application memory page of the second type, and storing the compressed application memory page to a system memory of the electronic device.
Optionally, the adjusting policy further includes: adjusting an operating frequency of a processor of the electronic device; the adjusting the operating frequency of the processor of the electronic device includes:
adjusting the working frequency of the processor of the electronic equipment from the current working frequency to a target working frequency;
wherein the target operating frequency is greater than the current operating frequency.
Optionally, the adjusting policy further includes: adjusting the running state of the application program running in the background; the adjusting the running state of the application program running in the background comprises the following steps:
and when the number of the application programs running in the background is larger than a preset threshold value, closing the unused application programs in the preset running time.
Optionally, the determining the number of the application programs started in the preset time period according to the preset starting manner includes:
determining the number of the application programs started according to the preset starting mode within a first preset time length;
wherein, the starting time of the first preset duration is as follows: and detecting the moment when the application program is started according to the preset starting mode.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for processing an application program, applied to an electronic device, including:
the first determining module is configured to determine the number of the application programs started according to a preset starting mode;
the second determining module is configured to determine that the electronic device enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold;
the execution module is configured to execute an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process.
Optionally, the execution module is further configured to:
adjusting the trigger threshold of the low-memory termination daemon for executing the terminated process task from a standard trigger threshold to a target trigger threshold corresponding to the continuous starting mode;
wherein the target trigger threshold is less than the standard trigger threshold.
Optionally, the apparatus further comprises:
and the adjusting module is configured to adjust the trigger threshold of the low-memory termination daemon for executing the termination process task from the target trigger threshold to the standard trigger threshold when the electronic device exits the continuous starting mode.
Optionally, the adjusting policy further includes: adjusting an application memory page of the application program running in the background; the execution module is further configured to:
the application memory pages of the first type are recycled to a preset cache region; and/or the presence of a gas in the gas,
and compressing the application memory page of the second type, and storing the compressed application memory page to a system memory of the electronic device.
Optionally, the adjusting policy further includes: adjusting an operating frequency of a processor of the electronic device; the execution module is further configured to:
adjusting the working frequency of the processor of the electronic equipment from the current working frequency to a target working frequency;
wherein the target operating frequency is greater than the current operating frequency.
Optionally, the adjusting policy further includes: adjusting the running state of the application program running in the background; the execution module is further configured to:
and when the number of the application programs running in the background is larger than a preset threshold value, closing the unused application programs in the preset running time.
Optionally, the first determining module is further configured to:
determining the number of the application programs started according to the preset starting mode within a first preset time length;
wherein, the starting time of the first preset duration is as follows: and detecting the moment when the application program is started according to the preset starting mode.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for processing an application program, including:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: the steps in the processing method for implementing any one of the above-described applications of the first aspect when executed.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor of a processing apparatus of an application program, enable the apparatus to perform the processing method of any one of the above-mentioned first aspects.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in this embodiment of the present disclosure, when the number of the applications started in the preset starting manner is greater than a preset number threshold, it may be determined that the electronic device enters a continuous starting mode, and in the continuous starting mode, an adjustment policy corresponding to the continuous starting mode is executed, where the adjustment policy at least includes: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process.
Therefore, on one hand, compared with the related art in which whether to close a process with a lower priority is determined only according to the memory state of the system memory of the electronic device, in the embodiment of the present disclosure, after the electronic device enters the continuous start mode, the adjustment policy corresponding to the continuous start mode is started to be executed, that is, the corresponding adjustment policy is determined according to the state of the application program, and from the perspective of the application program, the closing operation is performed on the process with the lower priority after the memory state of the system memory is not analyzed, which can trigger a more timely process.
On the other hand, the method and the device can adjust the trigger threshold for executing the task of terminating the process to the low-memory terminating daemon according to the current application scene of the electronic device, for example, the trigger threshold can be reduced, compared with the prior art in which only the memory state of the system memory is considered and the current use scene of the electronic device is not considered, the possibility of closing off the application program which is just started can be reduced, and the trigger threshold is set to be adjustable, so that the processing process of the application program is more flexible, the application program is more adaptive to the current scene, and the normal operation of the application program can be ensured as much as possible.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flowchart illustrating a processing method of an application according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating another method of processing an application according to an example embodiment.
FIG. 3 is a block diagram illustrating a processing device for an application according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating an application processing apparatus 1200 according to an example embodiment.
Fig. 5 is a block diagram illustrating another application processing apparatus 1300 according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
The embodiment of the disclosure provides a processing method of an application program, which can be applied to electronic equipment. Fig. 1 is a flowchart illustrating a processing method of an application according to an exemplary embodiment, where the method mainly includes the following steps as shown in fig. 1:
in step 101, determining the number of application programs started in a preset starting mode within a preset time period;
in step 102, determining that the electronic device enters a continuous starting mode when the number of the application programs started according to the preset starting mode is greater than a preset number threshold;
in step 103, in the continuous starting mode, executing an adjusting strategy corresponding to the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process.
The processing method of the application program related in the embodiment of the present disclosure may be applied to an electronic device, where the electronic device includes a mobile terminal and a fixed terminal, where the mobile terminal includes: mobile phones, tablet computers, notebook computers, and the like; the fixed terminal includes: a personal computer. In other optional embodiments, the processing method of the application program may also be executed in a network side device, where the network side device includes: servers, processing centers, etc.
In some embodiments, an application may be a computer program for performing one or more specific tasks, which may interact with a user while the application is running in user mode, with a visual user interface, while an application process is an entity of the application, which is a running activity of the application with independent functionality with respect to a certain data set.
Here, the application program started in the preset starting manner includes: the application process is not created by the system, and an application program of the application resource needs to be loaded in the starting process, for example, the application program of a part of or all the application resource needs to be loaded in the starting process; or an application that was previously started, but was closed. The application program started according to the preset starting mode has no historical starting and running process, which is equivalent to starting the application program for the first time.
Wherein, the preset starting mode may include: a cold start mode or a warm start mode. For example, an application program started in a cold-boot manner needs to load all application resources during the boot process, while an application program started in a warm-boot manner needs to load part of the application resources during the boot process. In some embodiments, the application is started in the cold start mode at a slower speed than in the warm start mode, and the memory resources consumed by starting the application in the cold start mode are higher than the memory resources consumed by starting the application in the warm start mode. And the user does not accumulate the count if the previously started application is repeatedly started.
In the embodiment of the present disclosure, the application programs started in the preset starting manner within the preset time period may be counted, and when the number of the application programs started in the preset starting manner within the preset time period is greater than a preset number threshold, it is determined that the electronic device enters the continuous starting mode. Because the application programs started according to the preset starting mode consume the system memory of the electronic equipment, when the number of the application programs started according to the preset starting mode is large, namely exceeds a preset number threshold value, the requirement on memory resources is particularly high, and at this time, the electronic equipment can be determined to enter a continuous starting mode.
In the embodiment of the present disclosure, after entering the continuous start mode, an adjustment policy corresponding to the continuous start mode may be determined, for example, a trigger threshold for executing a task of terminating a process by a low-memory termination daemon of the electronic device may be adjusted. Here, a Low Memory termination Daemon (LMKD) is used to monitor the state of the system Memory of the electronic device, and the Memory pressure should be reduced by terminating unnecessary processes.
In this embodiment of the present disclosure, when the number of the applications started in the preset starting manner is greater than a preset number threshold, it may be determined that the electronic device enters a continuous starting mode, and in the continuous starting mode, an adjustment policy corresponding to the continuous starting mode is executed, where the adjustment policy at least includes: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process. For example, the trigger threshold for the low memory termination daemon to execute the terminating process task may be lowered.
In some embodiments, the trigger threshold of the low memory termination daemon may be determined according to a remaining amount of a system memory of the electronic device, and when the trigger threshold is reached, the low memory termination daemon starts executing the terminated process task, i.e., starts to close a process with a lower priority. For example, the termination process task may be started when the remaining amount of the system memory is 180MB, and the termination process task may be executed when the remaining amount of the system memory is 100 MB.
Therefore, on one hand, compared with the related art in which whether to close a process with a lower priority is determined only according to the memory state of the system memory of the electronic device, in the embodiment of the present disclosure, after the electronic device enters the continuous start mode, the adjustment policy corresponding to the continuous start mode is started to be executed, that is, the corresponding adjustment policy is determined according to the state of the application program, and from the perspective of the application program, the closing operation is performed on the process with the lower priority after the memory state of the system memory is not analyzed, which can trigger a more timely process.
On the other hand, the method and the device can adjust the trigger threshold for executing the task of terminating the process by the low-memory termination daemon according to the current application scene of the electronic device, for example, the trigger threshold can be reduced, compared with the prior art that only the memory state of the system memory is considered and the current use scene of the electronic device is not considered, the possibility of closing the application program which is just started can be reduced, and the trigger threshold is set to be adjustable, so that the processing process of the application program is more flexible, the application program is more adaptive to the current scene, and the normal operation of the application program can be ensured as much as possible.
In some embodiments, the adjusting the trigger threshold for the low-memory termination daemon of the electronic device to execute the task of terminating the process includes:
adjusting the trigger threshold of the low-memory termination daemon for executing the terminated process task from a standard trigger threshold to a target trigger threshold corresponding to the continuous starting mode;
wherein the target trigger threshold is less than the standard trigger threshold.
In the embodiment of the present disclosure, the trigger threshold of the low-memory termination daemon may be determined according to the remaining amount of the system memory of the electronic device, and when the trigger threshold is reached, the low-memory termination daemon starts to execute the task of terminating the process, that is, starts to close the process with a lower priority. For example, the standard trigger threshold may be 180MB, i.e. before the trigger threshold is adjusted, when the residual amount of the system memory is less than or equal to 180MB, the operation of terminating the task of the process is started. For another example, the target trigger threshold may be 100MB, that is, after the trigger threshold is adjusted, when the remaining amount of the system memory is less than or equal to 100MB, the operation of terminating the process task is started. Of course, the standard trigger threshold and the target trigger threshold may be other values as long as the target trigger threshold is lower than the standard trigger threshold, and are not specifically limited herein.
In some embodiments, the target trigger threshold may be set as needed, for example, the target trigger threshold corresponding to the electronic device in the continuous activation mode may be determined according to a capacity of a system memory of the electronic device, for example, a size of the target trigger threshold is positively correlated to a capacity of the system memory of the electronic device, that is, the larger the capacity of the system memory of the electronic device is, the larger the target trigger threshold corresponding to the electronic device is, the smaller the capacity of the system memory of the electronic device is, and the smaller the target trigger threshold corresponding to the electronic device is. By associating the size of the target trigger threshold with the system memory of the electronic device, the target trigger threshold can be made to correspond to the system memory of the electronic device, and further the processing process of the application program is made to be more adaptive to the system memory of the electronic device.
Of course, in other embodiments, the target trigger threshold corresponding to the electronic device in the continuous system mode may also be determined according to the model of the electronic device; in other embodiments, the target trigger threshold corresponding to the electronic device in the continuous system mode may also be determined according to performance of a processor of the electronic device, and is not limited in this embodiment.
In the embodiment of the disclosure, after the electronic device enters the continuous start mode, the trigger threshold of the low-memory termination daemon program may be reduced from the standard trigger threshold to the target trigger threshold, so that the operation of terminating the process task is performed when the system memory is low, and the possibility of the electronic device closing the application program which has just been started can be further reduced.
Compared with the method for setting the fixed standard trigger threshold in the related art, the trigger threshold in the embodiment of the present disclosure may be adjusted according to the number of the started application programs, so that the processing process of the application programs is more flexible, and the application scenes of the current electronic device are more matched.
In some embodiments, the method further comprises:
and under the condition that the electronic equipment exits the continuous starting mode, adjusting the trigger threshold of the low-memory termination daemon for executing the task of the termination process from the target trigger threshold to the standard trigger threshold.
In some embodiments, the electronic device is determined to exit the continuous start mode when detecting that the number of the applications started in the preset start mode is less than or equal to a preset number threshold. In other embodiments, it may also be determined that the electronic device exits the continuous start mode when a preset operation is detected. For example, upon detecting a lock screen operation, it may be determined that the electronic device exits the continuous start mode. For another example, it may also be determined that the electronic device exits the continuous start mode when a cleanup instruction for a background application is detected. The cleaning instruction can be used for instructing all application programs in the background to be cleaned by one key.
In the embodiment of the present disclosure, when the electronic device exits the continuous start mode, the trigger threshold for executing the termination process task by the low-memory termination daemon may be adjusted from the target trigger threshold to the standard trigger threshold. By restoring the trigger threshold of the low-memory termination daemon for executing the termination process task from the target trigger threshold to the standard trigger threshold in time, the extra power consumption of the electronic equipment can be reduced.
In some embodiments, the adjusting policy further comprises: adjusting an application memory page of the application program running in the background; the adjusting the application memory page of the application program running in the background includes:
the application memory pages of the first type are recycled to a preset cache region; and/or the presence of a gas in the gas,
and compressing the application memory page of the second type, and storing the compressed application memory page to a system memory of the electronic device.
Here, the first type of application memory page may include: memory pages, e.g., process file pages, may be reclaimed. In the embodiment of the present disclosure, memory recovery may be performed on the application memory page of the first type. Here, memory reclamation refers to: the system memory that can be reclaimed after the release, such as the cache and the buffer, belongs to a recoverable memory page, and is usually referred to as a process file page in memory management. Most process file pages can be directly recycled to the preset cache region, and when the process file pages are needed, the process file pages can be read again from the preset cache region (such as a disk).
The second type of application memory page includes: non-reclaimable memory pages, such as memory anonymous pages. Here, the memory anonymous page may be: the heap memory dynamically allocated by the application program cannot be directly recycled because the memory anonymous page is likely to be accessed again, and the memory anonymous page is rarely accessed after being allocated, which is also a waste of resources. In the embodiment of the present disclosure, the application memory page of the second type may be compressed and then stored, for example, the compression of the application memory page of the second type may be implemented by adjusting the configuration of the zram swappiness.
In the embodiment of the present disclosure, the first type of application memory page may be recycled to the preset cache region, so that the burden of the system memory may be reduced, the application memory page of the second memory may be compressed, and the compressed application memory page is stored in the system memory of the electronic device, so as to further reduce the burden of the system memory, and further reduce the occurrence of jamming in the electronic device.
In some other embodiments, the first type of application memory page and/or the second type of application memory page may be: and switching to the application memory page of the background. In the embodiment of the disclosure, the application memory page switched to the background can be recycled or compressed, so that the burden of the system memory can be reduced on the basis of ensuring the available memory. And the fluency of foreground application is ensured by limiting the memory resources required to be consumed by the background application program.
In some embodiments, the adjusting policy further comprises: adjusting an operating frequency of a processor of the electronic device; the adjusting the operating frequency of the processor of the electronic device includes:
adjusting the working frequency of the processor of the electronic equipment from the current working frequency to a target working frequency;
wherein the target operating frequency is greater than the current operating frequency.
Because each application program can execute a large amount of codes in the process of continuously starting the application, the method comprises the following steps: the memory to be used or the code for loading the picture resource is allocated, and even after the application program is switched to the background, the code still continues to execute the operations, and further occupies a Central Processing Unit (CPU) resource, so that the starting process of the subsequent application program is affected, and the electronic device is stuck.
In the embodiment of the disclosure, after the electronic device enters the continuous start mode, the operating frequency of the processor of the electronic device can be increased from the current operating frequency to the target operating frequency. Therefore, even if more application programs are started, the normal operation of the electronic equipment can be ensured, and the possibility of blockage is reduced.
In other embodiments, the operating frequency of the processor of the electronic device may also be adjusted after the application memory page of the application program running in the background is adjusted.
In other embodiments, after the electronic device exits the continuous start mode, the operating frequency of the processor of the electronic device may be adjusted from the target operating frequency to the current operating frequency, and the additional power consumption may be reduced by timely restoring the operating frequency of the processor of the electronic device to the current operating frequency.
In the embodiment of the disclosure, under the scene of continuously starting the application program, the working frequency of the CPU can be increased, and the fluency of the foreground application program is further ensured.
In some embodiments, the adjusting policy further comprises: adjusting the running state of the application program running in the background; the adjusting the running state of the application program running in the background comprises the following steps:
and when the number of the application programs running in the background is larger than a preset threshold value, closing the unused application programs in the preset running time.
Here, when the number of the applications running in the background is greater than the preset threshold, it indicates that the electronic device currently has a high requirement on the processor, and if all the applications running in the background are continuously maintained to run normally, the processor of the electronic device is burdened. In the embodiment of the disclosure, when it is determined that the number of the application programs running in the background is greater than the preset threshold, the unused application programs within the preset running duration can be closed in time.
Since the unused application program in the preset running time period may be the application program which is not desired by the user at present but forgotten to be closed, the unused application program in the preset running time period is closed, so that the burden of the processor can be relieved, and the feeling of using the electronic equipment by the user is not reduced.
The preset threshold may be set as needed, for example, the preset threshold may be determined according to a capacity of a system memory of the electronic device, for example, the preset threshold is positively correlated with the capacity of the system memory of the electronic device, that is, the larger the capacity of the system memory of the electronic device is, the larger the number of the applications allowed to run in the background is, the smaller the capacity of the system memory of the electronic device is, the smaller the number of the applications allowed to run in the background is. Of course, the preset threshold may also be determined in other ways, for example, the preset threshold is determined based on the model or the performance of the electronic device, and is not limited in this respect.
For another example, taking the preset threshold value as 5, and the preset running time as 2 minutes as an example, in the implementation process, if it is detected that the number of the applications running in the background exceeds 5, the applications that have not been used in 2 minutes may be closed.
In the embodiment of the disclosure, by limiting the running state of the application program in the background, the burden of the application program running in the background on the processor can be reduced, and the normal running of the electronic device is ensured.
In some embodiments, the determining the number of the applications started according to the preset starting manner includes:
determining the number of the application programs started according to the preset starting mode within a first preset time length;
wherein, the starting time of the first preset duration is as follows: and detecting the moment when the application program is started according to the preset starting mode.
In the embodiment of the disclosure, when the timing is started at the moment when the application program started in the preset starting manner is detected, the number of the application programs started in the preset starting manner within a first preset time period is determined. The first preset time period may be determined as needed, and in the implementation process, the first preset time period may be determined according to an experiment, or determined according to historical application data, which is not specifically limited herein.
For example, the first preset time period may be determined to be 60 seconds(s), and taking the first preset time period as 60s as an example, if it is detected that the number of the applications started according to the preset starting manner is greater than the preset number threshold within 60s, it is determined that the electronic device enters the continuous starting mode, and otherwise, the electronic device does not enter the continuous starting mode. The preset number threshold may be set as needed, for example, may be 5, and is not limited in particular herein.
Taking the electronic device as an example of a mobile phone, in the embodiment of the present disclosure, in the process of continuously starting an application program by using the mobile phone, a user scenario of the electronic device may be identified, and when the electronic device enters the scenario of continuously starting the application program, a trigger threshold of the LMKD may be reduced, a probability of closing a process may be reduced, and then the number of application programs closed by the LMKD may be reduced, so as to ensure the residence of the application program; by actively compressing or recycling the application memory pages, the situation that the processes occupy the memory can be reduced, and the working performance of the electronic equipment can be enhanced by improving the working frequency of the CPU. And when the electronic equipment exits the continuous starting mode, restoring the triggering threshold value of the LMKD and the working frequency of the CPU so as to reduce the power consumption of the electronic equipment.
Fig. 2 is a flowchart illustrating another processing method of an application according to an exemplary embodiment, where as shown in fig. 2, the method mainly includes the following steps:
in step 201, an application is started.
Here, an application on a desktop interface of the electronic device may be launched upon detecting a triggering operation (e.g., a clicking operation) for the application.
In step 202, it is determined whether the application program is started according to a preset starting mode.
In step 203, when it is determined that the starting mode of the application program is the preset starting mode, a first staying time period on a desktop interface of the electronic device is determined.
In step 204, after the application program is started, if an operation of returning from the application interface to the desktop interface is detected, a second staying time period on the application interface is obtained.
In step 205, it is determined whether the first dwell period is less than a second preset period and whether the second dwell period is less than a third preset period.
In step 206, 1 is added to the cumulative number of applications started according to the preset starting mode.
Here, when the first staying time period is shorter than a second preset time period and the second staying time period is shorter than a third preset time period, the application programs started in the preset starting manner are counted. The second preset time length and the third preset time length may be determined as needed, and in the implementation process, may be determined according to an experiment, or may be determined according to historical application data, which is not specifically limited herein.
In other embodiments, when the number of the applications started according to the preset starting mode is greater than a preset number threshold, it is determined that the electronic device enters the continuous starting mode. In other embodiments, the time when it is determined that the first staying time period is less than the second preset time period and the second staying time period is less than the third preset time period may also be determined as the starting time of the first preset time period.
For example, when a click operation for an application program on a desktop interface of the electronic device is detected, the application program can be started, and whether the application program is started according to a preset starting mode or not can be determined.
When the starting mode of the application program is determined to be the preset starting mode, a first stay time (T) on a desktop interface of the electronic equipment can be determined, after the application program is started, if the operation of returning from the application interface to the desktop interface is detected, a second stay time (A) on the application interface is obtained, and under the condition that T is less than 5 seconds and A is less than 10 seconds, the cumulative number of the application program started according to the preset starting mode is increased by 1.
In step 207, it is determined whether the number of applications started according to the preset starting manner is greater than a preset number threshold.
In step 208, when the number of the applications started according to the preset starting mode is greater than a preset number threshold, it is determined that the electronic device enters the continuous starting mode.
In other embodiments, when the number of the applications started according to the preset starting mode is greater than a preset number threshold, it is determined that the electronic device enters the continuous starting mode. For example, when the number of the applications started according to the preset starting mode exceeds 5, it is determined that the electronic device enters the continuous starting mode.
In other embodiments, the time when it is determined that the first staying time period is less than the second preset time period and the second staying time period is less than the third preset time period may also be determined as the starting time of the first preset time period.
FIG. 3 is a block diagram illustrating a processing device for an application according to an exemplary embodiment. As shown in fig. 3, the processing device 300 of the application program is applied to an electronic device, and mainly includes:
a first determining module 301, configured to determine the number of the applications started in a preset starting manner within a preset time period;
a second determining module 302, configured to determine that the electronic device enters a continuous start mode when the number of the application programs started according to the preset start mode is greater than a preset number threshold;
an executing module 303 configured to execute, in the continuous start mode, an adjustment policy corresponding to the continuous start mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process.
In some embodiments, the executing module 303 is further configured to:
adjusting the trigger threshold of the low-memory termination daemon for executing the terminated process task from a standard trigger threshold to a target trigger threshold corresponding to the continuous starting mode;
wherein the target trigger threshold is less than the standard trigger threshold.
In some embodiments, the apparatus 300 further comprises:
and the adjusting module is configured to adjust the trigger threshold of the low-memory termination daemon for executing the termination process task from the target trigger threshold to the standard trigger threshold when the electronic device exits the continuous starting mode.
In some embodiments, the adjusting policy further comprises: adjusting an application memory page of the application program running in the background; the execution module 303 is further configured to:
the application memory pages of the first type are recycled to a preset cache region; and/or the presence of a gas in the gas,
and compressing the application memory page of the second type, and storing the compressed application memory page to a system memory of the electronic device.
In some embodiments, the adjustment strategy further comprises: adjusting an operating frequency of a processor of the electronic device; the execution module 303 is further configured to:
adjusting the working frequency of the processor of the electronic equipment from the current working frequency to a target working frequency;
wherein the target operating frequency is greater than the current operating frequency.
In some embodiments, the adjustment strategy further comprises: adjusting the running state of the application program running in the background; the execution module is further configured to:
and when the number of the application programs running in the background is larger than a preset threshold value, closing the unused application programs in the preset running time.
In some embodiments, the first determining module 301 is further configured to:
determining the number of the application programs started according to the preset starting mode within a first preset time length;
wherein, the starting time of the first preset duration is as follows: and detecting the moment when the application program started according to the preset starting mode exists.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 4 is a block diagram illustrating an application processing device 1200 in accordance with an example embodiment. For example, the apparatus 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 1200 may include one or more of the following components: processing component 1202, memory 1204, power component 1206, multimedia component 1208, audio component 1210, input/output (I/O) interface 1212, sensor component 1214, and communications component 1216.
The processing component 1202 generally controls overall operation of the apparatus 1200, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 1202 can include one or more modules that facilitate interaction between the processing component 1202 and other components. For example, the processing component 1202 can include a multimedia module to facilitate interaction between the multimedia component 1208 and the processing component 1202.
The memory 1204 is configured to store various types of data to support operation at the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1204 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A power supply component 1206 provides power to the various components of the device 1200. The power components 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 1200.
The multimedia components 1208 include a screen that provides an output interface between the device 1200 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1200 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1210 is configured to output and/or input audio signals. For example, audio component 1210 includes a Microphone (MIC) configured to receive external audio signals when apparatus 1200 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 1204 or transmitted via the communications component 1216. In some embodiments, audio assembly 1210 further includes a speaker for outputting audio signals.
The I/O interface 1212 provides an interface between the processing component 1202 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1214 includes one or more sensors for providing various aspects of state assessment for the apparatus 1200. For example, the sensor assembly 1214 may detect the open/closed state of the device 1200, the relative positioning of the components, such as the display and keypad of the apparatus 1200, the sensor assembly 1214 may also detect a change in the position of the apparatus 1200 or a component of the apparatus 1200, the presence or absence of user contact with the apparatus 1200, the orientation or acceleration/deceleration of the apparatus 1200, and a change in the temperature of the apparatus 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 1214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communications component 1216 is configured to facilitate communications between the apparatus 1200 and other devices in a wired or wireless manner. The apparatus 1200 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives the broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1216 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as memory 1204 comprising instructions, executable by processor 1220 of apparatus 1200 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of a processing device of an application, enable the processing device of the application to perform a method of processing of the application, the method comprising:
determining the number of application programs started according to a preset starting mode in a preset time period;
determining that the electronic equipment enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold;
executing an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process.
Fig. 5 is a block diagram illustrating another application processing apparatus 1300 according to an example embodiment. For example, the apparatus 1300 may be provided as a server. Referring to fig. 5, apparatus 1300 includes a processing component 1322, which further includes one or more processors, and memory resources, represented by memory 1332, for storing instructions, such as application programs, that may be executed by processing component 1322. The application programs stored in memory 1332 may include one or more modules that each correspond to a set of instructions. Further, processing component 1322 is configured to execute instructions to perform a method of processing an application program as described above, the method comprising:
determining the number of application programs started according to a preset starting mode in a preset time period;
determining that the electronic equipment enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold;
executing an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of the termination process.
The apparatus 1300 may also include a power component 1326 configured to perform power management for the apparatus 1300, a wired or wireless network interface 1350 configured to connect the apparatus 1300 to a network, and an input-output (I/O) interface 1358. The apparatus 1300 may operate based on an operating system stored in the memory 1332, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. The processing method of the application program is applied to the electronic equipment, and comprises the following steps:
determining the number of the application programs started according to a preset starting mode in a preset time period;
determining that the electronic equipment enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold;
executing an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of terminating the process.
2. The method of claim 1, wherein adjusting the trigger threshold for the low-memory termination daemon of the electronic device to execute the task of terminating the process comprises:
adjusting the trigger threshold of the low-memory termination daemon for executing the terminated process task from a standard trigger threshold to a target trigger threshold corresponding to the continuous starting mode;
wherein the target trigger threshold is less than the standard trigger threshold.
3. The method of claim 2, further comprising:
and under the condition that the electronic equipment exits the continuous starting mode, adjusting the trigger threshold of the low-memory termination daemon for executing the task of the termination process from the target trigger threshold to the standard trigger threshold.
4. The method of claim 1, wherein adjusting the policy further comprises: adjusting an application memory page of the application program running in the background; the adjusting the application memory page of the application program running in the background comprises:
the application memory pages of the first type are recycled to a preset cache region; and/or the presence of a gas in the atmosphere,
and compressing the application memory page of the second type, and storing the compressed application memory page to a system memory of the electronic device.
5. The method of claim 1, wherein adjusting the policy further comprises: adjusting an operating frequency of a processor of the electronic device; the adjusting the operating frequency of the processor of the electronic device includes:
adjusting the working frequency of the processor of the electronic equipment from the current working frequency to a target working frequency;
wherein the target operating frequency is greater than the current operating frequency.
6. The method of claim 1, wherein adjusting the policy further comprises: adjusting the running state of the application program running in the background; the adjusting the running state of the application program running in the background comprises the following steps:
and when the number of the application programs running in the background is larger than a preset threshold value, closing the unused application programs in the preset running time.
7. The method of claim 1, wherein the determining the number of applications launched in a preset launching manner within a preset time period comprises:
determining the number of the application programs started according to the preset starting mode within a first preset time length;
wherein, the starting time of the first preset duration is: and detecting the moment when the application program started according to the preset starting mode exists.
8. An application program processing apparatus applied to an electronic device, comprising:
the device comprises a first determining module, a second determining module and a control module, wherein the first determining module is configured to determine the number of the application programs started according to a preset starting mode in a preset time period;
the second determining module is configured to determine that the electronic device enters a continuous starting mode under the condition that the number of the application programs started according to the preset starting mode is larger than a preset number threshold;
the execution module is configured to execute an adjustment strategy corresponding to the continuous starting mode in the continuous starting mode; the adjustment strategy at least comprises: and adjusting a trigger threshold value of the low-memory termination daemon of the electronic equipment for executing the task of the termination process.
9. The apparatus of claim 8, wherein the execution module is further configured to:
adjusting the trigger threshold of the low-memory termination daemon for executing the terminated process task from a standard trigger threshold to a target trigger threshold corresponding to the continuous starting mode;
wherein the target trigger threshold is less than the standard trigger threshold.
10. The apparatus of claim 9, further comprising:
and the adjusting module is configured to adjust the trigger threshold of the low-memory termination daemon for executing the termination process task from the target trigger threshold to the standard trigger threshold when the electronic device exits the continuous starting mode.
11. The apparatus of claim 8, wherein the adjustment strategy further comprises: adjusting an application memory page of the application program running in the background; the execution module is further configured to:
the application memory pages of the first type are recycled to a preset cache region; and/or the presence of a gas in the gas,
and compressing the application memory page of the second type, and storing the compressed application memory page to a system memory of the electronic device.
12. The apparatus of claim 8, wherein the adjustment strategy further comprises: adjusting an operating frequency of a processor of the electronic device; the execution module is further configured to:
adjusting the working frequency of the processor of the electronic equipment from the current working frequency to a target working frequency;
wherein the target operating frequency is greater than the current operating frequency.
13. The apparatus of claim 8, wherein the adjustment strategy further comprises: adjusting the running state of the application program running in the background; the execution module is further configured to:
and when the number of the application programs running in the background is larger than a preset threshold value, closing the unused application programs in the preset running time.
14. The apparatus of claim 8, wherein the first determining module is further configured to:
determining the number of the application programs started according to the preset starting mode within a first preset time length;
wherein, the starting time of the first preset duration is: and detecting the moment when the application program is started according to the preset starting mode.
15. An apparatus for processing an application program, comprising:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: processing method implementing, when executed, any one of the applications of the above claims 1 to 7.
16. A non-transitory computer readable storage medium, wherein instructions, when executed by a processor of a processing device for an application, enable the device to perform the processing method of any one of the above claims 1 to 7.
CN202110511034.7A 2021-05-11 2021-05-11 Application program processing method and device and storage medium Pending CN115344357A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110511034.7A CN115344357A (en) 2021-05-11 2021-05-11 Application program processing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110511034.7A CN115344357A (en) 2021-05-11 2021-05-11 Application program processing method and device and storage medium

Publications (1)

Publication Number Publication Date
CN115344357A true CN115344357A (en) 2022-11-15

Family

ID=83946749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110511034.7A Pending CN115344357A (en) 2021-05-11 2021-05-11 Application program processing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN115344357A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049025A (en) * 2023-01-29 2023-05-02 荣耀终端有限公司 Method for dynamically adjusting memory reclamation GC parameters, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049025A (en) * 2023-01-29 2023-05-02 荣耀终端有限公司 Method for dynamically adjusting memory reclamation GC parameters, electronic equipment and storage medium
CN116049025B (en) * 2023-01-29 2023-08-11 荣耀终端有限公司 Method for dynamically adjusting memory reclamation GC parameters, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9860844B2 (en) Method and apparatus of temperature control
CN105955765B (en) Application preloading method and device
CN104050035B (en) The processing method and processing device of application program
CN105338409B (en) Network video preloading method and device
US20160342410A1 (en) Method and apparatus for processing application installation package
CN107193653B (en) Bandwidth resource allocation method, device and storage medium
CN109471596B (en) Data writing method, device, equipment and storage medium
CN110968523A (en) Memory defragmentation method and device
CN109634762B (en) Data recovery method and device, electronic equipment and storage medium
CN109062625B (en) Application program loading method and device and readable storage medium
CN111580980B (en) Memory management method and device
CN115344357A (en) Application program processing method and device and storage medium
CN106502740B (en) Using installation method and device
CN112214254A (en) Method and device for accelerating starting of application program and electronic equipment
CN112307229A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111722919B (en) Method and device for running background application program, storage medium and electronic equipment
CN114077461A (en) Application program running method, device, equipment and storage medium
CN112286692A (en) Memory recovery method, memory recovery device and storage medium
CN114253385A (en) Power consumption management method and device of mobile terminal and computer readable storage medium
CN110008135B (en) Information processing method and device and electronic equipment
CN114860242A (en) Compiling method, compiling device and storage medium
CN113722080A (en) Memory optimization method and device and computer storage medium
CN111240590A (en) Dirty data erasing method, dirty data erasing device and electronic equipment
CN112083981A (en) Method and device for creating page view component
CN114115025B (en) Method, device and equipment for storing fault information based on automatic driving system

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