Operation management method, readable storage medium, program product and electronic equipment

By configuring dynamic management of resident applications, the problem of long application startup time on electronic devices is solved, achieving fast startup and efficient use of memory space, thus improving the user experience.

CN121722452APending Publication Date: 2026-03-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Electronic devices clear their processes and running data after closing applications, resulting in longer startup times and impacting user experience.

Method used

Configure two types of persistent applications: dynamic persistent applications and non-dynamic persistent applications. Dynamically manage memory space based on the operating status of the electronic device. By stopping and resuming the processes and data of some persistent applications, ensure sufficient available memory space and improve application startup speed.

Benefits of technology

By enabling users to quickly launch their selected applications via warm restart, application startup time is reduced, user experience is improved, and lag caused by insufficient memory is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121722452A_ABST
    Figure CN121722452A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses an operation management method, a readable storage medium, a program product and electronic equipment. In the method, the electronic equipment can divide the resident application into a dynamic resident application and a non-dynamic resident application. The electronic equipment can end the dynamic resident application running in the background and clear running data of the dynamic resident application in a memory under the condition that the running state of the electronic equipment meets a clearing condition, and the clearing condition indicates that the memory space of the electronic equipment is about to be insufficient. In this way, enough available memory space can be provided for the foreground application in time, the starting speed of the foreground application can be increased, and the situation that the foreground application is stuck due to insufficient memory space is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more particularly to an operation management method, a readable storage medium, a program product, and an electronic device. Background Technology

[0002] When an electronic device detects that a user has closed an application, it typically terminates the application's process and removes the application's runtime data (such as objects created for the application by the device's operating system services or modules, including windows and user interfaces) from the device's memory. The next time the electronic device runs the application, it needs to re-establish the application's process and recreate the objects required for its operation. This results in longer application startup times, negatively impacting the user experience. Summary of the Invention

[0003] This application provides an operation management method, a readable storage medium, a program product, and an electronic device.

[0004] In a first aspect, a runtime management method is provided, applied to an electronic device, the method comprising: running at least one persistent application in the background, the persistent application including a first type of persistent application and a second type of persistent application; stopping at least some of the first type of persistent applications in response to the running state of the electronic device meeting a cleanup condition; and resuming the running of at least some of the first type of persistent applications in the background in response to the running state of the electronic device meeting a recovery condition, wherein the recovery condition includes the available space of the electronic device's memory being greater than a first threshold.

[0005] In this method, the electronic device can be configured with two types of resident applications. When the electronic device's operating state meets the cleanup conditions, the electronic device can stop running at least some of the first type of resident applications (e.g., terminate the processes running those applications and clear the running data of those applications from memory) so that the electronic device's operating state no longer meets the cleanup conditions. This provides more available memory space for the electronic device. In this scenario, if the electronic device detects a user launching an application, it has enough available memory to directly launch that application. Thus, the electronic device does not need to clean up other applications running in the background besides resident applications to provide sufficient available memory for that application after detecting a user launching it, which helps improve the application's startup speed.

[0006] Furthermore, if the electronic device's operating state meets the recovery conditions, the electronic device can also resume running at least some of the first-type persistent applications in the background. In this case, if the electronic device detects that the user has launched at least some of the first-type persistent applications, the electronic device can launch the user-selected applications via a warm restart, which helps improve the launch speed of the user-selected applications. Moreover, the recovery conditions at least include that the electronic device's internal available space is greater than a first threshold, which can prevent insufficient available memory space on the electronic device due to resuming running at least some of the first-type persistent applications in the background.

[0007] In some implementations, the recovery condition can also be that the available memory space of the electronic device is greater than a first threshold for a duration greater than or equal to a first duration. This avoids frequent recovery and cleanup of the first type of persistent applications caused by fluctuations in the available memory space of the electronic device.

[0008] In one possible implementation of the first aspect above, the cleanup conditions include at least one of the following conditions: the available space of the electronic device's memory is less than a second threshold, and the second threshold is less than a first threshold; a preset application is detected to be launched; the data exchange frequency between the memory and the non-volatile memory of the electronic device is greater than a first frequency; the processor utilization rate of the process exchanging data between the memory and the non-volatile memory is greater than a first utilization rate; the number of applications launched within a preset time period is greater than a first number; the number of applications running in the background is greater than a second number; the memory space occupied by at least one running application is greater than a third threshold; a first user operation is detected to match a first historical operation, wherein the first historical operation includes one or more operations performed by the user on the electronic device before the available memory space of the electronic device became less than the memory space required by the application.

[0009] The above cleanup conditions indicate that the electronic device is about to run out of available memory. By stopping at least some of the Category 1 resident applications when the electronic device's operating status meets the above cleanup conditions, sufficient available memory can be provided to the electronic device in a timely manner.

[0010] In some implementations, when the first operation matches the first historical operation, if the first historical operation includes an exempted first-category persistent application (i.e., a first-category persistent application that is launched (or switched to the foreground) within a preset time after the electronic device detects the first historical operation), then at least some of the aforementioned first-category persistent applications may not include the exempted first-category persistent applications of the first historical operation. Thus, when the electronic device detects that a user has launched an exempted first-category persistent application, it can launch that exempted first-category persistent application via a warm restart, which helps improve the launch speed of that exempted first-category persistent application.

[0011] In some implementations, after terminating at least some of the aforementioned Category 1 persistent applications, the electronic device can stop running the Category 1 persistent application corresponding to the first historical operation after detecting the user's operation of switching the exempted Category 1 persistent application corresponding to the first historical operation to the foreground (or the operation of switching the exempted Category 1 persistent application corresponding to the first historical operation to the foreground) and then switching to the background. This provides more available memory space for the electronic device.

[0012] In some implementations, the aforementioned preset applications can be applications from the list of large memory applications below, or applications of a preset type.

[0013] In one possible implementation of the first aspect above, the recovery conditions further include at least one of the following conditions: a preset application is detected not running; the number of applications running in the background is less than or equal to a second number; an application currently not running occupies more than a third threshold of memory space; a second user operation is detected to match a second historical operation, and the second historical operation includes one or more operations performed by the user on the electronic device before the first application was historically run, wherein the first application is a first type of resident application.

[0014] In some implementations, if a second user action is detected to match a second historical action, the electronic device can first resume the thread of the first application running in the background and load the running data of the first application into memory. This ensures that if the user's action to launch the first application is detected, the first application can be launched via a warm restart, which helps improve the startup speed of the first application.

[0015] In some implementations, after loading the runtime data of the first application into memory, if the running state of the electronic device still meets the recovery conditions, the electronic device can restore other resident applications of the first type.

[0016] In one possible implementation of the first aspect above, stopping the operation of at least some of the first type of resident applications running in the background includes: terminating the process running at least some of the first type of resident applications, clearing the runtime data of at least some of the first type of resident applications in memory, and storing the runtime data in the non-volatile memory of the electronic device.

[0017] In some implementations, runtime data may include, but is not limited to, images corresponding to the application's user interface, application windows (e.g., views corresponding to the application's user interface, related content in the views, images of the user interface, etc.), and application objects created by the electronic device's operating system or corresponding modules for the application.

[0018] Based on this approach, if the electronic device detects a user launching a portion of the first-type resident applications after stopping their operation, the device can retrieve the running data of the user-selected application from non-volatile memory and launch that application. In this way, the electronic device can launch the user-selected application via a warm boot, which helps improve the startup speed of the chosen application.

[0019] In one possible implementation of the first aspect above, restoring at least a portion of the first type of resident application running in the background includes: the process of the first type of resident application running in the background and loading the running data into memory.

[0020] In one possible implementation of the first aspect above, before stopping the operation of at least some of the first type of resident applications, the electronic device is running a second application in the background, and the second application is not a resident application; and the method further includes: in response to the operating state of the electronic device meeting the cleanup conditions, stopping the operation of the second application before stopping the operation of at least some of the first type of resident applications, wherein the historical usage frequency of the second application is less than the historical usage frequency of at least some of the first type of resident applications, or the historical usage duration of the second application is less than the historical usage duration of at least some of the first type of resident applications, or the last usage time of the second application is earlier than the last usage time of at least some of the first type of resident applications.

[0021] In this implementation, if the electronic device's operating state meets the cleanup conditions, and a second application that is not a resident application is running in the background, and this second application has a lower historical usage frequency, shorter historical usage duration, or earlier last usage time compared to at least some of the first-type resident applications, then the electronic device can clean up the second application first. This ensures that at least some of the first-type resident applications can be started via a warm boot, which helps improve the startup speed of these applications.

