Control method and device

By switching operation modes and releasing resources in electronic devices, the problem of high resource consumption when running complex applications is solved, and the device usage time is extended.

CN112306714BActive Publication Date: 2024-12-20LENOVO (BEIJING) LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202011190334.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2024-12-20
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

When electronic devices run complex applications, unclosed applications continue to consume resources, resulting in reduced efficiency of device resources and shorter battery life.

Method used

After receiving the pause notification from the application process, the operating system switches from high-performance mode to low-performance mode, releases relevant resources and adjusts the operating parameters of hardware components to reduce resource consumption.

Benefits of technology

It effectively reduces the resource consumption of electronic devices in the application pause state, extends the battery life and equipment service life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112306714B_ABST
    Figure CN112306714B_ABST
Patent Text Reader

Abstract

The present application provides a control method and device, the method comprising: in the process of running an application process, if the operating system of the electronic device obtains a first notification sent by the target application process that the application process enters a suspended state, controlling the electronic device to switch from the current first operating mode to a second operating mode, wherein the performance of the electronic device in the first operating mode is higher than its performance in the second operating mode. The solution of the present application can reduce the resource consumption of the electronic device when the application process enters a suspended state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of control technology, and more specifically, to a control method and device. Background Art

[0002] Currently, electronic devices have an increasing number of applications involving complex data processing, such as games.

[0003] The operation of such applications requires more resources. In many cases, although the user has not closed the application, he or she does not need to operate the application temporarily. For example, taking a game as an example, the user may pause the game due to some temporary matters. However, as long as the application is not closed, the electronic device will consume more resources due to running the application, resulting in high resource consumption of the electronic device. Summary of the invention

[0004] The present application provides a control method and device.

[0005] A control method includes:

[0006] During the running of an application process, if the operating system of the electronic device receives a first notification from the target application process to enter a suspended running state, it controls the electronic device to switch from the current first operating mode to the second operating mode, wherein the performance of the electronic device in the first operating mode is higher than its performance in the second operating mode.

[0007] In one implementation, the operating system of the electronic device obtains a first notification sent by a target application process that the target application process enters a suspended state, including:

[0008] If a first preset operation acting on an input component of an electronic device is obtained, the first preset operation is used to cause a target application process to enter a suspended state, notify the target application process so that the target application process enters a suspended state and send a first notification of entering a suspended state to the operating system, wherein the target application process includes at least an application process whose display window is currently located at the frontmost end of a display component of the electronic device.

[0009] In yet another implementation, the target application process enters a suspended state, including:

[0010] All subprocesses of the target application process enter a suspended state; and / or,

[0011] Pauses updating of the display window of the target application process.

[0012] In one implementation, controlling the electronic device to switch from the current first operating mode to the second operating mode includes:

[0013] After obtaining the first notification, the operating system or the pre-installed driver optimizes at least the system resources related to the target application process, so that the electronic device is switched from the current first operating mode to the second operating mode.

[0014] In yet another implementation, the operating system or the pre-installed driver optimizes at least the system resources related to the target application process, including:

[0015] The hardware resources occupied by the target application process are released through the operating system or the preset driver, and the related cache resources and / or memory resources are released to the preset storage location; or,

[0016] The hardware resources occupied by the target application process and other application processes different from the target application process are released through the operating system or the preset driver, and the related cache resources and / or memory resources are released to the preset storage location; or,

[0017] Lowering the operating parameters of the hardware components for the target application process to run through the operating system or the pre-installed driver; or,

[0018] The operating parameters of the hardware components for the target application process and other application processes different from the target application process are lowered through the operating system or the preset driver. In another implementation, after obtaining the first notification, if the operating system of the electronic device obtains a second notification of restoring the operating state sent by the target application process, the electronic device is controlled to switch from the current second operating mode to the first operating mode.

[0019] In yet another implementation, the operating system of the electronic device obtains a second notification of the recovery running state sent by the target application process, including:

[0020] If a second preset operation acting on the input component of the electronic device is obtained, the second preset operation is used to make the target application process enter a continue running state, notify the target application process to make the target application process enter a resume running state and send a second notification of entering the resume running state to the operating system.

[0021] In yet another implementation, after obtaining the second notification of the recovery running state sent by the target application process, the method further includes:

[0022] Loading at least the cache resources and / or memory resources related to the target application process released to the preset storage location into the memory and / or cache of the electronic device through the operating system or the preset driver;

[0023] or,

[0024] The operating parameters of the hardware components for the target application process to run are called back through the operating system or the pre-installed driver.

[0025] In another implementation, after obtaining the first notification, if no notification is obtained within a preset time period or a third preset operation acting on the electronic device is obtained, the electronic device is controlled to switch from the current second operating mode to the third operating mode, wherein the power consumption of the electronic device in the second operating mode is higher than its power consumption in the third operating mode.

[0026] A control device includes:

[0027] A notification receiving unit, configured to obtain, through the operating system, a first notification of entering a suspended running state sent by a target application process;

[0028] A mode control unit is used to control the electronic device to switch from the current first operating mode to the second operating mode if the operating system of the electronic device obtains a first notification of entering a suspended operating state sent by a target application process during the running of an application process, wherein the performance of the electronic device in the first operating mode is higher than its performance in the second operating mode.

[0029] In another aspect, the present application further provides an electronic device, the electronic device comprising at least a memory and a processor;

[0030] Wherein, the processor is used to execute any of the control methods described above.

[0031] This memory is used to store the programs that the processor needs to perform operations.

[0032] On the other hand, the present application also provides a storage medium for storing a program, which, when executed, is used to implement any of the control methods described above.

[0033] From the above scheme, it can be seen that during the running of an application process, if the application process sends a notification to the operating system to enter a suspended state, the operating system will control the electronic device to switch from a higher-performance first operating mode to a lower-performance second operating mode, thereby reducing the resource consumption of the electronic device when the application process enters a suspended state. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 A flow chart of an embodiment of a control method provided by the present application;

[0036] Figure 2 A flow chart of another embodiment of the control method provided by the present application;

[0037] Figure 3 A flow chart of another embodiment of the control method provided by the present application;

[0038] Figure 4 A flow chart of another embodiment of the control method provided by the present application;

[0039] Figure 5 A schematic diagram of the implementation flow of the control method of the present application in an application scenario;

[0040] Figure 6 A schematic diagram of an implementation principle of the control method of the present application in a game scenario;

[0041] Figure 7 A schematic diagram of the structure of an embodiment of a control device provided by the present application;

[0042] Figure 8 A schematic diagram of the composition architecture of an embodiment of an electronic device provided in this application.

[0043] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims and the above drawings are used to distinguish similar parts, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated herein. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0045] See also Figure 1 , Figure 1 The present invention provides a flow chart of a control method according to an embodiment of the present application. The method according to the present embodiment can be applied to an electronic device, which may be a mobile phone, a tablet computer, or a personal computer.

[0046] The method of this embodiment may include:

[0047] S101, during the process of running an application process, the operating system of the electronic device obtains a first notification of entering a suspended running state sent by a target application process.

[0048] It is understandable that the electronic device can install and run at least one application process. The at least one application can include: at least one application that can realize human-computer interaction, and the resources consumed by the operation of such applications are relatively large. The application that realizes human-computer interaction refers to an application that can receive user input and can respond to the user input.

[0049] For example, an application that enables human-computer interaction can output a display window to a display unit of an electronic device so that a user can input information into the application through an application interface. For example, an application that enables human-computer interaction can be a game application, a virtual reality application, an entertainment application, an office application, and the like.

[0050] During the running of the application process, if the user leaves the electronic device, the user may control the application process to enter a paused state by operating the electronic device, so that the application process controls itself to enter a paused running state.

[0051] For example, the user can perform preset operations such as clicking on input components such as a mouse or keyboard of an electronic device to enable the application to obtain a pause indication, and accordingly, the application process will enter a paused running state.

[0052] For another example, when an application process detects that a running control button on an application interface corresponding to the application process is pressed, for example, a "pause / run" button is pressed by a user, the application process will enter a paused running state.

[0053] In one possible scenario, if a first preset operation acting on an input component of an electronic device is obtained, the electronic device will notify the target application process so that the target application process enters a suspended state and sends a first notification of entering a suspended state to the operating system. For example, when there is a first preset operation on the input component of the electronic device, the Basic Input Output System (BIOS) or Embedded Controller (EC) in the electronic device can obtain a message (or input event) corresponding to the first preset operation of the input component, and notify the target application process of the message through the BIOS or EC. After obtaining the message, the target application enters a suspended state and sends the first notification of entering a suspended state to the operating system.

[0054] The input component of the electronic device may be a mouse, keyboard, touch screen, remote controller or control handle of the electronic device.

[0055] The first preset operation is used to make the target application process enter a suspended running state.

[0056] In this case, the target application process at least includes the application process whose display window is currently located at the forefront of the display component of the electronic device. It is understandable that when the target application process is at the forefront of the display component of the electronic device, the target application can be controlled to enter a suspended state by performing a first preset operation such as clicking through an input component such as a mouse or keyboard.

[0057] For example, in a game application, when the cursor is on the display interface of the game application, the user can trigger the game to pause by clicking the mouse.

[0058] In another possible implementation, the application process may also monitor whether the condition for entering the suspended state is met according to the user's operation state. If the application detects that the condition for entering the suspended state is currently met, it automatically enters the suspended state and sends a first notification of entering the suspended state to the operating system.

