Process release methods and electronic devices

By selecting the appropriate memory release method based on processor load and foreground application type, the problem of background process release affecting foreground application performance is solved, achieving efficient memory reclamation and system performance improvement.

CN119739489BActive Publication Date: 2026-04-03HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In electronic devices, releasing background processes can lead to performance degradation in foreground applications, impacting user experience, especially when processor load is high or the foreground application is load-sensitive.

Method used

Choose between serial or parallel release methods based on processor load and foreground application type. Release background processes one by one in a serial manner to reduce the impact on processor load, or use a parallel release method to improve efficiency when the load is low.

Benefits of technology

Without affecting the performance of foreground applications, it effectively reclaims memory space, improves overall system performance, reduces resource consumption, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739489B_ABST
    Figure CN119739489B_ABST
Patent Text Reader

Abstract

This application provides a process release method and an electronic device, belonging to the field of terminal technology. The process release method includes: determining a memory release method based on the processor load and / or the type of foreground application in the electronic device, and then releasing multiple background processes in the electronic device according to the memory release method. The memory release method includes a serial release method or a parallel release method, thereby reducing the impact of process release operations on the performance of foreground applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of terminal technology, and in particular relates to a process release method and an electronic device. Background Technology

[0002] With the development of intelligent electronic devices, users can install various applications on their devices to meet their daily life and work needs.

[0003] When users use electronic devices, many applications that have been used remain running in the background, resulting in significant memory consumption. Releasing these background processes can increase the amount of available memory. Summary of the Invention

[0004] This application provides a process release method and electronic device, which can reduce the impact of process release operations on the performance of foreground applications.

[0005] Firstly, a process release method is provided, which is applied to an electronic device, or to a processor or other module in an electronic device, and includes:

[0006] The memory release method is determined based on the processor load and / or the type of foreground application in the electronic device. The memory release method includes serial release or parallel release. Multiple background processes in the electronic device are released according to the memory release method.

[0007] In the above solution, different memory release methods can be selected to release background processes based on the current scenario (i.e., different load conditions and / or different types of foreground applications) to reduce the impact of process release operations on the performance of foreground applications. Because the process of releasing processes needs to be completed by the processor scheduling, if a fixed method is used to release background processes in different scenarios, the processor load may be impacted by the process release operation in some situations, thus affecting the performance of foreground applications. For example, if there are many processes to be released, releasing these processes simultaneously may cause a sudden surge in processor load, leading to a slower processor response time and affecting the performance of foreground applications. For instance, the frame rate of the foreground application may fluctuate drastically in a short period, which will greatly affect the user experience.

[0008] In the solution provided in this application, the memory release method can be determined based on the processor load and / or the type of foreground application. Therefore, in scenarios where the performance of some foreground applications may be affected by the release process operation, a serial release method can be adopted. Based on the serial release method, multiple background processes can be released one by one, which puts much less load on the processor than releasing multiple background processes at the same time. Therefore, it will not have a significant impact on the performance of foreground applications and improves the user experience. In scenarios where the performance of some foreground applications is not easily affected by the release process operation, a parallel release method can be adopted. Based on the parallel release method, multiple background processes can be released at the same time, thereby shortening the time occupied by process release, enabling the system to reclaim memory space as soon as possible and improving the overall performance of the system.

[0009] As an example, the electronic device is currently in a screen-on state.

[0010] In other words, in one example, the process release method provided in this application embodiment can be applied to a screen-on scenario. At this time, the display screen of the electronic device is showing the interface of the foreground application, that is, the user is using the foreground application. In this case, the solution provided in this application embodiment can be adopted to reduce the impact of the process release operation on the performance of the foreground application, so as to minimize the impact on the user's experience of using the foreground application.

[0011] If a memory release operation still needs to be performed in the screen-off state, the solution provided in this application can be used or not. For example, in the screen-off state, a fixed memory release method (such as parallel release method) can be used to release background processes. This eliminates the need to obtain information such as the load and / or the type of foreground application, and also eliminates the need to determine the process of memory release, thereby reducing resource consumption and improving the efficiency of process release.

[0012] As an example, when the determined memory release method is serial release, multiple background processes in the electronic device are released according to the memory release method, including: releasing multiple background processes one by one in the same memory release agent process.

[0013] Based on the above scheme, when releasing multiple background processes serially, all background processes to be released can be released within the same memory release agent process. For example, the multiple background processes can be placed in a queue and released one by one in a memory release agent process. Since an agent process can only release one process at a time, the release times of these multiple background processes will not overlap. Therefore, this implementation method can complete the serial release of processes without cumbersome timing control, which can improve the efficiency of process release.

[0014] As an example, before releasing multiple background processes one by one in the same memory release agent process, the method further includes: waking up a dormant memory release agent process, which is a pre-established process.

[0015] Based on the above scheme, in scenarios where multiple background processes are released serially within a single memory release agent process, a memory release agent process can be pre-established and put into a sleep state. After determining to perform serial release, the memory release agent process in the sleep state is woken up, and then the multiple background processes are released sequentially within the memory release agent process. In this way, the memory release agent process can be directly woken up and used, improving the efficiency of process release.

[0016] As an example, before releasing multiple background processes one by one in the same memory release agent process, the method also includes: creating a memory release agent process.

[0017] Based on the above approach, in scenarios where multiple background processes are released sequentially within a single memory release agent process, the memory release agent process can be temporarily created upon determining that sequential release is necessary. After creation, the multiple background processes are released sequentially within this agent process. Once the release is complete, the memory release agent process can be cleared. This method eliminates the need to continuously maintain the memory release agent process, thereby reducing memory usage.

[0018] As an example, the processor is a multi-core processor, and the method also includes binding the memory release agent process to the small or medium core of the processor.

[0019] For example, for multi-core processors, the large cores have the strongest clock speed and are usually used to handle tasks with high performance requirements. If the memory release agent process is bound to the large core of the processor, there is a high probability that it will impact the load of the large core. However, if the memory release agent process is bound to the small or medium core of the processor, the impact of the process release operation on the processor load can be minimized, thereby reducing the impact on the performance of the foreground application.

[0020] As an example, when the determined memory release method is serial release, multiple background processes in the electronic device are released according to the memory release method, including: releasing multiple background processes one by one in sequence according to preset rules.

[0021] As an example, the default rules include: releasing multiple background processes in descending order of load.

[0022] In the above solution, the background processes can be released sequentially in descending order of their load. That is, the background processes with the highest load are released first, followed by those with lower load. By prioritizing the release of high-load processes, the system load can be reduced as quickly as possible, improving system performance.

[0023] As an example, the preset rules include: releasing multiple background processes in order of increasing usage frequency of the applications they correspond to.

[0024] In the above solution, the background processes are released sequentially according to their usage frequency from low to high. That is, the processes of infrequently used applications are released first, followed by those of frequently used applications. By prioritizing the release of infrequently used applications, the processes of frequently used applications can be preserved as much as possible. This improves application loading speed when the user reopens these preserved applications.