[0022] In one possible implementation of the first aspect above, before stopping the operation of at least some of the first type of resident applications, the electronic device runs at least one third application in the background, the third application being a non-resident application; and the method further includes: after stopping the operation of the first type of resident applications, detecting that the available space of the electronic device's memory does not meet the operating conditions of the fourth application, and stopping the operation of the third application.

[0023] In this implementation, after stopping the first type of resident application, if it is detected that the available space in the electronic device's memory does not meet the running conditions of the fourth application, the electronic device can stop running the third application, which is not a resident application (terminating the process of the third application and clearing the running data of the third application in memory) to provide more available internal space for the fourth application.

[0024] In one possible implementation of the first aspect above, the method further includes: after stopping the third application, detecting that the available memory space of the electronic device does not meet the running conditions of the fourth application, and ending the running of the second type of resident application.

[0025] In this implementation, if the available memory space of the electronic device is still insufficient to support the operation of the fourth application after the third application is stopped, the electronic device can provide more available memory space for the fourth application by ending the operation of the second type of resident application.

[0026] In one possible implementation of the first aspect above, the method further includes: in response to the available memory space of the electronic device being greater than a fourth threshold, resuming the running of a second type of resident application in the background, wherein the fourth threshold is less than the first threshold.

[0027] In this implementation, when the available memory space of the electronic device exceeds a fourth threshold, the second type of persistent applications running in the background are resumed. Since the fourth threshold is less than the first threshold, the second type of persistent applications can resume before the first type of persistent applications.

[0028] In a second aspect, an electronic device is provided, comprising: a memory for storing instructions; and at least one processor for executing the instructions to cause the electronic device to implement the operation management method provided in the first aspect and any possible implementation of the first aspect.

[0029] Thirdly, a readable storage medium is provided, on which instructions are stored, which, when executed by an electronic device, cause the electronic device to implement the first aspect and any possible implementation of the operation management method provided by the first aspect.

[0030] Fourthly, a computer program product is provided that, when run on an electronic device, enables the electronic device to implement the operation management method provided in the first aspect and any possible implementation of the first aspect.

[0031] The beneficial effects of the second to fourth aspects mentioned above can be referred to the content of the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0032] Figure 1 According to some embodiments of this application, a comparative schematic diagram of an application launch method is shown.

[0033] Figure 2 According to some embodiments of this application, a schematic diagram of a process for managing the operation of an application is shown.

[0034] Figure 3A According to some embodiments of this application, a schematic diagram of a user's historical operations is shown.

[0035] Figure 3B According to some embodiments of this application, a schematic diagram of an electronic device prompting a user is shown.

[0036] Figure 4 According to some embodiments of this application, another schematic diagram of the process for managing the operation of an application is shown.

[0037] Figure 5 According to some embodiments of this application, a comparative schematic diagram of application operation management is shown.

[0038] Figure 6 According to some embodiments of this application, a flowchart of another operation management method is shown.

[0039] Figure 7 According to some embodiments of this application, a flowchart of yet another operation management method is shown.

[0040] Figure 8 According to some embodiments of this application, a flowchart of yet another operation management method is shown.

[0041] Figure 9 According to some embodiments of this application, a flowchart of yet another operation management method is shown.

[0042] Figure 10 According to some embodiments of this application, a schematic diagram of the software architecture of an electronic device is shown.

[0043] Figure 11 According to some embodiments of this application, a schematic diagram of the structure of an electronic device is shown. Detailed Implementation

[0044] The embodiments of this application include, but are not limited to, operation management methods, readable storage media, program products, and electronic devices.

[0045] To facilitate understanding, the terminology used in the embodiments of this application will be introduced first.

[0046] In electronic devices, applications can be launched in various ways, such as cold start, warm start, and hot start. Different launch methods result in different launch processes and speeds. Furthermore, the way an electronic device handles the closing of an application also differs depending on the launch method.

[0047] For example, Figure 1 According to some embodiments of this application, a comparative schematic diagram is shown of the startup process of cold start, warm start and hot start, and the handling method when the application is closed.

[0048] (1) Cold start

[0049] A cold start refers to a startup method where the electronic device has neither the application's process running nor the application's running data stored before detecting the user's operation to launch the application.

[0050] It should be noted that the application's runtime data can include data generated by the application's threads or processes during runtime, including but not limited to images corresponding to the application's UI, application windows (such as views corresponding to the application's UI, related content in the views, images of the user interface, etc.), application objects created for the application by the electronic device's operating system or corresponding modules (such as globally unique application objects corresponding to the application (used to implement global initialization operations, such as initializing the database, configuring global variables, registering services, etc.), activity objects (used to create and manage application windows, manage the interaction between the application and the user, process user input, etc.), and objects corresponding to components such as service / broadcastreceiver / contentprovider, etc.).

[0051] It should be noted that the application object may differ depending on the operating system. (Reference) Figure 1 The cold start process typically includes three steps: creating the application process, creating application objects and windows, and displaying the application's UI.

[0052] Continue to refer to Figure 1 For applications launched using a cold start method, the electronic device can stop the application process and clear the application's runtime data from memory after detecting that the user has closed the application. Therefore, the next time the device detects that the user has launched the application, it needs to re-execute the aforementioned three steps: creating the application process, creating the application object and window, and displaying the application UI. Consequently, launching an application using the cold start method is time-consuming.

[0053] It should be noted that for applications that use a cold start method, after the electronic device detects that the user has closed the application, the application's runtime data cleared from memory can be the runtime data of the application's process or thread in the corresponding storage space in memory. Services of the electronic device or processes of other applications also store the application's runtime data (such as images corresponding to the application's UI), and these services or applications can clear or save this runtime data according to their own logic.

[0054] (2) Warm start

[0055] Warm start refers to a startup method in which an electronic device has an application process running in the background but no application running data stored in memory, or has application running data stored in memory but no application process running in the background, before detecting the user's operation to launch the application.

[0056] refer to Figure 1 A warm start process typically includes two steps: creating the application process and restoring the application's running data from storage to display the application's UI. Alternatively, it may include two steps: creating the application object and window, and displaying the application's UI.

[0057] Continue to refer to Figure 1 For applications launched using a warm start method, after detecting a user closing the application, the electronic device can either stop the application process while retaining its runtime data in memory, or switch the application process to the background and clear its runtime data from memory. Thus, the next time the device detects a user launching the application, it only needs two steps to launch it: either establish the application process and restore the application's UI based on its runtime data in memory, or establish the application object and window and display its UI. Therefore, launching an application using a warm start method is less time-consuming than launching it using a cold start method.

[0058] For applications that use warm start, after detecting that the user has closed the application, the electronic device can switch the application process to run in the background and clear the application's running data in memory; or, switch the application process to run in the background and transfer the application's running data in memory (for example, store the application's running data in memory in a storage device other than memory on the electronic device and clear the application's running data in memory); or, terminate the application process and retain the application's running data in the electronic device's memory.

[0059] (3) Hot start

[0060] A warm start refers to a startup method where an electronic device has the application's process running in the background and the application's running data stored in the electronic device's memory before the user's operation to launch the application is detected.

[0061] refer to Figure 1 A warm restart process typically includes a step of restoring the display of the application's UI.

[0062] Continue to refer to Figure 1For applications launched using a warm start method, the electronic device can switch the application's process to run in the background after detecting that the user has closed the application, while retaining the application's running data in memory. Thus, the next time the device detects that the user has launched the application, it only needs to restore the application's UI to launch the application again. Therefore, launching an application using a warm start method is less time-consuming than launching it using a warm start or cold start method.

[0063] The technical solution of this application will now be described in conjunction with the accompanying drawings.

[0064] As mentioned in the background, when an electronic device detects that a user has closed an application, if it terminates the application's process and clears the application's runtime data from the device's memory, the next time the device runs the application, it needs to re-establish the application's process and recreate the application object and window (equivalent to a cold start). This results in longer application startup times, impacting the user experience.

[0065] To improve application startup speed, in some embodiments, electronic devices can be configured with a resident application whitelist to record applications that need to be launched quickly (hereinafter, applications in the resident application whitelist are referred to as resident applications).

[0066] In some embodiments, the resident applications in the resident application whitelist may be applications preset by the developers of the electronic device or the developers of the electronic device's operating system, applications configured by the users of the electronic device according to their own needs, applications obtained by the electronic device from other devices (such as servers), or applications recorded by the electronic device according to the user's usage habits, without any limitation.

[0067] In some embodiments, there may be one or more resident application whitelists. When there are multiple resident application whitelists, electronic devices can use different resident application whitelists to manage the operation of applications on different dates / times or in different operating modes (e.g., work mode, game mode, high-performance mode, power-saving mode, etc.).

