Application management method and electronic device

By stopping the layer synthesis processing and interrupting the process of virtual screens when the application is not perceived by the user, it solves the frequent system interaction problems caused by the virtual screen application background operation, avoids black screen or restart, and ensures virtuality when the application is unfreezed Real-time acquisition of screen images.

CN117707715BActive Publication Date: 2024-11-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310610213.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2024-11-01
Estimated Expiration
2043-05-25

AI Technical Summary

Technical Problem

When an application that has created a virtual screen is converted to the background operation, the electronic device may have a black screen or restart problem, mainly due to system problems caused by frequent interactions with the application.

Method used

When the application is in a state that is not perceived by the user, the layer synthesis processing of the virtual screen image is stopped and the application process is interrupted to avoid frequent interaction between the system process; when the application is converted from the background to the foreground, restore the image Layer synthesis processing and process to ensure real-time acquisition of virtual screen images.

Benefits of technology

It effectively avoids black screen or restart problems caused by frequent interactions between system processes, and ensures that the application can obtain images of the virtual screen in real time when it is unfreezed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707715B_ABST
    Figure CN117707715B_ABST
Patent Text Reader

Abstract

The embodiments of the present application are applicable to the field of data processing technology, and provide an application management method and an electronic device, including: determining whether a first application creates a virtual screen, and if the first application creates a virtual screen, then when the electronic device is in a first state, stopping layer synthesis processing on the image of the virtual screen, and then performing a first process on the first application, wherein the first state refers to the electronic device stopping outputting first information through the first application, and the first process refers to interrupting the process of the first application. When the electronic device stops outputting the first information through the first application, it is equivalent to being in a state where the first application is not perceived by the user. The electronic device first stops layer synthesis processing on the image of the virtual screen, and then interrupts the process of the first application. This can avoid the problem of a black screen or restart of the electronic device due to problems with the system process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and more specifically, to an application management method and an electronic device. Background Art

[0002] At present, most applications (Application, App) support the function of virtual screen. Among them, the virtual screen refers to a virtual interface created and destroyed by the application. Among them, the interface of the virtual screen is usually not the display interface actually displayed by the electronic device.

[0003] It should be understood that in the process of displaying the display interface of the application, before each frame of the image is sent for display, the electronic device needs to perform image synthesis on the data to be displayed through the layer synthesis (SurfaceFlinger) module to obtain the synthesized image, and then send the synthesized image to the display screen for display. If the application creates a virtual screen, the SurfaceFlinger module also needs to perform layer synthesis processing on the data to be displayed corresponding to the virtual screen to obtain the synthesized image, and then send the synthesized image to the application, and the application determines the purpose of the synthesized image. For example, the application can send the synthesized image to the projection device so that the projection device displays the synthesized image. Alternatively, the application can encode the synthesized image, generate a file in video format, and store the file. However, when the application that creates the virtual screen is turned to the background, the electronic device usually interrupts the thread corresponding to the application to reduce the CPU load. In this case, since the application creates a virtual screen, the system process in the electronic device still needs to interact with the application frequently, which may cause problems with the system process, and then cause the electronic device to have a black screen or restart problem.

[0004] Based on this, how to avoid the problem of black screen or restart of electronic devices when the application that creates the virtual screen runs in the background has become an urgent problem to be solved. Summary of the invention

[0005] The present application provides an application management method, which can avoid the problem of black screen or restart of electronic device when the application that creates a virtual screen is switched to background operation.

[0006] In a first aspect, a method for managing an application is provided, the method being applied to an electronic device, the electronic device including a first application, including:

[0007] Determining whether the first application creates a virtual screen;

[0008] If the first application creates a virtual screen, then when the electronic device is in a first state, the layer synthesis process of the image of the virtual screen is stopped, and the first state means that the electronic device stops outputting first information through the first application, and the type of the first information includes audio, picture, video and / or vibration;

[0009] A first process is performed on the first application, where the first process is a process of interrupting the process of the first application.

[0010] The application management method provided by the embodiment of the present application is applied to an electronic device, including determining whether a first application creates a virtual screen. If the first application creates a virtual screen, when the electronic device is in a first state, the layer synthesis processing of the image of the virtual screen is stopped, and then the first processing is performed on the first application, wherein the first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. The first processing refers to the processing of interrupting the process of the first application. When the electronic device stops outputting audio type, picture type, video type and / or vibration type information through the first application, it is equivalent to being in a state where the first application is not perceived by the user. In this case, the electronic device first stops the layer synthesis processing of the image of the virtual screen, and then interrupts the process of the first application. In this way, the problem of frequent interaction between the system process and the first application due to the first application still performing layer synthesis processing on the image of the virtual screen after the process of the first application is interrupted can be avoided, thereby avoiding problems with the system process caused by frequent interaction between the system process and the first application, thereby avoiding problems with the electronic device caused by problems with the system process. Black screen or restart problems caused by problems with the system process are avoided.

[0011] In combination with the first aspect, in some embodiments of the first aspect, the method also includes: when the electronic device is converted from a first state to a second state, resuming layer synthesis processing of the image of the virtual screen, the second state means that the electronic device resumes outputting the first information through the first application; performing a second processing on the first application, and the second processing refers to the processing of resuming the process of the first application.

[0012] The application management method provided in the embodiment of the present application is applied to an electronic device, comprising determining whether a first application creates a virtual screen, and if the first application creates a virtual screen, then when the electronic device is in a first state, stopping layer synthesis processing on the image of the virtual screen, and then performing a first process on the first application, wherein the first state refers to the electronic device stopping outputting first information through the first application, the type of the first information includes audio, picture, video and / or vibration, the first process refers to the process of interrupting the process of the first application, and when the electronic device is converted from the first state to the second state, resuming layer synthesis processing on the image of the virtual screen, and then performing a second process on the first application, the second process refers to resuming the first application The second state refers to the state in which the electronic device resumes outputting the first information through the first application, and the second processing refers to the processing of resuming the process of the first application, that is, when the first application in the electronic device is converted from a state not perceived by the user (the first state) to a state perceived by the user (the second state), the electronic device first resumes the layer synthesis processing of the image of the virtual screen, and then unfreezes the first application, so that before the first application is unfrozen, the image of the virtual screen has begun to undergo layer synthesis processing, that is, when the first application is unfrozen, the electronic device can obtain the image of the virtual screen, thereby avoiding the problem of not being able to obtain the image of the virtual screen in real time when the first application is unfrozen.

