Method for managing application program and electronic equipment

By freezing some or all the processes corresponding to the application windows in the desktop operating system of electronic devices, the system response delay and lag caused by applications with high resource consumption is solved, and the system fluency and user experience is improved, while avoiding process starvation or starvation.

CN120179345APending Publication Date: 2025-06-20HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311750319.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In electronic devices, when multiple applications with larger resource consumption are running in the foreground, it may cause delays and lag in system responses, affecting the user experience. Existing prioritization scheduling-based methods cannot be effective for a long time, which may lead to low-priority applications not being scheduled for a long time, causing processes to starve or starve to death.

Method used

Scheduling system resources to improve system fluency by displaying multiple application windows in the desktop operating system and freezing the processes corresponding to some or all of the application windows when a specific event is detected. The frozen process is in an uninterruptible sleep state to prevent the process from starving or starving to death.

Benefits of technology

This method can effectively improve the fluency of the system, improve user experience, avoid process starvation or death, and quickly restore the original state of the frozen process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179345A_ABST
    Figure CN120179345A_ABST
Patent Text Reader

Abstract

The invention provides an application program management method and electronic equipment, the method is applied to a personal computer, and the method comprises the following steps: displaying M application windows; and in response to the detected specific event, freezing a process corresponding to at least one application window in the M application windows. In the embodiment of the invention, due to the characteristics of the desktop operating system, a plurality of application windows can be displayed on the screen, the plurality of application windows can be randomly placed, and a part of application windows can be partially or completely shielded, so that a user cannot pay attention to all application windows on the screen at the same time; according to the embodiment of the invention, when the specific event is detected, a user cannot perceive that the process corresponding to the partial application window is frozen, so that when the specific event is detected, the process corresponding to the partial application window can be frozen, the fluency of the system is improved, and the user experience is improved. In addition, the frozen process is in an uninterruptible dormant state, and the process cannot be starved, so that the process can be quickly recovered to the original state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic devices, and more particularly, to a method for managing application programs and an electronic device. Background Art

[0002] An electronic device can run multiple application programs in the foreground. When the electronic device runs an application program that consumes a large amount of system resources, such as an arithmetic application, in the foreground, if the user operates other application programs running in the foreground at this time, the electronic device may not be able to respond in time, resulting in problems such as lag and delay. To solve this problem, the electronic device can adjust the priority of the application program to adjust the system resources, and thus can ensure timely response to the user's operations. However, this priority-based scheduling method cannot be operated for a long time, which may cause low-priority application programs to not be scheduled for a long time, affecting the user experience. Therefore, how to manage application programs has become a technical problem to be solved urgently. Summary of the Invention

[0003] This application provides a method for managing application programs and an electronic device, which can reasonably schedule system resources, and will not cause problems such as process starvation or process death, and can better improve the user experience.

[0004] In a first aspect, a method for managing application programs is provided. The method is applied to a personal computer (PC). The method includes: displaying M application windows, where M≥2 and M is an integer; and in response to detecting a specific event, freezing the process corresponding to at least one of the M application windows.

[0005] In the embodiments of this application, due to the characteristics of the desktop operating system, multiple application windows can be displayed on the screen. The multiple application windows can be placed randomly, and some application windows may be partially or completely blocked. The user cannot pay attention to all the application windows on the screen at the same time. The user cannot perceive the freezing of the processes corresponding to some application windows. Therefore, when a specific event is detected, the processes corresponding to some application windows can be frozen, thereby improving the fluency of the system and helping to improve the user experience.

[0006] In addition, the frozen process is in an uninterruptible sleep state, and the process will not starve to death, so it can be quickly restored to the original state.

[0007] In combination with the first aspect, in some implementation manners of the first aspect, the PC runs one or more invisible application windows, and the method further includes: in response to detecting the specific event, freezing the process corresponding to at least one of the one or more invisible application windows.

[0008] In the embodiments of the present application, since the PC can also run invisible application windows, that is, the application windows corresponding to the application programs running in the background, the user may be more likely to ignore these invisible application windows. Therefore, when a specific event is detected, the processes corresponding to some of the invisible application windows can be frozen, thereby improving the system fluency and helping to enhance the user experience.

[0009] In combination with the first aspect, in some implementation manners of the first aspect, the processes corresponding to the frozen application windows do not perform perceivable services.

[0010] In the embodiments of the present application, the processes corresponding to the frozen application windows can be processes that do not perform user-perceivable services. Since the services executed by the frozen processes are not perceivable by the user, after the processes are frozen, the user will be even less likely to perceive the freezing, and it will not affect the normal use of the user.

[0011] In combination with the first aspect, in some implementation manners of the first aspect, the perceivable service includes one or more of the following services: audio playback service, video playback service, screen recording service, recording service, and navigation service.

[0012] In combination with the first aspect, in some implementation manners of the first aspect, the processes corresponding to the frozen application windows do not perform external device connection services.

[0013] In the embodiments of the present application, the processes corresponding to the frozen application windows can be processes that do not perform external device connection services, so the user will not perceive the freezing and it will not affect the normal use of the user.

[0014] In combination with the first aspect, in some implementation manners of the first aspect, the freezing of the processes corresponding to at least one of the M application windows in response to the detection of a specific event includes: freezing the processes corresponding to at least one of the M application windows in response to the detection of the specific event and the overall machine load being greater than the first threshold.

[0015] In combination with the first aspect, in some implementation manners of the first aspect, the freezing of the processes corresponding to at least one of the M application windows includes: determining N application windows from the M application windows, where N≥1 and is an integer; freezing the processes corresponding to at least one of the N application windows.

[0016] In combination with the first aspect, in some implementation manners of the first aspect, the N application windows are the application windows determined in descending order of the loads of the processes corresponding to the M application windows.

[0017] In the embodiments of the present application, the processes corresponding to the frozen application windows are processes with relatively large loads. Therefore, after freezing the processes with relatively large loads, the normal operation of other services can be ensured.

[0018] In combination with the first aspect, in some implementations of the first aspect, the N application windows are application windows with a load greater than a second threshold.

[0019] In the embodiments of the present application, the processes corresponding to the frozen application windows are processes with a relatively large load. Therefore, after freezing the processes with a relatively large load, the normal operation of other services can be ensured.

[0020] In combination with the first aspect, in some implementations of the first aspect, the overall machine load is determined according to the Processor Stress Information (PSI) of the processor and / or the PSI of the memory and / or the PSI of the input / output of the memory.

[0021] In combination with the first aspect, in some implementations of the first aspect, the specific event includes one or more of the following: an operation by the user to start an application; an operation by the user to set one of the M application windows as the focus window; an operation by the user to maximize the application window.

[0022] In combination with the first aspect, in some implementations of the first aspect, the specific event further includes that the data of frame drops in the application window is greater than a third threshold.

[0023] In combination with the first aspect, in some implementations of the first aspect, the M application windows belong to the same application, or the M application windows belong to at least two applications.

[0024] In combination with the first aspect, in some implementations of the first aspect, the M application windows include fully displayed application windows and / or overlapping application windows.

[0025] In combination with the first aspect, in some implementations of the first aspect, the M application windows include a first application window, and the process corresponding to the first application window is frozen. The method further includes: in response to detecting an operation by the user to set the first application window as the focus window, thawing the process corresponding to the first application window.