[0068] After configuring a whitelist of persistent apps, electronic devices can automatically run all apps on the whitelist in the background upon startup, keeping them running continuously. When the electronic device detects a user launching a persistent app, it can directly switch the app from the background to the foreground. This ensures that persistent apps are launched via warm starts, which helps improve their startup speed.

[0069] However, if a persistent application is kept running in the background of an electronic device, its running data will continuously occupy the device's memory space, resulting in less available memory space for other applications and affecting their operation.

[0070] For example, Figure 2 According to some embodiments of this application, a schematic diagram of an application runtime management process is shown. The execution entity of this process is the runtime management module in the electronic device (a module used to manage the memory space and application lifecycle in the electronic device, hereinafter referred to as runtime management). Figure 2 As shown, the process includes:

[0071] S21, in response to the startup of an electronic device, runs resident applications in the background.

[0072] After an electronic device starts up, the runtime management system can respond by running persistent applications from the whitelist in the background. For example, the runtime management system can run the processes of persistent applications in the background.

[0073] like Figure 2 As shown, the resident application occupies 900MB of memory space, and the electronic device also has a non-resident application running in the background (an application not in the resident application whitelist) (occupying 200MB of memory space) (hereinafter referred to as a background non-resident application). The available memory space of the electronic device is 2000MB.

[0074] S22, An operation to run a game application has been detected.

[0075] Runtime management can respond to a user's action of running a game application by first determining whether the available memory space of the electronic device meets the requirements for running the game application (2300MB of available memory space). If the available memory space of the electronic device meets the requirements for running the game application, runtime management can directly run the game application; if the available memory space of the electronic device does not meet the requirements for running the game application, runtime management can terminate the processes of background non-resident applications in a least recently used (LRU) order and clear the memory space occupied by background non-resident applications to increase the available memory space.

[0076] It's important to note that LRU is a sorting algorithm or a sorting mechanism. Different LRU algorithms can produce different sorting results. For example, it can be sorted by the number of times / frequency / duration of execution in the foreground within a recent period (the fewer times, the lower the frequency, and the shorter the duration of execution in the foreground, the higher the order), or it can be sorted by the time the application last ran in the foreground within a recent period from earliest to latest (for example, if application A last ran in the foreground before application B, then application A will be ranked before application B).

[0077] like Figure 2 As shown, the game application requires 2300MB of memory, while the electronic device has only 2000MB of available memory. The available memory of the electronic device does not meet the requirements for the game application to run.

[0078] It should be noted that in some other embodiments, the operation and management ends.

[0079] S23, Insufficient available memory space is detected. The process of background non-resident applications is terminated and the running data of background non-resident applications in memory is cleared.

[0080] When the system detects that the available memory is insufficient to run a game application (i.e., insufficient memory), the execution control mechanism can terminate background non-resident application processes and clear their running data from memory to provide more available memory for the game application. For example, the execution control mechanism can use an LRU (Least Recently Used) approach to terminate background non-resident application processes and clear their running data from memory. If clearing the running data of one non-resident application still results in insufficient available memory, the device can continue to terminate the next non-resident application process and clear its running data from memory, following the LRU order, until the available memory meets the game application's running requirements or all non-resident application running data has been cleared from memory.

[0081] like Figure 2 As shown, after closing all non-resident applications, the available memory space of the electronic device is 2200MB (2000MB + 200MB), which is still insufficient to meet the running requirements of game applications (2300MB of available memory space).

[0082] S24, after detecting that there is still insufficient memory space after clearing the running data of background non-resident applications in memory, terminate the process of the resident application and clear the running data of the resident application in memory.

[0083] If the runtime management system detects that the memory space is still insufficient to run the game application after terminating the processes of all non-resident applications running in the background and clearing the running data of all non-resident applications in memory, it can terminate the processes of resident applications and clear the running data of resident applications.

[0084] like Figure 2 As shown, after terminating all background processes of non-resident applications and clearing all their running data in memory, the available memory space of the electronic device is 2200MB, which is still insufficient for the game application to run. The electronic device can terminate the processes of resident applications and clear their running data in memory. After terminating the processes of resident applications and clearing their running data in memory, the available memory space of the electronic device is 3100MB (2200MB + 900MB), which is greater than 2300MB, thus meeting the requirements for the game application to run.

[0085] S25, running game applications.

[0086] The game application will run only if the available memory space on the electronic device is sufficient for its operation. After the game application starts running, the available memory space on the electronic device will be 800MB.

[0087] Based on the above process, when an electronic device detects that the available memory space is insufficient for the game application to run, it needs to first terminate the processes of non-resident background applications and clear their running data from memory. Then, it needs to terminate the processes of the resident background application and clear its running data from memory to ensure the foreground application (game application) can run. During this process, the foreground application on the electronic device may experience lag, such as slow game loading or interface crashes.

[0088] Furthermore, during the operation of a game application, if the electronic device determines that its available memory space exceeds a preset threshold, it will run the resident application again in the background. In this scenario, since the memory space occupied by an application is usually dynamic, if the memory required by the game application increases during operation, the runtime management still needs to execute the aforementioned S23 to S24 steps to provide more available memory space for the game application. This may cause the game application to lag during operation.

[0089] To balance the available memory space of an electronic device and the startup speed of applications, embodiments of this application provide a runtime management method. In this method, the electronic device can dynamically run or terminate at least some resident applications in the background based on its own runtime status (hereinafter, these resident applications are referred to as dynamically resident applications (also called first-type resident applications), and resident applications other than dynamically resident applications are referred to as non-dynamically resident applications (also called second-type resident applications)), thereby providing more available memory space for other applications. For example, if the electronic device's runtime status indicates that the available memory space is about to run out, it can terminate the dynamically resident applications running in the background and clear the running data of the dynamically resident applications from memory. Alternatively, if the electronic device's runtime status indicates that the available memory space is sufficient (e.g., the available memory space is greater than a first threshold), it can automatically run dynamically resident applications in the background.

[0090] Specifically:

[0091] When an electronic device starts up, all resident applications can run in the background.

[0092] During the operation of electronic devices:

[0093] When the operating status of an electronic device meets the cleanup conditions, the device can terminate the processes of background dynamic resident applications and clear their running data from the device's memory. The cleanup conditions indicate that the available memory space of the electronic device will be insufficient. These conditions may include: the available memory space of the electronic device is small; the electronic device is running or about to run an application that consumes a large amount of memory; the electronic device may soon enter a running state that consumes a large amount of memory; or applications of a preset type (such as games, 3D modeling applications, etc.) are already running or about to run.

[0094] When the operating status of an electronic device meets the recovery conditions, the device can automatically run the processes of dynamically resident applications in the background. These recovery conditions indicate that the electronic device has sufficient available memory. For example, recovery conditions may include: a large amount of available memory on the electronic device, and / or no memory-intensive applications currently running, and / or no applications of a preset type (such as games) currently running.

[0095] Based on the above method, when the electronic device's operating state meets the cleanup conditions, the device can promptly terminate the processes of background dynamically resident applications and clear their running data from memory. This provides sufficient memory space for other applications (such as foreground applications), preventing insufficient available memory from affecting their operation. When the electronic device's operating state meets the recovery conditions, since the dynamically resident applications are already running in the background, the device can launch them via a warm restart, which improves their startup speed.

[0096] For ease of description, terminating an application's process and clearing its runtime data from memory will be referred to as cleaning up the application. For example, cleaning up the settings application means terminating the settings application's process and clearing its runtime data from memory.

[0097] It should be noted that the persistent applications (including dynamic persistent applications and non-dynamic persistent applications) and non-persistent applications in the embodiments of this application can be any form of application, including but not limited to the operating system of the electronic device or services provided by third parties, quick apps, general applications (other applications besides quick apps), etc.

[0098] In some embodiments, electronic devices can record dynamically resident applications by maintaining a dynamic resident application whitelist. In some embodiments, there can be one or more dynamic resident application whitelists. When there are multiple dynamic resident application whitelists, the electronic device can use different dynamic resident application whitelists to manage the operation of applications on different dates / times or in different operating modes (e.g., work mode, game mode, high-performance mode, power-saving mode, etc.).

[0099] In some embodiments, if the electronic device clears the runtime data of a dynamically resident application from memory when the device's operating state meets the cleanup conditions, the runtime data can be stored in non-volatile memory (e.g., external memory card, universal flash storage (UFS), embedded multimedia card (eMMC), etc.). When the electronic device's operating state meets the recovery conditions, the device loads the stored runtime data of the dynamically resident application into its memory. Thus, when the electronic device detects a user's operation running the dynamically resident application, it runs the application based on the runtime data loaded into memory, restoring the application's display interface from its last execution (or last time it was switched to the background), thereby improving the user experience.