[0059] For example, the application process detects whether the user leaves the electronic device and how long the user has been away from the electronic device. If the user has been away from the electronic device for longer than a set time, it is determined that the conditions for entering the suspended state are met, the application process naturally enters the suspended state, and sends a first notification to the operating system.

[0060] For another example, if the application process does not detect the user's input operation for a set period of time, it enters the suspended state and sends a first notification to the operating system. It is understandable that since the application process needs to occupy memory and some hardware resources to run, if only the application process controls itself to be in the suspended state, some sub-processes related to the application process are actually still running in the background, but the user does not see the update of the corresponding interface of the application process.

[0061] For example, the application process entering the suspended state may be that the target application process suspends the update of the display window of the target application process; or, all subprocesses of the target application process enter the suspended state. For example, after the target application process is suspended, the subprocesses related to the update of the display window may be suspended to reduce the consumption of memory and hardware resources; or all subprocesses may be suspended to reduce the consumption of hardware resources. Of course, in actual applications, it is also possible that all subprocesses of the target application process enter the suspended state while suspending the update of the display window of the target application process.

[0062] It can be seen from this that although the user controls the application process to enter a suspended state, the data of the application process may still run in the background and still occupy and consume the memory and hardware and other resources of the electronic device.

[0063] In order to reduce the resources consumed by the application process after entering the suspended state, in the present application, the application process can send a notification of entering the suspended state to the operating system, so that the operating system can obtain that the application process has entered the suspended state; or, notify the operating system to control the application process to enter the suspended state.

[0064] For the sake of distinction, the notification that the application process sends to the operating system to enter the suspended state is called the first notification, and the application process that sends the first notification is called the target application process. The target application process belongs to the application process running on the electronic device.

[0065] S102: In response to the first notification, control the electronic device to switch from the current first operating mode to a second operating mode.

[0066] The performance of the electronic device in the first operating mode is higher than the performance of the electronic device in the second operating mode.

[0067] It is understandable that if the target application process sends a notification to the operating system that it has entered a suspended state, it means that the user does not need to use the application temporarily, and may not even need to use the electronic device.

[0068] For example, in a case where the target application includes at least an application process whose display window is currently located at the forefront of the display component of the electronic device, the target application sends a notification to the operating system to enter a suspended state, which means that the user may temporarily leave the display component of the electronic device due to reasons such as leaving the electronic device. Therefore, the operating system of the electronic device can control and adjust the electronic device to be in a second operating mode with relatively lower performance.

[0069] In a possible implementation, after obtaining the first notification, the operating system or the preset driver may optimize at least the system resources related to the target application process so that the electronic device is switched from the current first operating mode to the second operating mode.

[0070] Among them, optimizing the system resources related to the target application process can reduce the system resources such as memory occupied by the target application process. The specific optimization method is not limited in this application.

[0071] It can be seen that in the present application, during the running of an application process, if the application process sends a notification to the operating system to enter a suspended state, the operating system will control the electronic device to switch from a higher-performance first operating mode to a lower-performance second operating mode, thereby reducing the resource consumption of the electronic device when the application process enters a suspended state.

[0072] At the same time, by reducing the resource consumption of electronic devices, the battery life and the service life of electronic devices can be extended.

[0073] In order to facilitate understanding of the specific implementation of the electronic device switching from the current first operating mode to the second operating mode, the following is explained by taking the optimization of at least the system resources related to the target application process as an example.

[0074] First, we will take a system resource optimization method as an example, as shown in Figure 2 , which shows a flow chart of another embodiment of a control method of the present application. The method of this embodiment may include:

[0075] S201, during the running of an application process, if a first preset operation acting on an input component of an electronic device is obtained, the target application process is notified to enter a suspended state and a first notification of entering the suspended state is sent to the operating system.

[0076] The first preset operation is used to make the target application process enter a suspended state, wherein the target application process at least includes an application process whose display window is currently located at the frontmost end of a display component of the electronic device.

[0077] For ease of understanding, this embodiment takes a case of obtaining a first notification as an example. However, it is understandable that if the target application process obtains a virtual key, voice input, or gesture input acting on the target application process through an electronic device, the target application process can also enter a suspended state. In this case, the target application process can still send the first notification to the operating system. This application does not limit the method by which the target application process enters a suspended state. In this application, no matter which method is used to make the target application process enter a suspended state, the target application process will send the first notification to the operating system of the electronic device.

[0078] S202: releasing the hardware resources occupied by the target application process through the operating system or the preset driver, and releasing the related cache resources and / or memory resources to the preset storage location.

[0079] The preset driver may be a driver within the operating system.

[0080] For example, the hardware resources occupied by the target application process can be released by suspending the target application process and other operations, and the related cache or memory resources can be released to a preset storage location.

