WO2023116415A1 - 一种应用程序的抑制方法和电子设备 - Google Patents

一种应用程序的抑制方法和电子设备 Download PDF

Info

Publication number
WO2023116415A1
WO2023116415A1 PCT/CN2022/136878 CN2022136878W WO2023116415A1 WO 2023116415 A1 WO2023116415 A1 WO 2023116415A1 CN 2022136878 W CN2022136878 W CN 2022136878W WO 2023116415 A1 WO2023116415 A1 WO 2023116415A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
application
windows
electronic device
invisible
Prior art date
Application number
PCT/CN2022/136878
Other languages
English (en)
French (fr)
Inventor
郭晨阳
尹剑锋
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023116415A1 publication Critical patent/WO2023116415A1/zh

Links

Images

Classifications

    • 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/3243Power saving in microcontroller unit
    • 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
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • Embodiments of the present invention relate to the technical field of electronic equipment, and in particular, to a method for suppressing an application program and electronic equipment.
  • the existing application suppression method is usually that the electronic device identifies the first application that occupies too much computer resources, and adjusts the process priority of the first application, thereby reducing application lag.
  • the application program suppression method, device, and electronic device provided in the embodiments of the present application reduce resource consumption by applications that are invisible to users, and further solve the problem of application freeze.
  • the embodiment of the present application provides a method for suppressing an application program.
  • the execution subject of the method may be an electronic device, or a component (for example, a chip, a chip system or a processor, etc.) located in the electronic device.
  • the following description is made by taking the execution subject as an example of an electronic device.
  • the electronic device includes multiple application windows, and the method may include: monitoring the multiple application windows. When it is monitored that at least one application window in the plurality of application windows changes, the window information of the plurality of application windows is traversed. According to the window information and filtering rules of the multiple application windows, the window states of the multiple application windows are obtained. Wherein, the window state includes an invisible state, and the application windows that meet the filter rule are in the invisible state. According to the window states of multiple application windows, perform GPU suppression on at least one first application or first process; wherein, all application windows corresponding to the first application are in an invisible state, and all application windows corresponding to the first process are in an invisible state. visible status.
  • the electronic device will determine the application window that is invisible to the user.
  • performing GPU suppression on the first application or, when all windows of the first process are invisible to the user, performing GPU suppression on the first process can be effective Prevent the application or process from occupying the resources of the electronic device, reduce the waste of resources, and then solve the problem of application freeze.
  • the plurality of application windows may include at least one first window and at least one second window.
  • the first window is in an invisible state
  • at least one second window is a window except all the first windows among the plurality of application windows.
  • the method may further include: obtaining at least one third window according to window information of at least two second windows; wherein, the third window is obtained by at least two second windows A window in which at least one of the two windows is completely blocked. Make sure that the third window is invisible. In this way, the electronic device can further filter out the blocked windows of the at least two second windows, further reducing waste of resources.
  • At least one third window is obtained according to the window information of at least two second windows, specifically: according to the window information of at least two second windows, the In the orientation of the screen, an arrangement sequence of at least two second windows is determined. According to the window information and arrangement order of at least two second windows, it is determined that the first target application window is being projected within the scope of the second target application window, and the first target application window is arranged behind the second target application window. Determine the first target application window as the third window.
  • the first filtering rule includes at least one of the following: a window whose position is outside the area of the desktop window; a window whose size is smaller than or equal to the first threshold; a shadow window of one of the multiple application windows ;The window whose attribute is the target attribute; or the window whose attribute is the attribute of the owned window and whose display range does not exceed the display range of the owning window.
  • the target attribute may include at least one of a hidden attribute, an invisible attribute, a transparent attribute, and a sub-window attribute.
  • the method may further include: when it is monitored that at least one window in the first application or the first process is switched to a preview window, releasing the GPU inhibition of the first process or the first application.
  • the method may further include: minimizing all application windows that are in an invisible state, so that the resource consumption of the electronic device (such as the resources of the graphics processor) will be significantly reduced, so as to reduce the resource consumption of the electronic device. purpose of consumption.
  • the embodiment of the present application and the above-mentioned embodiment may be two sets of technical solutions in parallel, or may be a further limitation of the above-mentioned embodiment.
  • the embodiments of this application do not make specific limitations.
  • the change of at least one application window includes at least one of the following: the position of at least one application window changes, the state of at least one application window changes, and the size of at least one window changes.
  • the embodiment of the present application provides an application suppression device, which is applied to an electronic device, and the electronic device may include multiple application windows, and the device may include: a monitoring unit, configured to monitor the multiple application windows.
  • the traversal unit is configured to traverse window information of multiple application windows when at least one of the multiple application windows is monitored to change.
  • the first obtaining unit is configured to obtain window states of multiple application windows according to the window information and filtering rules of the multiple application windows. Wherein, the window state includes an invisible state, and the application windows that meet the filter rule are in the invisible state.
  • the suppression unit is configured to perform GPU suppression on at least one first application or first process according to the window states of multiple application windows. Wherein, all application windows corresponding to the first application are in an invisible state, and all application windows corresponding to the first process are in an invisible state.
  • the electronic device will determine the application window that is invisible to the user.
  • performing GPU suppression on the first application or, when all windows of the first process are invisible to the user, performing GPU suppression on the first process can be effective Prevent the application or process from occupying the resources of the electronic device, reduce the waste of resources, and then solve the problem of application freeze.
  • the plurality of application windows may include at least one first window and at least one second window.
  • the first window is in an invisible state
  • at least one second window is a window except all the first windows among the plurality of application windows.
  • the device may further include: a second obtaining unit, configured to obtain at least one third window according to window information of at least two second windows.
  • the third window is a window completely blocked by at least one window in the at least two second windows.
  • the first determining unit is configured to determine that the third window is in an invisible state. In this way, the electronic device can further filter out the blocked windows of the at least two second windows, further reducing waste of resources.
  • the second acquisition unit is further configured to: determine the arrangement of at least two second windows in a direction perpendicular to the display screen and projecting out of the display screen according to the window information of the at least two second windows order. According to the window information and arrangement order of at least two second windows, it is determined that the first target application window is being projected within the scope of the second target application window, and the first target application window is arranged behind the second target application window. Determine the first target application window as the third window.
  • the first filtering rule includes at least one of the following: a window whose position is outside the area of the desktop window; a window whose size is smaller than or equal to the first threshold; a shadow window of one of the multiple application windows ;The window whose property is the target property; or, the property is the property of the owned window, and the display range does not exceed the display range of the owning window.
  • the target attribute may include at least one of a hidden attribute, an invisible attribute, a transparent attribute, and a sub-window attribute.
  • the device may further include: a release unit, configured to release the GPU for the first process or the first application when it is monitored that at least one window in the first application or the first process is switched to a preview window. inhibition.
  • a release unit configured to release the GPU for the first process or the first application when it is monitored that at least one window in the first application or the first process is switched to a preview window. inhibition.
  • the apparatus may further include: a processing unit, configured to minimize all application windows that are in an invisible state, so that resource consumption of the electronic device (such as resources of a graphics processor) will be significantly reduced, reaching The purpose of reducing resource consumption of electronic equipment.
  • a processing unit configured to minimize all application windows that are in an invisible state, so that resource consumption of the electronic device (such as resources of a graphics processor) will be significantly reduced, reaching The purpose of reducing resource consumption of electronic equipment.
  • the change of at least one application window includes at least one of the following: the position of at least one application window changes, the state of at least one application window changes, and the size of at least one window changes.
  • the embodiment of the present application provides an electronic device, which may include: one or more processors; and a memory, in which codes are stored; when the codes are processed by the one or more When executed by a device, the electronic device is made to execute the method as described in the first aspect.
  • the embodiment of the present application provides a chip system, and the chip system is applied to an electronic device.
  • the chip system includes one or more interface circuits and one or more processors; the interface circuits and processors are interconnected by lines; the interface circuits are used to receive signals from the memory of the electronic device and send signals to the processor, and the signals include Stored computer instructions; when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, including computer instructions, and when the computer instructions are run on an electronic device, the electronic device is made to execute the method as described in the first aspect.
  • the embodiment of the present application provides a computer program product, when the computer program product runs on a computer, the computer executes the method as described in the first aspect
  • the electronic device monitors multiple application windows.
  • the electronic device traverses the window information of the multiple application windows.
  • the electronic device obtains the window states of the multiple application windows according to the window information and filtering rules of the multiple application windows.
  • the window state includes the invisible state, and the application windows that meet the filtering rules are in the invisible state.
  • the electronic device performs GPU suppression on at least one first application or first process according to window states of multiple application windows. Wherein, all application windows corresponding to the first application are in an invisible state, and all application windows corresponding to the first process are in an invisible state. In this way, once the application window changes, the electronic device will determine the application window that is invisible to the user.
  • performing GPU suppression on the first application or, when all windows of the first process are invisible to the user, performing GPU suppression on the first process can be effective Prevent the application or process from occupying the resources of the electronic device, reduce the waste of resources, and then solve the problem of application freeze.
  • FIG. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an application suppression method provided in an embodiment of the present application.
  • FIG. 4 is a schematic flow diagram of a window monitoring provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of an application scenario of a method for suppressing an application provided by an embodiment of the present application
  • FIG. 6 is a schematic flowchart of an application scenario of a method for suppressing an application provided by an embodiment of the present application
  • FIG. 7 is a schematic interface diagram of an electronic device provided in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an interface of an electronic device provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, “plurality” means two or more.
  • Process lasso is a unique systematic tool for debugging process level. Its main function is to dynamically adjust the priority of each process based on its special algorithm to achieve the purpose of system load reduction.
  • the suppression method currently applied is usually: Electronic Device Start Pro.
  • the electronic device displays the interface of the Pro.
  • the electronic device identifies the first application that occupies too much computer resources, and uses Pro to adjust the process priority of the first application level, thereby reducing app lag.
  • the electronic device only finds the first application according to the utilization rate of the CPU, and adjusts the process priority of the first application. If the first application is in a state invisible to the user, the first application still occupies resources of the electronic device, and there is still a problem of application freezing.
  • the electronic device monitors multiple application windows.
  • the electronic device traverses the window information of the multiple application windows.
  • the electronic device obtains the window states of the multiple application windows according to the window information and filtering rules of the multiple application windows.
  • the window state includes an invisible state, and the application windows that meet the filter rule are in the invisible state.
  • the electronic device performs graphics processing unit (graphics processing unit, GPU) suppression on at least one first application or first process according to window states of multiple application windows. Wherein, all application windows corresponding to the first application are in an invisible state, and all application windows corresponding to the first process are in an invisible state.
  • the electronic device will determine the application window that is invisible to the user.
  • performing GPU suppression on the first application or, when all windows of the first process are invisible to the user, performing GPU suppression on the first process can be effective Prevent the application or process from occupying the resources of the electronic device, reduce the waste of resources, and then solve the problem of application freeze.
  • the electronic device may also minimize all application windows that are in an invisible state. In this way, all application windows are minimized, so that the resource consumption of the electronic device (such as the resource of the graphics processor) is significantly reduced, and the purpose of reducing the resource consumption of the electronic device is achieved.
  • the GPU suppression of the first application or the GPU suppression of the first process may be replaced by: minimizing the first application or all application windows corresponding to the first process, or minimizing all Minimize application windows that are not visible.
  • the electronic device performs GPU suppression on the first application, specifically, the electronic device suppresses a process of the first application.
  • the electronic device suppresses the rendering process of the first application. In this way, rendering and compositing operations performed by applications that are invisible to the user are effectively reduced, resource consumption of the graphics processor is reduced, and resource waste is reduced.
  • the electronic device may also optimize the resources of the hardware unit corresponding to the first application.
  • the electronic device clears the cache of the first application in the memory.
  • the electronic device instructs the graphics processor to release resources occupied by the first application.
  • the electronic device can prevent applications invisible to the user from occupying too many resources, reduce waste of resources, and enable applications visible to the user to obtain more resources, thereby reducing stalling of applications visible to the user.
  • it can effectively reduce the heating of the whole electronic equipment and reduce the noise.
  • the electronic device may further filter the remaining windows, so as to filter out the windows that are completely blocked.
  • the multiple application windows include at least one first window and at least one second window.
  • the first window is an invisible window determined based on the filtering rule
  • at least one second window is a window except all the first windows among the plurality of application windows.
  • the method may further include: the electronic device obtains at least one third window according to window information of at least two second windows.
  • the third window is a window completely blocked by at least one of the at least two second windows.
  • the electronic device determines that the third window is in an invisible state. In this way, the electronic device can further filter out the blocked windows of the at least two second windows, further reducing waste of resources.
  • FIG. 1 is a structural block diagram of the above-mentioned electronic device.
  • the electronic device 100 may include a processor 110, a memory 120, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna, and a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a button 180, a display screen 150, and the like.
  • a processor 110 a memory 120
  • a universal serial bus (universal serial bus, USB) interface 130
  • a charging management module 140
  • a power management module 141
  • a battery 142
  • an antenna and a wireless communication module 160
  • an audio module 170 an audio module 170
  • speaker 170A a speaker 170A
  • a receiver 170B a microphone 170C
  • a headphone jack 170D a button 180
  • a display screen 150 and the like.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I1C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I1S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I1C integrated circuit
  • I1S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the memory 120 , the display screen 150 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by an antenna, a wireless communication module 160, a modem processor, a baseband processor, and the like.
  • Antennas are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antennas can be multiplexed as diversity antennas for wireless LANs. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 150 .
  • the modem processor may be a stand-alone device. In some other embodiments, the modem processor can be independent from the processor 110, or other functional modules can be set in the same device.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and convert it into electromagnetic wave and radiate it through the antenna.
  • the antenna of the electronic device 100 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR techniques, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code division multiple access
  • LTE long term evolution
  • BT GNSS
  • WLAN NFC
  • FM FM
  • IR techniques
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou navigation satellite system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 150 , and an application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 150 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 150 is used to display images, videos and the like.
  • the display screen 150 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 150 , where N is a positive integer greater than 1.
  • display screen 150 displays multiple application windows.
  • the electronic device 100 can realize the shooting function through an ISP, a camera, a video codec, a GPU, a display screen 150 and an application processor.
  • the ISP is used to process the data fed back by the camera. For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the electronic device 100 may include 1 or N cameras, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG1, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the memory 120 may be used to store computer-executable program code, which includes instructions.
  • the memory 120 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the memory 120 and/or instructions stored in the memory provided in the processor.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Speaker 170A also referred to as a "horn" is used to convert audio electrical signals into sound signals.
  • Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the receiver 170B can be placed close to the human ear to receive the voice.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 170C to make a sound, and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 may be provided with two microphones 170C, which may also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, so as to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions, etc.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the keys 180 include a power key, a volume key and the like.
  • the key 180 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the electronic device 100 may also include other functional units, which is not limited in this embodiment of the present application.
  • the electronic device 100 may be a desktop computer, a portable computer, a network server, a tablet computer, a wireless electronic device, an embedded device, a chip system or a device having a structure similar to that shown in FIG. 1 .
  • the composition structure shown in FIG. 1 does not constitute a limitation to the electronic device.
  • the electronic device may include more or less components than those shown in the illustration, or combine certain components , or different component arrangements.
  • system-on-a-chip may be composed of chips, or may include chips and other discrete devices.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the software structure of the electronic device 100 is exemplarily described by taking a windows system with a layered architecture as an example.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the windows system can be divided into three layers, which are application program layer, application program framework layer, and kernel layer from top to bottom.
  • the application layer can consist of a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include window managers, content providers, view systems, phone managers, resource managers, notification managers, and so on.
  • the application framework layer may also include window monitoring means, filtering means and restraining means.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on.
  • the view system can be used to build applications.
  • a display interface can consist of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 . For example, the management of call status (including connected, hung up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompting text information in the status bar issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
  • the window monitoring means is used to monitor the window information of the application program, and when the monitored window changes, it sends a notification message to the filtering means, and the notification message is used to notify the filtering means to perform window filtering.
  • the filtering means is used for filtering windows invisible to the user according to the notification message sent by the window monitoring means, and notifying the suppression means of the windows invisible to the user.
  • the filtering means may also be used to inform the restraining means of the first application or the first process that all windows of the first application are windows invisible to the user, and all windows of the first process are windows invisible to the user. Wherein, invisible to the user may be understood as being invisible to the user with naked eyes.
  • the suppressing device is used for suppressing the first application or the first process.
  • the suppression means may be used to perform GPU suppression on the first application or the first process.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
  • the window monitoring device at the application architecture layer monitors the application windows at the application program layer.
  • the window monitoring device sends a notification message indicating that the application window has changed to the filtering device.
  • the filtering device filters the windows invisible to the user according to the notification message, and sends the window information (such as identification information or API) to the suppressing device.
  • the suppressing means suppresses the first application (all windows of the first application are windows invisible to the user) or the first process (all windows of the first process are windows invisible to the user).
  • the suppression device calls the API of the first application, and runs the hook function loaded on the API, and then calls the kernel layer to suppress and start the display driver, start the audio driver, and play audio through the audio module 170 .
  • a method for suppressing an application program provided in an embodiment of the present application may be executed by an electronic device.
  • the electronic device is installed with a Windows operating system as an example for description.
  • FIG. 3 is a schematic flowchart of a method for suppressing an application provided by an embodiment of the present application. As shown in Figure 3, the method may include:
  • the electronic device monitors multiple application windows.
  • the window monitoring apparatus of the electronic device monitors multiple application windows.
  • the window monitoring device may include a window monitoring unit for monitoring multiple application windows. That is to say, multiple applications correspond to one window monitoring unit.
  • the window monitoring device may also include a plurality of window monitoring units corresponding to a plurality of applications. That is to say, each application has a corresponding window monitoring unit.
  • the window monitoring device is used for summarizing the monitoring results of each window monitoring unit.
  • the monitoring result may include that the window changes, the window does not change, and the like.
  • the window changes may include window minimization, window maximization, window restoration, window movement, and the like.
  • the window monitoring device may include a window monitoring unit a, a window monitoring unit b, and a window monitoring unit c.
  • the window monitoring unit a is used for monitoring the window of the application A.
  • the window monitoring unit b is used to monitor the windows of the application B.
  • the window monitoring unit c is used to monitor the windows of the application C.
  • the window monitoring device summarizes the monitoring results of the window monitoring unit a, the window monitoring unit b and the window monitoring unit c.
  • the window monitoring device summarizes the monitoring results of each window monitoring unit for the purpose of determining a notification strategy according to different monitoring results. Specifically as follows:
  • the window monitoring device may send a notification message in real time.
  • the window monitoring device can send a notification message in real time according to summarizing the monitoring results of each window monitoring unit. That is to say, the window change can be monitored in real time.
  • the window monitoring device monitors that the window is maximized or minimized, it will send a notification message, so that the suppression strategy can be switched in real time without affecting the user experience, ensuring that the visible window seen by the user will never The screen is played normally.
  • the window monitoring device may send a notification message at a preset time interval.
  • the preset time interval may be 0.1-1.5 seconds.
  • the window monitoring device may send a notification message every 1 second.
  • the window monitoring device can send notification messages at preset time intervals according to the monitoring results of each window monitoring unit, without frequently starting the operation of traversing multiple application window information described below, saving electronic equipment power consumption.
  • the change of the window may be understood as the change of the window information.
  • the window information may include position information of the window, status information of the window, and the like.
  • Each application window corresponds to a window information.
  • the position information of the window can be understood as the display position of the window on the display screen.
  • the status information of the window can be understood as the window being maximized or minimized.
  • the operations that cause the window to change may include operations such as dragging the window, maximizing the window, minimizing the window, and restoring the window.
  • the window monitoring device of the electronic device receives the monitoring results sent by each window monitoring unit, and monitors at least one application in multiple application windows (as shown in Figure 5 The application A) window shown changes.
  • the window monitoring device of the electronic device sends a notification message to the filtering device of the electronic device, the notification message is used to indicate that there is a change in the application window, and instructs the filtering device to perform a filtering operation.
  • the filtering device of the electronic device traverses the window information of each application window in the multiple application windows. Optionally, the electronic device traverses window information of all application windows.
  • the electronic device obtains window states of the multiple application windows according to the window information and filtering rules of the multiple application windows.
  • the window state includes an invisible state, and the application windows that meet the filter rule are in the invisible state.
  • each of the multiple applications has multiple windows. Therefore, the window information of multiple application windows mentioned here should be understood as the information of multiple windows of each of the multiple applications, or can also be understood as the information of all windows of each of the multiple applications information.
  • the window information includes not only the above-mentioned position information and state information, but also attributes of the window.
  • the properties of the window may include hidden properties, invisible properties, tool window properties, sub-window properties, transparent properties, and so on.
  • the window has a hidden attribute or an invisible attribute may mean that the window is invisible to the user.
  • the property that the window is a tool window or a sub-window may mean that the window is attached to other windows and will not exceed the scope of the attached window.
  • a window has a transparent property which means that the window cannot block other windows.
  • the filtering rules may include at least one or more of the following:
  • the property is the property of the owned window, and the display range does not exceed the display range of the owning window.
  • the target attribute may include at least one of a hidden attribute, an invisible attribute, a transparent attribute, and a sub-window attribute.
  • the plurality of application windows may include at least one first window and at least one second window.
  • the window states of multiple application windows may include a visible state and an invisible state.
  • the first window is an invisible window obtained based on the filtering rule
  • at least one second window is a window other than all the first windows among the multiple application windows, that is, the second window does not satisfy the Any one of the filter rules.
  • the implementation of S303 is also different, and the specific implementation may include one or more of the following, as follows:
  • the window information includes position information
  • the filtering rule includes windows whose positions are outside the area of the desktop window.
  • S303 may specifically include: S3031.
  • the electronic device filters out the first window outside the area of the desktop window according to the location information of multiple application windows, that is, the first window is No window is visible. Exemplarily, as shown in FIG. 7 , if window A is located outside the area of the desktop window, window A is an invisible window, and thus, window A is filtered out.
  • the window information includes position information
  • the filtering rule includes windows whose size is smaller than or equal to the first threshold.
  • S303 may be specifically implemented as: S3032.
  • the electronic device filters out the first window whose size is smaller than or equal to the first threshold according to the position information of multiple application windows, that is, the first window is Invisible window; wherein, the first threshold is used to indicate a size invisible to the naked eye of the user.
  • the first threshold is a numerical value representing a pixel level.
  • the size of the window C is only at the pixel level, so the window C is an invisible window, and thus, the window C is filtered out.
  • the window information includes location information
  • the filtering rule includes a shadow window of one of the multiple application windows.
  • S303 can be specifically implemented as: S3033.
  • the electronic device filters out shadow windows in multiple application windows according to the location information of the multiple application windows, and the shadow windows are invisible windows. .
  • the first window is a shadow window of the second window
  • the first window is an invisible window.
  • the second window D, the shadow window D' of the second window D, that is, the shadow window D' is the first window
  • the window D' is an invisible window.
  • the window information includes window attributes
  • the filtering rule includes windows whose attributes are target attributes.
  • S303 can be specifically implemented as: S3034.
  • the electronic device filters out the first window whose attribute is the target attribute, that is, the first window is an invisible window .
  • the target attribute may include at least one of a hidden attribute, an invisible attribute, a transparent attribute, and a sub-window attribute.
  • the electronic device filters out the first window whose attribute is hidden, that is, the first window is an invisible window.
  • the electronic device filters out the first window whose attribute is the invisible attribute, that is, the first window is an invisible window.
  • the electronic device filters out the first window whose attribute is transparent, that is, the first window is an invisible window.
  • the electronic device filters out the first window whose attribute is the sub-window attribute, that is, the first window is an invisible window.
  • the window information includes the attributes of the window
  • the filtering rules include windows whose attributes are owned window attributes and whose display range does not exceed the display range of the owning window.
  • S303 can be specifically implemented as: S3035.
  • the electronic device filters out the attributes as the owned window attributes, and the display range does not exceed the display range of the owning window.
  • the first window that is, the first window is an invisible window.
  • the first specified window is the owning window
  • the first window is the owned window.
  • the range of the first window does not exceed the range of the first specified window, it can be understood that the first window is located in the area of the first specified window.
  • the first window G is the first specified window H.
  • the first window G is owned by the first specified window H, and the first window G is within the area of the first specified window H, then the first window G is an invisible window, thus, the first window G is filtered out.
  • S303 may be specifically implemented as: S3036.
  • the electronic device filters out sub-windows of the second specified window according to the attributes of multiple application windows, and the range does not exceed the second specified window.
  • the first window of the range, the first window is an invisible window.
  • the first window I and the second specified window J are in a subordinate relationship.
  • the first window I is a child window of the second specified window J
  • the second specified window J is the parent window of the first window I. If the first window I is within the area of the second designated window J, then the first window I is an invisible window.
  • the electronic device may further filter the remaining windows, so as to filter out completely blocked windows. Details as follows:
  • the method for suppressing an application program provided in the embodiment of the present application may further include:
  • the electronic device obtains at least one third window according to the window information of the at least two second windows.
  • the third window is a window completely blocked by at least one of the at least two second windows.
  • complete occlusion can be understood as: in the direction perpendicular to the display screen and projecting out of the display screen, the range of the windows arranged in front covers the range of the windows arranged in the rear. Then, the windows arranged at the back are completely blocked by the windows arranged at the front.
  • S304 may specifically be implemented as:
  • the electronic device determines at least two target windows from at least two second windows.
  • the window information may include location information, state information, attributes of the window, and the like. According to the content contained in the window information, the implementation of S3041 is also different, as follows:
  • the window information includes location information.
  • S3041 may specifically be implemented as: S30411.
  • the electronic device determines at least one second window whose first part is outside the area of the desktop window according to the position information of the at least two second windows.
  • S30412. The electronic device performs cropping processing on the first part of the at least one second window determined in S30411.
  • the electronic device determines that the second window after the cropping process is the first target window. Exemplarily, as shown in FIG. 7, the first part B' of the window B is located outside the area of the desktop window, and then the electronic device crops the first part B' of the window B.
  • the second type, window information includes the properties of the window.
  • S3041 may specifically be implemented as: S30411', the electronic device determines at least one second window whose attribute is the attribute of the parent window according to the attributes of the at least two second windows, wherein the attribute is The second window of the parent window property is the second target window.
  • the third designated window H and the fourth designated window G are in a subordinate relationship.
  • the fourth specified window G is a child window of the third specified window H
  • the third specified window H is a parent window of the fourth specified window G. If the fourth specified window G is within the area of the third specified window H, then the third specified window H is the second target window.
  • S3041 may specifically be implemented as: S30412', the electronic device determines a third target window from the at least two second windows according to the attributes of the at least two second windows, the The third target window is owned by the fourth target window, and the range exceeds the range of the fourth target window.
  • the fifth designated window E and the sixth designated window F are owned by the sixth specified window F, and the area of the fifth specified window E partially overlaps with the area of the sixth specified window F, then the fifth specified window E is the third target window.
  • S304 is for judging the occlusion relationship between multiple windows, so S304 is processing for at least two target windows. If there is only one window after filtering, there is no need to perform S304 and related steps thereafter.
  • the electronic device determines an arrangement order of the at least two target windows in a direction perpendicular to the display screen and projecting out of the display screen according to the window information of the at least two target windows.
  • the window information may include location information of the application window.
  • S3042 may specifically be: according to the position information of the at least two target windows, the electronic device determines the arrangement order of the at least two target windows in a direction perpendicular to the display screen and exiting the display screen, that is, determines that the Z-order is first window, and the Z-order window in the back.
  • Z-order is the order in which the windows are displayed on the screen.
  • the window with Z-order in the front will block the window with Z-order in the back.
  • the window with the first Z-order in the same sub-window chain is refreshed first, and the window with the next Z-order is refreshed after.
  • windows with a parent/child relationship the parent window refreshes first, the child windows after.
  • the electronic device determines that the fifth target window (such as the above-mentioned first target application window) is being projected within the range of the sixth target window (such as the above-mentioned second target application window) according to the window information and arrangement order of at least two target windows , and the fifth target window is arranged behind the sixth target window.
  • the fifth target window such as the above-mentioned first target application window
  • the sixth target window such as the above-mentioned second target application window
  • the electronic device may determine that the fifth target window is blocked by the sixth target window.
  • the electronic device determines that the fifth target window is the third window.
  • the electronic device determines that the fifth target window is blocked by the sixth target window, the electronic device determines that the fifth target window is the third window, that is, the third window is an invisible window.
  • the electronic device determines that the third window is in an invisible state.
  • the electronic device filters all windows that are invisible to the user according to the information of multiple application windows. Subsequently, the electronic device performs a suppression operation.
  • the suppression operation may include the following multiple methods: method 1, the electronic device suppresses all invisible windows; method 2, the electronic device suppresses the first application (all windows of the first application are invisible windows); method 3 , the electronic device suppresses the first process (all windows of the first process are invisible windows). details as follows:
  • the electronic device performs GPU suppression on at least one first application according to window states of multiple application windows.
  • the first application is an application whose corresponding application windows are in an invisible state.
  • the filtering device sends a suppression command to the suppression device of the electronic device.
  • the suppressing device performs a suppressing operation on the first application or the first process according to the suppressing instruction.
  • the filtering device of the electronic device determines that all windows of the first application are invisible windows, that is, after determining that the first application is an invisible application, the filtering device of the electronic device sends an interception notification to the restraining device of the electronic device.
  • the suppression device intercepts the central processing unit (central processing unit, CPU) of the electronic device to issue process instructions according to the interception notification.
  • S306 is specifically: the electronic device suppresses a rendering process of the first application.
  • the electronic device configures a graphics processing unit (graphics processing unit, GPU) suppression program for the first application.
  • the filtering device of the electronic device sends an interception notification to the suppression device of the electronic device, where the interception notification carries an application programming interface (application programming interface, API) of the first application.
  • the suppression device intercepts the rendering instruction for the first application sent by the CPU of the electronic device to the GPU according to the interception notification, so that the CPU no longer notifies the GPU to perform the rendering action of the first application.
  • the suppressing device intercepts the rendering instruction for the first application sent by the CPU of the electronic device to the GPU according to the interception notification, which can be implemented specifically as follows: a hook function (hook) is loaded on the API of the first application, and when the API is called, the electronic device The hook function is executed first, thereby intercepting the rendering instruction for the first application sent from the CPU of the electronic device to the GPU.
  • a hook function hook
  • hook function may also be called hook programming (hooking), also called “hook”, which is a computer programming term.
  • Hook functions refer to various technologies such as modifying or extending the behavior of operating systems, applications, or other software components by intercepting function calls, message passing, and event passing between software modules.
  • the suppression device of the electronic device can be used in conjunction with the window monitoring device and the filtering device to optimize the use of GPU resources by the first application (that is, the application in a state invisible to the user) in real time, so as to optimize the whole machine The purpose of GPU energy efficiency.
  • the audio is still played normally, so that the entire optimization process is automatically performed without manual intervention by the user, and does not cause any negative impact on the user experience.
  • the electronic device performs GPU suppression on at least one first process according to the window states of multiple application windows.
  • the first process is a process in which all application windows corresponding to it are in an invisible state.
  • the filtering device sends a suppression command to the suppression device of the electronic device.
  • the suppression device performs a suppression operation on the first process according to the suppression instruction.
  • an application may include multiple processes.
  • the first process may be one or more of multiple processes of an application.
  • the electronic device minimizes all windows in an invisible state.
  • the filtering device of the electronic device determines that the first application is an invisible application
  • the filtering device of the electronic device sends a processing notification to the processor of the electronic device, where the processing notification carries the API of the first application.
  • the processor of the electronic device calls the API of the first application according to the processing notification.
  • the electronic device performs a minimization operation of the first application window.
  • the electronic device may determine that it is invisible to the user when receiving the minimization message, so as to optimize calls to the graphics interface and achieve the purpose of reducing GPU resource consumption.
  • this embodiment of the present application may also include other suppression operations, for example, performing resource optimization processing on the hardware unit of the electronic device, specifically as follows:
  • the hardware unit may include CPU, memory or disk.
  • S3053 can be implemented as follows:
  • the hardware unit is a CPU.
  • the electronic device adjusts the process and thread priority of the first application.
  • the electronic device performs a core binding operation on the application process. For example, the first application is bound to run on a few cores or small cores, and the second application below is bound to run on most cores or large cores.
  • the hardware unit is memory.
  • the electronic device adjusts the memory priority of the application. For example, reduce the memory priority of the first application.
  • the electronic device reclaims the memory working set of the application. For example, recycle the working set of the first application to ensure sufficient memory for the foreground application.
  • the hardware unit is a disk.
  • the electronic device adjusts the IO priority of the application. For example, reduce the IO priority of the first application.
  • the electronic device limits the network transmission speed of the first application to ensure the network traffic of the foreground application.
  • the electronic device optimizes the resources of the hardware unit corresponding to the first application according to whether the application is visible to the user, thereby expanding the optimization scenario.
  • the special operation may include alt+tab switching windows, clicking a "task view” button on the windows taskbar, moving the mouse to the taskbar to automatically pop up a preview view of the window, and the like.
  • the special operation may also include some system shortcut key operations. This special operation will not cause the position of the application window to change, but will cause the application to change from the user-invisible state to the user-visible state. That is, a preview window as shown in FIG. 8 will be displayed on the desktop window of the electronic device. The windows are arranged and displayed in the preview window.
  • the method provided by the embodiment of the present application may further include: when the electronic device monitors that at least one window in the first application or the first process is switched to a preview window, releasing the GPU restriction on the first process or the first application.
  • the window monitoring device of the electronic device monitors that at least one window is switched to a preview window.
  • the window monitoring device of the electronic device sends a notification message to the filtering device of the electronic device, and the filtering device determines that the window is a user-visible window, that is, each window displayed in the window is also a user-visible window. Therefore, the first application or the first process corresponding to the window changes from the state invisible to the user to the state visible to the user.
  • the filtering device of the electronic device sends an instruction to the restraining device of the electronic device, where the instruction is used to instruct the restraining device to release the restraint of the first application or the first process.
  • the suppression device of the electronic device releases the suppression of the first application or the first process according to the instruction. It can be seen that in the embodiment of the present application, the electronic device can monitor the change of the window status in real time, support real-time policy switching, and make the background suppression measures insensitive to the user.
  • Still another electronic device provided in the embodiment of the present application.
  • the electronic device executes any one of the above methods.
  • An embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when run on a computer, cause the computer to execute any one of the above methods.
  • the embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute any one of the above methods.
  • the embodiment of the present application also provides a chip, the chip includes a processor and an interface circuit, the interface circuit is coupled to the processor, the processor is used to run computer programs or instructions to implement the above method, and the interface circuit is used to communicate with other modules outside the chip to communicate.
  • words such as “exemplary” or “for example” are used to mean an example, illustration or illustration. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places . Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请公开了一种应用程序的抑制方法和电子设备,该方法包括:电子设备监控多个应用窗口。当监控到多个应用窗口中的至少一个应用窗口发生变化时,电子设备遍历多个应用窗口的窗口信息,并确定出用户不可见状态的应用窗口。当第一应用的所有窗口均处于用户不可见状态时,对第一应用进行GPU抑制,或者,当第一进程的所有窗口均处于用户不可见状态时,对第一进程进行GPU抑制,从而可以有效防止该应用或进程占用电子设备的资源,减少资源浪费,进而解决应用卡顿的问题。

Description

一种应用程序的抑制方法和电子设备
本申请要求于2021年12月22日提交国家知识产权局、申请号为202111583775.2、申请名称为“一种应用程序的抑制方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及电子设备技术领域,尤其涉及一种应用程序的抑制方法和电子设备。
背景技术
目前电子设备(如电脑、手机等)越来越轻薄化。以电子设备是电脑为例,用户在使用电脑的过程中,往往会打开多个应用。其中,被打开的这些应用会占用电脑的资源。而电脑的资源是有限的,当多个应用共用电脑的资源时,往往会带来应用卡顿,电脑整机发热、散热噪音大等问题,严重影响用户体验。
为了解决上述问题,现有的应用的抑制方法通常是电子设备识别占用电脑资源过高的第一应用,并调整第一应用的进程优先级,从而减少应用卡顿。
发明内容
本申请实施例提供的一种应用程序的抑制方法、装置和电子设备,减少处于用户不可见状态的应用消耗资源,进一步解决应用卡顿的问题。
为达到上述目的,本申请实施例采用如下技术方案。
第一方面,本申请实施例提供了一种应用程序的抑制方法,该方法的执行主体可以是电子设备,也可以是位于电子设备中的部件(例如,芯片,芯片系统或处理器等),下面以执行主体是电子设备为例进行描述。该电子设备包括多个应用窗口,该方法可以包括:监控多个应用窗口。当监控到多个应用窗口中的至少一个应用窗口发生变化时,遍历多个应用窗口的窗口信息。根据多个应用窗口的窗口信息和过滤规则,得到多个应用窗口的窗口状态。其中,窗口状态包括不可见状态,符合过滤规则的应用窗口处于不可见状态。根据多个应用窗口的窗口状态,对至少一个第一应用或者第一进程进行GPU抑制;其中,第一应用对应的所有应用窗口均处于不可见状态,第一进程对应的所有应用窗口均处于不可见状态。
这样,一旦应用窗口发生变化,电子设备就会确定出用户不可见状态的应用窗口。当第一应用的所有窗口均处于用户不可见状态时,对第一应用进行GPU抑制,或者,当第一进程的所有窗口均处于用户不可见状态时,对第一进程进行GPU抑制,可以有效防止该应用或进程占用电子设备的资源,减少资源浪费,进而解决应用卡顿的问题。
在一些可实施方式中,多个应用窗口可以包括至少一个第一窗口和至少一个第二窗口。其中,第一窗口处于不可见状态,至少一个第二窗口为多个应用窗口中除所有第一窗口以外的窗口。在对至少一个第一应用或者第一进程进行GPU抑制之前,方法还可以包括:根据至少两个第二窗口的窗口信息,得到至少一个第三窗口;其中,第三窗口为被至少两个 第二窗口中的至少一个窗口完全遮挡的窗口。确定第三窗口处于不可见状态。这样,电子设备可以进一步过滤掉至少两个第二窗口中被遮挡的窗口,进一步减少资源浪费。
在一种具体可实现方式中,根据至少两个第二窗口的窗口信息,得到至少一个第三窗口,具体可以为:根据至少两个第二窗口的窗口信息,在垂直于显示屏且射出显示屏的方向上,确定至少两个第二窗口的排列顺序。根据至少两个第二窗口的窗口信息和排列顺序,确定第一目标应用窗口正投影在第二目标应用窗口的范围内,且第一目标应用窗口排列在第二目标应用窗口的后边。确定第一目标应用窗口为第三窗口。
在一种具体可实现方式中,第一过滤规则包括以下至少一项:位置位于桌面窗口的区域之外的窗口;尺寸小于等于第一阈值的窗口;多个应用窗口中的一个窗口的阴影窗口;属性为目标属性的窗口;或属性为被拥有窗口属性,且显示范围未超出拥有窗口显示范围的窗口。
在一种具体可实现方式中,目标属性可以包括隐藏属性、不可见属性、透明属性、子窗口属性中的至少一个。
在一些可实现方式中,该方法还可以包括:当监控到第一应用或者第一进程中的至少一个窗口切换为预览窗口时,解除对第一进程或者第一应用的GPU抑制。
在一些可实现方式中,该方法还可以包括:对所有处于不可见状态的应用窗口进行最小化,使得电子设备的资源(如图形处理器的资源)消耗会明显减少,到达降低电子设备的资源消耗的目的。
本申请实施例与上述实施例可以为并列的两套技术方案,也可以是上述实施例的进一步限定。本申请实施例不做具体限定。
在一种具体可实现方式中,至少一个应用窗口发生变化,包括以下至少一项:至少一个应用窗口的位置发生变化,至少一个应用窗口的状态发生变化,至少一个窗口的尺寸发生变化。
第二方面,本申请实施例提供了一种应用程序的抑制装置,应用于电子设备,电子设备可以包括多个应用窗口,该装置可以包括:监控单元,用于监控多个应用窗口。遍历单元,用于当监控到多个应用窗口中的至少一个应用窗口发生变化时,遍历多个应用窗口的窗口信息。第一获取单元,用于根据多个应用窗口的窗口信息和过滤规则,得到多个应用窗口的窗口状态。其中,窗口状态包括不可见状态,符合过滤规则的应用窗口处于不可见状态。抑制单元,用于根据多个应用窗口的窗口状态,对至少一个第一应用或者第一进程进行GPU抑制。其中,第一应用对应的所有应用窗口均处于不可见状态,第一进程对应的所有应用窗口均处于不可见状态。
这样,一旦应用窗口发生变化,电子设备就会确定出用户不可见状态的应用窗口。当第一应用的所有窗口均处于用户不可见状态时,对第一应用进行GPU抑制,或者,当第一进程的所有窗口均处于用户不可见状态时,对第一进程进行GPU抑制,可以有效防止该应用或进程占用电子设备的资源,减少资源浪费,进而解决应用卡顿的问题。
在一些可实现方式中,多个应用窗口可以包括至少一个第一窗口和至少一个第二窗口。其中,第一窗口处于不可见状态,至少一个第二窗口为多个应用窗口中除所有第一窗口以外的窗口。该装置还可以包括:第二获取单元,用于根据至少两个第二窗口的窗口信息,得到至少一个第三窗口。其中,第三窗口为被至少两个第二窗口中的至少一个窗口完全遮 挡的窗口。第一确定单元,用于确定第三窗口处于不可见状态。这样,电子设备可以进一步过滤掉至少两个第二窗口中被遮挡的窗口,进一步减少资源浪费。
在一种具体可实现方式中,第二获取单元还用于:根据至少两个第二窗口的窗口信息,在垂直于显示屏且射出显示屏的方向上,确定至少两个第二窗口的排列顺序。根据至少两个第二窗口的窗口信息和排列顺序,确定第一目标应用窗口正投影在第二目标应用窗口的范围内,且第一目标应用窗口排列在第二目标应用窗口的后边。确定第一目标应用窗口为第三窗口。
在一种具体可实现方式中,第一过滤规则包括以下至少一项:位置位于桌面窗口的区域之外的窗口;尺寸小于等于第一阈值的窗口;多个应用窗口中的一个窗口的阴影窗口;属性为目标属性的窗口;或,属性为被拥有窗口属性,且显示范围未超出拥有窗口显示范围的窗口。
在一种具体可实现方式中,目标属性可以包括隐藏属性、不可见属性、透明属性、子窗口属性中的至少一个。
在一些可实现方式中,该装置还可以包括:解除单元,用于当监控到第一应用或者第一进程中的至少一个窗口切换为预览窗口时,解除对第一进程或者第一应用的GPU抑制。
在一些可实现方式中,该装置还可以包括:处理单元,用于对所有处于不可见状态的应用窗口进行最小化,使得电子设备的资源(如图形处理器的资源)消耗会明显减少,到达降低电子设备的资源消耗的目的。
在一种具体可实现方式中,至少一个应用窗口发生变化,包括以下至少一项:至少一个应用窗口的位置发生变化,至少一个应用窗口的状态发生变化,至少一个窗口的尺寸发生变化。
第三方面,本申请实施例提供了一种电子设备,该设备可以包括:一个或多个处理器;以及存储器,所述存储器中存储有代码;当所述代码被所述一个或多个处理器执行时,使得所述电子设备执行如第一方面所述的方法。
第四方面,本申请实施例提供了一种芯片系统,该芯片系统应用于电子设备。该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行如第一方面所述的方法。
第五方面,本申请实施例提供了一种计算机可读存储介质,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如第一方面所述的方法。
第六方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面所述的方法
其中,上述第二方面至第六方面中各个实施例的具体实施方式及对应的技术效果可以参见上述第一方面的具体实施方式及技术效果。
在本申请实施例中,电子设备监控多个应用窗口。当监控到多个应用窗口中的至少一个应用窗口发生变化时,电子设备遍历多个应用窗口的窗口信息。电子设备根据多个应用窗口的窗口信息和过滤规则,得到多个应用窗口的窗口状态。其中,窗口状 态包括不可见状态,符合过滤规则的应用窗口处于不可见状态。电子设备根据多个应用窗口的窗口状态,对至少一个第一应用或者第一进程进行GPU抑制。其中,第一应用对应的所有应用窗口均处于不可见状态,第一进程对应的所有应用窗口均处于不可见状态。这样,一旦应用窗口发生变化,电子设备就会确定出用户不可见状态的应用窗口。当第一应用的所有窗口均处于用户不可见状态时,对第一应用进行GPU抑制,或者,当第一进程的所有窗口均处于用户不可见状态时,对第一进程进行GPU抑制,可以有效防止该应用或进程占用电子设备的资源,减少资源浪费,进而解决应用卡顿的问题。
附图说明
图1为本申请实施例提供的一种电子设备的结构示意图;
图2为本申请实施例提供的一种电子设备的软件架构示意图;
图3为本申请实施例提供的一种应用程序的抑制方法的流程示意图;
图4为本申请实施例提供的一种窗口监控的流程示意图;
图5为本申请实施例提供的一种应用程序的抑制方法的应用场景流程示意图;
图6为本申请实施例提供的一种应用程序的抑制方法的应用场景流程示意图;
图7为本申请实施例提供的一种电子设备的界面示意图;
图8为本申请实施例提供的一种电子设备的界面示意图。
具体实施方式
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
进程化工具(process lasso,简称Pro),是一款独特的调试进程级别的系统化工具,主要功能是基于其特别的算法动态调整各个进程的优先级以实现系统减负的目。目前应用的抑制方法通常是:电子设备启动Pro。电子设备显示Pro的界面。当用户在电子设备显示的Pro的主菜单界面上选择“启用ProBalance(进程CPU用量平衡)”选项后,电子设备识别占用电脑资源过高的第一应用,并利用Pro调整第一应用的进程优先级,从而减少应用卡顿。但是,电子设备只是根据CPU的利用率找到第一应用,并调整第一应用的进程优先级。若第一应用处于用户不可见状态,则第一应用依然会占用电子设备的资源,依然存在应用卡顿的问题。
为了解决上述技术问题,在本申请实施例中,电子设备监控多个应用窗口。当监控到多个应用窗口中的至少一个应用窗口发生变化时,电子设备遍历多个应用窗口的窗口信息。电子设备根据多个应用窗口的窗口信息和过滤规则,得到多个应用窗口的窗口状态。其中,窗口状态包括不可见状态,符合过滤规则的应用窗口处于不可见状态。电子设备根据多个应用窗口的窗口状态,对至少一个第一应用或者第一进程进行图形处理器(graphics processing unit,GPU)抑制。其中,第一应用对应的所有应用窗口均处于不可见状态,第一进程对应的所有应用窗口均处于不可见状态。这样,一旦应用窗口发生变化,电子设备就会确定出用户不可见状态的应用窗口。当第一应用的所有窗口均处于用户不可见状态时,对第一应用进行GPU抑制,或者,当第一进程的所有窗口均处于用户不可见状态时,对第 一进程进行GPU抑制,可以有效防止该应用或进程占用电子设备的资源,减少资源浪费,进而解决应用卡顿的问题。
在一些实施例中,进一步的,电子设备还可以对所有处于不可见状态的应用窗口进行最小化。这样,所有的应用窗口被最小化,使得电子设备的资源(如图形处理器的资源)消耗会明显减少,到达降低电子设备的资源消耗的目的。或者,可选的,上述对第一应用进行GPU抑制或者对第一进程进行GPU抑制可以被替换为:对第一应用或者对第一进程对应的所有应用窗口都进行最小化,或者,对所有处于不可见状态的应用窗口进行最小化。
在一些实施例中,电子设备对第一应用进行GPU抑制,具体可以为:电子设备抑制第一应用的进程。示例性的,电子设备抑制第一应用的渲染进程。这样,有效减少处于用户可不见状态的应用进行渲染合成运算,减少图形处理器的资源消耗,从而减少资源浪费。
当然,在一些实施例中,电子设备也可以对第一应用对应的硬件单元的资源进行优化处理。示例性的,电子设备对存储器中第一应用的缓存进行清除处理。或者,电子设备指示图形处理器释放第一应用占用的资源。这样,电子设备能够抑制用户不可见应用占用过多资源,减少资源浪费,使得用户可见应用能够获取更多资源,从而减少用户可见应用卡顿。另外,能够有效减少电子设备整机发热,降低噪声。
在一些实施例中,在过滤掉处于不可见状态的窗口之后,电子设备还可以对剩下的窗口进行进一步的过滤,以过滤掉完全被遮挡的窗口。具体可以为:多个应用窗口包括至少一个第一窗口和至少一个第二窗口。其中,第一窗口为基于过滤规则确定的处于不可见状态的窗口,至少一个第二窗口为多个应用窗口中除所有第一窗口以外的窗口。在电子设备对至少一个第一应用或者第一进程进行GPU抑制之前,该方法还可以包括:电子设备根据至少两个第二窗口的窗口信息,得到至少一个第三窗口。其中,第三窗口为被至少两个第二窗口中的至少一个窗口完全遮挡的窗口。电子设备确定第三窗口处于不可见状态。这样,电子设备可以进一步过滤掉至少两个第二窗口中被遮挡的窗口,进一步减少资源浪费。
图1是上述电子设备的结构框图。
如图1所示,电子设备100可以包括处理器110,存储器120,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,按键180,显示屏150等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件, 也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I1C)接口,集成电路内置音频(inter-integrated circuit sound,I1S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,存储器120,显示屏150,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏150显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于 处理器110,或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。
在一些实施例中,电子设备100的天线和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏150,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏150和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏150用于显示图像,视频等。显示屏150包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏150,N为大于1的正整数。在一些实施例中,显示屏150显示多个应用窗口。
电子设备100可以通过ISP,摄像头,视频编解码器,GPU,显示屏150以及应用处理器等实现拍摄功能。
ISP用于处理摄像头反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头中。
摄像头用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。 感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG1,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
存储器120可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。存储器120可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在存储器120的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集 声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
按键180包括开机键,音量键等。按键180可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
当然,电子设备100还可以包括其他功能单元,本申请实施例对此不进行限定。
需要说明的是,电子设备100可以是台式机、便携式电脑、网络服务器、平板电脑、无线电子设备、嵌入式设备、芯片系统或有图1中类似结构的设备。此外,图1中示出的组成结构并不构成对该电子设备的限定,除图1所示部件之外,该电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
本申请实施例中,芯片系统可以由芯片构成,也可以包括芯片和其他分立器件。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的windows系统为例,示例性说明电子设备100的软件结构。
图2是本发明实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将windows系统可以分为三层,从上至下分别为应用程序层,应用程序框架层,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。当然,应用程序框架层还可以包括窗口监控装置、过滤装置和抑制装置。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文 件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
窗口监控装置用于监控应用程序的窗口信息,并且,当监控到窗口发生变化时向过滤装置发送通知消息,该通知消息用于通知过滤装置进行窗口过滤。
过滤装置用于根据窗口监控装置发送的通知消息,过滤用户不可见的窗口,并将用户不可见的窗口告知给抑制装置。当然,过滤装置还可以用于将第一应用或第一进程告知给抑制装置,该第一应用的所有窗口为用户不可见的窗口,该第一进程的所有窗口为用户不可见的窗口。其中,用户不可见可以理解为用户肉眼不能看见。
抑制装置用于对第一应用或第一进程进行抑制操作。具体地,抑制装置可以用于对第一应用或第一进程进行GPU抑制。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合抑制第一应用场景,示例性说明电子设备100软件以及硬件的工作流程。
①应用架构层的窗口监控装置监控应用程序层的应用窗口。②当窗口监控装置监控到应用窗口发生变化时,窗口监控装置向过滤装置发送用于指示应用窗口发生变化的通知消息。③过滤装置根据该通知消息,过滤用户不可见的窗口,并将该窗口的信息(如标识信息或API)发送给抑制装置。④抑制装置对第一应用(该第一应用的所有窗口为用户不可见的窗口)或第一进程(该第一进程的所有窗口为用户不可见的窗口)进行抑制操作。如,抑制装置调用第一应用的API,并运行API上加载的钩子函数,进而调用内核层抑制启动显示驱动,启动音频驱动,通过音频模块170播放音频。
此外,本申请的各实施例之间涉及的动作,术语等均可以相互参考,不予限制。本申请的实施例中各个设备之间交互的消息名称或消息中的参数名称等只是一个示例,具体实现中也可以采用其他的名称,不予限制。
本申请实施例提供的一种应用程序的抑制方法的执行主体可以为电子设备。在本申请实施例中,以该电子设备安装Windows操作系统为例进行说明。
图3为本申请实施例提供的一种应用程序的抑制方法的流程示意图。如图3所示,该方法可以包括:
S301、电子设备监控多个应用窗口。
在一种具体可实现方式中,电子设备的窗口监控装置监控多个应用窗口。
其中,该窗口监控装置可以包括一个窗口监控单元,该窗口监控单元用于监控多个应用窗口。也就是说,多个应用对应一个窗口监控单元。
当然,该窗口监控装置也可以包括多个窗口监控单元,该多个窗口监控单元与多个应用一一对应。也就是说,每个应用都有与之对应的一个窗口监控单元。该窗口监控装置用于汇总各个窗口监控单元的监控结果。其中,监控结果可以包括窗口发生变化,窗口未发生变化等。其中,窗口发生变化可以包括窗口最小化、窗口最大化、窗 口还原、窗口移动等。
示例性的,如图4所示,假设:多个应用可以包括应用A、应用B和应用C。相应的,窗口监控装置可以包括窗口监控单元a、窗口监控单元b和窗口监控单元c。其中,窗口监控单元a用于监控应用A的窗口。窗口监控单元b用于监控应用B的窗口。窗口监控单元c用于监控应用C的窗口。窗口监控装置汇总窗口监控单元a、窗口监控单元b和窗口监控单元c的监控结果。
其中,窗口监控装置汇总各个窗口监控单元的监控结果,目的是根据不同的监控结果确定通知策略。具体如下所述:
示例1,当窗口监控装置汇总的监控结果中存在窗口最大化或窗口最小化时,窗口监控装置可以实时发送通知消息。在本申请实施例中,窗口监控装置根据汇总各个窗口监控单元的监控结果,可以实时发送通知消息。也就是说,可以实时监控窗口变化,窗口监控装置一旦监控到窗口发送最大化或最小化的变化就发送通知消息,使抑制策略实时切换,不会影响用户体验,保证用户看到的可见窗口永远都正常播放画面。
示例2,当窗口监控装置汇总的监控结果中存在窗口拖动时,窗口监控装置可以按照预设时间间隔发送通知消息。其中,预设时间间隔可以为0.1-1.5秒。具体的,窗口监控装置可以每1秒发送一次通知消息。在本申请实施例中,窗口监控装置根据汇总各个窗口监控单元的监控结果,可以按照预设时间间隔发送通知消息,无需频繁启动下文中所述的遍历多个应用窗口信息的操作,节省电子设备的功耗。
在Windows操作系统中,往往一个应用可能有几十甚至上百个窗口,由于这些窗口设置了不同的属性、位置信息、尺寸大小等,能够被用户看见的一般只有几个窗口或十几个窗口。因此,在Windows操作系统中,需要对窗口进行筛选,将用户不可以看见的窗口过滤掉。具体如S302-S304、S3041-S3044所述:
S302、当电子设备监控到多个应用窗口中至少一个应用窗口发生变化时,电子设备遍历多个应用窗口的窗口信息。
其中,窗口发生变化可以理解为窗口信息发生变化。其中,窗口信息可以包括窗口的位置信息、窗口的状态信息等。每个应用窗口对应一个窗口信息。该窗口的位置信息可以理解为窗口在显示屏上的显示位置。该窗口的状态信息可以理解为窗口处于最大化或最小化。导致窗口发生变化的操作可以包括窗口的拖动、窗口最大化、窗口最小化、窗口还原等操作。
在一种具体可实现方式中,如图5所示,①电子设备的窗口监控装置接收到各个窗口监控单元发送的监控结果,并监控到多个应用窗口中的至少一个应用(如图5中所示的应用A)窗口发生变化。②电子设备的窗口监控装置向电子设备的过滤装置发送通知消息,该通知消息用于表示存在应用窗口发生变化,并指示过滤装置执行过滤操作。电子设备的过滤装置遍历多个应用窗口中每个应用窗口的窗口信息。可选的,电子设备遍历所有的应用窗口的窗口信息。
S303、电子设备根据多个应用窗口的窗口信息和过滤规则,得到多个应用窗口的窗口状态。其中,窗口状态包括不可见状态,符合过滤规则的应用窗口处于不可见状态。
其中,多个应用中的每个应用具有多个窗口。故,这里所说的多个应用窗口的窗 口信息,应该理解为多个应用中的每个应用的多个窗口的信息,或者,还可以理解为多个应用中的每个应用的所有窗口的信息。
其中,窗口信息包括除了上述的位置信息、状态信息之后,还可以包括窗口的属性。
示例性的,窗口的属性可以包括隐藏属性、不可见属性、工具窗口属性、子窗口属性、透明属性,等等。其中,窗口具有隐藏属性或不可见属性可以指该窗口对用户可不见。窗口为工具窗口属性或子窗口可以指该窗口是依附于其他窗口的,不会超出所依附窗口的范围。窗口具有透明属性可以指该窗口并不能遮挡其他窗口。
该过滤规则可以包括以下至少一项或多项:
(1)位置位于桌面窗口的区域之外的窗口;
(2)尺寸小于等于第一阈值的窗口;
(3)多个应用窗口中的一个窗口的阴影窗口;
(4)属性为目标属性的窗口;或,
(5)属性为被拥有窗口属性,且显示范围未超出拥有窗口显示范围的窗口。
其中,目标属性可以包括隐藏属性、不可见属性、透明属性、子窗口属性中的至少一个。
其中,多个应用窗口可以包括至少一个第一窗口和至少一个第二窗口。多个应用窗口的窗口状态可以包括可见状态和不可见状态。示例性的,第一窗口为基于所述过滤规则得到的处于不可见状态的窗口,至少一个第二窗口为多个应用窗口中除所有第一窗口以外的窗口,即第二窗口不满足所述过滤规则中的任意一项。
示例性的,针对窗口信息包含的内容不同,及过滤规则的不同,S303的实现方式也不同,具体实现方式可以包括以下的一种或多种,如下:
第一种,窗口信息包括位置信息,过滤规则包括位置位于桌面窗口的区域之外的窗口。
在一种具体可实现方式中,参见图3,S303具体可以包括:S3031、电子设备根据多个应用窗口的位置信息,过滤掉在桌面窗口的区域之外的第一窗口,即第一窗口为不可见窗口。示例性的,如图7所示,窗口A位于桌面窗口的区域之外,则窗口A为不可见窗口,由此,该窗口A被过滤掉。
第二种,窗口信息包括位置信息,过滤规则包括尺寸小于等于第一阈值的窗口。
在一种具体可实现方式中,参见图3,S303具体可实现为:S3032、电子设备根据多个应用窗口的位置信息,过滤掉尺寸小于等于第一阈值的第一窗口,即第一窗口为不可见窗口;其中,第一阈值用于表示用户肉眼不可见的尺寸大小。例如,第一阈值为表示像素级别的数值。示例性的,如图7所示,窗口C的尺寸只有像素级别大小,则窗口C为不可见窗口,由此,该窗口C被过滤掉。
第三种,窗口信息包括位置信息,过滤规则包括多个应用窗口中的一个窗口的阴影窗口。
在一种具体可实现方式中,参见图3,S303具体可实现为:S3033、电子设备根据多个应用窗口的位置信息,过滤掉多个应用窗口中的阴影窗口,该阴影窗口为不可见窗口。例如,第一窗口是第二窗口阴影窗口,则第一窗口为不可见窗口。示例性的, 如图7所示,第二窗口D,第二窗口D的阴影窗口D’,即该阴影窗口D’为第一窗口,则窗口D’为不可见窗口。
第四种,窗口信息包括窗口的属性,过滤规则包括属性为目标属性的窗口。
在一种具体可实现方式中,参见图3,S303具体可实现为:S3034、电子设备根据多个应用窗口的属性,过滤掉属性为目标属性的第一窗口,即第一窗口为不可见窗口。
其中,目标属性可以包括隐藏属性、不可见属性、透明属性、子窗口属性中的至少一个。
也就是说,电子设备过滤掉属性为隐藏属性的第一窗口,即第一窗口为不可见窗口。或者,电子设备过滤掉属性为不可见属性的第一窗口,即第一窗口为不可见窗口。或者,电子设备过滤掉属性为透明属性的第一窗口,即第一窗口为不可见窗口。或者,电子设备过滤掉属性为子窗口属性口第一窗的,即第一窗口为不可见窗口。
第五种,窗口信息包括窗口的属性,过滤规则包括属性为被拥有窗口属性,且显示范围未超出拥有窗口显示范围的窗口。
在一种具体可实现方式中,参见图3,S303具体可实现为:S3035、电子设备根据多个应用窗口的属性,过滤掉属性为被拥有窗口属性,且显示范围未超出拥有窗口显示范围的第一窗口,即第一窗口为不可见窗口。
假设,第一指定窗口为拥有窗口,第一窗口为被拥有窗口。其中,第一窗口的范围未超出第一指定窗口的范围,可以理解为第一窗口位于第一指定窗口的区域内。示例性的,如图7所示,第一窗口G,第一指定窗口H。第一窗口G被第一指定窗口H拥有,且第一窗口G在第一指定窗口H的区域内,则第一窗口G为不可见窗口,由此,该第一窗口G被过滤掉。
在另一种具体可实现方式中,参见图3,S303具体可实现为:S3036、电子设备根据多个应用窗口的属性,过滤掉第二指定窗口的子窗口,且范围未超出第二指定窗口的范围的第一窗口,则第一窗口为不可见窗口。
示例性的,如图7所示,第一窗口I,第二指定窗口J。第一窗口I和第二指定窗口J是从属关系。其中,第一窗口I是第二指定窗口J的子窗口,第二指定窗口J是第一窗口I的父窗口。第一窗口I在第二指定窗口J的区域内,则第一窗口I为不可见窗口。
在一些实施例中,在上述过滤掉处于不可见状态的窗口之后,电子设备还可以对剩下的窗口进行进一步的过滤,以过滤掉完全被遮挡的窗口。具体如下:
在执行S303之后,可选的,本申请实施例提供的一种应用程序的抑制方法还可以包括:
S304、电子设备根据至少两个第二窗口的窗口信息,得到至少一个第三窗口。其中,第三窗口为被至少两个第二窗口中的至少一个窗口完全遮挡的窗口。
其中,完全遮挡可以理解为:在垂直于显示屏且射出显示屏的方向上,排列在前的窗口的范围覆盖排列在后的窗口的范围。那么,排列在后的窗口完全被排列在前的窗口遮挡。
在一种具体可实现方式中,参见图3,S304具体可实现为:
S3041、电子设备从至少两个第二窗口中确定至少两个目标窗口。
如上所述,窗口信息可以包括位置信息、状态信息、窗口的属性等。针对窗口信息包含的内容不同,S3041的实现方式也不同,具体如下:
第一种,窗口信息包括位置信息。
在一种具体可实现方式中,S3041具体可实现为:S30411、电子设备根据所述至少两个第二窗口的位置信息,确定出第一部分位于桌面窗口的区域之外的至少一个第二窗口。S30412、电子设备对S30411中确定出的所述至少一个第二窗口的第一部分进行裁剪处理。S30413、电子设备确定在裁剪处理之后的第二窗口为第一目标窗口。示例性的,如图7所示,窗口B的第一部分B’位于桌面窗口的区域之外,则电子设备对窗口B的第一部分B’进行裁剪。
第二种,窗口信息包括窗口的属性。
在一种具体可实现方式中,S3041具体可实现为:S30411’、电子设备根据所述至少两个第二窗口的属性,确定出属性为父窗口属性的至少一个第二窗口,其中,属性为父窗口属性的第二窗口即为第二目标窗口。示例性的,如图7所示,第三指定窗口H,第四指定窗口G。第四指定窗口G和第三指定窗口H是从属关系。其中,第四指定窗口G是第三指定窗口H的子窗口,第三指定窗口H是第四指定窗口G的父窗口。第四指定窗口G在第三指定窗口H的区域内,则第三指定窗口H为第二目标窗口。
在另一种具体可实现方式中,S3041具体可实现为:S30412’、电子设备根据所述至少两个第二窗口的属性,从所述至少两个第二窗口中确定第三目标窗口,该第三目标窗口被第四目标窗口拥有,且范围超出第四目标窗口的范围。示例性的,如图7所示,第五指定窗口E,第六指定窗口F。第五指定窗口E被第六指定窗口F拥有,且第五指定窗口E的区域与第六指定窗口F的区域部分重叠,则第五指定窗口E为第三目标窗口。
需要说明的是,S304是为了判断多个窗口之间的遮挡关系,所以S304中是对至少两个目标窗口进行的处理。如果过滤之后只有一个窗口,则无需执行S304及之后的相关步骤。
S3042、电子设备根据至少两个目标窗口的窗口信息,在垂直于显示屏且射出显示屏的方向上,确定至少两个目标窗口的排列顺序。
如上述,窗口信息可以包括应用窗口的位置信息。
具体地,S3042具体可以为:电子设备根据至少两个目标窗口的位置信息,在垂直于显示屏且射出显示屏的方向上,确定至少两个目标窗口的排列顺序,即确定Z-order在前的窗口,及Z-order在后的窗口。
其中,Z-order就是表示窗口在屏幕上显示时的先后顺序。Z-order在前的窗口会遮挡Z-order在后的窗口。在屏幕上的一块区域需要刷新时,同一个子窗口链中Z-order在前的窗口先刷新,Z-order在后的窗口后刷新。例如,具有父/子关系的窗口:父窗口先刷新,子窗口后刷新。
S3043、电子设备根据至少两个目标窗口的窗口信息和排列顺序,确定第五目标窗口(如上述第一目标应用窗口)正投影在第六目标窗口(如上述第二目标应用窗口)的范围内,且第五目标窗口排列在第六目标窗口的后边。
如上,当Z-order在前的第六目标窗口的范围大于Z-order在后的第五目标窗口的范围时, 电子设备可以确定第五目标窗口被第六目标窗口遮挡。
S3044、电子设备确定第五目标窗口为第三窗口。
当电子设备确定第五目标窗口被第六目标窗口遮挡时,电子设备确定第五目标窗口为第三窗口,即第三窗口为不可见的窗口。
S305、电子设备确定第三窗口处于不可见状态。
综上,电子设备根据多个应用窗口信息,过滤处于用户不可见状态的所有窗口。后续,电子设备进行抑制操作。该抑制操作可以包括以下多种方式:方式一,电子设备对所有不可见的窗口进行抑制;方式二,电子设备对第一应用(第一应用的所有窗口为不可见窗口)进行抑制;方式三,电子设备对第一进程(第一进程的所有窗口为不可见窗口)进行抑制。具体如下:
方式一,
S306、电子设备根据多个应用窗口的窗口状态,对至少一个第一应用进行GPU抑制。其中,第一应用为其对应的所有应用窗口均处于不可见状态的应用。
具体的,如图5所示,③在电子设备的过滤装置确定出所有处于不可见状态的应用窗口之后,过滤装置向电子设备的抑制装置发送抑制指令。④抑制装置根据抑制指令,对第一应用或第一进程进行抑制操作。
具体的,在电子设备的过滤装置确定第一应用的所有窗口为不可见窗口,即确定第一应用为不可见应用之后,电子设备的过滤装置向电子设备的抑制装置发送拦截通知。抑制装置根据拦截通知拦截电子设备的中央处理器(central processing unit,CPU)发出进程指令。
在一种具体可实现方式中,S306具体为:电子设备抑制第一应用的渲染进程。
示例性的,如图6所示,在第一应用启动时,电子设备为第一应用配置图形处理器(graphics processing unit,GPU)抑制程序。电子设备的过滤装置向电子设备的抑制装置发送拦截通知,该拦截通知中携带第一应用的应用编程接口(application programming interface,API)。抑制装置根据拦截通知,拦截电子设备的CPU向GPU发送的用于第一应用的渲染指令,使得CPU不再通知GPU做第一应用的渲染动作。
其中,抑制装置根据拦截通知,拦截电子设备的CPU向GPU发送的用于第一应用的渲染指令,具体可实现为:第一应用的API上加载钩子函数(hook),当调用API时电子设备先执行钩子函数,从而拦截电子设备的CPU向GPU发送的用于第一应用的渲染指令。
其中,钩子函数也可以称钩子编程(hooking),亦称作“挂钩”,是计算机程序设计术语。钩子函数指通过拦截软件模块间的函数调用、消息传递、事件传递来修改或扩展操作系统、应用程序或其他软件组件的行为等各种技术。
在本申请实施例中,电子设备的抑制装置可以通过与窗口监控装置、过滤装置配合使用,实时地优化第一应用(即处于用户不可见状态的应用)对GPU资源的使用,达到优化整机GPU能效的目的。另外,在整个抑制过程中,音频仍然正常播放,使得整个优化过程自动进行不需要用户手动干预,也对用户体验不造成任何负面影响。
方式二,
S307、电子设备根据多个应用窗口的窗口状态,对至少一个第一进程进行GPU抑 制。其中,第一进程为其对应的所有应用窗口均处于不可见状态的进程。
具体的,如图5所示,③在电子设备的过滤装置确定第一进程的所有窗口均处于用户为不可见状态之后,过滤装置向电子设备的抑制装置发送抑制指令。④抑制装置根据抑制指令,对第一进程进行抑制操作。
具体的,在电子设备的过滤装置确定第一进程的所有窗口均处于用户为不可见状态之后,电子设备的过滤装置向电子设备的抑制装置发送拦截通知。抑制装置根据拦截通知拦截电子设备的CPU发出渲染指令,从而达到对第一进程进行GPU抑制的目的。其中,一个应用可以包括多个进程。第一进程可以是一个应用的多个进程中的一个或多个。
方式三,
S308、电子设备对所有处于不可见状态的窗口进行最小化处理。
示例性的,在电子设备的过滤装置确定第一应用为不可见应用之后,电子设备的过滤装置向电子设备的处理器发送处理通知,该处理通知中携带第一应用的API。电子设备的处理器根据处理通知,调用第一应用的API。电子设备执行第一应用窗口的最小化操作。
在本申请实施例中,在电子设备可以在收到最小化消息时判定自己对用户不可见,从而优化对图形接口的调用,达到减少GPU资源消耗的目的。
当然,本申请实施例还可以包括其他抑制操作,例如,对电子设备的硬件单元进行资源优化处理,具体如下:
其中,硬件单元可以包括CPU、内存或磁盘。针对不同的硬件,S3053具体可实现如下:
示例性的,硬件单元为CPU。
具体可实现如下:第一,电子设备对第一应用的进程、线程优先级进行调节。第二,电子设备对应用的进程进行绑核操作。如,将第一应用绑到少数核或小核上运行,将下文的第二应用绑到多数核或大核上运行。
示例性的,硬件单元为内存。
具体可实现如下:第一,电子设备对应用的内存优先级进行调整。如,降低第一应用的内存优先级。第二,电子设备对应用的内存工作集回收。如,回收第一应用的工作集,保证前台应用内存足够。
示例性的,硬件单元为磁盘。
具体可实现如下:第一,电子设备对应用的IO优先级调整。如,降低第一应用的IO优先级。第二,电子设备限制第一应用的网络传输速度,保证前台应用的网络流量。
在本申请实施例中,电子设备通过应用是否对用户可见,来对第一应用对应的硬件单元的资源进行优化处理,扩大了优化场景。
另外,存在一些特殊操作也会使一个原本用户不可见的窗口变成用户可见的窗口。该特殊操作可以包括alt+tab切换窗口、点击windows任务栏的“任务视图”按钮、鼠标移动到任务栏上自动弹出窗口的预览视图等。当然,该特殊操作还可以包括一些系统快捷键操作。该特殊操作不会导致应用窗口位置发生变化,但是会导致该应用由用户不可见状态变为用户可见状态。即电子设备的桌面窗口中会显示如图8所示的预览窗 口。在该预览窗口中排布显示各个窗口。
因此,本申请实施例提供的方法,还可以包括:电子设备当监控到第一应用或者第一进程中的至少一个窗口切换为预览窗口时,解除对第一进程或者第一应用的GPU抑制。示例性的,电子设备的窗口监控装置监控到至少一个窗口切换为预览窗口。电子设备的窗口监控装置向电子设备的过滤装置发送通知消息,过滤装置确定该窗口为用户可见窗口,即该窗口中显示的各个窗口也为用户可见窗口。所以,该窗口对应的第一应用或第一进程由用户不可见状态变成用户可见状态。电子设备的过滤装置向电子设备的抑制装置发送指令,该指令用于指示抑制装置解除对第一应用或第一进程的抑制。电子设备的抑制装置根据指令解除对第一应用或第一进程的抑制。可见,本申请实施例中,电子设备可以实时监控窗口状态的变化,支撑实时策略切换,使后台抑制措施对用户无感。
本申请实施例提供的又一种电子设备。该电子设备执行上述任一方法。
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述任一方法。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一方法。
本申请实施例还提供了一种芯片,该芯片包括处理器和接口电路,该接口电路和该处理器耦合,该处理器用于运行计算机程序或指令,以实现上述方法,该接口电路用于与该芯片之外的其它模块进行通信。
在本申请的描述中,除非另有说明,“/”表示“或”的意思,例如,A/B可以表示A或B。本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。此外,“至少一个”是指一个或多个,“多个”是指两个或两个以上。“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
在本申请的描述中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显 示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (12)

  1. 一种应用程序的抑制方法,其特征在于,应用于电子设备,所述电子设备包括多个应用窗口,所述方法包括:
    监控所述多个应用窗口;
    当监控到所述多个应用窗口中的至少一个应用窗口发生变化时,遍历所述多个应用窗口的窗口信息;
    根据所述多个应用窗口的窗口信息和过滤规则,得到所述多个应用窗口的窗口状态;其中,所述窗口状态包括不可见状态,符合所述过滤规则的应用窗口处于不可见状态;
    根据所述多个应用窗口的窗口状态,对至少一个第一应用或者第一进程进行GPU抑制;其中,所述第一应用对应的所有应用窗口均处于不可见状态,所述第一进程对应的所有应用窗口均处于不可见状态。
  2. 根据权利要求1所述的方法,其特征在于,所述多个应用窗口包括至少一个第一窗口和至少一个第二窗口;其中,所述第一窗口处于不可见状态,所述至少一个第二窗口为所述多个应用窗口中除所有所述第一窗口以外的窗口;
    在所述对至少一个第一应用或者第一进程进行GPU抑制之前,所述方法还包括:
    根据所述至少两个第二窗口的窗口信息,得到至少一个第三窗口;其中,所述第三窗口为被所述至少两个第二窗口中的至少一个窗口完全遮挡的窗口;
    确定所述第三窗口处于不可见状态。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述至少两个第二窗口的窗口信息,得到至少一个第三窗口,包括:
    根据所述至少两个第二窗口的窗口信息,在垂直于显示屏且射出所述显示屏的方向上,确定所述至少两个第二窗口的排列顺序;
    根据所述至少两个第二窗口的窗口信息和排列顺序,确定第一目标应用窗口正投影在第二目标应用窗口的范围内,且所述第一目标应用窗口排列在所述第二目标应用窗口的后边;
    确定所述第一目标应用窗口为所述第三窗口。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述第一过滤规则包括以下至少一项:
    位置位于桌面窗口的区域之外的窗口;
    尺寸小于等于第一阈值的窗口;
    所述多个应用窗口中的一个窗口的阴影窗口;
    属性为目标属性的窗口;或
    属性为被拥有窗口属性,且显示范围未超出拥有窗口显示范围的窗口。
  5. 根据权利要求4所述的方法,其特征在于,所述目标属性包括隐藏属性、不可见属性、透明属性、子窗口属性中的至少一个。
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,还包括:
    当监控到所述第一应用或者所述第一进程中的至少一个窗口切换为预览窗口时,解除对所述第一进程或者所述第一应用的GPU抑制。
  7. 根据权利要求1所述的方法,其特征在于,还包括:
    对所有处于不可见状态的应用窗口进行最小化。
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述至少一个应用窗口发生变化,包括以下至少一项:所述至少一个应用窗口的位置发生变化,所述至少一个应用窗口的状态发生变化,所述至少一个窗口的尺寸发生变化。
  9. 一种电子设备,其特征在于,包括:一个或多个处理器;以及存储器,所述存储器中存储有代码;当所述代码被所述一个或多个处理器执行时,使得所述电子设备执行如权利要求1-8任一项所述的方法。
  10. 一种芯片系统,其特征在于,该芯片系统应用于电子设备,该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行如权利要求1-8任一项所述的方法。
  11. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-8任一项所述的方法。
  12. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-8任一项所述的方法。
PCT/CN2022/136878 2021-12-22 2022-12-06 一种应用程序的抑制方法和电子设备 WO2023116415A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111583775.2 2021-12-22
CN202111583775.2A CN116339486A (zh) 2021-12-22 2021-12-22 一种应用程序的抑制方法和电子设备

Publications (1)

Publication Number Publication Date
WO2023116415A1 true WO2023116415A1 (zh) 2023-06-29

Family

ID=86889966

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/136878 WO2023116415A1 (zh) 2021-12-22 2022-12-06 一种应用程序的抑制方法和电子设备

Country Status (2)

Country Link
CN (1) CN116339486A (zh)
WO (1) WO2023116415A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4954818A (en) * 1985-10-18 1990-09-04 Hitachi, Ltd. Multi-window display control system
CN107787482A (zh) * 2015-09-18 2018-03-09 谷歌有限责任公司 非活动窗口的管理
CN110825524A (zh) * 2019-10-31 2020-02-21 Oppo广东移动通信有限公司 应用运行优化控制方法及相关产品
CN112379808A (zh) * 2020-12-01 2021-02-19 腾讯科技(深圳)有限公司 窗口控制方法、装置、设备及介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4954818A (en) * 1985-10-18 1990-09-04 Hitachi, Ltd. Multi-window display control system
CN107787482A (zh) * 2015-09-18 2018-03-09 谷歌有限责任公司 非活动窗口的管理
CN110825524A (zh) * 2019-10-31 2020-02-21 Oppo广东移动通信有限公司 应用运行优化控制方法及相关产品
CN112379808A (zh) * 2020-12-01 2021-02-19 腾讯科技(深圳)有限公司 窗口控制方法、装置、设备及介质

Also Published As

Publication number Publication date
CN116339486A (zh) 2023-06-27

Similar Documents

Publication Publication Date Title
US20230115868A1 (en) Displaying Interfaces in Different Display Areas Based on Activities
US20220224665A1 (en) Notification Message Preview Method and Electronic Device
EP4030276B1 (en) Content continuation method and electronic device
US11573829B2 (en) Task processing method and apparatus, terminal, and computer readable storage medium
US20240179237A1 (en) Screenshot Generating Method, Control Method, and Electronic Device
WO2021036771A1 (zh) 具有可折叠屏幕的电子设备及显示方法
WO2020037611A1 (zh) 通知消息的处理方法及电子设备
WO2021052415A1 (zh) 资源调度方法及电子设备
US20240134591A1 (en) Projection display method and electronic device
WO2022068483A1 (zh) 应用启动方法、装置和电子设备
WO2022002205A1 (zh) 一种显示方法及电子设备
JP2023506936A (ja) マルチ画面共働方法およびシステム、ならびに電子デバイス
WO2023015956A1 (zh) 控制摄像头的方法、电子设备及计算机可读存储介质
WO2020107463A1 (zh) 一种电子设备的控制方法及电子设备
EP4152782A1 (en) Message pushing method and apparatus
WO2021057472A1 (zh) 一种显示控制方法与电子设备
WO2023088209A1 (zh) 一种跨设备音频数据传输的方法和电子设备
CN117130773A (zh) 资源分配方法、装置和设备
CN113391743B (zh) 一种显示方法及电子设备
WO2021042881A1 (zh) 消息通知方法及电子设备
CN110609650B (zh) 一种应用状态切换方法及终端设备
WO2023116415A1 (zh) 一种应用程序的抑制方法和电子设备
CN115242994A (zh) 视频通话系统、方法和装置
WO2024041006A1 (zh) 一种控制摄像头帧率的方法及电子设备
WO2024032430A1 (zh) 管理内存的方法和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22909730

Country of ref document: EP

Kind code of ref document: A1