[0100] In some embodiments, a cleanup condition is used to indicate that the electronic device's memory is insufficient. Exemplarily, the cleanup condition may include at least one of the following conditions C1 to C7:

[0101] C1, the available memory space of the electronic device is less than the second threshold.

[0102] In some embodiments, the second threshold is greater than the threshold at which the electronic device determines that its memory space is insufficient. For example, when the electronic device starts cleaning up background non-resident applications based on LRU when its available memory space is less than 1000MB, the second threshold can be any value greater than 1000MB. Based on this, the electronic device can terminate dynamically resident applications before detecting insufficient memory space, providing more memory space for foreground applications and avoiding lag caused by insufficient memory space.

[0103] C2 indicates that a preset application has been detected. This preset application can be a memory-intensive application or an application of a preset type (such as a game).

[0104] For example, an electronic device can maintain a large whitelist of memory-intensive applications to record applications that require significant memory usage. If the device detects that an application from this whitelist is among the currently running applications, or if it detects that a user has launched an application from this whitelist, it determines that the device's operating state meets the cleanup criteria. Alternatively, the device can also determine that it meets the cleanup criteria if it detects that an application of a preset type is among the currently running applications, or if it detects that a user has launched an application of a preset type.

[0105] C3, the data exchange frequency between main memory and non-volatile memory is greater than a first frequency. When the data exchange frequency between the electronic device's main memory and non-volatile memory exceeds the first frequency, it indicates that the available memory space of the electronic device may be insufficient. The electronic device needs to frequently transfer data from main memory to non-volatile memory to ensure available storage space in main memory. Based on this, the electronic device can determine that its operating state meets the cleanup conditions when the data exchange frequency between main memory and non-volatile memory exceeds the first frequency.

[0106] In some embodiments, the electronic device may also base its cleanup on the activity or resource utilization (e.g., central processing unit (CPU) utilization) of processes that transfer data from memory to non-volatile memory or frequently transfer data from memory to non-volatile memory (hereinafter referred to as data exchange processes). Based on this, the cleanup conditions may further include condition C3.1, whereby the activity of the data exchange process is greater than a first activity level, or the CPU utilization of the data exchange process is greater than a first utilization level.

[0107] It should be noted that the data exchange process can be a swap process or any other process. The name of the data exchange process may differ across different operating systems or electronic devices from different manufacturers; therefore, no specific name is specified here.

[0108] C4: The number of applications launched within a preset time period exceeds a first-order limit. In some scenarios, although a single application may occupy a small amount of memory, launching multiple applications within a short period can still lead to insufficient memory. Therefore, if the number of applications launched by an electronic device within a preset time period exceeds a first-order limit, the device's operating state is determined to meet the cleanup conditions.

[0109] C5 indicates that the number of applications running in the background exceeds the second-highest number. A large number of background applications may lead to insufficient available memory on the electronic device. Therefore, if the number of background applications running on the electronic device exceeds the second-highest number, the device's operating status is determined to meet the cleanup criteria.

[0110] C6, the electronic device is running at least one application whose memory usage exceeds the third threshold. In some embodiments, the electronic device may have other memory-intensive applications not on the aforementioned large memory application whitelist installed. To prevent the running of such applications from causing insufficient available memory on the electronic device, the electronic device may determine that its operating state meets the cleanup conditions if the currently running applications include at least one application whose memory usage exceeds the third threshold.

[0111] C7, Detecting a match between the user's first operation and a historical operation. In some embodiments, the electronic device may record user operations performed by the user before the electronic device experienced insufficient memory space (i.e., historical operations, a historical operation may include one or more user operations). When the electronic device detects that the user's first operation on the electronic device (which may be one or more operations) matches a historical operation, it can determine that the electronic device will experience insufficient memory, thereby determining that the operating state of the electronic device meets the cleanup conditions.

[0112] In some embodiments, the electronic device may also record whether a dynamically persistent application is launched by the user during the execution of a historical operation (or within a preset time period thereafter). (For ease of description, the dynamically persistent application launched by the user during the execution of a historical operation (or within a preset time period thereafter) is referred to as the exempted dynamically persistent application of that historical operation.) If the device detects that the user's first operation matches a historical operation, and that historical operation corresponds to an exempted dynamically persistent application, the electronic device may only clear other dynamically persistent applications besides the exempted dynamically persistent applications. In this way, if the device detects that the user is running an operation that exempts the dynamically persistent application, the exempted dynamically persistent application can be launched via a warm restart.

[0113] For example, Figure 3A According to some embodiments of this application, a schematic diagram of an electronic device determining an exemption from dynamically resident applications is shown.

[0114] like Figure 3A As shown, after detecting a user's click on the game application icon U11, the electronic device can display the game application's launch screen U12. After detecting a user's swipe-up action from the bottom of the launch screen U12, the electronic device can display the task manager U13, which can include thumbnails U14 of the currently running settings application (dynamically resident application) and U15 of the game application. After detecting a user's selection of thumbnail U14 in the task manager U13, the electronic device can display the settings interface U16. After detecting a user's operation of the brightness control U17 in the settings interface U16, the electronic device can adjust the brightness of the electronic device. After detecting a user's swipe-up action from the bottom of the settings interface U16, the electronic device can display the task manager U18, which can include thumbnails U14 of the settings application and U15 of the game application. After detecting a user's selection of thumbnail U15 in the task manager U18, the electronic device can display the game application's launch screen U19.

[0115] based on Figure 3A The process illustrated allows the electronic device to identify the settings app as an exempted dynamically resident app from the user's action of launching a game app. Based on this, upon detecting the user's action of launching a game app, the electronic device can determine that the cleanup conditions are met and clean up only other dynamically resident apps besides the settings app.

[0116] In some embodiments, the electronic device may also clean up the exempted dynamic persistent application running in the background after detecting that the user has switched the exempted dynamic persistent application to the foreground and then to the background.

[0117] Furthermore, the electronic device will clear the settings app if it detects that the user has switched the settings app to the foreground or to the background, or if it detects that the user has not switched the settings app to the foreground within a preset time after launching a game app.

[0118] In some embodiments, after identifying an exempted dynamic persistent application, the electronic device may prompt the user whether to remove the exempted dynamic persistent application from the persistent applications, or prompt the user whether to configure the exempted dynamic persistent application as a non-dynamic persistent application.

[0119] For example, refer to Figure 3B Once the electronic device determines that the Settings app is an exempted app for the user's action of launching a game app, it can display a prompt box U21 to ask the user "Do you want to configure the Settings app as a non-dynamic persistent app?" In response to the user selecting "Yes" in the prompt box U21, the electronic device can configure the Settings app as a non-dynamic persistent app (e.g., remove the Settings app from the dynamic persistent app whitelist).

[0120] It should be noted that in some other embodiments, the cleaning conditions may also include other conditions, which are not limited here.

[0121] In some embodiments, an electronic device can clean up dynamically resident applications one by one (or multiple applications at once) when it detects that the cleanup conditions are met. If the running state of the electronic device no longer meets the cleanup conditions after cleaning up one (or more) background dynamically resident applications, the electronic device may stop cleaning up the dynamically resident applications still running in the background. Based on this, it can be ensured that resident applications still running in the background can be started in a warm-start manner.

[0122] In some embodiments, when an electronic device clears background dynamic persistent applications one by one (or multiple applications at once), it can do so in the following order: from shortest to longest historical usage time; from earliest to latest last usage time; or from lowest to highest historical usage frequency. This ensures that frequently used dynamic persistent applications can be started with a warm restart, improving the user experience.

[0123] In some embodiments, when an electronic device detects that the cleaning conditions are met, it can also clean up applications with shorter historical usage time (or the lowest historical usage frequency, or the earliest last usage time) based on the historical usage duration, historical usage frequency, and last usage time of background dynamic resident applications and background non-resident applications.

[0124] In some embodiments, if the electronic device detects that the cleaning conditions are met, it can also directly clean up all background dynamic resident applications.

[0125] In some embodiments, the recovery conditions may include available memory space being greater than a first threshold, or the duration for which available memory space is greater than the first threshold reaching a first duration. The first threshold is greater than a second threshold. Since the memory space occupied by an application during runtime is dynamically changing, setting the first threshold to be greater than the second threshold can prevent electronic devices from frequently cleaning or restoring dynamically resident applications.