[0081] It is understandable that after the target application process is in a suspended state, by releasing the application resources occupied by the target application process and releasing the cache resources and / or memory resources related to the target application process to a preset storage location, the consumption of hardware and memory resources caused by the target application process still running in the memory can be reduced.

[0082] As an optional method, while releasing the hardware resources and memory or cache resources of the target application process, the present application can also release the hardware resources occupied by other application processes different from the target application process through the operating system or preset driver, and release the cache resources and / or memory resources related to the other application processes to a preset storage location.

[0083] Among them, other application processes different from the target application process may be application processes running in the foreground of the electronic device, or may be application processes running in the background.

[0084] It is understandable that, considering that the display window of the target application process is at the top layer of the display component of the electronic device, the target application process enters a suspended state, and the user may temporarily not need to use the electronic device due to reasons such as leaving the electronic device. Therefore, in this case, the hardware and memory resources occupied by the target application process and other application processes are released, which can further reduce resource consumption.

[0085] Understandably, Figure 2 This is explained by taking at least one method of optimizing the system resources related to the target application process as an example. In practical applications, the present application can also optimize the system resources related to the target application process by lowering the operating parameters of the hardware components for the target application process to run through the operating system or the preset driver.

[0086] Among them, the operating parameters of the hardware components can affect various operating parameters of electronic device resource consumption. For example, the hardware components can be the CPU and internal memory, etc. Correspondingly, the operating parameters can be the CPU operating speed required to run the target application process, the storage speed of the internal memory, etc.

[0087] For example, lowering the operating parameters of a hardware component may be achieved by sending a control instruction to the corresponding hardware component to instruct the hardware component to lower its own operating parameters. Of course, there may be other possible implementations, which are not limited thereto.

[0088] It is understandable that after the target application process sends a notification to the operating system to enter a suspended state, the performance of the electronic device can be reduced by lowering the operating parameters of the hardware components for the target application process to run, thereby reducing the resources required after suspending the target application process.

[0089] As an optional method, after the operating system of the electronic device obtains the first notification from the target application process that it has entered a suspended state, the optimization of system resources related to the target application process may also be carried out by lowering the operating parameters of the hardware components used to run the target application process and other application processes different from the target application process through the operating system or a preset driver.

[0090] Among them, the operating parameters and adjustment methods of the hardware components for running other application processes can be found in the above introduction and will not be repeated here.

[0091] It can be understood that in the above embodiments of the present application, after the operating system of the electronic device obtains the first notification, if the operating system of the electronic device obtains the second notification of resuming the operating state sent by the target application process, the electronic device is controlled to switch from the current second operating mode to the first operating mode.

[0092] The second notification is actually a notification that the target application process requests to resume from a suspended running state to a normal running state.

[0093] By controlling the electronic device to adjust from the second operating mode to the first operating mode, the performance of the electronic device can be improved, so as to facilitate the operating performance of the target application process.

[0094] For example, the second notification sent by the target application process to resume the running state may be a notification sent by the target application process to the operating system after the target application process is converted from a suspended running state to a resumed running state, so that the operating system controls the relevant system resources required to resume the operation of the target application process, restores the system resources to the state before optimization, and restores the target application process to a normal operating state.

[0095] Similar to obtaining the first notification, in one possible implementation, if a second preset operation acting on the input component of the electronic device is obtained, the target application process is notified so that the target application process enters a recovery state and sends a second notification of entering the recovery state to the operating system.

[0096] The second preset operation is used to make the target application process enter a continuing running state.

[0097] For example, the second preset operation may be clicking a mouse of the electronic device or a designated key on a keyboard. After the target application process is triggered to enter the suspended state by a preset operation such as clicking a mouse, the target application process may be triggered to resume from the suspended state to the normal state by a preset operation such as clicking a mouse again.

[0098] The process of obtaining the second preset operation and notifying the target application process is similar to the process of the electronic device obtaining the first preset operation and notifying the target application process, and will not be repeated here.

[0099] It is understandable that if the target application process obtains the second preset operation acting on the virtual key on the display window of the target application process, in order to enable the target application process to resume normal operation, the target application process will also send the second notification to the operating system.

[0100] In another possible implementation, the target application process may enter the recovery state and send a second notification to the operating system when detecting that the user leaves and returns to the electronic device or detecting an input operation by the user.

[0101] It is understandable that when the target application process enters the suspended state, the target application process will suspend the update of the display interface or the operation of some sub-processes. If the target application process confirms that the second preset operation is detected, the target application will resume the update of the display interface or the operation of the suspended sub-process. At the same time, in order to ensure that the sub-process of the target application can run normally in the memory, the target application process will send the second notification to the operating system so that the operating system resumes the processing related to the operation of the target application.