[0026] In combination with the first aspect, in some implementations of the first aspect, the M application windows include a first application window, and the process corresponding to the first application window is frozen. The method further includes:

[0027] In response to detecting that the freezing duration of the first application window is greater than a fourth threshold, thawing the process corresponding to the first application window.

[0028] In combination with the first aspect, in some implementations of the first aspect, the method further includes: in response to detecting that the overall machine load is less than a fifth threshold, thawing the processes corresponding to the frozen application windows.

[0029] In a second aspect, an electronic device is provided, which includes one or more processors; one or more memories; the one or more memories store one or more computer programs, and the one or more computer programs include instructions that, when executed by the one or more processors, cause the above aspect or any possible implementation manner of the above aspect to be executed.

[0030] In a third aspect, a computer-readable storage medium is provided, which includes a computer program or instructions that, when running on a computer, cause the method of the first aspect and any possible implementation of the first aspect to be executed.

[0031] In a fourth aspect, a computer program product is provided, which includes a computer program or instructions that, when running on a computer, cause the method of the first aspect and any possible implementation of the first aspect to be executed.

[0032] In a fifth aspect, a computer program is provided, which, when running on a computer, causes the method in the first aspect and any possible implementation manner thereof to be executed.

[0033] In a sixth aspect, an electronic device according to an embodiment of the present application includes modules / units that execute the method of the above aspect or any possible design of the above aspect; these modules / units can be implemented by hardware or by hardware executing corresponding software.

[0034] For the beneficial effects of the second aspect to the sixth aspect, please refer to the beneficial effects of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a schematic structural diagram of the electronic device provided by an embodiment of the present application.

[0036] Figure 2 is a group of GUIs provided by an embodiment of the present application.

[0037] Figure 3 is a schematic diagram of improving the priority of an application program provided by an embodiment of the present application.

[0038] Figure 4 is an operating system framework diagram provided by an embodiment of the present application.

[0039] Figure 5 is a schematic flowchart of the method for managing an application program provided by an embodiment of the present application.

[0040] Figure 6 is a schematic diagram of the method for the load collection and reporting module to report PSI provided by an embodiment of the present application.

[0041] Figure 7 It is a schematic diagram of the life cycle of Application #1 provided by an embodiment of the present application.

[0042] Figure 8 It is a set of GUIs provided by an embodiment of the present application.

[0043] Figure 9 It is a set of GUIs provided by an embodiment of the present application.

[0044] Figure 10 It is a schematic flowchart of the freezing and thawing method provided by an embodiment of the present application.

[0045] Figure 11 It is a schematic flowchart of the method for managing an application provided by an embodiment of the present application. Detailed implementation manners

[0046] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular forms "a", "an", "the", "above", "said", "this" are also intended to include, for example, the expression "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" means one, two or more than two. The term "and / or" is used to describe the association relationship of associated objects and means that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship.

[0047] Referring to "one embodiment" or "some embodiments" described in this specification means that specific features, structures or characteristics described in combination with the embodiment are included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" and the like that appear in different parts of this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprise", "include", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0048] The following describes an electronic device, a user interface for such an electronic device, and examples of using such an electronic device. In some embodiments, the electronic device may be a personal computer (PC), such as a laptop computer or a desktop computer. The operating systems installed on the PC include, but are not limited to, desktop operating systems such as Windows operating system, Linux operating system, MacOS operating system, etc., and may also be future desktop operating systems.

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

[0050] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0051] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0052] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0053] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0054] In some embodiments, the processor 110 may include one or more interfaces. The 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.

[0055] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, baseband processor, etc.

[0056] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt 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 Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0057] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0058] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0059] To facilitate the understanding of the embodiments of the present application, several concepts that may be involved in the embodiments of the present application are introduced first:

[0060] Operating System: A computer program that manages computer hardware and software resources, and is also the core and foundation of a computer system. The operating system needs to handle basic tasks such as managing and configuring memory, determining the priority order of system resource supply and demand, controlling input and output devices, operating networks, and managing file systems. The operating system also provides an operation interface for users to interact with the system. The types of operating systems are very diverse. The operating systems installed on different machines can range from simple to complex, from embedded systems in mobile phones to large operating systems in supercomputers. The definitions of the scope covered by many operating system manufacturers are also not consistent. For example, some operating systems integrate a graphical user interface (GUI), while some only use a command-line interface and regard the GUI as an unnecessary application program.

[0061] An application program is a computer program designed to implement a set of related functions, tasks, or activities for users. Application programs are deployed on the operating system. Specifically, they can be deployed by binding to the system software of the operating system (such as the operating system), such as system-level application programs (or system services), or they can be deployed independently, such as the currently common word processing application programs, web browser application programs, multimedia playback application programs, game application programs, etc.

[0062] System resources: In this application, it refers to the resources inside the computer system, including but not limited to any one or more of memory resources, processing resources, and I / O resources. The management of resources includes many implementations. For example, resource recycling can be achieved by closing, freezing, or compressing some application programs, or resource reservation can be achieved by refusing to start application programs, or resource reservation for an application can be achieved by preloading the application program.

[0063] Foreground application, background application: A foreground application is the abbreviation of an application program running in the foreground. A background application is the abbreviation of an application program running in the background. For users, the application windows of foreground applications are visible, while the application windows of background applications are invisible. The application windows of foreground applications can block each other.

[0064] It should be noted that when an application window of a foreground application is completely blocked, the application window can still be understood as visible.

[0065] Process freezing: Add a freeze flag to the process. After the process with the freeze flag enters the kernel state, it will enter an infinite loop, and the process will yield the resources of the processor after entering the infinite loop.

[0066] Process thawing: Remove the freeze flag of the process, and the process will jump out of the infinite loop and continue to execute the business before being frozen.

[0067] An electronic device can run multiple application programs in the foreground. When the electronic device runs an application program that consumes a large amount of system resources, such as an operation class application, if the user operates other application programs running in the foreground at this time, the electronic device may not be able to respond in time, resulting in problems such as lag and delay. To solve this problem, currently, the electronic device can define different priorities for different application programs, and then the electronic device can respond to the user's operation in time. The following will be introduced in combination with Figure 2 and Figure 3 for introduction.

[0068] Figure 2 shows a set of GUIs, Figure 3 shows a schematic diagram of the priority change.

[0069] As shown in (a) and (b) of Figure 2 , the task bar 201 of the electronic device displays icons 202, 203, 204, 205 and 206. The icon 202 corresponds to a notepad application program, the icon 203 corresponds to a compression application program, the icon 204 corresponds to a video application program, the icon 205 corresponds to a music application program, and the icon 206 corresponds to a browser application program. Among them, the notepad application program, the compression application program, the video application program and the music application program are foreground application programs, and the browser application program is a background application program. Since the notepad application program, the compression application program, the video application program and the music application program are foreground application programs, the corresponding application windows are visible. The electronic device can display the application windows corresponding to the notepad application program, the compression application program, the video application program and the music application program. For example, the application window 207 is the application window of the notepad application program, the application window 208 is the application window of the compression application program, the application window 209 is the window of the video application program, and the application window 210 (not shown in the figure) is the application window of the music application program. Among them, the application window 209 is partially blocked by the application window 207, and the application window 210 is completely blocked by the application window 207 (so it is not shown in the figure). Since the compression application program will occupy a large amount of system resources (such as processor resources, memory resources, etc.), it may cause other application programs to lag, making it impossible to respond to the user's operation in time and reducing the user experience. To avoid this problem, taking the interaction between the user and the application window 207 as an example, when the electronic device detects that the user enters the operation of "123456" through the keyboard, the electronic device can increase the priority of the application window 207, that is, the priority of the notepad application program, so that more system resources can be allocated to the notepad application program, enabling it to respond to the user's input quickly and in time. When the user performs the above process of increasing the priority, it can be represented by the schematic diagram of the priority change of Figure 3 .