[0126] In some embodiments, the recovery conditions may further include at least one of the following conditions C8 to C11:

[0127] C8 does not have the aforementioned preset applications running. It should be noted that this explanation uses C2 and C8 having the same preset applications as an example; it is understandable that the preset applications of C2 and C8 can be different.

[0128] C9, the number of background applications is less than or equal to the second number mentioned above. It should be noted that this explanation uses both C5 and C9 as examples; however, different thresholds can be used.

[0129] C10 indicates that no applications currently running that consume more memory than the aforementioned third threshold are currently running. It should be noted that this explanation uses both C6 and C10 with the third threshold as examples; however, different thresholds can be used.

[0130] C11, a second user action is detected that matches a second historical action. The second historical action includes one or more actions performed by the user on the electronic device before the first dynamically persistent application was launched. Based on this, if a match is detected, it indicates that the user may launch the first dynamically persistent application. The electronic device can resume the process of the first dynamically persistent application in the background and load the stored running data of the first dynamically persistent application into memory. This improves the launch speed of the first dynamically persistent application.

[0131] For example, after historically detecting that the user launched application A and application B, the electronic device also detects that the user launched application C (as a first dynamically resident application). The second historical operation can be the user launching application A and application B. If the electronic device detects that the user's second operation includes launching application A and application B, it can determine that the recovery conditions are met and resume the process of application C running in the background. Furthermore, if the electronic device also stores the running data of application C, it can load the running data of application C into memory.

[0132] It should be noted that in some other embodiments, the recovery conditions may also include other conditions, which are not limited here.

[0133] In some embodiments, when an electronic device detects that the recovery conditions are met, it can restore the processes of dynamically resident applications running in the background one by one (or multiple applications at once). If it is determined that restoring the running of one (or more) dynamically resident applications in the background may cause the running state of the electronic device to meet the cleanup conditions, the electronic device may choose not to restore the dynamically resident applications that have not yet been restored to the background. In this way, it is possible to avoid insufficient available memory space of the electronic device due to too many dynamically resident applications being restored to the background.

[0134] Below, in conjunction with Figures 4 to 11 This paper introduces the technical solution of this application.

[0135] For example, Figure 4 According to some embodiments of this application, a flowchart of another operation management method is shown. As shown in Figure 3, the method includes:

[0136] S41, in response to the startup of an electronic device, runs resident applications in the background.

[0137] After an electronic device is started, the operation management system can respond to the startup of the electronic device by running dynamic and non-dynamic persistent applications in the background.

[0138] like Figure 4 As shown, the resident application occupies 900MB of memory, of which the dynamically resident application occupies 600MB of memory. Additionally, the background non-resident application occupies 200MB of memory.

[0139] S42, in response to the operation of running a game application, clears background dynamic resident applications and transfers the running data of background dynamic resident applications in memory.

[0140] Runtime management can respond to user actions when running game applications, and can terminate the processes of background dynamic persistent applications, transfer (e.g., transfer to the non-volatile memory of electronic devices) the running data of background dynamic persistent applications in memory, and clear the running data of background dynamic persistent applications in memory.

[0141] like Figure 4As shown, the runtime management system can respond to the user's operation of running the game application, ending the background dynamic persistent application process and clearing the 600MB of memory space occupied by the background dynamic persistent application. After clearing the 600MB of memory space occupied by the background dynamic persistent application, the available memory space is 2000MB + 600MB = 2600MB, which meets the requirements for running the game application. Therefore, the runtime management system can run the game application, and after running the game application, the available memory space of the electronic device is 2600MB - 2300MB = 300MB.

[0142] S43, in response to the user's action of closing the game application, resumes the process of the dynamically persistent application running in the background and loads the stored running data of the dynamically persistent application into memory.

[0143] After detecting that a user closes the game application, the operation management system can restore the dynamically resident application running in the background if the recovery conditions are met (the game application is closed, and the available memory space after the game application is closed is 300MB + 2300MB = 2600MB).

[0144] In some embodiments, restoring a dynamically persistent application running in the background may include the process of the dynamically persistent application running in the background, and loading runtime data stored in non-volatile memory into memory. After restoring the dynamically persistent application running in the background, the available memory space is 2600MB - 600MB = 2000MB.

[0145] based on Figure 4 As shown in the process, after detecting the operation of a running game application, the electronic device can automatically clean up dynamically resident applications in the background to provide more available memory space for the game application. Based on this, the electronic device can have sufficient memory space to run the game application without needing to clear the memory space occupied by non-resident and resident background applications as described in S23 and S24. This improves the game application's startup speed and avoids lag. Furthermore, even if the electronic device has ample available memory during game application operation, it will not restore dynamically resident applications in the background. Instead, it will only restore them after the game application is closed (meeting the restoration conditions). This avoids the impact of restoring dynamically resident applications in the background on the game application's performance.

[0146] The following section compares and introduces the technical solutions of this application using the following examples: resident applications include Connect app and settings app, where settings app is a dynamically resident application and Connect app is a non-dynamically resident application; background non-resident applications include browser app, news app, and video app (browser app, news app, and video app are ordered in LRU order: browser app → news app → video app).

[0147] For example, Figure 5 According to some embodiments of this application, a comparative schematic diagram of an operation management method is shown.

[0148] refer to Figure 5 The part of the application that is always resident in the middle is based on Figure 2 The illustrated operation management method, when the background resident applications include the Connect app and settings app, and the background non-resident applications include browser apps, news apps, and video apps, if the electronic device detects that the user has launched a game app, it can respond to insufficient available memory (available memory is less than the memory required by the game app) by sequentially clearing the video app, news app, and browser app. After clearing one or more of the video app, news app, and browser app, if there is sufficient available memory, the electronic device can run the game app; if there is still insufficient available memory after clearing the video app, news app, and browser app, the electronic device can respond to insufficient memory by clearing the Connect app and settings app, and then run the game app. Based on the above process, the electronic device needs to provide more memory for the game app by sequentially clearing the video app, news app, browser app, and Connect app / settings app, which may cause the game app to start slowly.

[0149] Continue to refer to Figure 5 Regarding the dynamically persistent application portion, based on the method provided in this application embodiment, when the electronic device detects a user launching a game application, it can directly clear the settings application regardless of whether there is sufficient available memory. If there is sufficient available memory after clearing the settings application, the electronic device can directly run the game application, which allows for faster game application launch compared to the solution where the persistent application remains running. If there is still insufficient available memory after clearing the settings application, the electronic device can sequentially close and clear the video application, news application, and browser application. After clearing one or more of the video application, news application, and browser application, if there is sufficient available memory, the electronic device can run the game application; if there is still insufficient available memory, the electronic device can clear the Connect application and then run the game application.

[0150] Based on the foregoing embodiments, this application provides an operation management method that helps improve the startup speed of applications.

[0151] For example, Figure 6 According to some embodiments of this application, a flowchart of an operation management method is shown. The entity executing this process can be an electronic device, such as the aforementioned operation control system. Figure 6 As shown, the method includes:

[0152] S601 runs resident applications in the background in response to the startup of electronic devices.

[0153] After an electronic device is started, it can run processes of persistent applications such as dynamic persistent applications and non-dynamic persistent applications in the background, and create application objects and windows for persistent applications.

[0154] In some embodiments, after a persistent application is running in the background, both dynamically persistent and non-dynamically persistent applications are launched using a warm start method.

[0155] S602, the operating status of the electronic device is detected to meet the cleaning conditions, at least some background dynamic resident applications are cleaned up and the running data of the at least some background dynamic resident applications in memory are transferred.

[0156] During operation, electronic devices can, in response to detecting that the operating state meets the cleanup conditions, clean up at least some background dynamic resident applications and transfer the running data of at least some background resident applications in memory to non-volatile memory, so as to provide more available memory space for other applications.

[0157] In some embodiments, an electronic device can clean up dynamic resident applications one by one (or multiple applications at a time). If the running state of the electronic device does not meet the cleaning conditions after cleaning up one (or more) dynamic resident applications, then the cleanup of background dynamic resident applications that have not yet been cleaned up can be stopped.

[0158] In some embodiments, electronic devices may clean up background dynamic resident applications in LRU order (or cleanup priority as described below).

[0159] In some embodiments, electronic devices can also clear all background dynamic resident applications at once.

[0160] In some embodiments, after clearing at least some background dynamically resident applications and transferring their runtime data from memory, the startup method for the remaining background dynamically resident applications and background non-dynamically resident applications is a warm start, while the startup method for the cleared background dynamically resident applications is a warm start. After clearing at least some background dynamically resident applications and transferring their runtime data from memory, the electronic device can, in response to a user's operation to launch a remaining background dynamically resident application or a background non-dynamically resident application, launch the user-selected application via a warm start; or, in response to a user's operation to launch a cleared dynamically resident application, launch the user-selected application via a warm start. This improves the startup speed of the user-selected application.