[0013] In combination with the first aspect, in some embodiments of the first aspect, the electronic device further includes a second application, and the second state includes a state in which the second application requests to communicate with the first application.

[0014] In combination with the first aspect, in some embodiments of the first aspect, the second state includes a state in which the first application program switches from background running to foreground running.

[0015] In combination with the first aspect, in some embodiments of the first aspect, the second state includes a state in which the electronic device switches from a screen-off state to a screen-on state.

[0016] In combination with the first aspect, in some embodiments of the first aspect, the electronic device also includes a third application and an image synthesis SurfaceFlinger module, the third application is used to manage the first application, the image synthesis module is used to perform layer synthesis processing, and when the electronic device is in a first state, the layer synthesis processing of the image on the virtual screen is stopped, including: when the electronic device is in the first state, the third application sends a first instruction to the SurfaceFlinger module, the first instruction is used to instruct the SurfaceFlinger module to stop performing layer synthesis processing on the image on the virtual screen; the SurfaceFlinger module responds to the first instruction and stops performing layer synthesis processing on the image on the virtual screen.

[0017] In combination with the first aspect, in some embodiments of the first aspect, the above-mentioned first processing of the first application includes: the third application sends a second instruction to the first application, the second instruction is used to instruct to interrupt the process of the first application; the first application responds to the second instruction and interrupts the process of the first application.

[0018] In combination with the first aspect, in some embodiments of the first aspect, the electronic device includes a third application and an image synthesis SurfaceFlinger module, the third application is used to manage the first application, the image synthesis module is used to perform layer synthesis processing, and when the electronic device is converted from the first state to the second state, the layer synthesis processing of the image of the virtual screen is restored, including:

[0019] When the electronic device is converted from the first state to the second state, the third application sends a third instruction to the SurfaceFlinger module, and the third instruction is used to instruct the SurfaceFlinger module to resume layer synthesis processing of the image of the virtual screen; the SurfaceFlinger module responds to the third instruction and resumes layer synthesis processing of the image of the virtual screen.

[0020] The application management method provided in the embodiment of the present application is applied to an electronic device, which includes a first application, a second application, an application "power saving wizard" (equivalent to a third application), an image synthesis SurfaceFlinger module, a display manager and a window manager. The method includes the display manager determining whether the first application creates a virtual screen. When the first application creates a virtual screen, the window manager determines whether the electronic device is in a first state, and then when the electronic device is in the first state, the "power saving wizard" sends a first instruction to the SurfaceFlinger module to instruct to stop layer synthesis processing of the image of the virtual screen, and then sends a second instruction to the first application to interrupt the process of the first application through the "power saving wizard". Because the layer synthesis processing of the image of the virtual screen is stopped before the process of the first application is interrupted, it is possible to avoid the problem of frequent interaction between the system process and the first application due to the first application continuing to perform layer synthesis processing on the image of the virtual screen after the process of the first application is interrupted, thereby avoiding problems with the system process caused by frequent interaction between the system process and the first application, thereby avoiding the problem of a black screen or restart of the electronic device due to problems with the system process.

[0021] In combination with the first aspect, in some embodiments of the first aspect, the above-mentioned second processing of the first application includes: the third application sends a fourth instruction to the first application, and the fourth instruction is used to instruct to resume the process of the first application; the first application responds to the fourth instruction and resumes the process of the first application.

[0022] The application management method provided in the embodiment of the present application is applied to an electronic device, which includes a first application, a second application, an application "power saving wizard", an image synthesis SurfaceFlinger module, a display manager and a window manager. In the process of thawing the first application, the window manager determines that the first application is switched from background operation to foreground operation, or the window manager determines the operation of switching the electronic device from screen off to screen on, or when the second application requests to establish a communication connection with the first application, the "power saving wizard" first sends an instruction to the SurfaceFlinger module to instruct the SurfaceFlinger module to resume layer synthesis processing of the image of the virtual screen, and then sends an instruction to the first application to resume the process of the first application. In this way, before the first application is thawed, the image of the virtual screen has begun to be layer synthesized. That is, when the first application is thawed, the electronic device can obtain the image of the virtual screen, avoiding the problem of not being able to obtain the image of the virtual screen in real time when the first application is thawed.

[0023] In a second aspect, an application management device is provided, comprising a unit for executing any one of the methods in the first aspect. The device may be a server, a terminal device, or a chip in a terminal device. The device may include an input unit and a processing unit.

[0024] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory, which is used to store computer program code. When the processor executes the computer program code stored in the memory, the terminal device executes any one of the methods in the first aspect.

[0025] When the device is a chip in a terminal device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin or a circuit, etc.; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods in the first aspect.

[0026] In a possible implementation, a memory is used to store computer program code; a processor executes the computer program code stored in the memory, and when the computer program code stored in the memory is executed, the processor is used to execute:

[0027] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code, and when the computer program code is executed by an application management device, the application management device executes any one of the application management methods according to the first aspect.

[0028] In a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by a management device of an application, the management device of the application executes any one of the device methods in the first aspect.

[0029] The application management method provided by the embodiment of the present application is applied to an electronic device, including determining whether a first application creates a virtual screen. If the first application creates a virtual screen, when the electronic device is in a first state, the layer synthesis processing of the image of the virtual screen is stopped, and then the first processing is performed on the first application, wherein the first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. The first processing refers to the processing of interrupting the process of the first application. When the electronic device stops outputting audio type, picture type, video type and / or vibration type information through the first application, it is equivalent to being in a state where the first application is not perceived by the user. In this case, the electronic device first stops the layer synthesis processing of the image of the virtual screen, and then interrupts the process of the first application. In this way, the problem of frequent interaction between the system process and the first application due to the first application still performing layer synthesis processing on the image of the virtual screen after the process of the first application is interrupted can be avoided, thereby avoiding problems with the system process caused by frequent interaction between the system process and the first application, thereby avoiding problems with the electronic device caused by problems with the system process. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a schematic diagram of a hardware system of an electronic device applicable to the present application;

[0031] Figure 2 is a schematic diagram of a software system for an electronic device applicable to the present application;

[0032] Figure 3 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0033] Figure 4 It is a flowchart of a method for managing an application program provided in an embodiment of the present application;

[0034] Figure 5 It is a flowchart of a method for managing an application program provided in an embodiment of the present application;

[0035] Figure 6 It is a flowchart of a method for managing an application program provided in an embodiment of the present application;

[0036] Figure 7 It is a flowchart of a method for managing an application program provided in an embodiment of the present application;