[0025] As an example, the memory release method is determined based on the processor load, including: if the processor load is greater than or equal to a preset threshold, the memory release method is determined to be serial release.

[0026] For example, if the processor load is greater than or equal to a preset threshold, it indicates a high processor load. Since the process of releasing background processes requires processor scheduling, releasing background processes in parallel could impact the processor load. For instance, if many background processes need to be cleared simultaneously, clearing them all would further degrade processor performance, thus affecting the performance of foreground applications. Releasing background processes serially reduces the impact on processor performance because releasing background processes one by one places a much lower load on the processor than releasing multiple background processes simultaneously.

[0027] As an example, the memory release method is determined based on the processor load, including: if the processor load is less than a preset threshold, the memory release method is determined to be the parallel release method.

[0028] For example, if the processor load is less than a preset threshold, it means that the processor load is relatively small. Therefore, even if the background process is released in parallel, it will not cause processor overload. At the same time, using the parallel release method instead of the serial release method can shorten the time occupied by process release, so that the system can reclaim memory space as soon as possible and improve the overall performance of the system.

[0029] As an example, the memory release method is determined based on the type of the foreground application, including: if the foreground application is a load-sensitive application, then the memory release method is determined to be serial release.

[0030] In this case, the performance of the load-sensitive application is affected by the processor load to a greater extent than the preset level.

[0031] For example, if the foreground application is a load-sensitive application, its performance is easily affected by load changes. If background processes are released in parallel, the processor load may increase, further impacting the performance of the foreground application, such as causing frame drops. Releasing background processes serially reduces the impact of process release on the processing load, thus minimizing the performance impact on the foreground application and maintaining its stable operation as much as possible.

[0032] As an example, the memory release method is determined based on the type of the foreground application, including: if the foreground application is not a load-sensitive application, then the memory release method is determined to be the parallel release method.

[0033] Among them, the performance of load-sensitive applications is affected by load to a greater extent than the preset level.

[0034] For example, if the foreground application is not a load-sensitive application (such as a photo album application or a financial application), then the performance of the foreground application is not easily affected by load changes. In this case, even if the processor load increases due to the parallel release method for background processes, it will not significantly affect the performance of the foreground application. At the same time, using the parallel release method instead of the serial release method can also shorten the time occupied by process release, allowing the system to reclaim memory space as quickly as possible and improve the overall performance of the system.

[0035] As an example, the memory release method is determined based on the processor load and the type of foreground application, including: if the processor load is less than a preset threshold and the foreground application is a load-sensitive application, then the memory release method is determined to be serial release.

[0036] Among them, the performance of load-sensitive applications is affected by load to a greater extent than the preset level.

[0037] For example, if the processor load is less than a preset threshold and the foreground application is a load-sensitive application, then the memory release method is determined to be the serial release method. Specifically, if the processor load is less than the preset threshold, it means that the processor load is relatively low. However, since the foreground application is a load-sensitive application, if the background process is released in parallel, even if the processor load is currently low, the process release operation may still increase the load, which may affect the performance of the foreground application. Therefore, the serial release method can be used to release the background process to reduce the impact of process release on the processor load, thereby reducing the impact on the performance of the foreground application.

[0038] As an example, the memory release method is determined based on the processor load and the type of foreground application, including: if the processor load is less than a preset threshold and the foreground application is not a load-sensitive application, then the memory release method is determined to be the parallel release method.

[0039] Among them, the performance of load-sensitive applications is affected by load to a greater extent than the preset level.

[0040] For example, if the processor load is less than a preset threshold, it means that the processor load is relatively small. Therefore, even if the background process is released in a parallel manner, which increases the load, it will not cause the processor to overload. Furthermore, since the foreground application is not a load-sensitive application, even if the load increases, it will not significantly affect the performance of the foreground application. At the same time, it can improve the efficiency of memory reclamation and improve the overall system performance.

[0041] As an example, the memory release method is determined based on the processor load and the type of foreground application, including: if the processor load is greater than or equal to a preset threshold, and the foreground application is a load-sensitive application or not a load-sensitive application, then the memory release method is determined to be serial release.

[0042] Among them, the performance of load-sensitive applications is affected by load to a greater extent than the preset level.

[0043] For example, if the processor load is greater than or equal to a preset threshold, it indicates that the processor load is relatively high. In this case, releasing background processes in parallel may impact the processor load, causing processor overload and affecting the performance of foreground applications. Releasing background processes serially can reduce the impact of releasing processes on processor performance.

[0044] As an example, the method also includes: if the foreground application is a media application, then determine that the foreground application is a load-sensitive application, where the media application is an application used to take pictures or an application used to take or display video footage.

[0045] Based on the above scheme, it's possible to determine whether a foreground application is load-sensitive based on its type, and then further determine the appropriate memory release method based on the judgment result. Specifically, the type of load-sensitive application can be pre-configured. For example, media applications can be set as load-sensitive applications. These media applications are used for taking pictures (such as camera applications) or for capturing or displaying video (such as recording applications, game applications, video applications, live streaming applications, etc.). Therefore, before determining the memory release method, the type of the foreground application can be determined first. If the foreground application is a media application, then it is determined to be a load-sensitive application.

[0046] As an example, the method also includes: reading the classification information of the front-end application through the front-end application's interface; and determining the type of the front-end application based on the classification information.

[0047] For example, an electronic device can read the classification information of a foreground application through its interface, and then determine the type of the foreground application based on that classification information. Here, classification information refers to information determined based on preset classification rules to indicate the type of the foreground application. The type of the foreground application indicated by this classification information is, for example, any one or more of the following: games, videos, music, social media, photography, finance, etc.

[0048] As an example, before determining the memory release method based on the processor load and / or the type of foreground application in the electronic device, the method further includes: determining to release multiple background processes.

[0049] Secondly, a process release method and an electronic device are provided. The method is applied to an electronic device, or to a processor or other module in an electronic device. The method includes: determining a memory release method based on the load of the processor in the electronic device and / or the load sensitivity of the foreground application, wherein the load sensitivity of the foreground application is used to indicate the degree to which the performance of the foreground application is affected by the processor load, and the memory release method includes a parallel release method or a serial release method; and releasing multiple background processes in the electronic device according to the memory release method.

[0050] Thirdly, an electronic device is provided, which includes a memory release method decision module for determining a memory release method based on the load of the processor in the electronic device and / or the type of foreground application, wherein the memory release method includes a serial release method or a parallel release method.

[0051] The memory release control module is used to release multiple background processes in the electronic device according to the memory release method.

[0052] As an example, the electronic device also includes a policy notification module for receiving a memory release method from the memory release method decision module and sending the memory release method to the memory release control module.