[0161] In some embodiments, if a dynamically resident application is running in the foreground, the electronic device does not clear that dynamically resident application.

[0162] S603, the system detects that the operating status of the electronic device meets the recovery conditions, resumes the running process of the non-running dynamic resident application in the background, and loads the stored running data of the dynamic resident application into memory.

[0163] During operation, electronic devices can respond to the detection that the operating status of the electronic device meets the recovery conditions, resume the running process of non-running dynamic resident applications in the background, and load the stored running data of dynamic resident applications into memory.

[0164] In some embodiments, the electronic device can resume the processes of dynamically resident applications running in the background one by one (or multiple applications at a time), and load the running data corresponding to the resumed resident applications into memory. During this process, the electronic device can also detect whether resuming the process of one (or more) dynamically resident applications running in the background (or loading the running data of one (or more) dynamically resident applications into memory) would cause the running state of the electronic device to meet the cleanup conditions. If so, the electronic device can stop resuming the dynamically resident applications; if not, the electronic device can resume the process of the one (or more) dynamically resident applications running in the background, and / or load the running data of the one (or more) dynamically resident applications into memory. This avoids the ping-pong effect.

[0165] In some embodiments, the electronic device may also resume running all dynamic resident applications in the background and load the running data corresponding to all dynamic resident applications into memory.

[0166] In some embodiments, after resuming the process of a non-running dynamic persistent application in the background and loading the stored runtime data of the dynamic persistent application into memory, both dynamic and non-dynamic persistent applications are launched using a warm start method.

[0167] Based on the above method, electronic devices can provide sufficient memory space for foreground applications by clearing background dynamically resident applications, provided the running state meets the cleanup conditions. This allows the electronic device to have enough space to launch foreground applications, thus improving their startup speed. Furthermore, if the electronic device also has non-dynamically resident applications running in the background, and clearing the background dynamically resident applications meets the startup conditions for the foreground applications, the electronic device can launch the background non-dynamically resident applications via a warm restart.

[0168] In some embodiments, if the available memory space of the electronic device is insufficient to meet the running conditions of the foreground application after clearing background dynamic persistent applications, the electronic device can also clear background non-persistent applications and background non-dynamic persistent applications in turn to provide more available memory space for the foreground application.

[0169] For example, Figure 7 According to some embodiments of this application, a flowchart of another operation management method is shown. The entity executing this process can be an electronic device, such as the aforementioned operation control system. Figure 7 As shown, the method includes:

[0170] The S701 runs resident applications in the background in response to the startup of electronic devices.

[0171] After an electronic device is started, it can run persistent applications in the background, such as dynamically persistent applications and non-dynamically persistent applications.

[0172] S702, the operating status of the electronic device is detected to meet the cleanup conditions, the background dynamic resident applications are cleaned up and the running data of the background dynamic resident applications in memory are transferred.

[0173] In some embodiments, the electronic device can clear all background dynamic persistent applications, or it can clear some background dynamic persistent applications until the clearing conditions are no longer met. For details, please refer to the aforementioned S602, which will not be repeated here.

[0174] It should be noted that if the available memory space is less than the memory space required by the foreground application, and there are still one or more dynamic resident applications running in the background, the electronic device can first clear the one or more dynamic resident applications and transfer the running data of the one or more dynamic resident applications in memory.

[0175] S703, in response to a situation where available memory is less than the memory required by the foreground application, cleans up background non-resident applications.

[0176] During the operation of an electronic device, if the available memory space is less than the memory space required by the foreground application, the electronic device can clear background non-resident applications to provide more available memory space for the foreground application.

[0177] In some embodiments, the electronic device can clean up background non-resident applications one by one (or multiple at a time) in an LRU order. If, after cleaning up one or more background non-resident applications, the available memory space of the electronic device reaches (is greater than or equal to) the memory space required by the foreground application, the electronic device may stop cleaning up background non-resident applications.

[0178] In some embodiments, electronic devices can also clear all background non-resident applications at once.

[0179] In some embodiments, if the available memory space of the electronic device is less than the memory space required by the foreground application after all background non-resident applications have been cleared, S704 can be executed.

[0180] During or after the execution of S703, non-dynamic resident applications are started via warm start, while dynamic resident applications are started via warm start.

[0181] S704, in response to the situation where the available memory space after clearing background non-resident applications is less than the memory space required by the foreground application, clears background non-dynamic resident applications.

[0182] When an electronic device is running, if the available memory space of the electronic device is less than the memory space required by the foreground application after clearing background non-resident applications, the electronic device can clear background non-dynamic resident applications to provide more available memory space for the foreground application.

[0183] In some embodiments, after cleaning up background non-dynamic resident applications, the applications or services running in the background of the electronic device are usually applications necessary for the operating system, and the available memory space of the electronic device is usually sufficient to meet the memory space required by the foreground applications.

[0184] After executing S704, background non-dynamic persistent applications and background dynamic persistent applications will start with a warm start.

[0185] It should be noted that after clearing background non-dynamic resident applications, if the available memory space detected during the operation of the electronic device reaches the memory space required by the non-dynamic resident applications (for example, greater than the fourth threshold, and the fourth threshold is less than the aforementioned first threshold), the electronic device can run non-dynamic resident applications in the background.

[0186] In some embodiments, an electronic device can restore a non-dynamically persistent application running in the background before restoring the dynamic persistent application to run.

[0187] S705 detects that the operating status of the electronic device meets the recovery conditions, resumes the process of the dynamically resident application in the background, and loads the stored running data of the dynamically resident application into memory.

[0188] During operation, the electronic device can resume the running of the dynamically resident application in the background and load the stored running data of the dynamically resident application into memory in response to the detection that the operating state of the electronic device meets the recovery conditions. For details, please refer to the aforementioned S603, which will not be repeated here.

[0189] After executing S705, both non-dynamic resident applications and dynamic resident applications will be launched via warm boot.

[0190] Based on the above method, electronic devices can provide sufficient memory space for foreground applications by clearing background dynamically resident applications, provided the running state meets the cleanup conditions. This allows the electronic device to have enough space to launch foreground applications, thus improving their startup speed. After clearing background dynamically resident applications, the electronic device can clean up applications in the order of background non-resident applications and background non-dynamically resident applications to provide more available memory space for foreground applications.

[0191] In some embodiments, when an electronic device detects that its operating state meets the cleanup conditions, it can also clean up background dynamic persistent applications and background non-persistent applications according to their cleanup priorities. This ensures that frequently used applications (applications with lower cleanup priority) are launched via warm starts, which improves the user experience.

[0192] For example, Figure 8 According to some embodiments of this application, a flowchart of another operation management method is shown. The execution subject of this method is an electronic device, such as the aforementioned operation control. Figure 8 As shown, the method includes:

[0193] S801 responds to the startup of an electronic device by running resident applications in the background.

[0194] After an electronic device is started, it can run persistent applications in the background, such as dynamically persistent applications and non-dynamically persistent applications.

[0195] S802, the operating status of the electronic device is detected to meet the cleaning conditions, and background dynamic resident applications and background non-resident applications are cleaned up based on the cleaning priority until the cleaning conditions are no longer met.

[0196] In some embodiments, the cleanup priority of an application is used to indicate the order in which applications are cleaned up when cleanup conditions are met; the higher the cleanup priority, the earlier the application is cleaned up.

[0197] In some embodiments, the cleanup priority of an application can be determined based on one or more of the application's historical usage duration, historical usage frequency, and most recent usage time. The longer the application's historical usage duration, the lower its cleanup priority and the later it will be cleaned up; the higher the application's historical usage frequency, the lower its cleanup priority and the later it will be cleaned up; the earlier the application's most recent usage time, the lower its cleanup priority and the later it will be cleaned up. Therefore, a lower cleanup priority indicates that the user uses the application more frequently.

[0198] In some embodiments, the electronic device can clean up background dynamic persistent applications and background non-persistent applications one by one (or multiple at a time) according to the cleaning priority. After cleaning up one (or more) applications, if the running status of the electronic device does not meet the cleaning conditions, the remaining background dynamic persistent applications and background non-persistent applications will not be cleaned up.

[0199] In some embodiments, during the process of clearing background dynamic persistent applications, the electronic device can transfer the running data of background dynamic persistent applications in memory to a storage outside memory (e.g., to non-volatile memory).

[0200] In some embodiments, after cleaning up background dynamic and non-dynamic persistent applications based on cleanup priority until the cleanup conditions are no longer met, the startup method for the cleaned background persistent applications, cleaned background dynamic persistent applications, and background non-dynamic persistent applications is warm start, and the startup method for the cleaned dynamic persistent applications is warm start. Thus, if the device detects that a user has launched a cleaned background persistent application, a cleaned background dynamic persistent application, or a background non-dynamic persistent application, the electronic device can launch the user-selected application via warm start, which helps improve the startup speed of the user-selected application.

[0201] S803 detects that the operating status of the electronic device meets the recovery conditions, resumes the process of the dynamically resident application in the background, and loads the stored running data of the dynamically resident application into memory.

[0202] For details, please refer to the aforementioned S603; no further limitations will be made here.

[0203] After resuming the process of the dynamically resident application in the background and loading the stored running data of the dynamically resident application into memory, the startup method of the dynamically resident application and the non-dynamically resident application is a warm start.

[0204] Based on the above method, when an electronic device detects that the cleaning conditions are met, it does not first clean up background dynamic resident applications, but rather cleans them according to the priority of background dynamic resident applications and non-background non-resident applications. This ensures that frequently used background dynamic resident applications are cleaned up last. Thus, if the electronic device detects that the user has launched a background dynamic resident application or a non-background non-resident application that has not been cleaned up, it can launch the user-selected application through a warm restart, which helps improve the launch speed of the selected application.

[0205] In some embodiments, if the available memory space of the electronic device is insufficient to meet the running conditions of the foreground application after clearing background dynamic persistent applications and background non-persistent applications, the electronic device may also sequentially clear the background dynamic persistent applications, background non-persistent applications, and background non-dynamic persistent applications to provide more available memory space for the foreground application.

[0206] For example, Figure 9 According to some embodiments of this application, a flowchart of another operation management method is shown. The entity executing this process can be an electronic device, such as the aforementioned operation control system. Figure 9 As shown, the method includes:

[0207] The S901 runs resident applications in the background in response to the startup of electronic devices.

[0208] S902, the operating status of the electronic device is detected to meet the cleaning conditions, and background dynamic resident applications and background non-resident applications are cleaned up based on the cleaning priority until the cleaning conditions are no longer met.

[0209] It should be noted that S901 and S902 are essentially the same as the aforementioned S801 and S802, and will not be elaborated upon here.

[0210] S903, in response to the available memory space being less than the memory space required by the foreground application, cleans up background non-resident applications and background dynamically resident applications.

[0211] During the operation of an electronic device, the device can respond to situations where the available memory space is less than the memory space required by the foreground application by clearing background resident applications and background dynamic resident applications.

[0212] In some embodiments, the electronic device can clean up background non-resident applications and background dynamic resident applications one by one (or multiple at a time) based on LRU order or the aforementioned cleanup priority. If, after cleaning up one or more applications, the available memory space of the electronic device reaches (is greater than or equal to) the memory space required by the foreground application, the electronic device may stop cleaning up.

[0213] In some embodiments, electronic devices can also clear all background non-resident applications and all background dynamic resident applications at once.

[0214] In some embodiments, after cleaning up all background non-resident applications and all background dynamic resident applications, if the available memory space of the electronic device is less than the memory space required by the foreground application, the electronic device may execute S904.

[0215] In some embodiments, electronic devices may first clear background dynamically resident applications. If, after clearing all background dynamically resident applications, the available memory space is less than the memory space required by the foreground application, the electronic device may clear background non-resident applications.

[0216] In some embodiments, the electronic device may first clear background non-resident applications. If, after clearing all background non-resident applications, the available memory space is less than the memory space required by the foreground applications, the electronic device may clear background dynamically persistent applications.

[0217] After executing S903, background non-dynamic persistent applications, background dynamic persistent applications that have not been cleaned up, and background non-dynamic persistent applications that have not been cleaned up will be launched as warm starts, while cleaned-up dynamic persistent applications will be launched as warm starts.

[0218] S904, in response to the situation where the available memory space after clearing background non-resident applications and background dynamic resident applications is less than the memory space required by the foreground application, clears background non-dynamic resident applications.

[0219] During the operation of an electronic device, after clearing background non-resident applications and background dynamic resident applications, if the available memory space of the electronic device is less than the memory space required by the foreground application, the electronic device can clear background non-dynamic resident applications to provide more available memory space for the foreground application.

[0220] In some embodiments, after cleaning up background non-dynamic resident applications, the applications or services running in the background of the electronic device are usually applications necessary for the operating system, and the available memory space of the electronic device is usually sufficient to meet the memory space required by the foreground applications.

[0221] After executing S904, both non-dynamic resident applications and dynamic resident applications will start with a warm start.

[0222] It should be noted that during the operation of an electronic device, if the available memory space of the electronic device reaches the memory space required by a non-dynamically resident application (for example, reaching the aforementioned fourth threshold), the electronic device can run the non-dynamically resident application in the background. For example, the electronic device can run a non-dynamically resident application in the background if the available memory space is greater than or equal to the fourth threshold for a continuous preset period of time.

[0223] In some embodiments, an electronic device can restore a non-dynamically persistent application running in the background before restoring the dynamic persistent application to run.

[0224] S905, the system detects that the operating status of the electronic device meets the recovery conditions, resumes the process of the dynamically resident application in the background, and loads the stored running data of the dynamically resident application into memory.

[0225] During operation, the electronic device can resume the running of the dynamically resident application in the background and load the stored running data of the dynamically resident application into memory in response to the detection that the operating state of the electronic device meets the recovery conditions. For details, please refer to the aforementioned S603, which will not be repeated here.

[0226] After executing S905, both non-dynamic resident applications and dynamic resident applications will be launched via warm boot.

[0227] Based on the above method, when an electronic device detects that the cleaning conditions are met, it can prioritize cleaning background dynamic persistent applications over non-dynamic background applications, ensuring that frequently used dynamic persistent applications are cleaned last. Thus, if the electronic device detects that the user has launched a non-cleaned dynamic persistent application or a non-cleaned background non-dynamic application, it can launch the selected application via a warm restart.

[0228] In addition, after cleaning up dynamic persistent applications and background non-persistent applications, if the available memory space of the electronic device is less than the memory space required by the foreground application, the electronic device can provide more available memory space for the foreground application by cleaning up background non-persistent applications.

[0229] The following section introduces a software architecture for an electronic device.

[0230] For example, Figure 10 A schematic diagram of a software architecture is shown according to some embodiments of this application.

[0231] like Figure 10 As shown, the software architecture of the electronic device is a layered architecture, consisting of the application layer, framework layer, service layer, and kernel layer from top to bottom.

[0232] The application layer includes the applications within an electronic device. These applications can include, but are not limited to, the electronic device's operating system, third-party services, quick apps, and universal apps.

[0233] In some embodiments, applications at the application layer can be categorized into dynamic persistent applications, non-dynamic persistent applications, and non-persistent applications.

[0234] The framework layer provides the application layer with multilingual user program frameworks and capabilities, including the ArkUI framework for JS, and various multilingual application programming interfaces (APIs) for software and hardware services.

[0235] The user program framework can create application objects of the application during application runtime.

[0236] In some embodiments, the framework layer may also include more or fewer modules, which is not limited here.

[0237] The service layer provides services to applications in the application layer through the framework layer. For example, the service layer may include runtime management.

[0238] Operation management can be performed on dynamic persistent applications, non-dynamic persistent applications, and non-persistent applications based on the operation management methods provided in the aforementioned embodiments (running in the background, cleaning up, transferring running data, restoring operation, etc.).

[0239] In some embodiments, operation management can also maintain the aforementioned whitelist of resident applications, whitelist of large memory applications, and sublist of dynamic resident applications.

[0240] In some embodiments, operation management can also be deployed in other layers, which is not limited here.

[0241] In some embodiments, the service layer may also include more modules, which is not limited here.

[0242] The framework and service layers can include various subsystems for implementing functions, such as a graphics subsystem. The graphics subsystem can be used to implement the user interface of an electronic device's application or operating system, for example. In some embodiments, the graphics subsystem can create application windows during application execution.

[0243] The kernel layer can include the kernel subsystem and the driver subsystem.

[0244] The kernel subsystem provides fundamental kernel capabilities to the upper layers (application layer, framework layer, and service layer), including but not limited to process / thread management, memory management, file system, network management, and peripheral device management. For example, runtime management can utilize kernel-provided process / thread management functions, methods, or interfaces to clean up applications or resume background applications.

