CN112306714A - Control method and device - Google Patents

Control method and device Download PDF

Info

Publication number
CN112306714A
CN112306714A CN202011190334.1A CN202011190334A CN112306714A CN 112306714 A CN112306714 A CN 112306714A CN 202011190334 A CN202011190334 A CN 202011190334A CN 112306714 A CN112306714 A CN 112306714A
Authority
CN
China
Prior art keywords
application process
target application
operating system
running
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011190334.1A
Other languages
Chinese (zh)
Inventor
王欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202011190334.1A priority Critical patent/CN112306714A/en
Publication of CN112306714A publication Critical patent/CN112306714A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

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

Abstract

The application provides a control method and a control device, wherein the method comprises the following steps: in the process of running the application process, if an operating system of the electronic equipment obtains a first notice of entering a suspended running state sent by a target application process, the electronic equipment is controlled to be switched from a current first running mode to a second running mode, wherein the performance of the electronic equipment in the first running mode is higher than that of the electronic equipment in the second running mode. According to the scheme, the resource consumption of the electronic equipment can be reduced under the condition that the application process enters the suspended state.

Description

Control method and device
Technical Field
The present application relates to the field of control technologies, and in particular, to a control method and apparatus.
Background
At present, games and the like provided in electronic devices are increasingly used in association with complex data processing.
The running of the application needs to occupy more resources. In many cases, the user does not need to operate the application temporarily although the application is not closed, for example, in the case of a game, the user may pause the game due to a temporary event. However, as long as the application is not closed, the electronic device consumes more resources due to running the application, resulting in higher resource consumption of the electronic device.
Disclosure of Invention
The application provides a control method and a control device.
The control method comprises the following steps:
in the process of running the application process, if an operating system of the electronic equipment obtains a first notice of entering a suspended running state sent by a target application process, the electronic equipment is controlled to be switched from a current first running mode to a second running mode, wherein the performance of the electronic equipment in the first running mode is higher than that of the electronic equipment in the second running mode.
In one implementation, obtaining, by an operating system of an electronic device, a first notification of entering a suspended running state sent by a target application process includes:
and if a first preset operation acting on an input component of the electronic equipment is obtained, the first preset operation is used for enabling the target application process to enter a suspended running state, informing the target application process so as to enable the target application process to enter the suspended running state, and sending a first notice of entering the suspended running state to the operating system, wherein the target application process at least comprises an application process of which a display window is positioned at the forefront of a display component of the electronic equipment currently.
In yet another implementation, the entering the suspended state by the target application process includes:
all sub-processes of the target application process enter a pause running state; and/or the presence of a gas in the atmosphere,
the update of the display window of the target application process is suspended.
In one implementation, controlling the electronic device to change from a current first operating mode to a second operating mode includes:
after obtaining the first notification, optimizing, by the operating system or a preset driver, at least system resources related to the target application process so that the electronic device is adjusted from the current first operation mode to the second operation mode.
In yet another implementation, optimizing, by the operating system or a preset driver, at least system resources associated with the target application process includes:
releasing hardware resources occupied by the target application process through the operating system or a preset driver, and releasing related cache resources and/or memory resources to a preset storage position; or the like, or, alternatively,
releasing 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 driving program, and releasing related cache resources and/or memory resources to a preset storage position; or the like, or, alternatively,
the operating parameters of the hardware components for the target application process to run are reduced through the operating system or a preset driver; or the like, or, alternatively,
and reducing the operation parameters of the hardware component for the target application process and other application processes different from the target application process through the operating system or a preset driver. In another implementation manner, after obtaining the first notification, if the operating system of the electronic device obtains a second notification for recovering the running state sent by the target application process, the electronic device is controlled to be adjusted from the current second running mode to the first running mode.
In another implementation, the obtaining, by the operating system of the electronic device, the second notification of the resumption of the running state sent by the target application process includes:
and if a second preset operation acting on an input component of the electronic equipment is obtained, the second preset operation is used for enabling the target application process to enter a continuous running state, informing the target application process, enabling the target application process to enter a running recovery state and sending a second notice of entering the running recovery state to the operating system.
In another implementation manner, after obtaining the second notification of resuming the running state sent by the target application process, the method further includes:
loading at least the cache resources and/or the memory resources related to the target application process, which are released to a preset storage position, to a memory and/or a cache of the electronic device through the operating system or a preset driver;
or the like, or, alternatively,
and calling back the running parameters of the hardware component for the target application process to run through the operating system or a preset driver.
In a further implementation manner, after the first notification is obtained, 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 be adjusted from the current second operation mode to a third operation mode, wherein the power consumption of the electronic device in the second operation mode is higher than that in the third operation mode.
Wherein, a controlling means includes:
the notification receiving unit is used for obtaining a first notification of entering a suspended running state sent by a target application process through an operating system;
and the mode control unit is used for controlling the electronic equipment to be adjusted to a second operation mode from a current first operation mode if an operating system of the electronic equipment obtains a first notice of entering a suspended operation state sent by a target application process in the process of operating the application process, wherein the performance of the electronic equipment in the first operation mode is higher than that of the electronic equipment in the second operation mode.
In yet another aspect, the present application further provides an electronic device comprising at least a memory and a processor;
wherein the processor is configured to perform the control method as described in any one of the above.
The memory is used for storing programs required for the processor to perform operations.
In yet another aspect, the present application also provides a storage medium storing a program for implementing the control method as described in any one of the above when the program is executed.
According to the scheme, in the process of running the application process, if the application process sends the notification of entering the suspended running state to the operating system, the operating system controls the electronic equipment to be switched from the first running mode with higher performance to the second running mode with lower performance, and therefore resource consumption of the electronic equipment can be reduced under the condition that the application process enters the suspended state.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a control method provided herein;
FIG. 2 is a schematic flow chart diagram illustrating another embodiment of a control method provided herein;
FIG. 3 is a schematic flow chart diagram illustrating another embodiment of a control method provided herein;
FIG. 4 is a schematic flow chart diagram illustrating another embodiment of a control method provided herein;
fig. 5 is a schematic flow chart illustrating an implementation process of the control method in an application scenario;
FIG. 6 is a schematic diagram of an implementation principle of the control method in a game application scenario;
FIG. 7 is a schematic diagram illustrating a configuration of an embodiment of a control device provided in the present application;
fig. 8 is a schematic diagram of a composition architecture of an embodiment of an electronic device provided in the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be practiced otherwise than as specifically illustrated.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an embodiment of a control method according to an embodiment of the present disclosure, where the method of the present embodiment may be applied to an electronic device, and the electronic device may be a mobile phone, a tablet computer, a personal computer, or the like.
The method of the embodiment may include:
s101, in the process of running the application process, the operating system of the electronic equipment obtains a first notice of entering a suspended running state, which is sent by a target application process.
It is understood that the electronic device may install and run an application process of at least one application. The at least one application may include: at least one application can realize human-computer interaction, and resources consumed by the operation of the application are relatively more. An application that enables human-computer interaction refers to an application that is capable of receiving user input and is responsive to the user input.
For example, an application capable of human-computer interaction may output a display window into a display unit of an electronic device, so that a user may input information into the application through an application interface. For example, the application that enables human-computer interaction may be a gaming application, a virtual reality application, an entertainment application, an office application, and so forth.
During the running process of the application process, if the user leaves the electronic device, the user may control the application process to enter the suspended state by operating the electronic device, so that the application process controls itself to enter the suspended running state.
For example, a user may obtain an instruction to enter a pause by performing a preset operation such as clicking on an input component such as a mouse or a keyboard of the electronic device, and accordingly, the application process may enter a pause running state.
For another example, when the application process detects that the operation control key on the application interface corresponding to the application process is touched, for example, the "suspend/run" key is touched by the user, the application process may enter a suspend operation state.
In one possible case, if a first preset operation acting on an input section of the electronic device is obtained, the electronic device notifies the target application process to cause the target application process to enter a suspended operating state and sends a first notification of entering the suspended operating state to the operating system. For example, in a case that there is a first preset operation on an Input component of the electronic device, a Basic Input Output System (BIOS) or an Embedded Controller (EC) in the electronic device may obtain a message (or referred to as an Input event) corresponding to the first preset operation on the Input component, and notify the message to a target application process through the BIOS or the EC. The target application enters a suspended running state after obtaining the message, and sends a first notice of entering the suspended running state to an operating system.
The input component of the electronic device may be a mouse, a keyboard, a touch screen, a remote controller, or a control handle of the electronic device.
The first preset operation is used for enabling the target application process to enter a pause running state.
In this case, the target application process includes at least an application process in which the display window is currently located at the forefront of the display section of the electronic device. It can be understood that, when the target application program is at the forefront of the display component of the electronic device, the target application program can be controlled to enter the suspended running state by performing a first preset operation such as clicking through an input component such as a mouse or a keyboard.
For example, in a game application, a user may trigger control of game pause by clicking a mouse on the basis of a cursor being on a display interface of the game application.
In yet another possible implementation manner, the application process may further monitor whether a condition for entering the suspended running state is satisfied according to the operation state of the user. If the application program detects that the condition for entering the suspended running state is met currently, the suspended running state is automatically entered, and a first notice for entering the suspended running state is sent to the operating system.
If the duration that the user leaves the electronic equipment exceeds the set duration, determining that the condition of entering the pause running state is met, naturally entering the pause running state, and sending a first notice to the operating system.
For another example, if the application process does not detect the input operation of the user for more than the set time length, the application process enters a suspended running state and sends a first notification to the operating system. It can be understood that, because the application process needs to occupy memory and some hardware resources during running, if only the application process control itself is in the suspended running state, some sub-processes related to the application process are still running in the background, but the user does not see the update of the corresponding interface of the application process.
For example, the application process entering the suspended state may be the target application process suspending an update of a display window of the target application process; alternatively, all sub-processes of the target application process enter a suspended state. For example, after the target application process is suspended, the sub-process related to the updated display window can be suspended, so that the consumption of memory and hardware resources is reduced; or all the sub-processes can be suspended to reduce the consumption of hardware resources. Of course, in practical applications, it is also possible that all sub-processes of the target application process enter the suspended state while the update of the display window of the target application process is suspended.
Therefore, although the user controls the application process to enter the suspended running state, the data of the application process may still run in the background, and resources such as memory and hardware of the electronic device may still be occupied and consumed.
In order to reduce resources consumed after the application process enters the suspended running state, the application process can send a notification of entering the suspended running state to the operating system, so that the operating system can obtain that the application process enters the suspended running state; or, the operating system is informed to control the application process to enter a suspended running state.
For the sake of distinction, the application process sending the notification of entering the suspended state to the operating system is referred to as a first notification, and the application process sending the first notification is referred to as a target application process. The target application process belongs to an application process operated by the electronic equipment.
And S102, responding to the first notice, and controlling the electronic equipment to be adjusted from the current first operation mode to the second operation mode.
The performance of the electronic device in the first operation mode is higher than that in the second operation mode.
It will be appreciated that if the target application process sends a notification to the operating system to enter a suspended state of operation, this indicates that the user is not temporarily required to use the application, and possibly even the electronic device.
For example, in a case where the target application includes at least an application process in which the display window is currently located at the forefront of the display unit of the electronic device, the target application sends a notification of entering the suspended operation state to the operating system, which indicates that the user may temporarily leave the display unit of the electronic device due to leaving the electronic device, and so on.
In one possible implementation, after obtaining the first notification, the operating system or the preset driver may optimize at least system resources related to the target application process, so that the electronic device is tuned from the current first operation mode to the second operation mode.
The optimization of the system resources related to the target application process can reduce the system resources such as the memory occupied by the target application process. The specific optimization mode is not limited in the application.
Therefore, in the application, in the process of running the application process, if the application process sends a notification of entering the suspended running state to the operating system, the operating system controls the electronic device to switch from the first running mode with higher performance to the second running mode with lower performance, so that the resource consumption of the electronic device can be reduced under the condition that the application process enters the suspended running state.
Meanwhile, the service time of the battery and the service life of the electronic equipment can be prolonged by reducing the resource consumption of the electronic equipment.
In order to facilitate understanding of a specific implementation of the electronic device tuning from the current first operation mode to the second operation mode, the following description is given by taking as an example at least optimization of system resources related to the target application process.
First, a system resource optimization method is taken as an example for explanation, and as shown in fig. 2, a flowchart of another embodiment of a control method according to the present application is shown, where the method according to the present embodiment may include:
s201, in the process of running the application process, if a first preset operation acting on an input component of the electronic equipment is obtained, the target application process is notified to enable the target application process to enter a running pause state, and a first notification of entering the running pause state is sent to the operating system.
The first preset operation is used for enabling target application processes to enter a suspended running state, wherein the target application processes at least comprise application processes of which the display windows are located at the forefront of a display component of the electronic equipment currently.
For ease of understanding, the present embodiment exemplifies a case where the first notification is obtained. It will be appreciated that if the target application process obtains a virtual key, voice input or gesture input through the electronic device that acts on the target application process, the target application process may likewise enter a suspended state of operation, in which case the target application process may still send the first notification to the operating system. In the application, no matter which way the target application process enters the suspended running state, the target application process sends the first notification to an operating system of the electronic device.
S202, 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 a preset storage position.
The preset driver may be a driver in the operating system.
For example, the hardware resources occupied by the target application process may be released by suspending the target application process, and the related cache or memory resources may be released to the preset storage location.
It can be understood that, after the target application process is in the suspended running state, the consumption of hardware and memory resources caused by the fact that the target application process is still running in the memory can be reduced 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 the preset storage location.
As an optional manner, when releasing the hardware resources of the target application process and the resources such as the memory or the cache, the application may also release the hardware resources occupied by other application processes different from the target application process through the operating system or the preset driver, and release the cache resources and/or the memory resources related to the other application processes to the preset storage location.
The other application process different from the target application process may be an application process running in the foreground or an application process running in the background in the electronic device.
It can be understood that, considering that the target application process enters the suspended running state when the display window of the target application process is on the top layer of the display component of the electronic device, and the like, the user may not need to use the electronic device for the moment due to leaving the electronic device, and the like, and therefore, in this case, resources such as hardware and memory occupied by the target application process and other application processes are released, and resource consumption can be further reduced.
It will be appreciated that FIG. 2 is illustrative of one manner of optimizing at least the system resources associated with the target application process. In practical application, the optimization of the system resources related to the target application process may further be: and reducing the operation parameters of the hardware component for the target application process to operate through the operating system or the preset driver.
The operating parameters of the hardware component may affect various operating parameters of the resource consumption of the electronic device, for example, the hardware component may be a CPU, an internal memory, and the like, and accordingly, the operating parameters may be an operating speed of the CPU, a storage speed of the internal memory, and the like, required for operating the target application process.
For example, the reduction of the operating parameter of the hardware component may be performed by issuing a control instruction to the corresponding hardware component to instruct the hardware component to reduce its own operating parameter. Of course, there are other possible implementations, which are not limited.
It can be understood that, after the target application process sends the notification of entering the suspended running state to the operating system, the performance of the electronic device can be reduced by turning down the running parameters of the hardware component for the target application process to run, thereby reducing the resources required to be consumed after the target application process is suspended.
As an optional manner, after the operating system of the electronic device obtains the first notification of entering the suspended running state sent by the target application process, the optimizing the system resources related to the target application process may further be: and reducing the operation parameters of the hardware component for the target application process and other application processes different from the target application process through the operating system or the preset driver.
The operation parameters and the adjustment mode of the hardware component for other application processes to operate may refer to the above description, and are not described herein again.
It can be understood that, in the above embodiment 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 for restoring the running state sent by the target application process, the electronic device is controlled to be turned from the current second running mode to the first running mode.
Wherein the second notification actually requests a notification to resume from the suspended state to the normal state.
The performance of the electronic equipment can be improved by controlling the electronic equipment to be adjusted from the second operation mode to the first operation mode, so that the operation performance of the target application process is facilitated.
For example, the second notification that the target application process sends the running state recovery may be a notification that the target application process sends to the operating system after the target application process is switched from the suspended running state to the running state recovery, so that the operating system controls the relevant system resources required for recovering the running of the target application process to recover, and the system resources are recovered to the state before optimization, so that the target application process is recovered to the normal running state.
Similar to obtaining the first notification, in one possible implementation, if a second preset operation is obtained that acts on an input component of the electronic device, the target application process is notified to enter the resume running state and a second notification of the entry into the resume running state is sent to the operating system.
And the second preset operation is used for enabling the target application process to enter a continuous running state.
For example, the second preset operation may be clicking a designated key in a mouse or a keyboard of the electronic device. After the target application process is triggered to enter the suspended running state by clicking a mouse and other preset operations, the target application process can be triggered to recover from the suspended running state to the normal running state by clicking the mouse and other preset operations again.
The process of obtaining the second preset operation and notifying the target application process is similar to the process of obtaining the first preset operation and notifying the target application process by the electronic device, and is not described herein again.
It is understood that, if the target application process obtains the second preset operation of the virtual key acting on the display window of the target application process, the target application process also sends the second notification to the operating system in order to enable the target application process to resume normal operation.
In yet another possible implementation manner, the target application process may also enter the resume running state and send the second notification to the operating system before detecting that the user goes from leaving to returning to the electronic device or detecting an input operation of the user.
It will be appreciated that the target application process enters a suspended state of operation, which suspends the operation of updating the display interface or some of the sub-processes. If the target application process confirms that the second preset operation is detected, the target application program resumes the updating of the display interface or the running of the suspended sub-process, and meanwhile, in order to ensure that the sub-process of the target application program can run normally in the memory, the target application process sends the second notification to the operating system, so that the operating system resumes the processing related to the running of the target application program.
It is understood that after the operating system obtains the second notification, the operating system or the preset driver controlling the electronic device to adjust from the second operation mode to the first operation mode may provide a possibility for the target application process to recover to the normal operation state. Furthermore, in order to restore the target application process to the normal operation state, after the operating system obtains the second notification, the memory resource or the cache resource related to the target application process can be called back to the memory or the cache; or, the operation parameters of the hardware component for the target application process to operate are called back.
For convenience of understanding, a possible case is taken as an example for explanation, and as shown in fig. 3, a schematic flow chart of another embodiment of the control method of the present application is shown, where the method of the present embodiment may include:
s301, in the process of running the application process, the operating system of the electronic device obtains a first notification of entering a suspended running state sent by the target application process.
S302, responding to the first notice, releasing the hardware resources occupied by the target application process through the operating system or a preset driver, and releasing the related cache resources and/or memory resources to a preset storage position.
As above steps S301 and S302 can refer to the related description of the previous embodiment, and are not described herein again.
S303, if the operating system of the electronic device obtains the second notification for recovering the running state sent by the target application process, loading, by the operating system or the preset driver, at least the cache resource and/or the memory resource, which are released to the preset storage location and are related to the target application process, to the cache and/or the memory of the electronic device.
In this embodiment, after the target application process enters the suspended running state and sends the first notification to the operating system, the operating system or the preset driver releases one or both of the cache resource and the memory resource related to the target application process to the preset storage location, so as to suspend the target application process. In the case that the normal operation state of the target application process needs to be recovered, the operating system or the preset driver reloads the cache or the memory resource associated with the target application process in the preset storage location to the cache and/or the memory, so that the target application process can operate normally again.
Wherein the resources reloaded into the cache and/or memory may remain consistent with the cache and/or memory resources associated with the target application process prior to the release.
If only the memory resource exists before the target application process is suspended, releasing the memory of the target application process to the preset storage position when the target application process is suspended. Correspondingly, when the normal operation of the target application process needs to be recovered, the memory resource of the target application process in the preset storage position can be loaded into the memory.
It is understood that, after the cache and/or memory resources related to the target application process are reloaded to the cache and/or memory resources, the hardware resources occupied by the target application process may also be recovered.
In an optional manner, if, while releasing the cache resource and/or the memory resource related to the target application process to the preset storage location, the cache resource and/or the memory resource related to another application process other than the target application process is also released to the preset storage location, while performing step S303, the cache resource and/or the memory resource of another application process other than the target application process in the preset storage location may also be reloaded into the cache and/or the memory.
It can be understood that, in this embodiment, after the second notification is obtained, the electronic device is still controlled to be adjusted from the current second operation mode to the first operation mode. On the basis, the released resources corresponding to the target application process are reloaded into the memory or the cache, so that the target application process can be more reliably ensured to be recovered to a normal operation state.
Taking the second notice that the electronic device recalls the operation parameters of the hardware component for the target application to operate as an example, as shown in fig. 4, it shows a flowchart of another embodiment of the control method according to the present application, where the method according to this embodiment may include:
s401, in the process of running 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 or a preset driver is used for reducing the running parameters of the hardware component for running the target application process.
For the process of obtaining the first notification, reference may be made to the related description of the foregoing embodiment, and details are not described herein.
S402, if a second preset operation acting on the input component of the electronic equipment is obtained, the target application process is informed, so that the target application process enters a running recovery state, and a second notice of entering the running recovery state is sent to the operating system.
For convenience of understanding, the embodiment takes the example of triggering the target application process to enter the recovery running state through the second preset operation acting on the input component of the electronic device, but the application is also applicable to other cases mentioned above, and the application is not limited to this.
And S403, responding to the second notice, and calling back the running parameters of the hardware component for the target application process to run through the operating system or the preset driver.
In this embodiment, if the target application process enters the suspended running state, the operating system or a driver preset by the operating system at least reduces the running parameters of the hardware component run by the target application process, so as to reduce the resources still required to be consumed when the target application process enters the suspended running state. Correspondingly, when the running state of the target application process needs to be recovered, the running parameters of the corresponding hardware component can be called back so as to meet the normal running requirement of the target application process.
In an optional implementation manner, if the operating system reduces the operating parameters of the hardware components for the target application process and the other application processes except the target application process through the operating system or the preset driver after obtaining the first notification, the operating system may call back the operating parameters of the hardware components for the target application process and the other application processes to run through the operating system or the preset driver after obtaining the second notification.
It should be noted that, in this embodiment, after the second notification is obtained, the electronic device may still be controlled to be adjusted from the current second operation mode to the first operation mode.
It is to be understood that, in any of the above embodiments of the present application, after the operating system obtains the first notification, if no notification is obtained or a third preset operation acting on the electronic device is obtained within a preset time period, the electronic device may be further controlled to be turned from the current second operation mode to the third operation mode. Wherein the power consumption of the electronic device in the second operation mode is higher than the power consumption of the electronic device in the third operation mode.
For example, in the second operation mode, the operation of the target application process in the memory may be suspended, and if the long-time operating system does not receive any notification or detects any operation, it indicates that the user does not operate the electronic device for a relatively long time, in this case, the electronic device may be adjusted to a lower-function sleep mode, and the like.
To facilitate understanding of the solution of the present application, the following description is made in connection with an application scenario. Take the example that the running application process comprises a game process of a game application. As shown in fig. 5, which shows a flowchart interaction schematic diagram of a control method applied to a game scene in the present application, the method of this embodiment is applied to an electronic device, where the electronic device runs at least one game application, and may include:
s501, in the process of running the game application process, if a first preset operation acting on an input component of the electronic equipment is obtained, the game application process is informed.
In this embodiment, the display window of the game application process is currently located at the forefront of the display section of the electronic device. In this case, after the electronic device detects a first preset operation of an input means such as a mouse or a keyboard, the operating system may notify the game progress that the first preset operation exists.
S502, the game application process suspends the updating of the display window.
In this embodiment, the game application process may confirm that the user inputs an instruction to pause the game based on the first preset operation, and in this case, the game application controls itself to enter a pause state, and stops updating the game data to the display window (game window).
For example, a cursor is positioned on a game window of a running game application through a mouse, and a first preset operation for triggering the game window to pause is generated through mouse click. Or clicking on a game window of the game application in operation through the touch screen, so that the operating system detects the first preset operation.
S503, the game application process sends a first notice of entering a suspended running state to the operating system.
When the game application process receives a pause instruction input by a user, only the data updating of the game window is paused by the game application process, the operating system cannot acquire that the game is paused, and the game application process still runs in the memory and still needs to consume resources such as the memory.
Based on this, in the application, the game application sends a notification of entering the suspended running state to the operating system while suspending updating of the display window, so that the operating system can control the running of the game application process in the suspended memory.
S504, the operating system releases the memory resource related to the game application process to a preset storage position.
For example, the operating system may temporarily tune the game application process away from memory by suspending the game application process.
It can be understood that, for the stand-alone game, the data interaction with the server side is not involved in the game running process, and in this case, all memory resources related to the game application process can be released to the preset storage location, so that all sub-processes of the game application process in the memory stop running.
If the game application is an online network game or the like, in order to ensure that the game can be communicated with the server so that the game can still be synchronized with the data of the server after being recovered from the suspended state to the normal state, the method and the device can release memory resources related to other processes except for the process responsible for data communication processing in the game application process, and only run the process responsible for data communication processing in the memory.
Referring to fig. 6, the scheme of the present application is applied to a game scene to realize a schematic diagram.
In fig. 6, in a game scene, a pause key for pausing and resuming a game is provided in a handle or a keyboard for controlling a game operation.
If the user wishes to pause the game, the pause key in the handle or keyboard may be clicked, in which case the BIOS or EC of the electronic device may sense the event that the pause key is touched and notify the gaming application process.
And after obtaining the notice that the pause key is touched, 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 to enter a suspended state of operation. In this case, the operating system or a preset driver (not shown) may control the game application process running in the suspended memory, that is, release the memory resources of the game application process in the memory to a preset storage location.
Of course, in this embodiment, after the operating system obtains the first notification, the hardware parameter of the hardware device for the game application process to run may also be reduced through the operating system or the preset driver. For example, the CPU dominant frequency can be reduced; and hardware parameters of related hardware such as CPU main frequency and the like can be reduced while the related memory resources of the game process in the memory are released to a preset position.
And S505, if the operating system obtains a second preset operation acting on the input component of the electronic equipment, informing the target application process.
S506, the game application process enters the running recovery state and sends a second notice of entering the running recovery state to the operating system.
And the second preset operation is used for enabling the target application process to enter a continuous running state.
For example, in the case that the game window is clicked by a mouse to pause the game window of the game application, the game window may also be clicked by the mouse to enable the operating system to detect the second preset operation and notify the game application, so that the game application suspends the execution of the pause operation for pausing the update of the game window, and in order to enable the relevant process of the game application to still run in the background, the operating system needs to be notified to enable the operating system to recall the suspended game application process to the memory.
And S507, loading at least the memory resource which is released to the preset storage position and is related to the target application process to the memory of the electronic equipment through the operating system or the preset driver.
Research shows that compared with the existing game application which detects that the first prediction operation only pauses the updating of the game window, the scheme of the embodiment can reduce the CPU utilization rate of the electronic equipment from about 67% to about 3%, and greatly reduces the consumption of memory resources and hardware resources such as CPU.
The application also provides a control device corresponding to the control method.
As shown in fig. 7, which shows a schematic structural diagram of an embodiment of a control device according to the present application, the device of the present embodiment may include:
a notification receiving unit 701, configured to obtain, by an operating system, a first notification of entering a suspended running state sent by a target application process;
a mode control unit 702, configured to, during running of an application process, if an operating system of an electronic device obtains a first notification sent by a target application process to enter a suspended running state, control the electronic device to switch from a current first running mode to a second running mode, where a performance of the electronic device in the first running mode is higher than that in the second running mode.
In a possible implementation manner, the notification receiving unit is specifically configured to notify the target application process if a first preset operation acting on an input component of the electronic device is obtained, so that the target application process enters a suspended running state and sends a first notification of entering the suspended running state to the operating system, where the first preset operation is used to cause the target application process to enter the suspended running state, and 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.
Optionally, the entering of the target application process into the suspended running state includes:
all sub-processes of the target application process enter a pause running state; and/or the presence of a gas in the atmosphere,
the update of the display window of the target application process is suspended.
In yet another possible implementation, the mode control unit includes:
and the resource optimization unit is used for optimizing at least system resources related to the target application process by the operating system or a preset driver if the operating system of the electronic equipment obtains a first notice of entering a suspended running state sent by the target application process in the process of running the application process, so that the electronic equipment is adjusted from the current first running mode to the second running mode.
In an alternative, the resource optimization unit includes:
the first resource releasing unit is used for releasing hardware resources occupied by a target application process through an operating system or a preset driving program and releasing related cache resources and/or memory resources to a preset storage position if the operating system of the electronic equipment obtains a first notice of entering a suspended running state sent by the target application process in the process of running the application process;
alternatively, the first and second electrodes may be,
a second resource releasing unit, configured to, in a process of running an application process, if an operating system of the electronic device obtains a first notification sent by a target application process to enter a suspended running state, release, by the operating system or a preset driver, hardware resources occupied by the target application process and other application processes different from the target application process, and release related cache resources and/or memory resources to a preset storage location;
alternatively, the first and second electrodes may be,
the first parameter reducing unit is used for reducing the operation parameters of the hardware component for the target application process to operate through the operating system or a preset driver;
alternatively, the first and second electrodes may be,
and the second parameter reducing unit is used for reducing the operation parameters of the hardware component for the target application process and other application processes different from the target application process through the operating system or a preset driver.
In a possible implementation manner, in any one of the above apparatus embodiments, the method further includes:
and the mode callback unit is used for controlling the electronic equipment to be called from the current second running mode to the first running mode if the operating system of the electronic equipment obtains a second notice of recovering the running state sent by the target application process after the first notice is obtained.
In an alternative, the mode callback unit includes:
a notification obtaining subunit, configured to, after obtaining the first notification, notify the target application process if a second preset operation acting on an input component of the electronic device is obtained, so that the target application process enters a running recovery state and send a second notification of entering the running recovery state to the operating system, where the second preset operation is used to cause the target application process to enter a running continuation state;
and the mode callback subunit is used for controlling the electronic equipment to be called from the current second operation mode to the first operation mode if the operating system obtains the second notification.
In an alternative, the apparatus further comprises:
the first mode callback subunit is configured to, after obtaining the first notification, if an operating system of the electronic device obtains a second notification, which is sent by a target application process and used for recovering an operating state, load, by the operating system or a preset driver, at least the cache resource and/or the memory resource, which are released to a preset storage location and are related to the target application process, into a memory and/or a cache of the electronic device;
or the like, or, alternatively,
and the second mode callback subunit is used for, after obtaining the first notification, if an operating system of the electronic equipment obtains a second notification for recovering the running state sent by the target application process, calling back the running parameters of the hardware component for running the target application process through the operating system or a preset driver.
In another possible implementation manner, any one of the apparatuses above in this application further includes:
and the mode changing unit is used for controlling the electronic equipment to be changed to a third running mode from the current second running mode if no notice is obtained or a third preset operation acting on the electronic equipment is obtained within a preset time period after the first notice is obtained, wherein the power consumption of the electronic equipment in the second running mode is higher than that of the electronic equipment in the third running mode.
In another aspect, the present application further provides an electronic device, which may be the specific structure of the aforementioned second electronic device. As shown in fig. 8, which shows a schematic view of a composition structure of an electronic device according to the present application, the electronic device of the present embodiment at least includes: a processor 801 and a memory 802.
Wherein the processor is configured to execute the control method of any of the above embodiments.
The memory is used for storing programs required for the processor to perform operations.
The memory may also be used for an operating system, BIOS programs, and the like.
It will be appreciated that the electronic device may also include other components, as shown in fig. 8, a display 803, an input device 804 to which the electronic device is connected, and a communication bus 805. The processor, memory and display and input device may be connected by a communication bus.
Of course, the electronic device may also include more or less components than those shown in fig. 8, which is not limited in this regard.
In still another aspect, the present application further provides a storage medium storing a program for implementing the control method according to any one of the above embodiments when the program is executed.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. Meanwhile, the features described in the embodiments of the present specification may be replaced or combined with each other, so that those skilled in the art can implement or use the present application. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A control method, comprising:
in the process of running the application process, if an operating system of the electronic equipment obtains a first notice of entering a suspended running state sent by a target application process, the electronic equipment is controlled to be switched from a current first running mode to a second running mode, wherein the performance of the electronic equipment in the first running mode is higher than that of the electronic equipment in the second running mode.
2. The method of claim 1, wherein obtaining, by an operating system of the electronic device, a first notification from the target application process to enter a suspended state of operation comprises:
and if a first preset operation acting on an input component of the electronic equipment is obtained, the first preset operation is used for enabling the target application process to enter a suspended running state, informing the target application process so as to enable the target application process to enter the suspended running state, and sending a first notice of entering the suspended running state to the operating system, wherein the target application process at least comprises an application process of which a display window is positioned at the forefront of a display component of the electronic equipment currently.
3. The method of claim 2, wherein the target application process entering a suspended state of operation comprises:
all sub-processes of the target application process enter a pause running state; and/or the presence of a gas in the atmosphere,
the update of the display window of the target application process is suspended.
4. The method of claim 1, wherein controlling the electronic device to change from the current first mode of operation to the second mode of operation comprises:
after obtaining the first notification, optimizing, by the operating system or a preset driver, at least system resources related to the target application process so that the electronic device is adjusted from the current first operation mode to the second operation mode.
5. The method of claim 4, wherein optimizing, by the operating system or a preset driver, at least system resources associated with the target application process comprises:
releasing hardware resources occupied by the target application process through the operating system or a preset driver, and releasing related cache resources and/or memory resources to a preset storage position; or the like, or, alternatively,
releasing 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 driving program, and releasing related cache resources and/or memory resources to a preset storage position; or the like, or, alternatively,
the operating parameters of the hardware components for the target application process to run are reduced through the operating system or a preset driver; or the like, or, alternatively,
and reducing the operation parameters of the hardware component for the target application process and other application processes different from the target application process through the operating system or a preset driver.
6. The method according to any one of claims 1 to 5, wherein after obtaining the first notification, if an operating system of the electronic device obtains a second notification for restoring the running state sent by the target application process, the electronic device is controlled to be adjusted from the current second running mode to the first running mode.
7. The method of claim 6, wherein obtaining, by the operating system of the electronic device, the second notification from the target application process to restore the running state comprises:
and if a second preset operation acting on an input component of the electronic equipment is obtained, the second preset operation is used for enabling the target application process to enter a continuous running state, informing the target application process, enabling the target application process to enter a running recovery state and sending a second notice of entering the running recovery state to the operating system.
8. The method of claim 7, wherein after obtaining the second notification to resume the running state sent by the target application process, further comprising:
loading at least the cache resources and/or the memory resources related to the target application process, which are released to a preset storage position, to a memory and/or a cache of the electronic device through the operating system or a preset driver; or the like, or, alternatively,
and calling back the running parameters of the hardware component for the target application process to run through the operating system or a preset driver.
9. The method of 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 be adjusted from the current second operation mode to a third operation mode, wherein the power consumption of the electronic device in the second operation mode is higher than that in the third operation mode.
10. A control device, comprising:
the notification receiving unit is used for obtaining a first notification of entering a suspended running state sent by a target application process through an operating system;
and the mode control unit is used for controlling the electronic equipment to be adjusted to a second operation mode from a current first operation mode if an operating system of the electronic equipment obtains a first notice of entering a suspended operation state sent by a target application process in the process of operating the application process, wherein the performance of the electronic equipment in the first operation mode is higher than that of the electronic equipment in the second operation mode.
CN202011190334.1A 2020-10-30 2020-10-30 Control method and device Pending CN112306714A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011190334.1A CN112306714A (en) 2020-10-30 2020-10-30 Control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011190334.1A CN112306714A (en) 2020-10-30 2020-10-30 Control method and device