[0053] Fourthly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the computer program, the electronic device performs the steps of the application display method as described in any of the first aspects above.

[0054] Fifthly, a computer-readable storage medium is provided that stores a computer program, which, when executed by a processor, implements the steps of the application display method as described in any of the first aspects above.

[0055] In a sixth aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to perform the application display method described in any one of the first aspects above.

[0056] In a seventh aspect, a chip system is provided, the chip system including a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the application display method described in any of the first aspects above.

[0057] The chip system can be a single chip or a chip module composed of multiple chips.

[0058] It is understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0059] Figure 1 An exemplary flowchart illustrating a method for releasing a background process, as provided in an embodiment of this application, is shown.

[0060] Figure 2 This diagram illustrates one application scenario of the solution proposed in this application.

[0061] Figure 3 This diagram illustrates the frame rate changes of the foreground application.

[0062] Figure 4 An exemplary flowchart illustrating a method for releasing a background process, as provided in an embodiment of this application, is shown.

[0063] Figure 5 Another application scenario diagram of the solution in this application is shown;

[0064] Figure 6 The graph shows the changes in foreground application startup time;

[0065] Figure 7 An exemplary flowchart of a process release method provided in an embodiment of this application is shown;

[0066] Figure 8 An exemplary block diagram of a process release method provided in an embodiment of this application is shown;

[0067] Figure 9 Another exemplary flowchart of the process release method provided in this application embodiment is shown;

[0068] Figure 10 This illustration shows a structural block diagram of an electronic device provided in an embodiment of this application;

[0069] Figure 11 A block diagram of a software system for an electronic device according to an embodiment of this application is shown;

[0070] Figure 12 This illustration shows a workflow diagram of an electronic device releasing background processes during the startup and use of a camera application, according to an embodiment of this application.

[0071] Figure 13 The diagram illustrates an exemplary interaction of an electronic device releasing background processes during the startup and use of a camera application, as provided in an embodiment of this application.

[0072] Figure 14 Another structural block diagram of the electronic device provided in the embodiments of this application is shown;

[0073] Figure 15 A block diagram of a hardware system for an electronic device according to an embodiment of this application is shown. Detailed Implementation

[0074] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0075] The terms "first," "second," "third," "fourth," and other various terminology (if present) used in the specification, claims, and accompanying drawings of this application are intended to distinguish similar objects and are not necessarily used to describe a particular order or quantity. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein.

[0076] It is understood that the various numerical designations used in this application are merely for descriptive convenience and are not intended to limit the scope of this application. The order of the process numbers does not imply the order of execution; the execution order of each process should be determined by its function and internal logic.

[0077] The terms “comprising” and “having”, and any variations thereof, mean “including, but not limited to”, unless otherwise specifically emphasized, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.

[0078] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0079] In the description of the embodiments of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document is merely a description of 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 the description of this application, unless otherwise stated, "multiple" means two or more.

[0080] In the various embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different 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. The specific operational methods in the method embodiments of this application can also be applied to the device embodiments or system embodiments.

[0081] In this application, "pre-configuration" may include pre-defined terms, such as protocol definitions. These "pre-defined terms" can be implemented by pre-storing corresponding codes, tables, or other means of indicating relevant information in the device (e.g., including various network elements), and this application does not limit the specific implementation method.

[0082] In this application's embodiments, "storage" or "preservation" can refer to storage in one or more memories. These memories can be separate installations or integrated into an encoder, decoder, processor, or electronic device. Alternatively, some memories can be separate installations, while others can be integrated into a decoder, processor, or electronic device. The type of memory can be any form of storage medium, and this application is not limited to this.

[0083] In the schematic diagrams in the accompanying drawings of this application, dashed lines or boxes indicate optional steps or modules, and dotted lines or boxes indicate annotations.

[0084] In order to describe the following embodiments provided in this application more clearly and concisely, some of the terms or technologies involved in the embodiments of this application will be briefly introduced first.

[0085] 1. Foreground application: The foreground application mentioned in the embodiments of this application refers to the application that the electronic device is currently running in the foreground.

[0086] For example, when a user clicks the icon of a game application on the system desktop of an electronic device, the electronic device will load and display the application interface of the game application on the screen. The game application is the foreground application of the electronic device until the user closes the game application or switches the game application to the background.

[0087] It is understood that the foreground application described in the embodiments of this application may also refer to an application that runs in the background but can be perceived by the user in the foreground, such as an input method that is being called by the user, a music or video software that plays sound in the background, or a social or news application that appears in the notification bar in the foreground through a pop-up window.

[0088] It is also understood that the foreground applications described in the embodiments of this application may include system applications, such as system desktop applications, artificial intelligence assistants that appear in the foreground via floating windows, the system negative one screen, etc.

[0089] 2. Background application: The background application mentioned in the embodiments of this application refers to an application that runs in the background. Specifically, it can refer to an application that is switched from the foreground to the background by the user and whose process resides in the background.

[0090] For example, when a user clicks the icon of a game application on the system desktop of an electronic device, the electronic device loads and displays the application interface of the game application on the screen. When the user returns to the desktop from the application interface of the game application or switches to other applications (without releasing the process of the game application), the game application becomes a background application of the electronic device.

[0091] It is understood that the background applications described in the embodiments of this application may also include applications that run continuously in the background but are not perceived by the user, such as wireless fidelity (WiFi), Bluetooth, etc.

[0092] 3. Background process: The process of a background application can be called a background process.

[0093] Understandably, an application can include one or more processes.

[0094] It's also understandable that when users release background processes, they usually don't release all background processes, but rather some or all of the processes that can be released. These processes that can be released refer to background applications that the user is not using and that do not affect the functionality of the electronic device. This excludes system-level application processes running in the background (such as background download processes, background location processes, etc.) and application processes that are still providing services to the user (such as alarm clocks, timers, navigation applications, etc. running in the background).

[0095] It is also understood that, in this embodiment of the application, releasing a background process refers to the operation of terminating or clearing a background process. Therefore, releasing a background process can also be called terminating a background process, clearing a background process, cleaning up a background process, or "killing" a background process, etc. Releasing a background process can reclaim the memory occupied by the background process.

[0096] 4. Frame Rate: Frame rate refers to the frequency at which images, measured in frames, appear continuously on a display screen; that is, the number of frames displayed on the screen per second. The unit of frame rate is frames per second (fps). Generally, frame rate represents the smoothness of video; the higher the frame rate value, the smoother the video.

[0097] 5. Processor: The processor is the core of an electronic device's computation and control, primarily used for information processing and program execution. In this application's embodiments, the processor is, for example, the central processing unit (CPU) in an electronic device.

[0098] To improve processor speed and performance, multi-core processors can be used in electronic devices. A processor can include large cores, medium cores, and small cores. Large cores have higher computing power than medium cores, but also consume more power. Similarly, medium cores have higher computing power than small cores, but also consume more power. Multi-core processors can include several types of large, medium, and small cores.