[0037] Figure 8 It is a schematic diagram of a management device for an application program provided by the present application;

[0038] Fig. 9 It is a schematic diagram of an electronic device for managing an application provided by the present application. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0040] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0041] To facilitate understanding, some of the examples given are provided for reference to the description of concepts related to the embodiments of the present application.

[0042] 1. Virtual screen

[0043] The virtual screen may refer to a virtual display interface created and destroyed by an application in an electronic device. The virtual screen may be the same as or different from the interface content displayed by the electronic device, and the embodiment of the present application does not limit this.

[0044] It should be understood that before displaying the interface through the display screen, the electronic device usually first performs layer synthesis processing on the content to be displayed through the layer synthesis (SurfaceFlinger) module, and then sends the synthesized image to the display screen for display. Similarly, after the application creates a virtual screen, it will also perform layer synthesis processing on the image of the virtual screen to obtain a synthesized image, which is the interface of the virtual screen. However, the interface of the virtual screen is usually not displayed. The application can store the interface of the virtual screen as a video file or image file, or it can send the interface of the virtual screen to the projection device so that the projection device displays the interface of the virtual screen.

[0045] Exemplarily, a screen recording program for recording the screen can create a virtual screen based on the currently displayed interface, copy the currently displayed interface to obtain the interface of the virtual screen, and store the interface of the virtual screen as a video file to realize the recording function of the current interface.

[0046] 2. Freezing of applications

[0047] In order to reduce the load on the central processing unit (CPU), when the application is not perceived by the user, the electronic device can interrupt the process of the application to reduce the load on the CPU and thereby reduce the power consumption of the electronic device. The state in which the electronic device interrupts the process of the application when the application is not perceived by the user is called freezing of the application. Among them, the application not being perceived by the user can mean that the application does not output information to the outside, so that the user cannot perceive that the application is in a working state, which can specifically include: the application does not output audio signals, video signals, or the application does not control the vibration of the electronic device, or the application does not download data, or the application does not output navigation information to the user.

[0048] At this stage, the application obtains the relevant data of the frame image to be displayed, processes the relevant data of the frame image to be displayed according to a fixed process, and sends it to the display screen. The above fixed process mainly includes the drawing and rendering process, the layer synthesis process and the display sending process. In other words, for a certain frame image, the electronic device needs to execute the drawing and rendering process, the layer synthesis process and the display sending process in sequence before it can be displayed on the display screen. Among them, the layer synthesis process can be implemented by the layer synthesis (SurfaceFlinger) module to realize layer synthesis.

[0049] It should be understood that when the application creates a virtual screen, a drawing and rendering process, a layer synthesis process, and a display sending process are executed for the relevant data displayed on the display screen. For the relevant data of the virtual screen, the drawing and rendering process and the layer synthesis process are executed, and the synthesized image is not sent to the display process. The purpose of the synthesized image is usually determined by the application.

[0050] For example, the application can send the synthesized image to the projection device so that the projection device displays the synthesized image. Alternatively, the application can encode the synthesized image, generate a file in video format, and store the file. However, when the application that creates the virtual screen is in a state that is not perceived by the user (for example, the application is switched to background running), the electronic device usually interrupts the thread corresponding to the application to reduce the CPU load and thus reduce the power consumption of the electronic device. In this case, since the application creates a virtual screen, the system process in the electronic device still needs to interact with the application frequently, which may cause problems with the system process, and then cause the electronic device to have a black screen or restart problem.

[0051] In view of this, an embodiment of the present application provides an application management method, which is applied to an electronic device, including determining whether a first application creates a virtual screen. If the first application creates a virtual screen, when the electronic device is in a first state, the layer synthesis processing of the image of the virtual screen is stopped, and then the first processing is performed on the first application, wherein the first state refers to the electronic device stopping outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. The first processing refers to the processing of interrupting the process of the first application. When the electronic device stops outputting audio type, picture type, video type and / or vibration type information through the first application, it is equivalent to being in a state where the first application is not perceived by the user. In this case, the electronic device first stops performing layer synthesis processing on the image of the virtual screen, and then interrupts the process of the first application. In this way, the problem of frequent interaction between the system process and the first application due to the first application still performing layer synthesis processing on the image of the virtual screen after the process of the first application is interrupted can be avoided, thereby avoiding problems with the system process caused by frequent interaction between the system process and the first application, thereby avoiding problems with the electronic device caused by problems with the system process.

[0052] The management method of the application provided in the embodiment of the present application can be applied to electronic devices. Optionally, the electronic device includes a terminal device, which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the terminal device.

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

[0054] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

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

[0056] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

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

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

[0059] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0060] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0061] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

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

[0063] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0064] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0065] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0066] It should be noted that any electronic device mentioned in the embodiments of the present application may include more or fewer modules in the electronic device 100.

[0067] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0068] Figure 2 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0069] The layered architecture of the electronic device 100 divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.

[0070] The application layer can include a series of application packages.

[0071] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, power saving wizard, etc.

[0072] Among them, Power Saver can be used to manage various applications.

[0073] For example, when the "Map" application is switched to the background, the Power Saver can interrupt the process of the "Map" application to reduce the CPU load and thus reduce the power consumption of the electronic device. When the "Map" application is switched from the background to the foreground, the Power Saver can restore the process of the "Map" application so that the "Map" application can run normally.

[0074] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0075] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a display manager, a layer synthesis SurfaceFlinger module, etc.

[0076] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0077] The window manager can also determine whether the application is in a state that is not perceived by the user based on changes in the display screen.

[0078] The display manager can be used to determine whether an application has created a virtual screen.

[0079] The SurfaceFlinger module is used to execute the layer synthesis process when receiving a layer synthesis trigger signal.

[0080] For example, the SurfaceFlinger module may execute a layer synthesis process upon receiving a layer synthesis trigger signal to generate an image of the interface displayed on the physical screen.

[0081] For another example, the SurfaceFlinger module may execute a layer synthesis process upon receiving a layer synthesis trigger signal to generate an image of an interface on the virtual screen.

[0082] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0083] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0084] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0085] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0086] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0087] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0088] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0089] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0090] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0091] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0092] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0093] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0094] A 2D graphics engine is a drawing engine for 2D drawings.

[0095] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, Wi-Fi driver, etc.

[0096] It should be noted that the electronic device mentioned in the embodiments of the present application may include more or fewer modules in the above-mentioned electronic device.