[0070] As shown in Figure 3As shown in the figure, at time t1, when the user does not input text through the keyboard in application window 207, the priority corresponding to the notepad application is Priority #3.

[0071] At time t2, when the electronic device detects that the user inputs text through the keyboard in application window 207, it can raise the priority corresponding to the notepad application to Priority #1, and Priority #1 is higher than the priority of the compression application. Then, the electronic device can preferentially allocate system resources such as the processor and memory to the notepad application.

[0072] In the above method of raising the priority, the priority of the notepad application will not always remain at Priority #1, but will correspond to a time slice. When the user no longer inputs text through the keyboard and the time slice is exhausted, the electronic device will lower the priority of the notepad application. For example, it will gradually decrease from Priority #1 to Priority #2 and then to Priority #3. When the user inputs text through the keyboard again, the electronic device can short-term raise the priority of the notepad application.

[0073] There are the following deficiencies in the way of scheduling resources for applications by raising the priority of applications:

[0074] (1) Processes with low priority will wait for system resources for a long time without being able to run and will be in a long-term waiting state, that is, process starvation occurs. When a process that has been starved to a certain extent waits until it is meaningless even if it is completed, it is called process death.

[0075] (2) Only some threads or some processes are adjusted to high priority. And the time slices are in milliseconds. As the time slices are consumed, other foreground-running applications will still preempt system resources, resulting in lags.

[0076] (3) Since multiple application windows are displayed on the screen, after raising the priority of a certain application window, the system resources obtained by other application windows may decrease, which may in turn affect other application windows. For example, after the electronic device raises the priority of the notepad application, the video application may still not get more system resources, and may even get fewer system resources, which may cause the video playback of the video application to be more laggy.

[0077] In summary, the embodiments of the present application provide a method for managing applications, which can reasonably schedule system resources and will not cause problems such as process starvation or process death, and can better improve the user experience.

[0078] Before introducing the method for managing applications provided by the embodiments of the present application, first introduce the operating system structure of an electronic device applicable to the embodiments of the present application.

[0079] Figure 4 It shows a schematic diagram of the operating system architecture of the electronic device provided by the embodiments of the present application. The layered architecture can divide the operating system into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. Exemplarily, the operating system can be, from top to bottom, the application layer, the application framework layer, the core service layer, and the kernel operating system layer (also known as the kernel layer). Generally speaking, the application framework layer and the core service layer can also be collectively referred to as the framework layer, and will be uniformly introduced as the framework layer hereinafter.

[0080] The application layer may include applications, and the applications may include third-party applications and official applications.

[0081] The framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The framework layer may include some predefined functions. The framework layer may include a basic system framework and service modules, and the basic system framework and service modules are used to provide functions to ensure the normal operation of the applications. The basic system framework and service modules include, but are not limited to: window manager, application manager, multimedia manager, etc. By registering listeners in the window manager, application manager, multimedia manager, etc., the basic system framework and service modules can obtain the hierarchy and visibility of the application window, the status of the application (such as playing video or playing audio), input events (such as the operation of the user operating the keyboard, the operation of the user operating the mouse), the association relationship between processes, and the recognition of the application scenario (such as application startup, application window maximization, file opening, frame dropping, etc.).

[0082] The framework layer further includes an instantaneous freeze management module, and the instantaneous freeze management module includes a configuration management module, a scenario recognition module, a freeze decision module, and an execution module.

[0083] The configuration management module can be used to manage freeze scenario configuration, load threshold configuration, exemption configuration, and freeze duration configuration.

[0084] The freeze scenario configuration mainly identifies the application scenarios that need to be controlled to support the scenario recognition module. In other words, the freeze scenario can also be understood as a specific event. When the specific event is satisfied, the process corresponding to the application window can be frozen, and the application window can be the application window of the application running in the foreground, or the invisible application window of the application running in the background.

[0085] For example, the configuration management module configures that when it detects the startup of an application, the process corresponding to the application window can be frozen.

[0086] For another example, the configuration management module is configured to freeze the processes corresponding to other application windows when an application window is maximized.

[0087] In some embodiments, when the specific event is satisfied and the overall load of the whole machine is greater than threshold #1, the processes corresponding to the application windows can be frozen.

[0088] For example, the configuration management module is configured to determine the overall load of the electronic device when an application is detected to start. If the overall load of the electronic device is greater than threshold #1, the processes corresponding to the application windows can be frozen.

[0089] For another example, the configuration management module is configured to determine the overall load of the electronic device when an application window is maximized. If the overall load of the electronic device is greater than threshold #1, the processes corresponding to other application windows can be frozen.

[0090] The load threshold configuration may include the overall load threshold of the electronic device and the load threshold of a single application.

[0091] For example, the configuration management module configures the overall load threshold of the electronic device to be 90%, that is, when the overall load value of the electronic device reaches 90%, the processes corresponding to the application windows are frozen.

[0092] For another example, the configuration management module configures the load threshold of application #1 to be 30%, that is, when the load value of application #1 reaches 30%, the processes corresponding to the application windows of application #1 can be frozen.

[0093] The exemption configuration is mainly used to assist the freeze decision module in exempting some applications (such as system applications, housekeeper applications, etc.) from control. In other words, the processes corresponding to the application windows of the applications in the exemption configuration will not be frozen even when the electronic device detects a specific event.

[0094] The freeze duration configuration is mainly used to assist the execution module in determining when to thaw. For example, thaw after freezing for 1.5 seconds.

[0095] The scenario recognition module determines whether freeze management is required based on various key system information and application status information provided by the basic system framework and services, in combination with the freeze scenario configuration.

[0096] The freeze decision module mainly includes load decision-making, selection of high-load application programs, and application filtering. Load decision-making mainly relies on the load information of the electronic device reported by the load collection and reporting module, and combines the load threshold configuration to determine whether freeze management is required. For the selection of high-load application programs, it mainly relies on the load information of each process reported by the load collection and reporting module, and combines the high-load threshold configuration to select application programs or processes with load values greater than the threshold. Application filtering mainly combines the exemption configuration list and application status information (for example, the application program is playing audio or video, the application program is in a multi-device collaboration state, etc.) to determine whether exemption is possible.

[0097] The execution module is used to freeze the processes corresponding to the application program or application window by using the freeze / thaw module. At the same time, it combines the freeze duration configuration and application status information (for example, the frozen application program is called by interprocess communication (IPC), awakened by a shortcut key, etc.) to thaw the corresponding application program or process in a timely manner.

[0098] The kernel layer is the layer between hardware and software. The kernel layer includes a CPU scheduling module, a memory management module, an input / output (IO) scheduling module, a file system, a device driver, a load collection and reporting module, and a freeze / thaw module.

[0099] The load collection and reporting module is used to obtain the load. The load can include the load of the electronic device and the load of the process.

[0100] The freeze / thaw module is used to freeze or thaw the process corresponding to the application window through the interface provided by the kernel layer.

[0101] It should be noted that Figure 4 The operating system architecture shown is only an example and should not be construed as a specific limitation of this application. In some other embodiments of this application, other operating system architectures can also be adopted. In addition, the division of modules in the above operating system architecture is only a logical function division, and there can be other division methods in actual implementation.

[0102] The above introduced the operating system architecture of the electronic device provided by the embodiments of this application. The following will be combined with Figure 5 to introduce the method for managing application programs provided by the embodiments of this application.

[0103] Figure 5 The schematic flowchart of the method for managing application programs provided by the embodiments of this application is shown. As Figure 5 shown, the method includes:

[0104] S501, the load collection and reporting module sends load information to the instantaneous freeze management module.

[0105] Correspondingly, the instantaneous freeze management module receives the load information sent by the load collection and reporting module.

[0106] In some embodiments, the load collection and reporting module may periodically obtain load information and send the load information to the instantaneous freeze collection module. The load information includes one or more of the following: the overall load of the electronic device, the loads of each process, and the loads of each thread.

[0107] In some embodiments, the load collection and reporting module may obtain load information according to the instruction of the instantaneous freeze management module, and then send the load information to the instantaneous freeze collection module. That is to say, when the instantaneous freeze management module detects a freeze scenario that meets its configuration, it may send instruction information to the load collection and reporting module. The load collection and reporting module obtains load information according to the instruction information and sends the load information to the instantaneous freeze collection module.

[0108] The load collection and reporting module may determine the load in various ways, which are not specifically limited in the embodiments of the present application. Several possible implementation manners are exemplarily introduced below.

[0109] One possible implementation manner is that the load obtained by the load collection and reporting module may be the average load (loadaverage). The average load refers to the average number of running and waiting-to-run processes in the run queue per unit time. Whether the overall load of the whole machine is too high can be determined by the average load and the number of cores of the processor. When the average load is equal to the number of cores of the processor, the processor is fully loaded. For example, for a single-core processor, when the average load is 1, the single-core processor is fully loaded. For another example, for an 8-core processor, when the average load is 8, the 8-core processor is fully loaded. Therefore, after the instantaneous freeze management system obtains the average load from the load collection and reporting module, it can determine whether the overall load of the whole machine is too high according to the number of cores of the processor.

[0110] One possible implementation manner is that the load obtained by the load collection and reporting module may be the pressure stall information (PSI). PSI quantifies the task execution interruption caused by resource tension, and the resource may be the processor, memory, or IO. PSI counts the time for tasks in the system to wait for resources. Taking PSI as an index can be used to measure the pressure situation of resources. It is not difficult to understand that the longer the task pause time, the greater the pressure on the resources. PSI can be used as an overall load index of the whole machine or a load index of a process.

[0111] The pressure information can be obtained through the / proc / pressure / --cpu, memory, and io files respectively.

[0112] The format of CPU-related information is as follows:

[0113] some avg10 = 0.00 avg60 = 0.00 avg300 = 0.00 total = 0.

[0114] The information related to memory and IO is as follows:

[0115] some avg10 = 0.00 avg60 = 0.00 avg300 = 0.00 total = 0.

[0116] full avg10 = 0.00 avg60 = 0.00 avg300 = 0.00 total = 0.

[0117] The "some" row represents the proportion of time when at least one task is blocked on a specific resource.

[0118] The "full" row represents the proportion of time when all non-idle tasks are blocked on a specific resource simultaneously. In this state, the CPU resources are completely wasted, and the business load is severely affected due to spending more time waiting compared to normal operation.

[0119] "avg" represents the proportion of blocked time (percentage), which is the average value within the recent 10 seconds, 60 seconds, and 300 seconds. This can observe both the impact of short-term events and the trends in the medium and long term. "total" represents the total blocked time (in microseconds), which can be used to observe latency spikes that may not be reflected in the average value.

[0120] The load collection and reporting module can register triggers to monitor whether the resource pressure exceeds the threshold. When the system resource pressure exceeds the threshold, it is determined that the load is high. Trigger definition: The maximum value of the cumulative blocked time within a specified time window. For example, it can be defined that when the accumulated blocked time reaches 100ms within 500ms, a wake-up event is triggered.

[0121] For example, when the load collection and reporting module writes "some 150000 1000000" to / proc / pressure / memory, a new trigger will be added, which will be triggered when the total time that at least one task is blocked on memory within 1 second exceeds 150ms.

[0122] For another example, when the load collection and reporting module writes "full 50000 1000000" to / proc / pressure / io, a new trigger will be added, which will be triggered when the total time that all tasks are blocked on io within 1 second exceeds 50ms.

[0123] Triggers can be set for multiple PSI metrics, and multiple triggers can be set for the same PSI metric. Each trigger requires a separate file descriptor for polling to distinguish it from other triggers. A possible implementation: What the load collection and reporting module obtains can be the processor utilization rate, such as the processor utilization rate of the entire machine and the processor utilization rate of each process.

[0124] A possible implementation: What the load collection and reporting module obtains can be the memory utilization rate, such as the memory utilization rate of the entire machine and the memory utilization rate of each process.

[0125] The following combines Figure 6 to introduce the method for the load collection and reporting module to report the load. When introducing, the load collection and reporting module reporting PSI is taken as an example for introduction.

[0126] Figure 6 FIG. shows a schematic diagram of the method for the load collection and reporting module provided by an embodiment of the present application to report PSI. As Figure 6 shown, the method includes:

[0127] S601, register a PSI monitor.

[0128] The load collection and reporting module can register a PSI monitor with the PSI module so that the PSI module reports the PSI of the processor, IO, and memory to the load collection and reporting module. The PSI module reporting the PSI of the processor, IO, and memory to the load collection and reporting module can also be understood as the PSI module reporting the pressure to the load collection and reporting module.

[0129] S602, initially set to no pressure.

[0130] The load collection and reporting module performs an initialization setting and initializes to no pressure.

[0131] It should be noted that there is no actual execution order for S601 and S602. S601 can be executed first and then S602, or S602 can be executed first and then S601, or S601 and S602 can be executed simultaneously.

[0132] S603, determine whether there is pressure.

[0133] After the load acquisition and reporting module registers for PSI monitoring with the PSI module, it can obtain the PSIs of the processor, IO, and memory, and determine whether there is pressure based on the PSIs of the processor, IO, and memory. When it is determined that there is pressure, S604 is executed; when it is determined that there is no pressure, S605 can be executed. The load acquisition and reporting module can determine whether there is pressure by checking whether the PSIs of the processor, IO, and memory are greater than a certain threshold. When the PSIs of the processor, IO, and memory are greater than a certain threshold, it can be determined that there is pressure; otherwise, it is determined that there is no pressure.

[0134] S604. Set the timeout waiting time according to the pressure reporting period.

[0135] The load acquisition and reporting module can set the timeout waiting time according to the pressure reporting period. Furthermore, when the load acquisition and reporting module determines that there is pressure and the timeout waiting time is reached, it can report the pressure to the instantaneous freeze management module, that is, report the PSI.

[0136] In some embodiments, the timeout waiting time can be greater than the pressure reporting period.

[0137] S605. Block and wait for pressure reporting.

[0138] When the load acquisition and reporting module determines that there is no pressure, it can block and wait for pressure reporting. When it is determined that there is pressure, it reports the pressure again.