[0099] As mentioned in the background section, during the use of electronic devices, many used applications' processes remain running in the background, consuming a large amount of memory. This can potentially lead to insufficient system memory or system lag. To prevent the continuous accumulation of background processes, they can be released according to preset rules to ensure that the system has enough usable memory. The following section will combine... Figures 1 to 6 This application introduces two possible implementations of releasing background processes according to embodiments.

[0100] Figure 1An exemplary flowchart of the first possible implementation is shown. For example, after the background application enters the cache state, state time monitoring is performed, that is, monitoring the time it takes for the background application to enter the cache state. When the time the background application spends in the cache state exceeds a preset threshold, a memory reclamation operation is performed, for example, triggering the Android native empty operation to release the background application's process. The specific process is not limited in this application.

[0101] Figure 2 It shows Figure 1 This illustrates a practical application scenario of the proposed solution. For example... Figure 2 As shown, a user is currently playing a racing game on an electronic device. If a background application remains in a cached state for longer than a preset threshold, the system will release the application's process in the background. An application may consist of multiple processes, so all of them need to be released. During this process, the performance of the current game application may be affected; for example, it may cause fluctuations in the game's frame rate. Figure 3 For example, assuming the racing game application has a stable frame rate of 90fps, the system starts releasing multiple background processes at time t1 and continues until time t2, as shown in the figure. Affected by the process release operation, the frame rate of the racing game application fluctuates irregularly, resulting in lag in the game interface that is perceptible to the user and reducing the user experience.

[0102] Figure 4 An exemplary flowchart of a second possible implementation is shown. For example, after receiving a user's click on an application icon, the electronic device, in response to this action, launches the application at the application layer (which can be understood as initiating the application's process). Then, the application sends a memory request to the kernel to request memory, the request carrying information indicating the size of the requested memory space. It is understood that the memory requested by the application is used to run the application's process. Further, after receiving the memory request, the kernel monitors the remaining memory space, i.e., determines whether the remaining memory space is less than the memory space requested by the application. If the remaining memory space is less than the memory space requested by the application, the kernel performs memory reclamation. For example, the kernel performs a cleanup operation on one or more background processes until the remaining memory space is greater than or equal to the memory space requested by the application. It is understood that the kernel can directly clean up all background processes, or it can clean up only some of the background processes according to preset rules; this application does not limit this. If the remaining memory space is greater than or equal to the memory space requested by the application after the above memory reclamation operation, the kernel can allocate memory space to the application to provide memory space for the application to start, so that the email application can start successfully.

[0103] Figure 5 It shows Figure 4 This illustrates a practical application scenario of the proposed solution. For example... Figure 5 As shown in (a), the user clicks the camera app icon on the system desktop. To launch successfully, the camera app requests memory from the kernel. If there is insufficient memory available, the system will release some or all background processes to make room for the camera app. Once the camera app has enough space, it can successfully open the launch screen, as shown in (a). Figure 5 As shown in (b) above. Camera applications often request a large amount of memory upon startup, thus requiring the clearing of numerous background processes to meet their memory demands. However, releasing a large number of background processes can actually increase the startup time of the camera application. Figure 6 For example, assuming ample memory, the camera application's startup time is 200ms. Figure 6 The startup time of the camera app on the first and second launches. Assuming that the system has insufficient remaining space when the camera app is launched for the third time, multiple background processes need to be released to allow the camera app to obtain enough memory. For example... Figure 6 As shown, due to the process release operation, the startup time of the camera application increased significantly on the third launch, reaching 500ms. At this point, users may experience a lag during camera application startup, degrading the user experience. On the other hand, the performance of the camera application may also be affected, for example, the photo-taking page may experience lag.

[0104] In conclusion, releasing background processes may impact the performance of foreground applications, thereby degrading the user experience.

[0105] Based on this, embodiments of this application provide a process release method, an exemplary flowchart of which is shown below. Figure 7 As shown. Figure 7 As shown, this method can determine whether to release memory serially or in parallel based on the processor load and / or the performance of the foreground application. By using serial release to release background processes in scenarios where the release process might affect the performance of the foreground application, it can prevent the simultaneous release of multiple background processes from increasing the processor load and thus impacting the performance of the foreground application. The following section combines... Figure 8The process release method 100 provided in this application is illustrated by way of example. It is understood that the method 100 can be applied to electronic devices, such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of this application do not impose any restrictions on the specific type of electronic device.

[0106] S110, determine the memory release method based on the processor load and / or the type of foreground application in the electronic device.

[0107] For example, an electronic device determines a memory release method based on the processor load and / or the type of foreground application. This memory release method indicates how to release memory, or in other words, it indicates how to release background processes. Therefore, this memory release method can also be called a process release method or a process cleanup method, etc.

[0108] As an example application scenario, the electronic device is currently in a screen-on state.

[0109] The memory release methods in this application include serial release and parallel release. Serial release refers to releasing background processes sequentially to reclaim memory, that is, releasing multiple background processes one by one (or possibly two by two, or three by three, etc.) to reclaim memory. Parallel release refers to releasing background processes in parallel to reclaim memory, that is, releasing multiple background processes in parallel within their respective processes to reclaim memory. In one implementation, parallel release refers to releasing multiple background processes simultaneously to reclaim memory.

[0110] In one example, when it is determined that multiple background processes need to be released, the memory release method is determined based on the processor load and / or the type of foreground application. This application does not limit the specific method for determining the release of background processes; as an example, it may employ methods such as... Figure 1 or Figure 4 The proposed solution determines the release of background processes; no specific restrictions are imposed here.

[0111] The following is an example of how to determine the specific implementation method of memory release.

[0112] In the first possible implementation, the memory release method is determined based on the processor load. An example is given below.

[0113] For example, if the processor load is greater than or equal to a preset threshold, the memory release method is determined to be a serial release method. Specifically, if the processor load is greater than or equal to the preset threshold, it indicates a high processor load. Since the release process requires processor scheduling, releasing background processes in parallel could impact the processor load. For instance, if many background processes need to be cleared simultaneously, clearing them all would further degrade processor performance, thus affecting the performance of foreground applications. Releasing background processes serially reduces the impact on processor performance because releasing background processes one by one places a much lower load on the processor than releasing multiple background processes simultaneously.

[0114] For example, if the processor load is less than a preset threshold, then the memory release method is determined to be the parallel release method. Specifically, if the processor load is less than the preset threshold, it means that the processor load is relatively low. Therefore, even if the parallel release method is used to release background processes, it will not cause processor overload. At the same time, using the parallel release method instead of the serial release method can shorten the time occupied by process release, allowing the system to reclaim memory space as quickly as possible and improve the overall performance of the system.

[0115] In the second possible implementation, the memory release method is determined based on the type of the foreground application. An example is given below.