[0097] The application scenarios provided by the embodiments of the present application are described below with reference to the accompanying drawings.

[0098] Figure 3 Schematic diagram of an application scenario of the application management method provided in the embodiment of the present application. Figure 3 As shown in (a) of FIG. 1 , the user clicks on the application "Screen Recording" 10, and the mobile phone starts running the application "Screen Recording". In order to allow the user to view the recorded interface more intuitively, "Screen Recording" usually creates a virtual screen so that the user can observe the recorded content. Then the user slides up, as shown in FIG. Figure 3 As shown in (b) in the figure. In response to the user's sliding operation, the mobile phone will display the display interface of the application "Video Play" and start recording the current interface through "Screen Recording". At this time, although the interface being displayed is the "Video Play" interface, it is equivalent to the virtual screen created by "Screen Recording", and "Screen Recording" is turned into background operation, as shown in the figure. Figure 3As shown in (c) in the figure. Compared with the interface of "Video Play", the display interface of the virtual screen created by "Screen Recording" adds controls 20 and 30 indicating that the screen is being recorded. In this case, since "Screen Recording" creates a virtual screen, when "Screen Recording" is turned into background operation, the system process in the electronic device will frequently interact with the virtual screen, which may cause the electronic device to have a black screen or freeze, such as Figure 3 The application management method provided in the embodiment of the present application can avoid the above situation.

[0099] It should be understood that the above is an example of an application scenario and does not limit the application scenario of the present application.

[0100] Combine the following Figures 4 to 7 The application management method provided in the embodiment of the present application is described in detail.

[0101] Figure 4 A flowchart of a method for managing an application program provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the method includes:

[0102] S101: Determine whether a first application creates a virtual screen.

[0103] The first application may be an application in the electronic device that can create a virtual screen. For example, the first application may be "Screen Recording" or "Hello Bike". TM ", or "Honor VR TM ", and this embodiment of the present application does not limit this.

[0104] If the first application creates a virtual screen, S102 is executed.

[0105] S102: When the electronic device is in the first state, stop performing layer synthesis processing on the image of the virtual screen.

[0106] The first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. Since the electronic device stops outputting audio, picture, video and / or vibration type information through the first application, the user cannot perceive the first application. In other words, when the electronic device is in the first state, the first application cannot be perceived by the user.

[0107] For example, when the electronic device is in the screen-off state, the first application cannot output audio, picture, video and / or vibration type information, so the first application cannot be perceived by the user. That is, the electronic device being in the first state may mean that the electronic device is in the screen-off state.

[0108] For another example, when a first application in an electronic device is switched to background operation, the first application cannot output audio, image, video and / or vibration type information, and thus the first application cannot be perceived by a user. That is, the electronic device being in the first state may refer to a state in which the first application in the electronic device is running in the background.

[0109] When the electronic device is in the first state, the electronic device can interrupt the process of performing layer synthesis processing on the image of the virtual screen, so that the electronic device stops performing layer synthesis processing on the image of the virtual screen. Since the electronic device interrupts the process of performing layer synthesis processing on the image of the virtual screen, the system process of the electronic device will not frequently interact with the first application based on the process of the virtual screen.

[0110] S103: Perform a first process on the first application.

[0111] The first process refers to a process of interrupting the process of the first application.

[0112] It should be understood that interrupting the process of the first application is equivalent to freezing the first application. In the application management method provided in the embodiment of the present application, when the first application in the electronic device is not perceived by the user, the electronic device first stops the layer synthesis processing of the image of the virtual screen created by the first application, and then freezes the first application.

[0113] The application management method provided by the embodiment of the present application is applied to an electronic device, including determining whether a first application creates a virtual screen. If the first application creates a virtual screen, when the electronic device is in a first state, the layer synthesis processing of the image of the virtual screen is stopped, and then the first processing is performed on the first application, wherein the first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. The first processing refers to the processing of interrupting the process of the first application. When the electronic device stops outputting audio type, picture type, video type and / or vibration type information through the first application, it is equivalent to being in a state where the first application is not perceived by the user. In this case, the electronic device first stops the layer synthesis processing of the image of the virtual screen, and then interrupts the process of the first application. In this way, the problem of frequent interaction between the system process and the first application due to the first application still performing layer synthesis processing on the image of the virtual screen after the process of the first application is interrupted can be avoided, thereby avoiding problems with the system process caused by frequent interaction between the system process and the first application, thereby avoiding problems with the electronic device caused by problems with the system process.

[0114] In one possible case, when the first application is converted from a state not perceived by the user to a state perceived by the user, that is, when the first application is converted from a first state to a second state, the electronic device will first resume the layer synthesis processing of the image on the virtual screen, and then resume the process of the first application. The second state can be a state in which the second application requests to communicate with the first application, or a state in which the first application is converted from background operation to foreground operation, or a state in which the electronic device is converted from screen off to screen on. Figure 5 The illustrated embodiment is described in detail.

[0115] Figure 5 A flowchart of a method for managing an application in another embodiment provided in the present application is shown in FIG. Figure 5 As shown, the method includes:

[0116] S201: Determine whether a first application creates a virtual screen.

[0117] If the first application creates a virtual screen, S102 is executed.

[0118] S202: When the electronic device is in the first state, stop performing layer synthesis processing on the image of the virtual screen.

[0119] The first state means that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration.

[0120] S203: Perform a first process on the first application, where the first process refers to a process of interrupting the process of the first application.

[0121] S204: When the electronic device is converted from the first state to the second state, the layer synthesis process of the image on the virtual screen is resumed.

[0122] Among them, the second state refers to the state in which the electronic device resumes outputting the first information through the first application. It should be understood that the type of the first information may include audio, picture, video and / or vibration. When the electronic device resumes outputting audio, picture, video and / or vibration type information through the first application, the user can perceive the information output by the first application, that is, the first application can be perceived by the user. When the first application is converted from a state in which it is not perceived by the user (first state) to a state in which the first application can be perceived by the user (second state), the electronic device can perform layer synthesis processing on the image of the virtual screen, that is, the process of restoring the virtual screen.

[0123] Optionally, the second state includes a state in which the second application requests to communicate with the first application.

[0124] It should be understood that the second application may refer to other applications in the electronic device besides the first application. When the second application requests to establish communication with the first application, it is usually necessary to wake up the first application from a frozen state, that is, to restore the process of the first application. The application management method provided in the embodiment of the present application first restores the layer synthesis processing of the image of the virtual screen before waking up the first application.