Publications (1)

Publication Number Publication Date
CN112306714A true CN112306714A (en) 2021-02-02

Family

ID=74332793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011190334.1A Pending CN112306714A (en) 2020-10-30 2020-10-30 Control method and device

Country Status (1)

Country Link
CN (1) CN112306714A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113031868A (en) * 2021-03-24 2021-06-25 联想(北京)有限公司 Control method and device of memory

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5696897A (en) * 1994-01-31 1997-12-09 Sun Microsystems, Inc. Method and apparatus for a multi-layer system quiescent suspend and resume operation
CN101395894A (en) * 2006-03-03 2009-03-25 日本电气株式会社 Mobile telephone and application program
CN105677141A (en) * 2015-12-29 2016-06-15 深圳市金立通信设备有限公司 Application program management method and terminal
CN106292994A (en) * 2016-07-25 2017-01-04 北京小米移动软件有限公司 The control method of virtual reality device, device and virtual reality device
CN111045824A (en) * 2019-12-12 2020-04-21 Oppo广东移动通信有限公司 Application control method and device, electronic equipment and computer readable medium
CN107735772B (en) * 2016-04-22 2020-07-07 华为技术有限公司 Data writing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5696897A (en) * 1994-01-31 1997-12-09 Sun Microsystems, Inc. Method and apparatus for a multi-layer system quiescent suspend and resume operation
CN101395894A (en) * 2006-03-03 2009-03-25 日本电气株式会社 Mobile telephone and application program
CN105677141A (en) * 2015-12-29 2016-06-15 深圳市金立通信设备有限公司 Application program management method and terminal
CN107735772B (en) * 2016-04-22 2020-07-07 华为技术有限公司 Data writing method and device
CN106292994A (en) * 2016-07-25 2017-01-04 北京小米移动软件有限公司 The control method of virtual reality device, device and virtual reality device
CN111045824A (en) * 2019-12-12 2020-04-21 Oppo广东移动通信有限公司 Application control method and device, electronic equipment and computer readable medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢素芬: "基于PROFINET的节能技术PROFlenergy-节能技术新趋势", 仪器仪表标准化与计量, no. 6, pages 36 - 39 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113031868A (en) * 2021-03-24 2021-06-25 联想(北京)有限公司 Control method and device of memory