[0139] S606. Wait for pressure reporting with a timeout.

[0140] The load acquisition and reporting module determines the timeout waiting time and can wait for pressure reporting within this time period.

[0141] S607. Judge whether there is pressure reporting before the timeout.

[0142] The load acquisition and reporting module can judge whether the PSI module has pressure reporting before the timeout waiting time is reached. When there is no pressure reporting, S608 is performed; when there is pressure reporting, S609 is performed.

[0143] S608. Set it to no pressure.

[0144] When the load acquisition and reporting module determines that the PSI module has not reported pressure during the timeout waiting period, it can be set to no pressure.

[0145] S609. Report the pressure.

[0146] When the load acquisition and reporting module determines that the PSI module reports pressure during the timeout waiting period, the load acquisition and reporting module can report the pressure to the instantaneous freeze management module, or it can also be said to report the load to the instantaneous freeze management module.

[0147] It should be noted that, in some other embodiments of the present application, S604, S606, S607, and S608 may not be performed. In other words, in some other embodiments of the present application, when the load collection and reporting module determines that there is pressure, it can directly report the pressure to the instantaneous freeze management module.

[0148] S502, the instantaneous freeze management module determines that a specific event is satisfied.

[0149] The electronic device displays M application windows. The instantaneous freeze management module can determine whether a specific event configured by it is satisfied by registering listeners in modules such as the window manager, application manager, and multimedia manager. In response to detecting a specific event, the instantaneous freeze management module can perform step S504.

[0150] For example, Figure 7 shows a schematic diagram of the life cycle of application #1 provided by an embodiment of the present application. The application manager can perform a listening step before calling the life cycle function callback of application #1, and then send relevant function information to the instantaneous freeze management module. Taking Figure 7 as an example and assuming that the freeze scenario configured by the instantaneous freeze management module includes the startup of application #1. The application manager can send the onCreate function to the instantaneous freeze management module to indicate the startup of application #1. After receiving this information, the instantaneous freeze management module can determine that a specific event is satisfied.

[0151] It can be understood that the M application windows are application windows of foreground applications, and the M application windows can also be referred to as visible windows. For example, as Figure 2 shown in application window 207, application window 208, and application window 209.

[0152] In some embodiments, the M application windows may belong to the same application.

[0153] In some embodiments, the M application windows may belong to at least two applications.

[0154] In some embodiments, the M application windows may be arranged overlappingly. For example, the M application windows include application window #1 and application window #2, where application window #1 may be partially or completely blocked by application window #2.

[0155] In some embodiments, the M application windows include fully displayed application windows.

[0156] It is understandable that the M application windows may also include application windows arranged overlapping and fully displayed at the same time. For example, the M application windows include application window #1, application window #2, and application window #3, where application window #1 and application window #2 are fully displayed, and application window #3 is partially blocked by application window #2.

[0157] In some embodiments, multiple application windows belonging to the same application program may correspond to one process, or may also correspond to multiple processes.

[0158] For example, application window #1, application window #2, and application window #3 belong to the same application program, and application window #1, application window #2, and application window #3 correspond to the same process.

[0159] In some embodiments, multiple application windows belonging to the same application program may correspond to multiple processes.

[0160] For example, application window #1, application window #2, and application window #3 belong to the same application program, and application window #1 corresponds to process #1, application window #2 corresponds to process #2, and application window #3 corresponds to process #3.

[0161] In the embodiments of the present application, no specific limitation is made on the specific event. The specific event may be preset by the operating system manufacturer or may be configured by the user himself.

[0162] Exemplarily, the specific event may include an operation of a user starting an application program.

[0163] For example, the electronic device displays application window #1 and application window #2. Application window #1 corresponds to application program #1, and application window #2 corresponds to application program #2. The instantaneous freeze management module responds to detecting the operation of the user starting application program #3 and executes step S504.

[0164] Exemplarily, the specific event may include an operation of a user maximizing an application window. The application window may be an application window of a foreground application or an application window of a background application.

[0165] For example, the electronic device displays application window #1, application window #2, and application window #3. The instantaneous freeze management module responds to the operation of the user maximizing application window #1 and executes step S504.

[0166] For another example, the electronic device displays application window #1 and application window #2, and also runs invisible application window #3 and application window #4. The instantaneous freeze management module responds to detecting the operation of the user maximizing application window #3 and may execute step S504.

[0167] Exemplarily, a specific event may include frame drops occurring in an application window.

[0168] For example, an electronic device displays application window #1, application window #2, and application window #3. In response to detecting frame drops in application window #1, the instantaneous freeze management module executes step S504.

[0169] Exemplarily, a specific event may include the number of frame drops in an application window exceeding threshold #2.

[0170] For example, an electronic device displays application window #1, application window #2, and application window #3. In response to detecting that the number of frame drops in application window #1 exceeds threshold #2, the instantaneous freeze management module executes step S504.

[0171] Exemplarily, a specific event may include an operation by the user to set an application window as the focused window. The focused window can be understood as the application window that the user is currently operating among multiple application windows. The operation by the user to set an application window as the focused window can be voice input, gesture input, keyboard input, mouse input, etc., including but not limited to the operation of the user inputting text in the application window, and the operation of the user clicking on any position of the application window. The focused window can also be understood as the application window selected by the user.

[0172] For example, an electronic device displays application window #1, application window #2, and application window #3. In response to detecting the operation of the user clicking on application window #1, the instantaneous freeze management module executes step S504.

[0173] S503, the instantaneous freeze management module determines whether the overall machine load is greater than threshold #1.

[0174] The instantaneous freeze management module can determine whether the overall machine load is greater than threshold #1 based on the load information reported by the load collection and reporting module. When it is determined that the overall machine load is greater than threshold #1, step S504 can be executed.

[0175] In some embodiments, step S503 is an optional step. In other words, in response to detecting a specific event, the instantaneous freeze management module can execute step S504.

[0176] S504, the instantaneous freeze management module determines at least one application window from the M application windows.

[0177] The electronic device displays M application windows on the screen. The instantaneous freeze management module can determine at least one application window from the M application windows, and the processes corresponding to the at least one application window will be frozen, where M≥2 and is an integer.

[0178] It can be understood that for different specific events, the application windows determined by the instantaneous freeze management module can be different.

[0179] For example, if the specific event is the operation of a user starting an application, the instant freeze management module may determine that the process corresponding to any application window among the M application windows is a frozen process.

[0180] For another example, if the specific event is the operation of a user maximizing an application window, and the maximized application window is one of the M application windows, the instant freeze management module may determine that the processes corresponding to any application windows among the M application windows except the maximized application window are frozen processes.

[0181] For another example, if the specific event is the operation of a user maximizing an application window, and the maximized application window is one of the invisible running application windows, the instant freeze management module may determine that the processes corresponding to any application windows among the M application windows are frozen processes.

[0182] For another example, if the specific event is that the number of dropped frames of an application window exceeds threshold #2, and the application window is one of the M application windows, the instant freeze management module may determine that the processes corresponding to any application windows among the M application windows except the application window whose number of dropped frames exceeds threshold #2 are frozen processes.

[0183] For another example, if the specific event is the operation of a user setting an application window as the focus window, and the application window is one of the M application windows, the instant freeze management module may determine that the processes corresponding to any application windows among the M application windows except the application window set as the focus window are frozen processes.

[0184] In some embodiments, when the instant freeze management module determines at least one window among the M application windows, it may first determine N application windows, and then determine at least one application window from the N application windows, where N≥1 and is an integer.

[0185] In some embodiments, the N application windows are the application windows determined in descending order of the load of the processes corresponding to the M application windows.

[0186] For example, when M = 10, the instant freeze management module may select the top 5 application windows according to the load of the processes corresponding to the 10 application windows, that is, N = 5.

[0187] In some embodiments, the load of the processes corresponding to the N application windows is greater than threshold #3.

[0188] In some embodiments, the instantaneous freeze management module may also detect the services executed by the processes corresponding to the M application windows, and determine the at least one application window according to the services executed by the processes corresponding to the M application windows, so that the processes corresponding to the determined at least one application window do not execute services perceptible to the user.

[0189] The instantaneous freeze management module may traverse the services executed by the processes corresponding to the M application windows, and determine whether the services perceptible to the user are included according to the services executed by the processes corresponding to the M application windows. The instantaneous freeze management module may determine that the processes running services perceptible to the user are processes that cannot be frozen, while the processes executing other services are processes that can be frozen. In other words, in step S504, the processes corresponding to the at least one application window determined by the instantaneous freeze management module do not execute services perceptible to the user. For services perceptible to the user and external device connection services, reference may be made to the following description and will not be elaborated here.

[0190] In some embodiments, the processes corresponding to the at least one application window determined by the instantaneous freeze management module also do not execute external device connection services.

[0191] For example, the electronic device displays 5 application windows on the screen, namely application window #1, application window #2, application window #3, application window #4, and application window #5. Among them, the processes corresponding to application window #1 and application window #2 are executing services perceptible to the user. Then the instantaneous freeze management module may determine that the processes corresponding to application window #3, application window #4, and application window #5 are processes that can be frozen from the above 5 application windows.

[0192] In some embodiments, when the application programs corresponding to the M application windows are application programs in the exemption configuration, the instantaneous freeze management module may also not select the application windows corresponding to the application programs in the exemption configuration.

[0193] For example, the electronic device displays 5 application windows on the screen, namely application window #1, application window #2, application window #3, application window #4, and application window #5. Among them, the processes corresponding to application window #1 and application window #2 are executing services perceptible to the user, and the application program corresponding to application window #3 is an application program in the exemption configuration. Then the instantaneous freeze management module may determine that the processes corresponding to application window #4 and application window #5 are processes that can be frozen.

[0194] The services perceptible to the user may also be referred to as perceptible services, which can be understood as services that cause stimulation to the user's senses. In other words, if the service stops running and the user can immediately perceive the stop of the service, then the service can be referred to as a service perceptible to the user.

[0195] For example, the audio playback service causes auditory stimulation to the user's ears. If it is frozen, the audio playback is interrupted, and the user's perception is obvious. Therefore, the audio playback service can be understood as a service that the user can perceive.

[0196] For another example, the video playback service causes visual stimulation to the user's eyes and auditory stimulation to the user's ears. If it is frozen, the video playback is interrupted, and the user's perception is obvious. Therefore, the video playback service can be understood as a service that the user can perceive.

[0197] For another example, the screen recording service causes visual stimulation to the user's eyes. If it is frozen, the screen recording is interrupted, and the user's perception is obvious. Therefore, the screen recording service can be understood as a service that the user can perceive.

[0198] For another example, the sound recorded by the recording service causes auditory stimulation to the user's ears. If it is frozen, the recording will not continue, and the user's perception is obvious when listening to the recording. Therefore, the recording service can be understood as a service that the user can perceive.

[0199] For another example, the navigation service causes visual stimulation to the user's eyes and auditory stimulation to the user's ears. If it is frozen, the electronic device cannot refresh the latest location in the interface in time and broadcast the latest navigation information, and the user's perception is obvious. Therefore, the navigation service can be understood as a service that the user can perceive.

[0200] In the above examples, the audio playback service and the recording service can be collectively referred to as the audio service, and the video playback service and the screen recording service can be collectively referred to as the video service. In other words, when the application runs the audio service and the video service, it can not be frozen.

[0201] It should be noted that a service can include multiple service types. For example, taking a game as an example, it can be classified as a game service, but since there may be audio during the running of the game, the game can also be an audio service, that is, the game is both a game service and an audio service.

[0202] The external device connection service can be understood as a service associated with other electronic devices. For example, electronic device #1 projects its screen to electronic device #2 through the screen mirroring service.

[0203] For another example, electronic device #1 is connected to a Bluetooth headset through the Bluetooth service.

[0204] The instantaneous freezing management module can determine the service type executed by the process through a preset rule or a trained model, etc. Table 1 shows a corresponding relationship between a service and whether it is frozen. The instantaneous freezing management module can determine the process to be frozen according to Table 1.

[0205] Table 1 Corresponding relationship table between service and whether it is frozen

[0206]

[0207] S505, the instantaneous freeze management module sends indication information #1 to the freeze / thaw module.

[0208] Correspondingly, the freeze / thaw module receives the indication information #1 sent by the instantaneous freeze management module, and the indication information #1 is used to indicate at least one of the M application windows.

[0209] In some embodiments, the indication information #1 is further used to indicate at least one of one or more invisible application windows.

[0210] S506, the freeze / thaw module freezes the processes corresponding to at least one of the M application windows according to the indication information #1.

[0211] In some embodiments, after receiving the indication information #1, the freeze / thaw module can freeze the processes corresponding to at least one of the M application windows.

[0212] For example, the electronic device displays application window #1, application window #2, and application window #3 on the screen. Application window #1 and application window #2 are application windows of a browser application, and application window #3 is an application window of a notepad application. The process corresponding to application window #1 executes an audio playback service, and the process corresponding to application window #2 executes a download service. When it is detected that the user maximizes application window #3, the process corresponding to application window #2 can be frozen.

[0213] For another example, the electronic device displays application window #1 and application window #2 on the screen. Application window #1 and application window #2 are application windows of a browser application. The process corresponding to application window #1 executes a video playback service, and the process corresponding to application window #2 executes a download service. When it is detected that the number of dropped frames of application window #1 is greater than threshold #2, the process corresponding to application window #2 can be frozen.

[0214] For another example, the electronic device displays application window #1 and application window #2 on the screen. Application window #1 and application window #2 are application windows of a browser application. The process corresponding to application window #1 executes a video playback service, and the process corresponding to application window #2 executes a download service. When it is detected that the user clicks on application window #1, the process corresponding to application window #2 can be frozen.

[0215] In the embodiment of the present application, due to the characteristics of the desktop operating system, multiple application windows can be displayed on the screen. The multiple application windows can be placed at will and some application windows may be partially or completely blocked. The user cannot pay attention to all windows on the screen at the same time. Therefore, when a specific event is detected, the processes corresponding to some application windows can be frozen, thereby improving the fluency of the system and helping to enhance the user experience.

[0216] In addition, the process corresponding to the frozen application window may be a process that does not execute user-perceivable services, so the user will not be aware of the occurrence of the freeze, and the normal use of the user will not be affected.

[0217] In addition, the frozen process is in an uninterruptible dormant state, and the process will not starve to death, so it can be quickly restored to its original state.

[0218] In some embodiments, after receiving the indication information #1, the freezing and thawing module may further freeze a process corresponding to at least one application window among the one or more invisible application windows.

[0219] In an embodiment of the present application, invisible application windows may also be run, which may be more easily ignored by users. Therefore, when a specific event is detected, the processes corresponding to some invisible application windows may be frozen, thereby improving the fluency of the system and helping to enhance the user experience.

[0220] S507: The instantaneous freeze management module detects that a thawing event is satisfied and determines a process corresponding to the application window to be thawed.

[0221] In response to detecting the thawing event, the instantaneous freeze management module may determine the process corresponding to the application window to be thawed from the processes corresponding to the frozen application windows.

[0222] In the embodiment of the present application, in response to different thawing events, the instantaneous freezing module can thaw all frozen processes, or thaw some frozen processes.

[0223] The thawing event is not specifically limited in the embodiments of the present application, and several possible thawing events are introduced as examples below.

[0224] Exemplarily, the thawing event includes the freezing duration reaching threshold #4. Under this trigger condition, the instantaneous freezing management module can determine that the process whose freezing duration reaches threshold #4 is the process to be thawed.

[0225] Exemplarily, when the thawing event includes an application being called by an IPC, the instantaneous freeze management module may determine that the process of the application called by the IPC is a process to be thawed.

[0226] For example, Application #1, Application #2, and Application #3 are called. When it is detected that Application #2 is called, the instantaneous freezing management module can determine that the process of Application #2 is a process to be thawed.

[0227] Exemplarily, the thawing event includes the user's thawing operation. The user's thawing operation can be voice input, gesture input, keyboard input, etc., and the embodiments of the present application do not make specific limitations thereto. Under this thawing event, the instantaneous freezing management module can determine that all frozen processes are processes to be thawed.

[0228] Exemplarily, the thawing event includes the operation of the user setting the frozen application window as the focus window. The operation of the user setting the frozen application window as the focus window, gesture input, keyboard input, mouse input, etc., are not specifically limited in the embodiments of the present application. For example, the user clicks on the control of the frozen application window. For another example, the user interacts with the frozen application window through a voice command. Under this thawing event, the instantaneous freezing management module can determine that the process corresponding to the frozen application window set as the focus window by the user is a process to be thawed.

[0229] For example, Figure 8 shows a set of GUIs provided by the embodiments of the present application. As Figure 8 shown, the electronic device displays Application Window 801 and Application Window 802, where Application Window 801 corresponds to a notepad application, Application Window 802 corresponds to a compression application, and the process corresponding to Application Window 802 has been frozen. When the control 803 in Application Window 802 is clicked, the instantaneous freezing management module can determine that the process corresponding to Application Window 802 is a process to be thawed.

[0230] For another example, Figure 9 shows a set of GUIs provided by the embodiments of the present application. As Figure 9 shown in (a) of, the electronic device displays Application Window 901, which corresponds to a notepad application. Assume that at this time, the application window of the invisible compression application running in the background has been frozen. When the electronic device detects the user's voice command: "Open the compression application", the electronic device can display the GUI shown in Figure 9 shown in (b) of, and the instantaneous freezing management module can determine that the process corresponding to the application window of the compression application is a process to be thawed.

[0231] Exemplarily, the trigger condition is to detect that the load of the entire machine is less than Threshold #1. Under this trigger condition, the instantaneous freezing module can thaw all frozen processes or thaw some of the frozen processes.

[0232] S508, the instantaneous freezing management module sends Indication Information #2 to the freezing and thawing module.

[0233] Correspondingly, the freeze-thaw module receives indication information #2 sent by the instantaneous freeze management module, and the indication information #2 is used to indicate the process corresponding to the application window to be thawed.

[0234] S509, the freeze-thaw module thaws the process corresponding to the application window according to the indication information #2.

[0235] In the embodiments of the present application, the method for freezing and thawing an application program is not specifically limited. For example, the Freezer mechanism can be used to make the process of the application program poll and execute the code for yielding system resources. In this state, the process is in an uninterruptible sleep state. The following will be combined with Figure 10 The freeze-thaw method provided by the embodiments of the present application will be introduced.

[0236] Figure 10 The schematic flowchart of the freeze-thaw method provided by the embodiments of the present application is shown. As Figure 10 shown in (a) of, the freezing method includes:

[0237] S1001, mount the freezer control group.

[0238] The control group (cgroup) is a mechanism for grouping and managing processes. The freezer control group (freezercgroup) is a type of cgroup used to control the freezing and thawing of processes. When the freeze-thaw module determines that an application program needs to be frozen or thawed, it can mount the freezercgroup.

[0239] S1002, write the identifier of the application program to be frozen into the freezer control group.

[0240] The freeze-thaw module can write the identifier of the application program to be frozen into the freezer control group. The identifier of the application program can be the process identifier (process ID, PID).

[0241] S1003, update freezer.state to forzen to freeze the application program.

[0242] The freezer.state corresponding to the process in the freezercgroup can record the state of the process or thread. When freezing is required, the freeze-thaw module can write forzen into freezer.state, and the corresponding process or thread will be frozen, and the current state will be saved in the memory. The data structure for saving the state includes registers, stacks, file descriptors, etc. of the process or thread.

[0243] As Figure 10 shown in (b) of, the thawing method includes:

[0244] S1004, mount the freeze control group.

[0245] It should be understood that for the description of S1004, reference can be made to the description of S1001. For the sake of brevity, it will not be elaborated here.

[0246] S1005, update freezer.state to thawed to thaw the application.

[0247] When freezing is required, the freeze thaw module can write thawed to freezer.state, reload the state data structure saved in memory into the context of the process, and continue execution from the place where it was last frozen.

[0248] S1006, move the identifier of the application to be thawed into a new control group.

[0249] After the freeze thaw module thaws the application, it can move the identifier of the application to be thawed into a new control group, and this control group is not the freeze control group.

[0250] In the above, the method for managing applications provided by the embodiments of the present application is introduced with each module as the main body. The division of the modules above is only a logical function division, and there may be other division methods in actual implementation. Below, the method for managing applications provided by the embodiments of the present application will be introduced with the electronic device as the main body.

[0251] Figure 11 Shows a schematic flowchart of the method for managing applications provided by the embodiments of the present application, as Figure 11 shown, the method includes:

[0252] S1101, display M application windows.

[0253] S1102, in response to detecting a specific event, freeze the process corresponding to at least one of the M application windows.

[0254] The electronic device can, in response to detecting a specific event, freeze the process corresponding to at least one of the M application windows displayed.

[0255] In some embodiments, the M application windows can belong to the same application.

[0256] In some embodiments, the M application windows can belong to at least two applications.

[0257] In some embodiments, the M application windows can be overlapped and placed.

[0258] In some embodiments, the M application windows include application windows that are fully displayed.

[0259] In some embodiments, the electronic device also runs one or more invisible application windows, and the method further includes:

[0260] In response to detecting a specific event, freezing the process corresponding to at least one of the one or more invisible application windows.

[0261] It can be understood that the one or more invisible application windows are processes corresponding to application programs running in the background.

[0262] In some embodiments, the process corresponding to the frozen application window does not perform perceivable services, and the perceivable services include but are not limited to: audio playback service, video playback service, screen recording service, recording service, and navigation service.

[0263] In the embodiments of the present application, due to the characteristics of the desktop operating system, multiple application windows can be displayed on the screen. The multiple application windows can be placed randomly, and some application windows may be partially or completely blocked. Users cannot pay attention to all the windows on the screen at the same time. Therefore, when a specific event is detected, the processes corresponding to some application windows can be frozen, thereby improving the fluency of the system and helping to enhance the user experience.

[0264] In some embodiments, the first application program has not yet run an external device connection service.

[0265] In addition, the process corresponding to the frozen application window can be a process that does not perform user-perceivable services, so that users are less likely to perceive the freezing and it will not affect the normal use of users.

[0266] In addition, the frozen process is in an uninterruptible sleep state, and the process will not starve, so it can quickly resume to its original state.

[0267] In some embodiments, freezing the process corresponding to at least one of the M application windows in response to detecting a specific event includes:

[0268] In response to detecting a specific event and the overall machine load being greater than a first threshold, freezing the process corresponding to at least one of the M application windows.

[0269] In some embodiments, freezing the process corresponding to at least one of the M application windows includes:

[0270] Determining N application windows from the M application windows;

[0271] Freezing the process corresponding to at least one of the N application windows.

[0272] In some embodiments, the N application windows are determined according to the loads of the processes corresponding to the m application windows from large to small.

[0273] In the embodiments of the present application, the process corresponding to the application window frozen by the electronic device is a process with a relatively large load. Therefore, after freezing the process with a relatively large load, the normal operation of other services can be ensured.

[0274] In some embodiments, the loads of the processes corresponding to the N application windows are greater than the second threshold.

[0275] In the embodiments of the present application, the process corresponding to the application window frozen by the electronic device is a process with a relatively large load. Therefore, after freezing the process with a relatively large load, the normal operation of other services can be ensured.

[0276] In some embodiments, the specific event includes an operation of the user starting an application program.

[0277] In some embodiments, the specific event includes an operation of the user setting one of the M application windows as the focus window.

[0278] In some embodiments, the specific event includes an operation of the user maximizing the application window.

[0279] In some embodiments, the overall load of the machine is determined according to the PSI of the processor and / or the PSI of the memory and / or the PSI of the input / output of the memory.

[0280] In some embodiments, the overall load of the machine is determined according to the usage rate of the processor.

[0281] In some embodiments, the overall load of the machine is determined according to the usage rate of the memory.

[0282] In some embodiments, the M application windows include a first application window, and the process corresponding to the first application window is frozen. The method further includes:

[0283] In response to detecting an operation of the user setting the first application window as the focus window, thaw the process corresponding to the first application window.

[0284] In some embodiments, the M application windows include a first application window, and the process corresponding to the first application window is frozen. The method further includes:

[0285] In response to detecting that the freezing duration of the first application window is greater than the fourth threshold, thaw the process corresponding to the first application window.

[0286] In some embodiments, the method further includes:

[0287] In response to detecting that the overall machine load is less than the fifth threshold, thaw the process corresponding to the frozen application window.

[0288] The embodiments of the present application provide a computer program product. When the computer program product runs on an electronic device, it causes the electronic device to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments of the above method, and will not be elaborated here.

[0289] The embodiments of the present application provide a readable storage medium. The readable storage medium contains instructions. When the instructions run on an electronic device, they cause the electronic device to execute the technical solutions of the above embodiments. Its implementation principle and technical effects are similar, and will not be elaborated here.

[0290] The embodiments of the present application provide a chip. The chip is used to execute instructions. When the chip runs, it executes the technical solutions in the above embodiments. Its implementation principle and technical effects are similar, and will not be elaborated here.

[0291] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but this implementation should not be considered to exceed the scope of the embodiments of the present application.

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

[0293] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0294] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0295] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0296] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.

[0297] As described above, the above is only the specific implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the embodiments of the present application, and all of them should be covered by the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims

1. A method for managing an application, characterized in that, The method is applied to a personal computer (PC), and the method includes: Displaying M application windows, where M≥2 and is an integer; In response to detecting a specific event, freezing the process corresponding to at least one of the M application windows.

2. The method according to claim 1, characterized in that, The PC runs one or more invisible application windows, and the method further includes: In response to detecting the specific event, freezing the process corresponding to at least one of the one or more invisible application windows.

3. The method according to claim 1 or 2, characterized in that, The process corresponding to the frozen application window does not perform perceivable services.

4. The method according to claim 3, characterized in that, The perceivable services include one or more of the following services: audio playback service, video playback service, screen recording service, recording service, and navigation service.

5. The method according to claim 3 or 4, characterized in that, The process corresponding to the frozen application window does not perform external device connection services.

6. The method according to any one of claims 1 to 5, characterized in that, The step of, in response to detecting a specific event, freezing the process corresponding to at least one of the M application windows includes: In response to detecting the specific event and the overall machine load being greater than a first threshold, freezing the process corresponding to at least one of the M application windows.

7. The method according to any one of claims 1 to 6, characterized in that, The step of freezing the process corresponding to at least one of the M application windows includes: Determining N application windows from the M application windows, where N≥1 and is an integer; Freezing the process corresponding to at least one of the N application windows.

8. The method according to claim 7, characterized in that, The N application windows are the application windows determined in descending order of the load of the processes corresponding to the M application windows.

9. The method according to claim 7, characterized in that, The N application windows are the application windows with a load greater than a second threshold.

10. The method according to any one of claims 7 to 9, characterized in that, The overall machine load is determined based on the Processor Stress Information (PSI) of the processor and / or the PSI of the memory and / or the PSI of the input / output of the memory.

11. The method according to any one of claims 1 to 10, characterized in that, The specific event includes one or more of the following: an operation by the user to start an application; An operation by the user to set one of the M application windows as the focus window; An operation by the user to maximize an application window.

12. The method according to any one of claims 1 to 11, characterized in that, The specific event further includes that the data of frame drops in the application window is greater than a third threshold.

13. The method according to any one of claims 1 to 12, characterized in that, The M application windows belong to the same application, or the M application windows belong to at least two applications.

14. The method according to any one of claims 1 to 13, characterized in that, The M application windows include fully displayed application windows and / or overlapping application windows.

15. The method according to any one of claims 1 to 14, characterized in that, The M application windows include a first application window, and the process corresponding to the first application window is frozen. The method further includes: In response to detecting an operation by the user to set the first application window as the focus window, thawing the process corresponding to the first application window.

16. The method according to any one of claims 1 to 14, characterized in that, The M application windows include a first application window, and the process corresponding to the first application window is frozen. The method further includes: In response to detecting that the freezing duration of the first application window is greater than a fourth threshold, thawing the process corresponding to the first application window.

17. The method according to any one of claims 1 to 14, characterized in that, The method further includes: In response to detecting that the overall machine load is less than a fifth threshold, thawing the process corresponding to the frozen application window.

18. An electronic device, characterized in that, Comprising one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs comprising instructions which, when executed by the one or more processors, cause the method according to any one of claims 1 to 17 to be executed.

19. A chip, characterized in that, The chip comprises a processor and a communication interface, the communication interface being configured to receive a signal and transmit the signal to the processor, the processor processing the signal such that the method according to any one of claims 1 to 17 is executed.

20. A computer-readable storage medium, characterized in that, Computer instructions are stored in the computer-readable storage medium, which, when run on a computer, cause the method according to any one of claims 1 to 17 to be executed.