[0125] Optionally, the second state includes a state in which the first application program switches from running in the background to running in the foreground.

[0126] When the first application is running in the background, the first application usually does not output information and is not perceived by the user; when the first application is running in the foreground, the first application starts to output information and is perceived by the user. Therefore, when the first application switches from running in the background to running in the foreground, it is usually necessary to wake up the first application from a frozen state to a normal state, that is, it is necessary to restore the process of the first application. The application management method provided in the embodiment of the present application first restores the layer synthesis processing of the image of the virtual screen before waking up the first application.

[0127] Optionally, the second state includes a state in which the electronic device switches from a screen-off state to a screen-on state.

[0128] Usually, when the screen of the electronic device is off, the first application usually does not output information and is not perceived by the user; when the screen of the electronic device turns from off to on, the first application starts to output information and is perceived by the user. Therefore, when the electronic device turns from off to on, it is usually necessary to wake up the first application from a frozen state to a normal state, that is, it is necessary to restore the process of the first application. The application management method provided in the embodiment of the present application first restores the layer synthesis processing of the image of the virtual screen before waking up the first application.

[0129] S205: Perform a second process on the first application, where the second process refers to a process of restoring the process of the first application.

[0130] It should be understood that restoring the process of the first application is equivalent to unfreezing the first application. In the application management method provided in the embodiment of the present application, when the first application in the electronic device is converted from a state not perceived by the user to a state perceived by the user, the electronic device first resumes the layer synthesis processing of the image of the virtual screen created by the first application, and then unfreezes the first application.

[0131] The application management method provided in the embodiment of the present application is applied to an electronic device, comprising determining whether a first application creates a virtual screen, and if the first application creates a virtual screen, then when the electronic device is in a first state, stopping layer synthesis processing on the image of the virtual screen, and then performing a first process on the first application, wherein the first state refers to the electronic device stopping outputting first information through the first application, the type of the first information includes audio, picture, video and / or vibration, the first process refers to the process of interrupting the process of the first application, and when the electronic device is converted from the first state to the second state, resuming layer synthesis processing on the image of the virtual screen, and then performing a second process on the first application, the second process refers to resuming the first application The second state refers to the state in which the electronic device resumes outputting the first information through the first application, and the second processing refers to the processing of resuming the process of the first application, that is, when the first application in the electronic device is converted from a state not perceived by the user (the first state) to a state perceived by the user (the second state), the electronic device first resumes the layer synthesis processing of the image of the virtual screen, and then unfreezes the first application, so that before the first application is unfrozen, the image of the virtual screen has begun to undergo layer synthesis processing, that is, when the first application is unfrozen, the electronic device can obtain the image of the virtual screen, thereby avoiding the problem of not being able to obtain the image of the virtual screen in real time when the first application is unfrozen.

[0132] In one possible case, the electronic device includes an application called "Power Saving Wizard" (equivalent to the third application), wherein the "Power Saving Wizard" can interrupt the process of other applications (such as the first application) when other applications are switched to background operation, thereby reducing the power consumption of the electronic device. It should be understood that the software framework of the electronic device to which the application management method provided in the embodiment of the present application is applied can be as follows: Figure 2 As shown, it includes a first application, a second application, an application "power saving wizard", an image synthesis SurfaceFlinger module, a display manager and a window manager. Figure 6 and Figure 7 Let me explain in detail.

[0133] Figure 6 A flowchart of a method for managing an application provided in an embodiment of the present application is provided, wherein the method is applied to an electronic device, wherein the electronic device includes a first application, a second application, an application "power saving wizard", an image synthesis SurfaceFlinger module, a display manager, and a window manager, such as Figure 6 As shown, the method includes:

[0134] S301: The display manager determines whether a first application creates a virtual screen.

[0135] If the first application creates a virtual screen, S302 is executed.

[0136] It should be understood that the Display Manager can be used to determine whether the application has created a virtual screen. For example, the Display Manager can determine whether the first application has created a virtual screen based on whether the first application has called the "create Virtual Display" function. If the Display Manager determines that the first application has called the "createVirtual Display" function, then the first application has created a virtual screen; if the Display Manager determines that the first application has not called the "create Virtual Display" function, then the first application has not created a virtual screen.

[0137] S302: The window manager determines whether the electronic device is in a first state.

[0138] The first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. Since the electronic device stops outputting audio, picture, video and / or vibration type information through the first application, the user cannot perceive the first application. In other words, when the electronic device is in the first state, the first application cannot be perceived by the user.

[0139] If the electronic device is in the first state, S303 is executed.

[0140] It should be understood that when the window manager determines that the electronic device is in the first state, the window manager can send information indicating that the electronic device is in the first state to the "power saving wizard" so that the "power saving wizard" executes corresponding method steps based on the state of the electronic device.

[0141] S303, the “Power Saving Wizard” sends a first instruction to the SurfaceFlinger module.

[0142] The first instruction may refer to an instruction for instructing the SurfaceFlinger module to stop performing layer synthesis processing on the image of the virtual screen.

[0143] "Power Saving Wizard" may refer to an application for managing applications in an electronic device, that is, a third application. Among them, "Power Saving Wizard" can interrupt the process related to the first application when the first application is in a frozen state to reduce the load of the electronic device processor and thus reduce the power consumption of the electronic device. "Power Saving Wizard" can also restore the process related to the first application when the first application is awakened from the frozen state so that the first application can work normally.

[0144] It should be understood that when the window manager determines that the electronic device is in the first state, the window manager can send information indicating that the electronic device is in the first state to the "power saving wizard". After receiving the above information, the "power saving wizard" sends a first instruction to the SurfaceFlinger module.

[0145] S304. The SurfaceFlinger module stops performing layer synthesis processing on the image of the virtual screen in response to the first instruction.

[0146] It should be understood that the SurfaceFlinger module stops performing layer synthesis processing on the image of the virtual screen in response to the first instruction, which is equivalent to the SurfaceFlinger module interrupting the process of performing layer synthesis processing on the image of the virtual screen.

[0147] S305, the "Power Saving Wizard" sends a second instruction to the first application.

[0148] The second instruction is used to instruct to interrupt the process of the first application.

[0149] After the "Power Saving Wizard" sends the first instruction to the SurfaceFlinger module, the "Power Saving Wizard" sends a second instruction to the first application to instruct the first application to interrupt the process. That is, the "Power Saving Wizard" can first send the first instruction to instruct the SurfaceFlinger module to stop the layer synthesis processing of the image of the virtual screen, and then send the second instruction to instruct the first application to interrupt the process.

[0150] S306: The first application program interrupts the process of the first application program in response to the second instruction.

[0151] The application management method provided in the embodiment of the present application is applied to an electronic device, which includes a first application, a second application, an application "power saving wizard", an image synthesis SurfaceFlinger module, a display manager and a window manager. The method includes the Display Manager determining whether the first application creates a virtual screen. When the first application creates a virtual screen, the window manager determines whether the electronic device is in a first state, and then when the electronic device is in the first state, the "power saving wizard" sends a first instruction to the SurfaceFlinger module to instruct to stop layer synthesis processing of the image of the virtual screen, and then the "power saving wizard" sends a second instruction to the first application to instruct to interrupt the process of the first application. Because the layer synthesis processing of the image of the virtual screen is stopped before the process of the first application is interrupted, it is possible to avoid the problem of frequent interaction between the system process and the first application due to the first application continuing to perform layer synthesis processing on the image of the virtual screen after the process of the first application is interrupted, thereby avoiding problems with the system process caused by frequent interaction between the system process and the first application, thereby avoiding the problem of a black screen or restart of the electronic device due to problems with the system process.

[0152] S307: The window manager determines whether the first application program is switched from background operation to foreground operation.

[0153] It should be understood that the window manager can be used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc., to determine whether the first application is switched from background operation to foreground operation according to the display content on the current display interface. Usually, when the first application is switched from background operation to foreground operation, the first application begins to be perceived by the user.

[0154] If the first application program is switched from background operation to foreground operation, S311 is executed.

[0155] It should be understood that when the window manager determines that the first application is switched from background operation to foreground operation, the window manager can send information to the "power saving wizard" instructing the electronic device to switch from screen off to screen on, so that the "power saving wizard" executes method step S311.

[0156] S308: The window manager determines whether a first operation of the user is detected.

[0157] Among them, the first operation may refer to the operation of switching the electronic device from screen off to screen on.

[0158] It should be understood that the window manager can be used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc., to determine whether the electronic device switches from the off screen to the bright screen according to the display content on the current display interface. Usually, when the electronic device switches from the off screen to the bright screen, the first application running in the foreground of the electronic device begins to be perceived by the user.

[0159] If the user's first operation is detected, S311 is executed.

[0160] It should be understood that when the window manager determines that the electronic device switches from off screen to bright screen, the window manager can send information to the "power saving wizard" instructing the electronic device to switch from off screen to bright screen, so that the "power saving wizard" executes the method step S311.

[0161] S309: The second application sends a first request to the “Power Saving Wizard”.

[0162] The first request is used to indicate that the second application requests to establish communication with the first application.

[0163] It should be understood that the second application may refer to other applications in the electronic device except the first application. When the first application is in a frozen state, the second application needs to communicate with the first application, and needs to first send a first request to the "Power Saving Wizard" to instruct the second application to request to establish communication with the first application.

[0164] S310 , the “power saving wizard” responds to the first request and executes S311 .

[0165] S311, “Power Saving Wizard” sends a third instruction to the SurfaceFlinger module.

[0166] The third instruction is used to instruct the SurfaceFlinger module to resume layer synthesis processing on the image of the virtual screen.

[0167] S312. The SurfaceFlinger module responds to the third instruction and resumes layer synthesis processing on the image of the virtual screen.

[0168] Since the SurfaceFlinger module stops performing layer synthesis processing on the image of the virtual screen when the first application is in the frozen state, when the "Power Saving Wizard" sends the third instruction to the SurfaceFlinger module, the SurfaceFlinger module resumes performing layer synthesis processing on the image of the virtual screen.

[0169] It should be understood that the "Power Saving Wizard" sends the third instruction to the SurfaceFlinger module when the window manager determines that the first application is running from the background to the foreground, or the window manager determines that the user's first operation is detected, or the second application sends a first request to the "Power Saving Wizard". Therefore, it is equivalent to the SurfaceFlinger module resuming the layer synthesis processing of the image of the virtual screen when the window manager determines whether the first application is running from the background to the foreground, or the window manager determines whether the user's first operation is detected, the SurfaceFlinger module resumes the layer synthesis processing of the image of the virtual screen, or the second application sends the first request to the "Power Saving Wizard". The SurfaceFlinger module resumes the layer synthesis processing of the image of the virtual screen.

[0170] S313, the “Power Saving Wizard” sends a fourth instruction to the first application.

[0171] The fourth instruction is used to instruct the process of resuming the first application.

[0172] S314: The first application resumes the process of the first application in response to the fourth instruction.

[0173] It should be understood that restoring the process of the first application is equivalent to unfreezing the first application. In the application management method provided in the embodiment of the present application, when the first application in the electronic device is converted from a state not perceived by the user to a state perceived by the user, the SurfaceFlinger module resumes the layer synthesis processing of the image of the virtual screen, and then resumes the process of the first application.

[0174] For example, when the window manager determines that the first application is switched from background operation to foreground operation, the SurfaceFlinger module resumes layer synthesis processing on the image of the virtual screen, and then resumes the process of the first application.

[0175] For another example, when the window manager determines that a first operation of the user switching the electronic device from screen-off to screen-on is detected, the SurfaceFlinger module resumes layer synthesis processing of the image of the virtual screen, and then resumes the process of the first application.

[0176] For another example, when the second application sends a first request to the "Power Saving Wizard" to establish communication with the first application, the SurfaceFlinger module resumes the layer synthesis processing of the image on the virtual screen, and then resumes the process of the first application.

[0177] The application management method provided in the embodiment of the present application is applied to an electronic device, which includes a first application, a second application, an application "power saving wizard", an image synthesis SurfaceFlinger module, a display manager and a window manager. In the process of thawing the first application, the window manager determines that the first application is switched from background operation to foreground operation, or the window manager determines the operation of switching the electronic device from screen off to screen on, or when the second application requests to establish a communication connection with the first application, the "power saving wizard" first sends an instruction to the SurfaceFlinger module to instruct the SurfaceFlinger module to resume layer synthesis processing of the image of the virtual screen, and then sends an instruction to the first application to resume the process of the first application, so that before the first application is thawed, the image of the virtual screen has begun to be layer synthesized. That is, when the first application is thawed, the electronic device can obtain the image of the virtual screen, avoiding the problem of not being able to obtain the image of the virtual screen in real time when the first application is thawed.

[0178] In one possible case, the first application does not create a virtual screen, and the "power saving wizard" can directly freeze the first application without the user noticing the first application to reduce the power consumption of the electronic device. Figure 7 Let me explain in detail.

[0179] Figure 7 A flowchart of a method for managing an application provided in an embodiment of the present application is provided, wherein the method is applied to an electronic device, wherein the electronic device includes a first application, a second application, an application "power saving wizard", an image synthesis SurfaceFlinger module, a display manager, and a window manager, such as Figure 7 As shown, the method includes:

[0180] S401: The display manager determines whether a first application creates a virtual screen.

[0181] If the first application creates a virtual screen, S402 is executed.

[0182] If the first application does not create a virtual screen, execute S414.

[0183] S402: The window manager determines whether the electronic device is in a first state.

[0184] The first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. Since the electronic device stops outputting audio, picture, video and / or vibration type information through the first application, the user cannot perceive the first application. In other words, when the electronic device is in the first state, the first application cannot be perceived by the user.

[0185] If the electronic device is in the first state, S403 is executed.

[0186] S403, the “Power Saving Wizard” sends a first instruction to the SurfaceFlinger module.

[0187] The first instruction is used to instruct the SurfaceFlinger module to stop performing layer synthesis processing on the image of the virtual screen.

[0188] S404. The SurfaceFlinger module stops performing layer synthesis processing on the image of the virtual screen in response to the first instruction.

[0189] S405, the "power saving wizard" sends a second instruction to the first application.

[0190] The second instruction is used to instruct to interrupt the process of the first application.

[0191] S406: The first application program interrupts the process of the first application program in response to the second instruction.

[0192] S407: The window manager determines whether the first application program is switched from background operation to foreground operation.

[0193] If the first application program is switched from background operation to foreground operation, S411 is executed.

[0194] It should be understood that when the window manager determines that the first application is switched from background operation to foreground operation, the window manager can send information to the "power saving wizard" instructing the electronic device to switch from screen off to screen on, so that the "power saving wizard" executes method step S411.

[0195] S408: The window manager determines whether a first operation of the user is detected.

[0196] Among them, the first operation may refer to the operation of switching the electronic device from screen off to screen on.

[0197] S409: The second application sends a first request to the “power saving wizard”.

[0198] The first request is used to indicate that the second application requests to establish communication with the first application.

[0199] It should be understood that the second application may refer to other applications in the electronic device except the first application. When the first application is in a frozen state, the second application needs to communicate with the first application, and needs to first send a first request to the "Power Saving Wizard" to instruct the second application to request to establish communication with the first application.

[0200] S410 , the “power saving wizard” responds to the first request and executes S411 .

[0201] S411, the “Power Saving Wizard” sends a third instruction to the SurfaceFlinger module.

[0202] The third instruction is used to instruct the SurfaceFlinger module to resume layer synthesis processing on the image of the virtual screen.

[0203] S412. The SurfaceFlinger module responds to the third instruction and resumes layer synthesis processing on the image of the virtual screen.

[0204] S413, the “power saving wizard” sends a fourth instruction to the first application, where the fourth instruction is used to instruct to resume the process of the first application;

[0205] S414: The first application resumes the process of the first application in response to the fourth instruction.

[0206] S415: The window manager determines whether the electronic device is in the first state.

[0207] The first state refers to that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration. Since the electronic device stops outputting audio, picture, video and / or vibration type information through the first application, the user cannot perceive the first application. In other words, when the electronic device is in the first state, the first application cannot be perceived by the user.

[0208] If the electronic device is in the first state, execute S416.

[0209] S416, the “Power Saving Wizard” sends a fifth instruction to the first application.

[0210] The fifth instruction is used to instruct to interrupt the process of the first application.

[0211] S417: The first application program interrupts the process of the first application program in response to the fifth instruction.

[0212] S418: The second application sends a second request to the “Power Saving Wizard”.

[0213] The second request is used to indicate that the second application requests to establish communication with the first application.

[0214] S419. In response to the second request, the "Power Saving Wizard" executes S421.

[0215] S420: The window manager determines whether the electronic device is in the second state.

[0216] The electronic device being in the second state may include the first application switching from background operation to foreground operation, or the electronic device switching from screen off to screen on.

[0217] If the window manager determines that the electronic device is in the second state, S421 is executed.

[0218] S421, “Power Saving Wizard” sends a sixth instruction to the first application.

[0219] The sixth instruction is used to instruct the process of resuming the first application.

[0220] S422: The first application program responds to the sixth instruction and resumes the process of the first application program.

[0221] According to the application management method provided in the embodiment of the present application, the third application ("Power Saving Wizard") can not only, when the first application has created a virtual screen, stop the layer synthesis processing of the image of the virtual screen and then interrupt the process of the first application to avoid the problem of system crash caused by frequent interaction between the system process and the first application when the first application is in a frozen state; but also, when the first application has not created a virtual screen, directly interrupt the process of the first application to reduce the power consumption of the electronic device.

[0222] It should be understood that, although each step in the flow chart in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0223] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0224] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. It should be noted that the names of the modules in the embodiment of the present application are schematic and are not limited to the names of the modules in actual implementation.

[0225] Figure 8 A schematic diagram of the structure of an application management device provided in an embodiment of the present application.

[0226] It should be understood that the application management device 600 can execute Figures 4 to 7 The application management method shown; the application management device 600 includes: an acquisition unit 610 and a processing unit 620.

[0227] The processing unit 620 is used to determine whether the first application creates a virtual screen; if the first application creates a virtual screen, then when the electronic device is in a first state, the layer synthesis processing of the image of the virtual screen is stopped, and the first state means that the electronic device stops outputting first information through the first application, and the type of the first information includes audio, picture, video and / or vibration; the first processing is performed on the first application, and the first processing refers to the processing of interrupting the process of the first application.

[0228] In one embodiment, the processing unit 620 is also used to resume layer synthesis processing of the image of the virtual screen when the electronic device is converted from a first state to a second state, the second state being that the electronic device resumes outputting the first information through the first application; and performs a second processing on the first application, the second processing being processing that resumes the process of the first application.

[0229] In one embodiment, the electronic device further includes a second application, and the second state includes a state in which the second application requests to communicate with the first application.

[0230] In one embodiment, the second state includes a state in which the first application program switches from background operation to foreground operation.

[0231] In one embodiment, the second state includes a state in which the electronic device switches from a screen-off state to a screen-on state.