[0116] For example, if the foreground application is a load-sensitive application, then the memory release method is determined to be the serial release method. This is because the performance of the load-sensitive application is more affected by processor load than a preset level. In other words, the performance of the load-sensitive application is easily affected by changes in processor load, or excessive processor load (such as exceeding a certain threshold) will affect the performance of the load-sensitive application (e.g., the application's frame rate). Specifically, if the foreground application is load-sensitive, it means that its performance is easily affected by load changes. If a parallel release method is used to release background processes in this case, it may increase the processor load, further affecting the performance of the foreground application, such as causing frame drops. Releasing background processes serially reduces the impact of the released processes on the processing load, and further reduces the impact on the performance of the foreground application, maintaining the stable operation of the foreground application as much as possible.

[0117] In one implementation, the type of load-sensitive application can be pre-configured. For example, a media application can be set as a load-sensitive application. This media application is used to capture images (such as a camera application) or to capture or display video footage (such as a recording application, game application, video application, live streaming application, etc.). Therefore, before determining the memory release method, the type of the foreground application can be determined first. If the foreground application is a media application, then it is determined to be a load-sensitive application.

[0118] It is understood that this application does not limit the specific implementation method by which an electronic device determines the type of a foreground application. As an example, an electronic device can read the classification information of the foreground application through its interface, and then determine the type of the foreground application based on that classification information. Here, classification information refers to information used to indicate the type of the foreground application based on preset classification rules. The type of the foreground application indicated by the classification information is, for example, any one or more of the following: games, videos, music, social networking, photography, finance, etc.

[0119] For example, if the foreground application is not a load-sensitive application, then the memory release method should be the parallel release method. Specifically, if the foreground application is not a load-sensitive application (such as a photo album application, a financial application, etc.), it means that the performance of the foreground application is not easily affected by load changes. In this case, even if using the parallel release method to release background processes increases the processor load, it will not significantly affect the performance of the foreground application. At the same time, using the parallel release method instead of the serial release method can also shorten the time occupied by process release, allowing the system to reclaim memory space as quickly as possible and improve the overall system performance.

[0120] In the third possible implementation, the memory release method is determined based on the processor load and the type of the foreground application. It is understood that in this implementation, the processor load can be determined first, followed by the type of the foreground application, or vice versa; this application does not impose any limitation on this. Examples are given below.

[0121] For example, if the processor load is less than a preset threshold and the foreground application is a load-sensitive application, then the memory release method is determined to be the serial release method. Specifically, if the processor load is less than the preset threshold, it means that the processor load is relatively low. However, since the foreground application is a load-sensitive application, if the background process is released in parallel, even if the processor load is currently low, the process release operation may still increase the load, which may affect the performance of the foreground application. Therefore, the serial release method can be used to release the background process to reduce the impact of process release on the processor load, thereby reducing the impact on the performance of the foreground application.

[0122] For example, if the processor load is less than the preset threshold and the foreground application is not a load-sensitive application, then the memory release method is determined to be a parallel release method. Specifically, if the processor load is less than the preset threshold, it means that the processor load is relatively small. Therefore, even if the parallel release method increases the load due to releasing background processes, it will not cause processor overload. Furthermore, since the foreground application is not a load-sensitive application, even if the load increases, it will not significantly affect the performance of the foreground application. At the same time, it can improve the efficiency of memory reclamation and improve the overall system performance.

[0123] For example, if the processor load is greater than or equal to a preset threshold, and the foreground application is either a load-sensitive application or not, then the memory release method is determined to be serial release. Specifically, if the processor load is greater than or equal to the preset threshold, it indicates a high processor load. Releasing background processes in parallel might overload the processor, affecting the performance of the foreground application. Releasing background processes serially reduces the impact on processor performance.

[0124] In summary, in the three examples above, if the processor load is greater than or equal to the preset threshold, the serial release method is used regardless of whether the foreground application is a load-sensitive application; if the foreground application is a load-sensitive application, the serial release method is used regardless of whether the processor load is greater than or equal to the preset threshold; only when the processor load is less than the preset threshold and the foreground application is a load-sensitive application is the parallel release method used.

[0125] Therefore, if the processor load is determined first, and the processor load is greater than or equal to a preset threshold, the type of foreground application can be determined without further determining the type of foreground application, and a serial release method can be used directly. If the type of foreground application is determined first, and the foreground application is a load-sensitive application, the processor load can be determined without further determining the type of foreground application, and a serial release method can be used directly. This method can reduce power consumption, save resources, and improve the efficiency of memory reclamation.

[0126] S120, release multiple background processes in the electronic device according to the memory release method.

[0127] For example, after determining the memory release method, multiple background processes are released according to that method. It is understood that these multiple background processes can be some or all of the background processes in the electronic device, and this application does not limit how the number of these multiple background processes is determined. For example, one method is to determine the number of background processes to be released based on the size of the memory requested by the foreground application; another method is to determine the number of background processes to be released based on the system's native cleanup rules. The specific implementation method for releasing background processes is illustrated below.

[0128] Example 1: When the memory release method is determined to be parallel release, each background process releases the memory in its own process. The specific process is not limited in this application.

[0129] Example 2: If the memory release method is determined to be serial release, release multiple background processes sequentially.

[0130] In the first implementation, these multiple background processes still release resources within their respective processes, but timing control ensures that the release times of each process do not overlap. This implementation does not require the introduction of additional proxy processes, which can reduce resource waste to some extent.

[0131] In the second implementation, the multiple background processes are released one by one within the same memory release agent process. That is, all background processes are released within the same memory release agent process. For example, the multiple background processes can be placed in a queue and released one by one within a single memory release agent process. Since an agent process can only release one process at a time, the release times of these multiple background processes will not overlap. Therefore, this implementation method can complete the serial release process operation without cumbersome timing control. The memory release agent process can be one of the aforementioned multiple processes, or it can be a process other than those multiple processes. An example of the second case is given below.

[0132] For example, a memory release agent process can be pre-established and put into a sleep state. After determining to perform serial release, the memory release agent process in the sleep state is woken up, and then the multiple background processes are released sequentially in the memory release agent process. In this way, the memory release agent process can be directly woken up and used, improving the efficiency of process release.

[0133] For example, if a serial memory release is determined to occur, a temporary memory release agent process can be created. After creation, the multiple background processes can be released sequentially within this agent process. Once the release is complete, the agent process can be cleared. In this way, it is not necessary to continuously maintain the memory release agent process, thereby reducing memory usage.

[0134] Alternatively, in one possible implementation, if the memory release method is determined to be serial release, the memory release agent process can be bound to the small or medium core of the processor. Specifically, for multi-core processors, the large cores have the strongest clock speed and are usually used to handle high-performance tasks. If the memory release agent process is bound to the large core of the processor, there is a high probability that it will impact the load of the large core. However, if the memory release agent process is bound to the small or medium core of the processor, the impact of the process release operation on the processor load can be minimized.

[0135] Optionally, in one possible implementation, if the memory release method is determined to be serial release, the multiple background processes can be cleaned up sequentially according to preset rules. For example, the background processes can be released in descending order of workload. That is, the background processes with high workload are released first, followed by those with low workload. By prioritizing the release of high-load processes, the system load can be reduced as quickly as possible, improving system performance. Another example is to release the background processes in ascending order of the usage frequency of the applications corresponding to them. That is, the processes of infrequently used applications are released first, followed by those of frequently used applications. By prioritizing the release of infrequently used application processes, the processes of frequently used applications can be preserved as much as possible, thus improving application loading speed when users reopen these preserved applications.

[0136] The following is combined Figure 9 The specific process of the process release method shown in method 100 above is illustrated by an example. For example... Figure 9As shown, the system makes decisions based on the current scenario (such as live video streaming, video editing, and gaming), processor load, process release monitoring, and system status. Specifically, it identifies the current scenario based on the type of foreground application (i.e., whether the foreground application is load-sensitive), determines whether the processor load is greater than or equal to a preset threshold, and determines whether to perform process cleanup based on scenarios such as empty cleanup, memory allocation, or power consumption / hot cleanup. Then, it comprehensively considers the above information to determine the memory release method. For a detailed description of the scheme, please refer to section S110 of method 100, which will not be repeated here. Further, the memory release method is written to the kernel control node, which controls the release of background processes. If it is a serial release, the background process (i.e., the process to be released) can optionally be bound to a small or medium core and then enter the release queue. Optionally, it can be sorted according to preset rules, and the processes are released one by one in the sorted order. For details, please refer to section S120 of method 100 regarding example 2. If the release is not sequential, each process will be released in parallel. For details, please refer to the description of Example 1 in section S120 of Method 100.

[0137] In summary, the process release method provided in this application can determine the memory release method based on the processor load and / or the performance of the foreground application, thereby reducing the impact of process release operations on the performance of the foreground application. Specifically, when the processor load is greater than or equal to a preset threshold, or when the foreground application is a load-sensitive application, a serial release method can be used to release background processes. This method can reduce the impact of process release on the processor load and also reduce the impact on the foreground application. When the processor load is less than the preset threshold, and / or the foreground application is not a load-sensitive application, a parallel release method can be used to release background processes. This method can shorten the time occupied by process release, enabling the system to reclaim memory space as quickly as possible and improve the overall performance of the system.

[0138] For example, for Figure 2 In the application scenario shown, while a user is playing a game on an electronic device, the system may release multiple background processes using the `android empty` function. In this case, the foreground application is a racing game. Based on the type of the foreground application (load-sensitive application), a serial release method can be used to release the background processes. Since the process release process requires CPU scheduling, releasing the background processes one by one serially can minimize the impact of process release operations on the processor load. It also reduces the impact of processor load fluctuations on the performance of the foreground application, preventing application performance issues such as... Figure 3 The frame rate fluctuations are shown.

[0139] For example, regarding Figure 5 As shown in the application scenario, when a user opens the camera app on an electronic device, if memory is insufficient, the system will clean up multiple background processes to free up memory space. If the current processor load is relatively high, a serial release method can be used to release background processes, minimizing processor overload caused by process release, improving camera app performance, shortening camera app startup time, and preventing issues such as... Figure 6 The example shown illustrates a sudden change in startup time.

[0140] Corresponding to the methods given in the above method embodiments, this application also provides a corresponding electronic device, which includes a module for executing the corresponding methods in the above method embodiments. This module can be software, hardware, or a combination of software and hardware. It is understood that the technical features described in the above method embodiments are also applicable to the following device embodiments. Therefore, details not described in detail can be found in the above method embodiments, and for brevity, will not be repeated here.

[0141] Figure 10 A structural block diagram of an electronic device 1000 provided in an embodiment of this application is shown. For convenience, only the parts related to the embodiment of this application are shown. (Refer to...) Figure 10 The electronic device 1000 may specifically include the following modules:

[0142] The memory release method decision module 1010 is used to determine the memory release method based on the processor load and / or the type of foreground application in the electronic device 1000. The memory release method includes serial release method or parallel release method.

[0143] The memory release control module 1030 is used to release multiple background processes in the electronic device according to the memory release method.

[0144] Optionally, the electronic device 1000 further includes a policy notification module 1020, which is located between the memory release method decision module 1010 and the memory release control module 1030. The policy notification module is used to obtain the memory release method from the memory release method decision module 1010 and send the memory release method to the memory release control module 1030.

[0145] It should be noted that the information interaction and execution process between the above modules / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method and system embodiments section, and they will not be repeated here.

[0146] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units or modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0147] The following is combined Figure 11 This paper introduces a software system corresponding to an electronic device 1000. In this software system, each module in the electronic device 1000 can be regarded as a software module.

[0148] The software system of electronic device 1000 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc. This application embodiment uses the layered architecture Android system as an example to illustrate the software system of electronic device 1000.

[0149] Figure 11 This is a block diagram of a software system for an electronic device 1000 provided in an embodiment of this application. See also... Figure 11 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the native service layer, and the kernel layer. It is understood that a hardware abstraction layer (HAL) (not shown in the diagram) can also be included between the native service layer and the kernel layer. The HAL is a kernel-mode module that hides various hardware-related details, such as I / O interfaces, interrupt controllers, and multiprocessor communication mechanisms, providing a unified service interface for different hardware platforms running Android, thus achieving portability across multiple hardware platforms.

[0150] The application layer can include a series of application packages. For example... Figure 11As shown, the application package can include media applications such as camera apps, game apps, and live video streaming apps. Of course, the application package can also include other applications, such as gallery, calendar, call, map, navigation, Bluetooth, music, video, and SMS applications.

[0151] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes predefined modules that can implement corresponding functionalities based on predefined functions. For example... Figure 11 As shown, the application framework layer may include a memory release method decision module. This module can determine the memory release method based on the processor load and / or the type of foreground application in the electronic device 1000. For specific implementation details, please refer to [reference needed]. Figure 8 The description of step S110 in method 100 is not repeated here.

[0152] Optionally, the application framework layer may also include a process management module, which is used to monitor process release, i.e., to monitor whether process release operations are needed. For example, the need for process cleanup operations can be determined based on the empty cleanup mechanism, memory allocation of foreground applications, system power consumption / hot cleanup, etc. The specific method is not limited in this application.

[0153] Optionally, the application framework layer may also include a scene recognition module, which is used to identify the current scene based on the type of the foreground application (i.e., to identify whether the foreground application is a load-sensitive application).

[0154] Optionally, the application framework layer may further include a load acquisition module for acquiring the processor's load. Optionally, it may also determine whether the processor's load is greater than or equal to a preset threshold.

[0155] It is understandable that the aforementioned process management module, scene recognition module, and load acquisition module can also be modules outside the application framework layer, or be parts of the memory release method decision module. In other words, in one implementation, the memory release method decision module can execute the functions performed by the aforementioned process management module, scene recognition module, and load acquisition module.

[0156] In addition, the application framework layer may also include modules such as a resource manager, which provides the application with various resources, such as localized strings, icons, images, layout files, video files, etc.

[0157] The native service layer mainly includes native services and linked libraries. It provides feature support for the Android system through C / C++ libraries. Additionally, the native service layer includes the Android Runtime. The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: functions that Java needs to call, and the core Android libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0158] Please refer to Figure 11 The local service layer may optionally include a policy notification module, which is used to obtain information indicating the memory release method output by the memory release method decision module in the application framework layer, and to forward the information to the memory release control node in the kernel layer.

[0159] The kernel layer is the layer between hardware and software. See also... Figure 11 The kernel layer controls a memory release control module, which is used to release multiple background processes in the electronic device 1000 according to a memory release method. In one implementation, the memory release control module learns the memory release method through a policy notification module in the local service layer.

[0160] In addition, such as Figure 11 As shown, the kernel layer may also include CPU drivers and GPU drivers, etc.

[0161] It should be noted that the embodiments of this application are only illustrated using the Android system. In other operating systems (such as Android, iOS, etc.), the solution of this application can also be implemented as long as the functions implemented by each functional module are similar to those in the embodiments of this application.

[0162] The following example, using a camera application scenario, illustrates the workflow of the software and hardware of the electronic device 1000.

[0163] Please refer to Figure 12 , Figure 12 This is a schematic diagram illustrating the workflow of an electronic device 1000 releasing background processes during the startup and use of a camera application, as provided in an embodiment of this application.

[0164] like Figure 12As shown, suppose a user launches a camera application at the application layer, and the camera application requests memory from the system. If the remaining memory space is insufficient, the process management module learns that the background process needs to be released and notifies the memory release method decision module of the process release event.

[0165] On the other hand, the scene recognition module of the application framework layer reads the foreground application (i.e., the camera application) from the application layer and identifies the type of the foreground application (optionally, it can also determine whether the foreground application is a load-sensitive application based on the type of the foreground application), and then sends the type of the foreground application (or the judgment result) to the memory release method decision module.

[0166] Secondly, the load acquisition module of the application framework layer acquires the processor load (optionally, it can also determine whether the processor load is greater than or equal to a preset threshold), and then sends the processor load (or the determination result) to the memory release method decision module.

[0167] After learning from the process management module that a process needs to be released, the memory release method decision module determines the memory release method based on the type of the foreground application and / or the processor load, and then sends the memory release method to the memory release control module through the local service layer policy notification module.

[0168] The specific interaction process of the above solution is as follows: Figure 13 As shown. In Figure 13 In method 200, the memory release method decision module obtains the processor load and the type of the foreground application from the load acquisition module and the scene recognition module respectively (or it may only obtain one of the processor load and the type of the foreground application, which is not limited here). Then, it determines the memory release method based on the processor load and / or the type of the foreground application. For specific implementation details, please refer to [reference needed]. Figure 8 The description in section S110 of method 100 further details the memory release method decision module sending the memory release method to the local service layer, which then sends the received memory release method to the memory release control module. After obtaining the memory release method, the memory release control module can release multiple background processes based on that method. For specific implementation details, please refer to [reference needed]. Figure 8 The description of part S120 in method 100.

[0169] Corresponding to the methods given in the above embodiments, this application also provides another architecture for the corresponding electronic device.

[0170] like Figure 14As shown, this application embodiment also provides an electronic device 1100, which includes: at least one processor 1100, a memory 1120, and a computer program 1121 stored in the memory. When the processor calls the computer program 1121 to run, the electronic device 1100 can implement the steps in any of the method embodiments of the above embodiments.

[0171] It is understood that the technical features described in the above method embodiments are also applicable to the device embodiments of this application. Therefore, for the content not described in detail, please refer to the above method embodiments. For the sake of brevity, they will not be repeated here.

[0172] For example, Figure 15 A detailed architectural diagram of an electronic device 1300 to which this application applies is shown.

[0173] like Figure 15 As shown, electronic device 1300 may include processor 1310, internal memory 1321, and one or more displays 1394 (these multiple displays may be represented by 1-N).

[0174] Optionally, the electronic device 1300 may also include an external memory interface 1320, a universal serial bus (USB) interface 1330, a charging management module 1340, a power management module 1341, a battery 1342, antenna 1, antenna 2, a mobile communication module 1350, a wireless communication module 1360, an audio module 1370, a speaker 1370A, a receiver 1370B, a microphone 1370C, a headphone jack 1370D, a sensor module 1380, buttons 1390, a motor 1391, an indicator 1392, a camera 1393, and a subscriber identification module (SIM) card interface 1395, etc. The sensor module 1380 may include a pressure sensor 1380A, a gyroscope sensor 1380B, a barometric pressure sensor 1380C, a magnetic sensor 1380D, an accelerometer sensor 1380E, a distance sensor 1380F, a proximity sensor 1380G, a fingerprint sensor 1380H, a temperature sensor 1380J, a touch sensor 1380K, an ambient light sensor 1380L, a bone conduction sensor 1380M, etc.

[0175] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 1300. In other embodiments of this application, the electronic device 1300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0176] Processor 1310 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. It is understood that processor 1310 in this embodiment can be used to schedule the process release process; for example, during process release, processor 1310 can allocate processing resources and schedule the execution order and priority of tasks.

[0177] The controller can serve as the central nervous system and command center of the electronic device 1300. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0178] The processor 1310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1310 is a cache memory. This memory can store instructions or data that the processor 1310 has just used or that are used repeatedly. If the processor 1310 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 1310, and thus improves the efficiency of the system.

[0179] In some embodiments, the processor 1310 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0180] The processor 1310 in this embodiment can be a multi-core processor, which has higher processing speed and performance than a conventional processor. For example... Figure 15 As shown, when the processor 1310 is a multi-core processor, it includes multiple cores. Figure 15 The example shown illustrates that processor 1310 includes three cores: a large core, a medium core, and a small core. However, it should be understood that this application is not limited to this; when processor 1310 is used as a multi-core processor, it may have only two cores or more than three cores.

[0181] To improve processor speed and performance, multi-core processors can be used in electronic devices. A processor can include large cores, medium cores, and small cores. Large cores have higher computing power than medium cores, but also consume more power. Similarly, medium cores have higher computing power than small cores, but also consume more power. Multi-core processors can include several types of large, medium, and small cores.

[0182] Internal memory 1321 can be used to store computer executable program code, which includes instructions. Processor 1310 executes various functional applications and data processing of electronic device 1300 by running the instructions stored in internal memory 1321. Internal memory 1321 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc. The data storage area may store data created during the use of electronic device 1300 (such as audio data, phone book, etc.). In addition, internal memory 1321 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, universal flash storage (UFS), etc. In this embodiment, background processes may be stored in internal memory 1321. In one application scenario, if the storage space of internal memory 1321 is insufficient when the foreground application starts, the processor 1310 can schedule a process release process to reclaim storage space.

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

[0184] Display screen 1394 is used to display images, videos, etc. Display screen 1394 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a minimized display, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 1300 may include one or N displays 1394, where N is a positive integer greater than 1.

[0185] In this embodiment, the display screen 1394 can be used to display the interface of a foreground application, such as displaying the game screen of a game application, like... Figure 2 As shown, or displaying the camera app's captured image, such as... Figure 5 As shown in (b) of the diagram.

[0186] Alternatively, in one implementation, the electronic device 1300 can implement the shooting function of the camera application through an ISP, a camera 1393, a video codec, a GPU, a display 1394, and an application processor.

[0187] The ISP (Image Signal Processor) is used to process data fed back from the camera 1393. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 1393.

[0188] Camera 1393 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, electronic device 1300 may include one or N cameras 1393, where N is a positive integer greater than 1.

[0189] Alternatively, the wireless communication module 1360 can provide a wireless communication solution for use on the electronic device 1300; the wireless communication module 1360 can be one or more devices integrating at least one communication processing module. In some embodiments, antenna 1 of the electronic device 1300 is coupled to the mobile communication module 1350, and antenna 2 is coupled to the wireless communication module 1360, enabling the electronic device 1300 to communicate with networks and other devices via wireless communication technology; the external memory interface 1320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 1300. The electronic device 1300 can implement audio functions, such as music playback and recording, through the audio module 1370, speaker 1370A, receiver 1370B, microphone 1370C, headphone jack 1370D, and application processor; the buttons 1390 include a power button, volume buttons, etc.; the motor 1391 can generate vibration prompts; the indicator 1392 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.; the SIM card interface 1395 is used to connect a SIM card.

[0190] It is understood that if the units integrated in the above-described device embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above-described method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0191] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0192] This application provides a computer program product that, when run on an electronic device, enables a mobile terminal to execute the steps described in the above-described method embodiments.

[0193] It should be noted that in the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0194] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0195] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0196] The units described as separate components may or may not be physically separate. The 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.

[0197] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A process release method, characterized in that, Applied to electronic devices, the method includes: The memory release method is determined based on the processor load and / or the type of foreground application in the electronic device. The memory release method includes a serial release method or a parallel release method. The serial release method refers to releasing background processes sequentially to reclaim memory, while the parallel release method refers to multiple background processes releasing memory in parallel within their respective processes. Release multiple background processes in the electronic device according to the memory release method described above; The method of determining the memory release method based on the processor load includes: if the processor load is greater than or equal to a preset threshold, then the memory release method is determined to be the serial release method; or, if the processor load is less than the preset threshold, then the memory release method is determined to be the parallel release method. The method of determining the memory release method based on the type of the foreground application includes: if the foreground application is a load-sensitive application, then the memory release method is determined to be the serial release method; or, if the foreground application is not a load-sensitive application, then the memory release method is determined to be the parallel release method; wherein the performance of the load-sensitive application is affected by the load to a degree higher than a preset level. The method of determining the memory release method based on the processor load and the type of the foreground application includes: if the processor load is less than a preset threshold and the foreground application is a load-sensitive application, then the memory release method is determined to be the serial release method; or, if the processor load is less than the preset threshold and the foreground application is not a load-sensitive application, then the memory release method is determined to be the parallel release method; or, if the processor load is greater than or equal to the preset threshold and the foreground application is a load-sensitive application or the foreground application is not a load-sensitive application, then the memory release method is determined to be the serial release method; wherein the performance of the load-sensitive application is affected by the load to a higher degree than a preset level.

2. The method according to claim 1, characterized in that, When the determined memory release method is the serial release method, releasing multiple background processes in the electronic device according to the memory release method includes: Release the multiple background processes one by one in the same memory release agent process.

3. The method according to claim 2, characterized in that, Before releasing the multiple background processes one by one in the same memory release agent process, the method further includes: Wake up the dormant memory release agent process, which is a pre-established process; or, Create the memory release agent process.

4. The method according to claim 2 or 3, characterized in that, The processor is a multi-core processor, and the method further includes: The memory release agent process is bound to the small or medium core of the processor.

5. The method according to any one of claims 1 to 3, characterized in that, When the determined memory release method is the serial release method, releasing multiple background processes in the electronic device according to the memory release method includes: According to preset rules, the multiple background processes are released one by one in sequence.

6. The method according to claim 5, characterized in that, The preset rules include: Release the multiple background processes in descending order of workload.

7. The method according to claim 5, characterized in that, The preset rules include: The background processes are released sequentially according to the usage frequency of the applications corresponding to them, from low to high.

8. The method according to claim 1, characterized in that, The load-sensitive applications include media applications, which are applications used to take pictures or to capture or display video footage.

9. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The classification information of the front-end application is read through the interface of the front-end application; The type of the front-end application is determined based on the classification information.

10. An electronic device, characterized in that, The electronic device includes: The memory release method decision module is used to determine the memory release method based on the processor load and / or the type of foreground application in the electronic device. The memory release method includes a serial release method or a parallel release method. The serial release method refers to releasing background processes sequentially to reclaim memory, while the parallel release method refers to multiple background processes releasing memory in parallel within their respective processes. A memory release control module is used to release multiple background processes in the electronic device according to the memory release method. Specifically, the memory release method decision module is used to: determine the memory release method as the serial release method if the processor load is greater than or equal to a preset threshold; or determine the memory release method as the parallel release method if the processor load is less than the preset threshold. Specifically, the memory release method decision module is further used to: if the foreground application is a load-sensitive application, determine that the memory release method is the serial release method; or, if the foreground application is not a load-sensitive application, determine that the memory release method is the parallel release method; wherein, the performance of the load-sensitive application is affected by the load to a degree higher than a preset level; Specifically, the memory release method decision module is further configured to: if the processor load is less than a preset threshold and the foreground application is a load-sensitive application, then determine the memory release method as the serial release method; or, if the processor load is less than the preset threshold and the foreground application is not a load-sensitive application, then determine the memory release method as the parallel release method; or, if the processor load is greater than or equal to the preset threshold and the foreground application is a load-sensitive application or the foreground application is not a load-sensitive application, then determine the memory release method as the serial release method; wherein the performance of the load-sensitive application is affected by the load to a degree higher than a preset level.

11. An electronic device, characterized in that, include: Processor and memory; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1 to 9.

12. A computer storage medium, characterized in that, Includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for releasing resources

    CN104778086A

  • Device dormancy method and computing device

    CN113467923A

  • Control method and device and electronic equipment

    CN113900819A