[0245] The driver subsystem provides the upper layer with unified peripheral access capabilities and drivers.

[0246] It should be noted that, Figure 10 The software architecture shown is only an example. In other embodiments, the software architecture of the electronic device may include more or fewer layers, more or fewer modules, or merge or split some modules, or adopt other software architectures, which are not limited here.

[0247] This application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to implement the methods described in the above embodiments of this application.

[0248] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to implement the methods described in the above embodiments of this application.

[0249] This application also provides an electronic device for implementing the operation management methods provided in the foregoing embodiments.

[0250] For example, Figure 11 According to some embodiments of this application, a schematic diagram of the structure of an electronic device is shown.

[0251] like Figure 11 As shown, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0252] Processor 110 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a microcontroller unit (MCU), a video codec, a digital signal processor (DSP), a baseband processor, a neural network processing unit (NPU), a field-programmable gate array (FPGA), etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors.

[0253] In some embodiments, the processor 110 may be used to execute one or more programs / instructions corresponding to the operation management methods provided in the foregoing embodiments.

[0254] The charging management module 140 receives charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0255] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display 194, camera 193, and wireless communication module 160, etc.

[0256] The wireless communication function of electronic device 10 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.

[0257] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0258] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 10. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0259] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 10, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), near field communication (NFC), infrared (IR), and near link (NL). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.

[0260] Electronic device 10 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0261] The display screen 194 is used to display images. For example, the display screen 194 can be used to display prompts and the interface of the electronic device 10.

[0262] Camera 193 is used to capture still images or videos.

[0263] The external memory interface 120 can be used to connect an external memory card. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, application data of an application (such as the runtime data of a dynamically resident application) can be stored on the external memory card.

[0264] Internal memory 121 can be used to store one or more programs and corresponding data. Internal memory 121 may include a program storage area and a data storage area. In some embodiments, the program storage area may store the operating system, applications required for at least one function, such as programs / instructions corresponding to the operation management methods provided in the foregoing embodiments. The data storage area may store data created during the use of electronic device 10, such as the aforementioned dynamic resident application whitelist, resident application whitelist, large memory application whitelist, etc. In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, UFS, eMMC, etc. The processor 110 executes various functional applications of electronic device 10 by running one or more programs stored in internal memory 121 and / or one or more programs stored in memory disposed in processor 110.

[0265] Electronic device 10 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor. For example, audio module 170 can be used to play prompts.

[0266] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals.

[0267] The loudspeaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.

[0268] The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals.

[0269] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

[0270] The 170D headphone jack is used to connect wired headphones.

[0271] The pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals.

[0272] The barometric pressure sensor 180C can be used to detect the barometric pressure at the geographical location of the electronic device 10.

[0273] Accelerometer 180E can detect the magnitude of acceleration of electronic device 10 in various directions (generally three axes). When electronic device 10 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic device, and can be applied to applications such as screen orientation switching and pedometers. In some embodiments, the acceleration data collected by accelerometer 180E can be used to determine the moving speed and direction of movement of electronic device 10.

[0274] The ambient light sensor 180L is used to sense the ambient light intensity. The electronic device 10 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 10 is in a pocket to prevent accidental touches.

[0275] The fingerprint sensor 180H is used to collect fingerprints.

[0276] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 10, in a different position than display screen 194.

[0277] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. The electronic device 10 can receive button input and generate key signal inputs related to user settings and function control of the electronic device 10.

[0278] Motor 191 can generate vibration alerts. Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, notifications, etc. In some embodiments, electronic device 10 can alert the user by controlling the vibration of motor 191.

[0279] The SIM card interface 195 is used to connect a SIM card or eSIM.

[0280] It should be noted that the structure of the electronic device 10 shown in the embodiments of this application does not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements. The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0281] It should be noted that the electronic device in the embodiments of this application can be any form of electronic device, including but not limited to user equipment (UE), mobile station (MS), mobile terminal (MT), etc. For example, the electronic device can be a mobile phone, wearable device (such as a watch, earphone, bracelet, etc.), tablet computer, desktop computer, laptop computer, server, smart home device, gaming device, etc.

[0282] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0283] In the description of the embodiments in this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In this application, "at least one" means one or more, and "more" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items.

[0284] The use of prefixes such as "first" and "second" in this application embodiment is solely for distinguishing different descriptive objects and does not limit the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefixes to distinguish descriptive objects in this application embodiment does not constitute a limitation on the described objects. The description of the described objects is found in the claims or the context of the embodiments, and the use of such prefixes should not constitute unnecessary restrictions.

[0285] In the embodiments provided in this application, the connection between electronic devices, the connection between modules, and the connection between physical network ports can be a direct connection or an indirect connection, and the connection method can be a wired connection or a wireless connection.

[0286] In the various embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between the various embodiments are consistent and can be referenced mutually. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships. Units described as separate components in various embodiments may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0287] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An operation management method applied to electronic devices, characterized in that, The method comprises: running at least one resident application in the background, the resident application comprising a first type of resident application and a second type of resident application; stopping running at least part of the first type of resident application in the background in response to a running state of the electronic device meeting a cleaning condition; resuming running the at least part of the first type of resident application in the background in response to the running state of the electronic device meeting a resuming condition, wherein the resuming condition comprises an available space of a memory of the electronic device being greater than a first threshold value.

2. The method of claim 1, wherein, The cleaning condition comprises at least one of the following conditions: an available space of a memory of the electronic device being less than a second threshold value, the second threshold value being less than the first threshold value; detecting a preset application being started; a frequency of data exchange between the memory and a non-volatile memory of the electronic device being greater than a first frequency; a process of data exchange between the memory and the non-volatile memory occupying a processor at a rate greater than a first rate; a number of application programs started within a preset time period being greater than a first number; a number of application programs running in the background being greater than a second number; a memory space occupied by at least one running application program being greater than a third threshold value; detecting a first operation of a user matching a first historical operation, wherein the first historical operation comprises one or more operations of the user performed on the electronic device before an available memory space of the electronic device historically being less than a memory space required by an application program.

3. The method of claim 2, wherein, The resuming condition further comprises at least one of the following conditions: detecting that the preset application is not running; a number of application programs running in the background being less than or equal to the second number; no application program currently running and occupying a memory space greater than the third threshold value; detecting a second operation of a user matching a second historical operation, and the second historical operation comprising one or more operations of the user performed on the electronic device before the electronic device historically running a first application, wherein the first application is the first type of resident application.

4. The method according to any one of claims 1 to 3, characterized in that, The stopping running at least part of the first type of resident application in the background comprises: ending a process of the at least part of the first type of resident application, clearing running data of the at least part of the first type of resident application in the memory, and storing the running data in a non-volatile memory of the electronic device.

5. The method of claim 4, wherein, The resuming running the at least part of the first type of resident application in the background comprises: running a process of the at least part of the first type of resident application in the background and loading the running data to the memory.

6. The method according to any one of claims 1 to 5, characterized in that, Before the stopping running the at least part of the first type of resident application, the electronic device runs a second application in the background, the second application being not the resident application; and the method further comprises: In response to the running state of the electronic device satisfying a cleaning condition, the second application is stopped from running before the at least part of the first type of resident application is stopped from running, wherein the second application has a historical usage frequency less than that of the at least part of the first type of resident application, or a historical usage time length less than that of the at least part of the first type of resident application, or a last usage time earlier than that of the at least part of the first type of resident application.

7. The method according to any one of claims 1 to 5, characterized in that, Before the at least part of the first type of resident application is stopped from running, the electronic device runs at least one third application in the background, the third application being different from the resident application; and the method further comprises: After the first type of resident application is stopped from running, it is detected that the available space of the memory of the electronic device does not satisfy a running condition of a fourth application, and the third application is stopped from running.

8. The method of claim 7, wherein, The method further comprises: After the third application is stopped from running, it is detected that the available memory space of the electronic device does not satisfy the running condition of the fourth application, and the second type of resident application is stopped from running.

9. The method of claim 8, wherein, The method further comprises: In response to the available memory space of the electronic device being greater than a fourth threshold value, the second type of resident application is resumed from running, wherein the fourth threshold value is less than the first threshold value.

10. A readable storage medium, characterized by, The readable storage medium comprises one or more programs, which, when executed on an electronic device, cause the electronic device to implement the running management method of any one of claims 1 to 9.

11. An electronic device, comprising: comprises: a memory for storing one or more programs; a processor for executing the one or more programs to cause the electronic device to implement the running management method of any one of claims 1 to 9.

12. A program product, characterized by The program product, when executed on an electronic device, causes the electronic device to implement the running management method of any one of claims 1 to 9.