[0232] The application management device provided in this embodiment is used to execute the application management method of the above-mentioned embodiment. The technical principle and technical effect are similar and will not be described again here.

[0233] It should be noted that the above application management device 600 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0234] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0235] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0236] Fig. 9 A structural schematic diagram of an electronic device provided by the present application is shown. Fig. 9 The dotted line in indicates that the unit or the module is optional. The electronic device 700 can be used to implement the application management method described in the above method embodiment.

[0237] The electronic device 700 includes one or more processors 701, which can support the electronic device 700 to implement the management method of the application program in the method embodiment. The processor 701 can be a general-purpose processor or a special-purpose processor. For example, the processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, such as discrete gates, transistor logic devices or discrete hardware components.

[0238] The processor 701 may be used to control the electronic device 700, execute software programs, and process data of the software programs. The electronic device 700 may also include a communication unit 705 to implement input (reception) and output (transmission) of signals.

[0239] For example, the electronic device 700 may be a chip, the communication unit 705 may be an input and / or output circuit of the chip, or the communication unit 705 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic devices.

[0240] For another example, the electronic device 700 may be a terminal device, and the communication unit 705 may be a transceiver of the terminal device, or the communication unit 705 may be a transceiver circuit of the terminal device.

[0241] The electronic device 700 may include one or more memories 702 on which a program 704 is stored. The program 704 can be executed by the processor 701 to generate instructions 703, so that the processor 701 executes the impedance matching method described in the above method embodiment according to the instructions 703.

[0242] Optionally, data may be stored in the memory 702. Optionally, the processor 701 may read data stored in the memory 702. The data may be stored at the same storage address as the program 704, or may be stored at a different storage address than the program 704.

[0243] The processor 701 and the memory 702 may be provided separately or integrated together; for example, integrated on a system on chip (SOC) of a terminal device.

[0244] Exemplarily, the memory 702 can be used to store the related program 704 of the application management method provided in the embodiment of the present application, and the processor 701 can be used to call the related program 704 of the application management method stored in the memory 702 when managing the application, and execute the application management method of the embodiment of the present application; including: determining whether the first application creates a virtual screen; if the first application creates a virtual screen, then when the electronic device is in a first state, stopping the layer synthesis processing of the image of the virtual screen, the first state means that the electronic device stops outputting the first information through the first application, and the type of the first information includes audio, picture, video and / or vibration; performing a first processing on the first application, and the first processing refers to the processing of interrupting the process of the first application.

[0245] The present application also provides a computer program product, which, when executed by the processor 701, implements the application management method described in any method embodiment of the present application.

[0246] The computer program product may be stored in the memory 702 , for example, a program 704 , which is converted into an executable target file that can be executed by the processor 701 after preprocessing, compiling, assembling, and linking.

[0247] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer program implements the application management method described in any method embodiment of the present application. The computer program can be a high-level language program or an executable target program.

[0248] The computer-readable storage medium is, for example, a memory 702. The memory 702 may be a volatile memory or a nonvolatile memory, or the memory 702 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0249] In this application, "at least one" means one or more, and "more" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0250] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

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

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

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

[0254] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0255] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0256] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for managing an application, characterized in that: The method is applied to an electronic device, the electronic device includes a first application and a third application, the third application is used to manage the first application, and the method includes: Determining whether the first application creates a virtual screen; If the first application creates the virtual screen, then when the electronic device is in the first state, the third application first sends a first instruction to stop layer synthesis processing on the image of the virtual screen to stop layer synthesis processing on the image of the virtual screen, and then performs a first processing on the first application. The first state means that the electronic device stops outputting first information through the first application. The type of the first information includes audio, picture, video and / or vibration. The first processing refers to the processing of interrupting the process of the first application.

2. The method according to claim 1, characterized in that The method further comprises: When the electronic device is converted from the first state to a second state, the layer synthesis process of the image on the virtual screen is resumed, wherein the second state refers to that the electronic device resumes outputting the first information through the first application program; A second process is performed on the first application, where the second process is a process of restoring the process of the first application.

3. The method according to claim 2, characterized in that The electronic device also includes a second application, and the second state includes a state in which the second application requests to communicate with the first application.

4. The method according to claim 2, characterized in that: The second state includes a state in which the first application program switches from background operation to foreground operation.

5. The method according to claim 2, characterized in that: The second state includes a state in which the electronic device switches from a screen-off state to a screen-on state.

6. The method according to any one of claims 1 to 5, characterized in that: The electronic device further includes a third application and an image synthesis SurfaceFlinger module, the third application is used to manage the first application, the SurfaceFlinger module is used to perform the layer synthesis process, and when the electronic device is in the first state, stopping the layer synthesis process on the image of the virtual screen includes: When the electronic device is in the first state, the third application sends a first instruction to the SurfaceFlinger module, where the first instruction is used to instruct the SurfaceFlinger module to stop performing layer synthesis processing on the image of the virtual screen; The SurfaceFlinger module stops performing layer synthesis processing on the image of the virtual screen in response to the first instruction.

7. The method according to claim 6, characterized in that The performing a first process on the first application program includes: The third application sends a second instruction to the first application, where the second instruction is used to instruct to interrupt the process of the first application; The first application program interrupts the process of the first application program in response to the second instruction.

8. The method according to any one of claims 2 to 5, characterized in that: The electronic device includes a third application and an image synthesis SurfaceFlinger module, the third application is used to manage the first application, the image synthesis module is used to perform the layer synthesis process, and when the electronic device is converted from the first state to the second state, the layer synthesis process of the image of the virtual screen is resumed, including: When the electronic device is converted from the first state to the second state, the third application sends a third instruction to the SurfaceFlinger module, where the third instruction is used to instruct the SurfaceFlinger module to resume layer synthesis processing on the image of the virtual screen; The SurfaceFlinger module resumes layer synthesis processing on the image of the virtual screen in response to the third instruction.

9. The method according to claim 8, characterized in that The performing a second process on the first application program includes: The third application sends a fourth instruction to the first application, where the fourth instruction is used to instruct to resume the process of the first application; The first application resumes the process of the first application in response to the fourth instruction.

10. An electronic device, characterized in that: The electronic device includes a module for executing the application management method according to any one of claims 1 to 9.

11. An electronic device, characterized in that: include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the method as claimed in any one of claims 1 to 9.

12. A chip system, characterized in that: The chip system includes a processor for calling and running a computer program from a memory, so that an electronic device equipped with the chip system executes the method as described in any one of claims 1 to 9.

13. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 9.