[0102] It is understandable that after the operating system obtains the second notification, the operating system or the preset driver program controls the electronic device to adjust from the second operating mode to the first operating mode, which can provide a possibility for the target application process to recover to a normal operating state. Further, in order to restore the target application process to a normal operating state, after the operating system obtains the second notification, the memory resources or cache resources related to the target application process can also be called back to the memory or cache; or the operating parameters of the hardware components for the target application process to run can be called back.

[0103] To facilitate understanding, let's take a possible situation as an example. Figure 3 As shown, it shows a flow chart of another embodiment of a control method of the present application. The method of this embodiment may include:

[0104] S301, during the process of running an application process, the operating system of the electronic device obtains a first notification of entering a suspended running state sent by a target application process.

[0105] S302, in response to the first notification, releasing the hardware resources occupied by the target application process through the operating system or the preset driver, and releasing the related cache resources and / or memory resources to the preset storage location.

[0106] For steps S301 and S302 above, reference may be made to the related introduction of the previous embodiment, which will not be described again here.

[0107] S303, if the operating system of the electronic device receives a second notification of resuming the running state sent by the target application process, the cache resources and / or memory resources released to the preset storage location and related to the target application process are at least loaded into the cache and / or memory of the electronic device through the operating system or a preset driver.

[0108] In this embodiment, after the target application process enters the suspended state and sends a first notification to the operating system, the operating system or the preset driver releases one or both of the cache resources and memory resources related to the target application process to the preset storage location to suspend the target application process. When it is necessary to restore the normal operation state of the target application process, the operating system or the preset driver reloads the cache or memory resources related to the target application process in the preset storage location into the cache and / or memory so that the target application process can resume normal operation.

[0109] The resources reloaded into the cache and / or memory may be consistent with the cache and / or memory resources related to the target application process before being released.

[0110] For example, if only memory resources exist before the target application process is suspended, the memory of the target application process is released to the preset storage location when the target application process is suspended. Accordingly, when the normal operation of the target application process needs to be restored, the memory resources of the target application process in the preset storage location can be loaded into the memory.

[0111] It is understandable that after the cache and / or memory resources related to the target application process are reloaded into the cache and / or memory resources, the hardware resources occupied by the target application process may also be restored.

[0112] In an optional manner, if, while releasing the cache resources and / or memory resources associated with the target application process to a preset storage location, the cache resources and / or memory resources associated with other application processes other than the target application process are also released to the preset storage location, then while executing step S303, the cache resources and / or memory resources in the preset storage location related to other application processes other than the target application process can also be reloaded into the cache and / or memory.

[0113] It is understandable that in this embodiment, after receiving the second notification, the electronic device will still be controlled to switch from the current second operating mode to the first operating mode. On this basis, the released resources corresponding to the target application process are reloaded into the memory or cache, which can more reliably ensure that the target application process is restored to a normal operating state.

[0114] The following is an example of the electronic device calling back the operating parameters of the hardware component for the target application to run after receiving the second notification. Figure 4 As shown, it shows a flow chart of another embodiment of a control method of the present application. The method of this embodiment may include:

[0115] S401, during the process of running an application process, if the operating system of the electronic device obtains a first notification from the target application process that the target application process enters a suspended state, the operating parameters of the hardware components for running the target application process are lowered through the operating system or a preset driver.

[0116] The process of obtaining the first notification may refer to the related introduction of the previous embodiment, which will not be repeated here.

[0117] S402: If a second preset operation acting on the input component of the electronic device is obtained, the target application process is notified so that the target application process enters a recovery state and a second notification of entering the recovery state is sent to the operating system.

[0118] For ease of understanding, this embodiment takes the example of triggering the target application process to enter the recovery state by acting on the second preset operation of the input component of the electronic device as an example, but the present application is also applicable to the other situations mentioned above and is not limited to this.

[0119] S403: In response to the second notification, call back the operating parameters of the hardware component for running the target application process through the operating system or the preset driver.

[0120] In this embodiment, if the target application process enters the suspended state, the operating system or the driver program preset by the operating system will at least lower the operating parameters of the hardware component running the target application process to reduce the resources still consumed when the target application process enters the suspended state. Accordingly, when it is necessary to restore the operating state of the target application process, the operating parameters of the corresponding hardware component can be called back to meet the normal operation requirements of the target application process.

[0121] In an optional implementation, if the operating system lowers the operating parameters of the hardware components for running the target application process and other application processes other than the target application process through the operating system or a preset driver after receiving the first notification, then after receiving the second notification, the operating parameters of the hardware components for running the target application process and the other application processes may be adjusted back through the operating system or a preset driver.

[0122] It should be noted that, in this embodiment, after obtaining the second notification, the electronic device can still be controlled to switch from the current second operating mode to the first operating mode.

[0123] It is understandable that in any of the above embodiments of the present application, after the operating system obtains the first notification, if no notification is obtained within a preset time period or a third preset operation acting on the electronic device is obtained, the electronic device can also be controlled to switch from the current second operating mode to the third operating mode. The power consumption of the electronic device in the second operating mode is higher than that in the third operating mode.

[0124] For example, in the second operating mode, the target application process can be suspended in the memory. If the operating system does not receive any notification or detect any operation for a long time, it means that the user has not operated the electronic device for a long time. In this case, the electronic device can be adjusted to a lower-function sleep mode.

[0125] In order to facilitate understanding of the solution of this application, an application scenario is introduced below. Take the running application process including the game process of the game application as an example. Figure 5 As shown, it shows a schematic diagram of a process interaction of a control method of the present application applied to a game scene. The method of this embodiment is applied to an electronic device, and at least one game application is running in the electronic device, which may include:

[0126] S501, during the running of a game application process, if a first preset operation acting on an input component of an electronic device is obtained, the game application process is notified.

[0127] In this embodiment, the display window of the game application process is currently located at the forefront of the display component of the electronic device. In this case, after the electronic device detects the first preset operation of the input component such as the mouse or keyboard, the operating system can notify the game process of the existence of the first preset operation.

[0128] S502: The game application process suspends updating of the display window.

[0129] In this embodiment, the game application process can confirm the user input of the command to pause the game based on the first preset operation. In this case, the game application controls itself to enter the pause state and stops updating the game data to the display window (game window).

[0130] For example, the cursor is placed on the game window of the running game application by using a mouse, and the mouse is clicked to generate a first preset operation for triggering the pause of the game window. Alternatively, the game window of the running game application is clicked on the touch screen to enable the operating system to detect the first preset operation.

[0131] S503: The game application process sends a first notification of entering a suspended state to the operating system.

[0132] When the game application process receives a pause instruction input by the user, the game application process only pauses the data update of the game window. The operating system cannot obtain that the game has been paused. The game application process is still running in the memory and still needs to consume memory and other resources.

[0133] Based on this, in the present application, while the game application pauses the update of the display window, it also sends a notification of entering a paused running state to the operating system so that the operating system can control the paused running of the game application process in the memory.

[0134] S504, the operating system releases the memory resources related to the game application process to a preset storage location.

[0135] For example, the operating system may temporarily remove the game application process from the memory by suspending the game application process.

[0136] It is understandable that for stand-alone games, the game operation process does not involve data interaction with the server side. In this case, the present application can release all memory resources related to the game application process to a preset storage location so that all sub-processes of the game application process in the memory stop running.

[0137] If the game application is an online network game, etc., in order to ensure that the game can communicate with the server so that the game can still synchronize data with the server after it resumes from a paused state to a normal state, the present application can also release memory resources related to other processes in the game application process except for the process responsible for data communication processing, and only run the process responsible for data communication processing in the memory.

[0138] like Figure 6 , a schematic diagram of an implementation principle of the solution of the present application applied in a game scenario.

[0139] exist Figure 6In the game scene, a handle or keyboard used to control game operations is provided with a pause button for pausing and resuming the game.

[0140] If the user wants to pause the game, he can click the pause button in the handle or keyboard. In this case, the BIOS or EC of the electronic device can sense the event of the pause button being touched and notify the game application process.

[0141] After receiving the notification that the pause button is pressed, the game application process pauses the updating of the game window of the game application process. At the same time, the game application process sends a first notification to the operating system that it enters the paused running state. In this case, the operating system or a preset driver (not shown in the figure) controls the suspension of the game application process running in the memory, that is, releases the memory resources of the game application process in the memory to the preset storage location.

[0142] Of course, in this embodiment, after the operating system receives the first notification, it can also adjust the hardware parameters of the hardware device for the game application process to run through the operating system or the preset driver. For example, the CPU main frequency can be reduced; or the hardware parameters of the related hardware such as the CPU main frequency can be reduced while releasing the memory resources related to the game process in the memory to the preset position.

[0143] S505: If the operating system obtains a second preset operation acting on the input component of the electronic device, the target application process is notified.

[0144] S506: The game application process enters a recovery state, and sends a second notification of entering the recovery state to the operating system.

[0145] The second preset operation is used to make the target application process enter a continuing running state.

[0146] For example, when the game window of a game application is paused by clicking the game window with the mouse, the game window can also be clicked with the mouse so that the operating system detects a second preset operation and notifies the game application so that the game application terminates the pause operation of pausing the update of the game window. In order to allow the related processes of the game application to still run in the background, it is also necessary to notify the operating system so that the operating system can recall the suspended game application process back to the memory.

[0147] S507: at least load the memory resources related to the target application process released to the preset storage location into the memory of the electronic device through the operating system or the preset driver.

[0148] Research has found that compared with the existing game application that simply pauses the update of the game window when detecting the first predicted operation, the solution of this embodiment can reduce the CPU usage of the electronic device from about 67% to about 3%, greatly reducing the consumption of memory resources and hardware resources such as the CPU.

[0149] Corresponding to a control method of the present application, the present application also provides a control device.

[0150] like Figure 7 As shown, it shows a schematic diagram of the composition structure of an embodiment of a control device of the present application. The device of this embodiment may include:

[0151] The notification receiving unit 701 is used to obtain a first notification of entering a suspended running state sent by a target application process through an operating system;

[0152] The mode control unit 702 is used to control the electronic device to switch from the current first operating mode to the second operating mode if the operating system of the electronic device obtains a first notification of entering a suspended operating state sent by the target application process during the running of the application process, wherein the performance of the electronic device in the first operating mode is higher than its performance in the second operating mode.

[0153] In one possible implementation, the notification receiving unit is specifically used to notify the target application process if a first preset operation acting on the input component of the electronic device is obtained, so that the target application process enters a suspended state and sends a first notification of entering the suspended state to the operating system, wherein the first preset operation is used to cause the target application process to enter a suspended state, wherein the target application process includes at least an application process whose display window is currently located at the front end of the display component of the electronic device.

[0154] Optionally, the target application process enters a suspended state, including:

[0155] All subprocesses of the target application process enter a suspended state; and / or,

[0156] Pauses updating of the display window of the target application process.

[0157] In yet another possible implementation, the mode control unit includes:

[0158] A resource optimization unit is used to optimize the system resources related to the target application process by the operating system or a preset driver during the running of the application process, so that the electronic device can be adjusted from the current first operating mode to the second operating mode.

[0159] In an optional manner, the resource optimization unit includes:

[0160] A first resource releasing unit is used to release the hardware resources occupied by the target application process through the operating system or a preset driver program, and release the related cache resources and / or memory resources to a preset storage location if the operating system of the electronic device obtains a first notification of entering a suspended running state sent by the target application process during the running of the application process;

[0161] or,

[0162] A second resource releasing unit is used for, during the running of the application process, if the operating system of the electronic device obtains a first notification sent by the target application process that the target application process enters a suspended running state, releasing the hardware resources occupied by the target application process and other application processes different from the target application process through the operating system or a preset driver, and releasing the relevant cache resources and / or memory resources to a preset storage location;

[0163] or,

[0164] A first parameter lowering unit, used for lowering the operating parameters of the hardware components for the target application process to run through the operating system or the preset driver;

[0165] or,

[0166] The second parameter lowering unit is used to lower the operating parameters of the hardware components for the target application process and other application processes different from the target application process through the operating system or the preset driver.

[0167] In a possible implementation manner, any one of the above device embodiments further includes:

[0168] The mode callback unit is used to control the electronic device to switch from the current second operating mode to the first operating mode if the operating system of the electronic device obtains a second notification of resuming the operating state sent by the target application process after obtaining the first notification.

[0169] In an optional manner, the mode callback unit includes:

[0170] a notification obtaining subunit, configured to, after obtaining the first notification, if a second preset operation acting on an input component of the electronic device is obtained, notify the target application process so that the target application process enters a resumed running state and send a second notification of entering a resumed running state to the operating system, wherein the second preset operation is used to cause the target application process to enter a continued running state;

[0171] The mode callback subunit is used to control the electronic device to switch from the current second operating mode to the first operating mode when the operating system obtains the second notification.

[0172] In an optional manner, the device further includes:

[0173] A first mode callback subunit is configured to load at least cache resources and / or memory resources related to the target application process released to a preset storage location into a memory and / or cache of the electronic device through the operating system or a preset driver program after obtaining the first notification, if the operating system of the electronic device obtains a second notification of restoring the running state sent by the target application process;

[0174] or,

[0175] The second mode callback sub-unit is used to call back the operating parameters of the hardware components for running the target application process through the operating system or a preset driver program after obtaining the first notification if the operating system of the electronic device obtains a second notification of restoring the running state sent by the target application process.

[0176] In another possible implementation, any one of the above devices in the present application further includes:

[0177] A mode change unit is used to control the electronic device to switch from the current second operating mode to the third operating mode after receiving the first notification, if no notification is received within a preset time period or a third preset operation is received on the electronic device, wherein the power consumption of the electronic device in the second operating mode is higher than that in the third operating mode.

[0178] On the other hand, the present application also provides an electronic device, for example, the electronic device may be the specific structure of the second electronic device mentioned above. Figure 8 As shown, it shows a schematic diagram of the composition structure of an electronic device of the present application. The electronic device of this embodiment at least includes: a processor 801 and a memory 802.

[0179] The processor is used to execute the control method of any one of the above embodiments.

[0180] This memory is used to store the programs that the processor needs to perform operations.

[0181] The memory can also be used for operating systems and BIOS programs, etc.

[0182] It is understandable that the electronic device may also include other components, such as Figure 8As shown, the electronic device may further include a display 803, an input device 804 connected to the electronic device, and a communication bus 805. The processor, the memory, the display, and the input device may be connected via a communication bus.

[0183] Of course, electronic equipment may also include, for example Figure 8 There may be more or fewer components, without limitation.

[0184] On the other hand, the present application also provides a storage medium for storing a program, which, when executed, is used to implement the control method described in any one of the above embodiments.

[0185] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. At the same time, the features recorded in each embodiment in this specification can be replaced or combined with each other, so that professionals in the field can implement or use this application. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0186] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A control method, comprising: During the running of the application process, if the operating system of the electronic device obtains a first notification of entering a suspended running state sent by the target application process, the operating system controls the electronic device to switch from the current first running mode to the second running mode, wherein the performance of the electronic device in the first running mode is higher than the performance in the second running mode; The controlling electronic device is adjusted from the current first operating mode to the second operating mode, including at least one of the following: The hardware resources occupied by the target application process are released through the operating system or the preset driver, and the related cache resources and / or memory resources are released to the preset storage location; or, The hardware resources occupied by the target application process and other application processes different from the target application process are released through the operating system or the preset driver, and the related cache resources and / or memory resources are released to the preset storage location.

2. The method according to claim 1, wherein: The operating system of the electronic device obtains a first notification sent by the target application process that the target application process enters a suspended state, including: If a first preset operation acting on an input component of an electronic device is obtained, the first preset operation is used to cause a target application process to enter a suspended state, notify the target application process so that the target application process enters a suspended state and send a first notification of entering a suspended state to the operating system, wherein the target application process includes at least an application process whose display window is currently located at the front end of a display component of the electronic device.

3. The method according to claim 1, wherein: The target application process enters a suspended state, including: All subprocesses of the target application process enter a suspended state; and / or, Pauses updating of the display window of the target application process.

4. The method according to claim 1, wherein: Controlling the electronic device to switch from the current first operating mode to the second operating mode also includes: Lowering the operating parameters of the hardware components for the target application process to run through the operating system or the pre-installed driver; or, The operating parameters of the hardware components for running the target application process and other application processes different from the target application process are lowered through the operating system or the pre-installed driver.

5. The method according to any one of claims 1 to 4, wherein: After obtaining the first notification, if the operating system of the electronic device obtains a second notification of resuming the running state sent by the target application process, the electronic device is controlled to switch from the current second running mode to the first running mode.

6. The method according to claim 5, wherein: The operating system of the electronic device obtains a second notification of restoring the running state sent by the target application process, including: If a second preset operation acting on the input component of the electronic device is obtained, the second preset operation is used to make the target application process enter a continue running state, notify the target application process to make the target application process enter a resume running state and send a second notification of entering the resume running state to the operating system.

7. The method according to claim 6, wherein: After obtaining the second notification of the recovery running state sent by the target application process, the method further includes: Loading at least the cache resources and / or memory resources related to the target application process released to the preset storage location into the memory and / or cache of the electronic device through the operating system or the preset driver; or, The operating parameters of the hardware components for the target application process to run are called back through the operating system or the pre-installed driver.

8. The method according to claim 1, wherein: After obtaining the first notification, if no notification is obtained within a preset time period or a third preset operation acting on the electronic device is obtained, the electronic device is controlled to switch from the current second operating mode to the third operating mode, wherein the power consumption of the electronic device in the second operating mode is higher than its power consumption in the third operating mode.

9. A control device comprising: A notification receiving unit, configured to obtain, through the operating system, a first notification of entering a suspended running state sent by a target application process; A mode control unit, configured to control the electronic device to switch from the current first operation mode to the second operation mode if the operating system of the electronic device obtains a first notification of entering a suspended operation state sent by the target application process during the operation of the application process, wherein the performance of the electronic device in the first operation mode is higher than the performance in the second operation mode; The controlling electronic device is adjusted from the current first operating mode to the second operating mode, including at least one of the following: The hardware resources occupied by the target application process are released through the operating system or the preset driver, and the related cache resources and / or memory resources are released to the preset storage location; or, The hardware resources occupied by the target application process and other application processes different from the target application process are released through the operating system or the preset driver, and the related cache resources and / or memory resources are released to the preset storage location.

Citation Information

Patent Citations

  • Mobile telephone and application program

    CN101395894A

  • A Method for Pausing and Resuming the Execution of MPI Parallel Applications

    CN104572283B

  • Dynamic testing method, device and system for software system

    CN105260316A

  • Application program management method and terminal

    CN105677141A

  • Virtual reality equipment control method, virtual reality equipment control device as well as virtual reality equipment

    CN106292994A