Similar Documents

Publication Publication Date Title
AU2019204911B2 (en) Terminal control method and apparatus, and terminal
US9116704B1 (en) Delaying the initiation of transitioning to a lower power mode by placing a computer system into an intermediate power mode between a normal power mode and the lower power mode
US9880606B2 (en) Method and apparatus for wake-up control of intelligent terminal
KR101818577B1 (en) Operation Method For Saving Power Consumption during a Communication Service And Portable Device supporting the same
CN107231679B (en) Data packet processing method and mobile terminal
JP5915406B2 (en) Control method of portable terminal device, control program, and portable terminal device
CN108762831B (en) Application program preloading method and device, storage medium and terminal
US20110185209A1 (en) Computer that reduces power consumption while maintaining a specific function
CN103207659B (en) Switching method and electronic equipment
JP2013516712A (en) System and method for dynamically controlling a processor
WO2011066715A1 (en) Method and device for processing tasks of portable apparatus and portable apparatus
CN107861602B (en) Terminal CPU performance control method, terminal and computer readable storage medium
CN104156223A (en) Application program control method and device for mobile terminal
CN102156534A (en) Hardware energy-saving processing method and device
CN104252203B (en) Electronic device, method for controlling electronic device, and program
JP5696603B2 (en) Computer system, power control method and program for computer system
CN112306714A (en) Control method and device
CN108549575B (en) Processing method and device for quitting split screen, storage medium and electronic equipment
CN113609107A (en) Database management method and device, electronic equipment and storage medium
CN107608521B (en) Touch screen failure processing method, storage medium and mobile terminal
CN103533588A (en) Method for switching current operation application in sub machine to host machine for operation, and mobile terminal for method
CN102044201B (en) Device and method for constant brightness display of mobile equipment screen
CN114090270B (en) Thread management method and device, electronic equipment and computer readable storage medium
US20140289545A1 (en) Information processing apparatus and method of controlling information processing apparatus
CN109673043B (en) Control method and device of split type electronic equipment, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination