Application display state switching method and device

By reconstructing the UI component tree and using the original process to present a floating window, the problem of lag in the runtime of electronic device applications is solved, and the terminal's usage performance and application fluency are improved.

CN119536868APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311113703.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

As applications and files in electronic devices increase, applications may run lag, reducing the fluency of the application and affecting the user experience.

Method used

By reconstructing the application's UI component tree, the original running first process supports the rendering of the application's floating window, without creating a new process, avoiding resource overhead caused by transferring data across processes and starting a new process.

Benefits of technology

It improves the terminal's usage performance, reduces resource overhead, and improves the smoothness and user experience of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536868A_ABST
    Figure CN119536868A_ABST
Patent Text Reader

Abstract

The invention discloses an application display state switching method and device, relates to the technical field of terminals, and can improve the operation performance of the terminal. The method comprises the steps of creating a first process of an application; through the first process, according to a first user interface UI component tree of the application, presenting an interface of the application; in response to an operation of switching the application to a suspended state, generating a second component tree of the application; and displaying an interface of the application in a floating window through the first process according to the second UI component tree. According to the method, through a mode of reconstructing the UI component tree, the floating window of the application is supported to be displayed through the first process which is originally operated by the application, a new process does not need to be created to support display of the floating window, resource overhead caused by processes of cross-process data transmission, new process creation, new process starting and the like is avoided, and the use performance of the terminal is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method and device for switching application display status. Background Art

[0002] At present, with the popularization of electronic devices such as mobile phones, users have higher and higher demands for the smoothness of applications.

[0003] As more and more applications are installed or files are stored in electronic devices, applications may freeze when running, reducing the fluency of the application, causing application freezes and affecting the user experience. Therefore, it is urgent to propose an effective method for improving the operating performance of electronic devices. Summary of the invention

[0004] The present application provides a method and device for switching application display status, which are used to improve the operating performance of a device.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, the technical solution of the present application provides a method for switching the display status of a device application, which can be applied to a terminal or a component that supports terminal functions (such as a chip system), and the method includes: creating a first process of an application; presenting the interface of the application through the first process according to the first user interface UI component tree of the application; generating a second component tree of the application in response to an operation of switching the application to a suspended state; and displaying the interface of the application in a suspended window through the first process according to the second UI component tree.

[0007] In this way, the UI component tree can be reconstructed so that the first process originally running the application can support the presentation of the floating window. There is no need to create a new process to support the display of the floating window, thereby avoiding resource overhead caused by cross-process data transmission, creation of new processes, and startup of new processes, thereby improving the terminal's performance.

[0008] In one possible design, it also includes:

[0009] Rendering the second component tree;

[0010] Displaying the interface of the application in a floating window includes: displaying the interface of the application in a floating window according to the rendering result of the second component tree.

[0011] In a possible design, after displaying the interface of the application in the floating window, the method further includes:

[0012] One or more threads of the first process are closed.

[0013] In this way, when the application switches to the suspended state, the device closes one or more threads of the first process of the application, which can reduce the impact of the application on the operation of other applications, so as to ensure the operation performance of the terminal as much as possible.

[0014] In one possible design, it also includes:

[0015] Register the registration parameters of the application in the suspended state, wherein the registration parameters include the UI construction function of the application in the suspended state and the size parameters of the floating window; the registration parameters are included in the installation package APK of the application.

[0016] In a possible design, generating a second component tree of the application includes:

[0017] The second component tree is generated according to the registration parameters.

[0018] In a second aspect, a device for switching an application display state is provided, which can be applied to a terminal or a component supporting terminal functions (such as a chip system), including:

[0019] A processor is used to create a first process of an application; a display screen is used to present the interface of the application through the first process according to a first user interface UI component tree of the application; the processor is also used to generate a second component tree of the application in response to an operation of switching the application to a suspended state; the display screen is also used to display the interface of the application in a suspended window according to the second UI component tree through the first process.

[0020] In one possible design, the processor is also used to render the second component tree; displaying the interface of the application in a floating window includes: displaying the interface of the application in a floating window according to the rendering result of the second component tree.

[0021] In one possible design, the processor is further used to: after displaying the interface of the application in the floating window, close one or more threads of the first process.

[0022] In one possible design, the processor is also used to obtain registration parameters; generate a second component tree for the application, including: generating the second component tree according to the registration parameters; the registration parameters include a UI construction function for the application in a suspended state, and size parameters of the floating window; the registration parameters are included in the installation package APK of the application.

[0023] In a third aspect, the technical solution of the present application provides a device, comprising: a display screen, one or more processors, a memory, and one or more computer programs; wherein the processor is coupled to the processor and the memory, and the one or more computer programs are stored in the memory, and when the device is running, the processor executes the one or more computer programs stored in the memory so that the device executes the method in any design of any of the above aspects.

[0024] In a fourth aspect, the present application provides a terminal comprising a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, a method in any possible design of any of the above aspects of the present application is executed.

[0025] In a fifth aspect, the technical solution of the present application provides a computer-readable storage medium, including computer instructions. When the computer instructions are executed on a device, the device executes any possible design method in any of the above aspects.

[0026] In a sixth aspect, the technical solution of the present application provides a computer program product, which, when executed on a device, enables the device to execute any possible design method in any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1A A schematic diagram of a floating window implementation scenario provided for related technologies;

[0028] Figure 1B A schematic diagram of the implementation process of the floating window provided for the related technology;

[0029] Figure 2A A schematic diagram of the application development process provided by the embodiment of the present application;

[0030] Figure 2B A schematic diagram of a UI component tree provided in an embodiment of the present application;

[0031] Figure 2C A schematic diagram of the hardware structure of a device provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of the software structure of a device provided in an embodiment of the present application;

[0033] Figure 4 A flowchart of a method for switching application display states provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of a scenario of a method for switching an application display state provided in an embodiment of the present application;

[0035] Figure 6A flowchart of a method for switching application display states provided in an embodiment of the present application;

[0036] Figure 7 A schematic diagram of an interface provided in an embodiment of the present application;

[0037] Figure 8 A flowchart of a method for switching application display states provided in an embodiment of the present application;

[0038] Fig. 9 A schematic diagram of the structure of an application display state switching device provided in an embodiment of the present application;

[0039] Fig.10 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in this article is merely a way to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0041] In the following, the terms "first" and "second" 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" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0042] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0043] In some scenarios, the device may present a floating window or card of the application after the application (APP) exits the main interface.

[0044] For example, Figure 1A In (a), the mobile phone displays the main interface 101 of the music application, and detects that the user switches the main interface of the music application to the floating window. Figure 1AAs shown in (b), the mobile phone presents a floating window 102 of the application. Specifically, the related technology provides a method for switching an application to a floating window display. In this method, after the mobile phone detects that the user wants to switch the application to floating mode for display, a new process is created to support the display of the floating window through the new process. The new process runs in an independent sandbox, which is isolated from the music application. In order for the new process to support the display of the floating window, the new process needs to obtain some data from the music application through inter-process communication (IPC) or shared memory. Figure 1A In order to enable process 2 to support the running of the floating window, process 2 needs to communicate with process 1 and obtain some data from process 1 to support the running of the floating window. Figure 1B The floating window implementation process of the related art is shown, and it can be seen that the floating window and the application are two independent activities.

[0045] It can be seen that in the floating window display method of the related art, on the one hand, when the developer develops the application, he needs to consider the cross-process data transmission to trigger the content update in the floating window, and the development complexity is high. On the other hand, when the user switches the application to the floating window display through the terminal, the new process used to support the floating window display will occupy more resources of the terminal, affecting the performance of the terminal.

[0046] In order to solve the above technical problems, an embodiment of the present application provides an application state switching method, in which a first process of an application is created, and when the application needs to be switched to a floating window state, the UI component tree is reconstructed, and the floating window of the application is presented through the first process according to the reconstructed UI component tree. In this way, the floating window of the application can be presented through the first process originally running the application by reconstructing the UI component tree, without the need to create a new process to support the display of the floating window, thereby avoiding resource overhead caused by cross-process data transmission, creating a new process, starting a new process, etc., and improving the performance of the terminal.

[0047] like Figure 2A An example of the application development process is shown, in which a developer writes a code for declaring the application and packages the code in an installation package (APK). A device can use the application by installing the installation package.

[0048] The application code includes but is not limited to the UI code of the application in various display modes. For example, the UI code in full-screen mode and the UI code in floating window mode. The full-screen mode of the application can also be called the full-screen state (or non-floating state), which can refer to the application interface covering the entire screen. The floating window mode of the application can also be called the floating window state (abbreviated as floating state), which can refer to the application displaying the application interface in the floating window.

[0049] like Figure 2A , the UI code in the non-suspended state includes: the UI construction function of the music application in the non-suspended state. For example, the UI construction function can be a construction function written in JS. The UI code in the suspended state includes: the UI construction function of the music application in the suspended state. The UI construction function in the suspended state can be used to generate the UI component tree in the suspended state.

[0050] In the embodiment of the present application, the UI component tree may also be referred to as a UI node tree (frame node tree). The UI component tree is a data structure formed by multiple UI components (elements). Figure 2B (a) shows the UI component tree of the application in a non-suspended state. The UI component tree includes multiple UI components (or UI nodes). In the UI component tree, the top root node (or parent component) 1 has no parent node, and the bottom nodes 8, 9, 10, and 11 have no child nodes (or child components). Other UI nodes in the UI component tree usually have their own parent nodes and child nodes. Figure 2B (b) shows a UI component tree in a suspended state generated according to a UI construction function applied in a suspended state.

[0051] The application state switching method of the embodiment of the present application can be applied to electronic devices. For example, the electronic device can be a mobile phone, a tablet computer, a personal computer (PC), a netbook, a wearable device, a vehicle-mounted device, etc. The present application does not impose any special restrictions on the specific form of the electronic device.

[0052] Taking a mobile phone as an example, Figure 2C 1 shows a schematic diagram of the hardware structure of the electronic device 100. The structures of other electronic devices can refer to the structure of the electronic device 100.

[0053] 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, etc. 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 invention 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 separate 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 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] Exemplarily, in an electronic device with a multi-core processor, each processor core can be used as an independent processing unit. For example, if the electronic device has an eight-core processor, each core can be used as an independent processing unit.

[0057] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0058] 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.

[0059] 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.

[0060] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a MicroUSB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0061] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention 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.

[0062] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal through the power management module 141.

[0063] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0064] 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.

[0065] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0066] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0067] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0068] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0069] In some embodiments of the present application, the electronic device 100 can establish a wireless connection with other terminals or servers through the wireless communication module 160 and the antenna 2 to achieve communication between the electronic device 100 and the other terminals or servers.

[0070] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0071] 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.

[0072] 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.

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

[0074] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0075] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0076] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0077] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0078] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

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

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

[0081] 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.

[0082] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0083] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0084] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0085] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0086] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0087] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0088] 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.

[0089] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0090] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0091] It should be noted that the structure of electronic equipment can also refer to Figure 2C The electronic device may have a structure as shown. Figure 2C The structures shown may have more or fewer components, or combine some components, or separate some components, or arrange the components differently. The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0092] In some embodiments, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes a layered architecture system as an example to exemplify the software structure of the electronic device 100.

[0093] Figure 3 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0094] The layered architecture 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 system is divided into four layers, from top to bottom, namely the application layer, the application framework layer (which can be referred to as the framework layer), and the system layer.

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

[0096] like Figure 3 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0097] The application program may be run in the software system of the electronic device 100 in the form of a process, and a process may also be understood as the execution process of the application. A process may include one or more threads.

[0098] After the device installs the application's installation package, the application can call the API provided by the framework layer to register the floating window mode of the application if the conditions are met. During the registration process, the framework layer obtains the UI construction function of the application in the floating state. Optionally, during the registration process, the framework layer can also obtain the size of the floating window displayed by the application in the floating state. After the registration is completed, the framework layer can mark the application as "switchable to floating state".

[0099] As a possible implementation, the application can register the floating window mode of the application with the framework layer when it is started. Alternatively, the application can register the floating window mode of the application with the framework layer when executing the corresponding function. Taking the navigation application as an example, the navigation application can register the floating window mode with the framework layer when starting navigation, or the navigation application can register the floating window mode when starting the navigation application.

[0100] Take the music application as an example. During the application usage phase, when the user opens the music application, the mobile phone can present the following information based on the component tree A: Figure 4 Afterwards, in response to the operation of switching the music application to the suspension mode, the mobile phone generates a component tree B according to the UI construction function of the music application in the suspension state, and presents the following according to the component tree B: Figure 4 (b) shows the floating window of the music application.

[0101] As a possible implementation method, in response to the operation of switching the music application to the floating mode, the music application calls the API provided by the framework layer, so that the framework layer generates a component tree B, and the mobile phone can present a floating window according to the component tree B.

[0102] For example, component tree B may be a component tree in C++ format.

[0103] 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.

[0104] In an embodiment of the present application, the framework layer may include a user interface (UI) framework, a rendering pipeline, an event manager, a gesture recognition module, a UI component tree, and a window manager.

[0105] The gesture recognition module converts the user's input information into corresponding events. For example, it receives the user's operation of switching the application to the suspended state and converts the operation information into the corresponding suspended event.

[0106] The UI framework can be used to execute the UI construction function of the application in response to the user switching the application to the suspended state to reconstruct the UI component tree of the application. The application can call the GPU to render the UI components in the UI component tree based on the reconstructed UI component tree and display the rendered UI.

[0107] The rendering pipeline can be used to manage the rendering process of the component tree.

[0108] The event manager can be used to manage application-related events, such as click events and drag events.

[0109] The window manager can be used to manage the position and size of application windows (such as floating windows).

[0110] The system layer can be used to manage the application process and rendering. Figure 3 ,The system layer may include a meta-capability framework and a graphics engine.

[0111] The meta-capability framework can be used to manage application processes and adjust process priorities and resource allocation.

[0112] The graphics engine can be used to draw the screen according to the drawing commands submitted by the rendering pipeline.

[0113] The above is only an example of a possible software architecture of the electronic device. The software architecture of the electronic device can also be other architectures, which are not limited in the embodiments of the present application. For example, some modules may be located in other layers, or the modules may be split into multiple functional modules, different functional modules may be set in different layers, or multiple modules may be integrated into one module.

[0114] The technical solution provided in the embodiments of the present application is described in detail below.

[0115] For example, Figure 4 The following is an example of a process for switching the application state of an embodiment of the present application. Taking the application as a music application as an example, the method may include:

[0116] S101. The device presents interface A through a first process of a music application.

[0117] During the process of starting the music application, the device creates a first process for the application. The device can execute the task of the music application through the first process, thereby realizing the function of the application.

[0118] As a possible implementation, the first process may include one or more threads. One or more threads execute corresponding tasks, thereby realizing the function of the music application. Exemplarily, the rendering thread renders the picture, and the synthesis thread synthesizes the picture, thereby realizing the interface display of the music application.

[0119] For example, when a mobile phone opens a music application, a first process is created, and one or more threads in the first process execute corresponding tasks, so that the mobile phone displays the following: Figure 5 (a) shows the main interface 501 of the music application (an example of interface A).

[0120] Exemplarily, the mobile phone can generate a UI component tree (an example of the first component tree) in non-floating window mode based on the UI construction function of the music application in non-floating window mode (such as full-screen mode), and render the UI component tree to display interface A of the music application through non-floating window mode.

[0121] S102: The device receives an operation to switch to a floating window mode.

[0122] Exemplarily, the operation may be a swipe-up operation input by the user on the full-screen application, or other preset operations.

[0123] In floating window mode, the application's display interface is scaled to a card or floating window, and continues to be displayed on the desktop or other applications. Figure 5 In (a), the full-screen application is a music application. When playing music, the user swipes up in the application interface, such as Figure 5 (b), the music app will switch to the music playback card and continue to be displayed at the top of the screen.

[0124] S103: In response to the operation of switching to the floating window mode, the device requests, through the first process, to reconstruct the UI component tree of the music application.

[0125] Still Figure 5(a), after the mobile phone detects that the user swipes up from the bottom of the screen, the first process can determine that the user wants to switch the music application to the floating window mode. The first process can then send a request message to the framework layer to request a UI component tree for presenting the floating window (an example of a second UI component tree).

[0126] As a possible implementation, Figure 6 , S103 can be implemented as follows: S103a, the music application receives the operation of switching to the floating window mode, and transmits the information of the operation to the framework layer; S103b, the gesture recognition module of the framework layer can convert the operation into a floating event, and send a request message to the UI framework to request the UI framework to reconstruct the UI component tree of the music application in the suspended state.

[0127] S104. The framework layer reconstructs the component tree.

[0128] After receiving the request message from the first process, the framework layer generates a UI component tree of the music application in a suspended state according to the UI construction function of the music application in response to the request message. Figure 5 The UI component tree shown in (b) is used to support the display of a floating window.

[0129] Optionally, after the framework layer generates the UI component tree for the music application in the suspended state, the UI component tree for the music application in the non-suspended state may be removed. In other words, the framework layer replaces the UI component tree in the non-suspended state with the UI component tree in the suspended state.

[0130] As a possible implementation method, the framework layer determines whether the music application has registered a floating window. If the music application has registered a floating window, the framework layer can generate a UI component tree for the music application in the floating state based on the UI construction function in the floating state registered by the music application.

[0131] Optional, such as Figure 5 S104 may be performed by the UI framework of the framework layer. As a possible implementation method, the UI framework runs a parser (such as viewStackProcessor) to parse commands (such as UI construction functions) in the front-end APK to generate a reconstructed UI component tree.

[0132] As a possible implementation method, after the framework layer learns that the display mode of the application needs to be switched, it notifies the window manager to change the size and rearrange the window. For example, when the framework layer learns that the application needs to be switched from full-screen display to display in a floating window, it notifies the window manager to adjust the window size. The UI framework can generate a reconstructed UI component tree based on the adjusted window size. The size of the components in the reconstructed UI component tree is adjusted according to the adjusted window size.

[0133] S105. The framework layer returns the reconstructed UI component tree to the first process.

[0134] S106. The mobile phone presents a second interface according to the reconstructed UI component tree through the first process, where the second interface includes a floating window.

[0135] Exemplarily, the first process calls the GPU to render the UI components in the UI component tree, and displays the UI components according to the rendering results of the GPU. Figure 5 Interface 502 (an example of the second interface) shown in (b) includes a floating window 503.

[0136] As a possible implementation, the first process may pass the reconstructed UI component tree to the GPU, and the GPU performs rendering according to the reconstructed UI component tree. The mobile phone displays the interface of the application in a floating window according to the rendering result.

[0137] Compared with the related art, in which the device needs to create a new process to run the floating window of the application, and the new process communicates with the original process of the application across processes, which affects the performance of the device, the method of the embodiment of the present application creates the first process of the application, and when the application needs to be switched to the floating window state, the UI component tree is reconstructed, and the floating window of the application is presented through the first process according to the reconstructed UI component tree. In this way, the floating window of the application can be presented through the first process originally running by the application by reconstructing the UI component tree, without creating a new process to support the display of the floating window, avoiding the resource overhead caused by cross-process data transmission and the creation of a new process, and improving the performance of the terminal.

[0138] In addition, there is no need to develop additional code related to independent processes, which reduces the development cost and can reduce the amount of code.

[0139] Optional, such as Figure 6 The method of the embodiment of the present application may further include: S201, presenting a zoom animation of the music application switching from a non-suspended state to a suspended state.

[0140] As a possible implementation method, the UI framework of the framework layer schedules the GPU to render the transition animation according to the UI component tree of the music application in the non-floating state and the UI component tree of the music application in the floating state. Afterwards, the device can display the transition animation before displaying the second interface including the floating window to achieve a smooth transition switch between the non-floating state and the floating state of the music application.

[0141] For example, Figure 7(a), the mobile phone displays the interface 501 of the music application in full screen mode. Afterwards, in response to the user's upward sliding operation, the mobile phone can render the transition animation between the non-suspended interface and the suspended interface according to the UI component tree of the music application in full screen mode (non-suspended state) and the UI component tree of the music application in suspended state, and Figure 7 The transition animation 505 is displayed on the interface 504 shown in (b). Figure 7 (c), the mobile phone displays the interface 502 of the music application in a floating mode (floating state), and the interface 503 includes a floating window 503.

[0142] Optional, such as Figure 6 The method of the embodiment of the present application may further include S202: the device marks the state of the application as a suspended state.

[0143] As a possible implementation method, the meta-capability framework of the system layer can obtain the state of the application and can mark the state of the application. For example, when the obtained state of the application is suspended, the meta-capability framework can mark the state of the application as suspended.

[0144] Optional, such as Figure 6 The method of the embodiment of the present application may also include S203, the device adjusts the size of the floating window.

[0145] For example, after detecting that the user has resized the floating window, the window manager resizes the floating window, and the sizes of UI components in the UI component tree corresponding to the floating window are also adjusted accordingly. The GPU renders the adjusted UI component tree, and the device displays the application interface in the resized floating window according to the rendering result.

[0146] Similarly, the device can adjust the position of the floating window through the window manager.

[0147] Optionally, the subsequent device may respond to the user's operation to exit the floating window mode. For example, detecting a left or right sliding operation on the floating window, or a closing operation, or other preset operations by the user triggers the first process of the music application to return to a normal state. Exemplarily, the first process may control the music application to retreat to the background.

[0148] Optionally, the subsequent device can respond to the user's operation and restore the non-floating window mode. For example, detecting a user's click or swipe down operation on the floating window, or other preset operations, triggers the restoration of the non-floating window mode of the music application. The framework layer will call the corresponding module and perform the corresponding operation to complete the transition of the display state (display mode) of the application. As a possible implementation method, the device can generate a UI component tree for the application in non-floating window mode based on the construction function of the application in non-floating window mode. The GPU renders the UI component tree to display the application interface through a non-floating window mode (such as full-screen mode). Optionally, the device renders and displays a transition animation so that the device display interface smoothly transitions from floating window mode to non-floating window mode.

[0149] The embodiment of the present application also provides an application state switching method, in which one or more threads of the application can be closed when the application is in a suspended state to reduce the occupation of device resources by the application. Figure 8 , the method may include S101-S106, and S301.

[0150] The specific implementation of S101 - S106 can be found in the above embodiments, which will not be described again here.

[0151] S301: The device closes one or more threads of the music application.

[0152] In a non-suspended state, the first process of the music application may include a main thread and multiple background threads, and these threads are used to execute some tasks, such as downloading network data and decoding compressed images.

[0153] Taking into account the low probability or frequency of the music application in the suspended state being used by the user, the device minimizes the use of device resources by the music application in the suspended state, and lowers the priority of the first process of the music application to prevent the music application from affecting the operation of other applications. As a possible implementation method, the device closes one or more threads in the first process. Optionally, the closed threads may be threads that are not currently executing tasks. For example, the device may close most of the background threads in the first process that are not executing tasks, and retain the background threads that are executing tasks. For another example, the device may close non-critical threads in the first process and retain critical threads (such as the main thread) in the first process. Critical threads may be threads that are executing critical tasks.

[0154] As described above, closing some threads of the first process may be referred to as thread pruning.

[0155] As a possible implementation manner, the device reduces the resource priority of the first process of the application through the meta-capability framework.

[0156] Optionally, the device can subsequently respond to the user's operation and restore the non-floating window mode. Optionally, when restoring the non-floating window mode, the device restores the priority of the first process of the application and resumes the thread that was closed in the floating window mode to improve the running performance of the application in the non-floating window mode.

[0157] It should be noted that the above-mentioned multiple embodiments can be combined and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a limitation on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described herein. In addition, it should be noted that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.

[0158] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added in the method embodiment. Alternatively, the execution subject (such as a functional module) of some steps in the method embodiment may be replaced by other execution subjects.

[0159] Furthermore, the above method embodiments may be implemented separately or in combination.

[0160] Some other embodiments of the present application provide a device, which may be the first terminal or the second terminal or the server mentioned above. The device may include: a display screen, a memory and one or more processors. The display screen, the memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the device may execute the various functions or steps executed by the corresponding device in the above method embodiment. The structure of the device may refer to Figure 2C The equipment (device) shown.

[0161] The core structure of the device can be expressed as Fig. 9 As shown in the structure, the device includes: a processing module 1301, an input module 1302, a storage module 1303 and a display module 1304.

[0162] The processing module 1301 may include at least one of a central processing unit (CPU), an application processor (AP) or a communication processor (CP). The processing module 1301 may perform operations or data processing related to the control and / or communication of at least one of the other elements of the user device. Specifically, the processing module 1301 may be used to control the content displayed on the main screen according to certain trigger conditions. The processing module 1301 is also used to process the input instructions or data and determine the display style according to the processed data.

[0163] The input module 1302 is used to obtain the instructions or data input by the user and transmit the obtained instructions or data to other modules of the device. Specifically, the input mode of the input module 1302 may include touch, gesture, approaching the screen, etc., or voice input. For example, the input module may be the screen of the device, obtain the user's input operation and generate an input signal according to the obtained input operation, and transmit the input signal to the processing module 1301.

[0164] The storage module 1303 may include a volatile memory and / or a non-volatile memory. The storage module is used to store at least one instruction or data related to other modules of the user device. Specifically, the storage module may record the location of the interface where the device interface element UI is located.

[0165] The display module 1304 may include, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a micro-electromechanical system (MEMS) display, or an electronic paper display, and is used to display content (e.g., text, images, videos, icons, symbols, etc.) that can be viewed by a user.

[0166] Optionally, a communication module 1305 is also included to support personal devices (via a communication network) to communicate with other personal devices. For example, the communication module can be connected to a network via wireless communication or wired communication to communicate with other personal devices or network servers. Wireless communication can use at least one of cellular communication protocols, such as long-term evolution (LTE), advanced long-term evolution (LTE-A), code division multiple access (CDMA), wideband code division multiple access (WCDMA), universal mobile telecommunications system (UMTS), wireless broadband (WiBro) or global mobile communication system (GSM). Wireless communication may include, for example, short-range communication. Short-range communication may include at least one of wireless fidelity (Wi-Fi), Bluetooth, near field communication (NFC), magnetic stripe transmission (MST) or GNSS.

[0167] It should be noted that each functional module of the device can execute one or more steps in the above method embodiment.

[0168] The present application also provides a chip system, such as Fig.10 As shown, the chip system includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 can be interconnected via lines. For example, the interface circuit 1402 can be used to receive signals from other devices (such as the memory of the device). For another example, the interface circuit 1402 can be used to send signals to other devices (such as the processor 1401). Exemplarily, the interface circuit 1402 can read the instructions stored in the memory and send the instructions to the processor 1401. When the instructions are executed by the processor 1401, the device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0169] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned device, the device executes each function or step executed by the mobile phone in the above-mentioned method embodiment.

[0170] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.

[0171] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0172] 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, 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.

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

[0174] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0175] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0176] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for switching an application display state, characterized in that: include: Create the first process of the application; Presenting the interface of the application according to the first user interface UI component tree of the application through the first process; In response to an operation of switching the application to a suspended state, generating a second component tree of the application; Through the first process, according to the second UI component tree, the interface of the application is displayed in a floating window.

2. The method according to claim 1, characterized in that Also includes: Rendering the second component tree; Displaying the interface of the application in a floating window includes: displaying the interface of the application in a floating window according to the rendering result of the second component tree.

3. The method according to claim 1 or 2, characterized in that: After displaying the interface of the application in the floating window, the method further includes: One or more threads of the first process are closed.

4. The method according to any one of claims 1 to 3, characterized in that: Also includes: Register the registration parameters of the application in the suspended state, wherein the registration parameters include the UI construction function of the application in the suspended state and the size parameters of the floating window; the registration parameters are included in the installation package APK of the application.

5. The method according to claim 4, characterized in that Generating a second component tree of the application includes: The second component tree is generated according to the registration parameters.

6. A device for switching application display status, characterized in that: include: A processor, configured to create a first process of an application; A display screen, used for presenting the interface of the application according to the first user interface UI component tree of the application through the first process; The processor is further configured to generate a second component tree of the application in response to an operation of switching the application to a suspended state; The display screen is also used to display the interface of the application in a floating window through the first process according to the second UI component tree.

7. The device according to claim 6, characterized in that The processor is further used to render the second component tree; Displaying the interface of the application in a floating window includes: displaying the interface of the application in a floating window according to the rendering result of the second component tree.

8. The device according to claim 6 or 7, characterized in that The processor is further configured to: After displaying the interface of the application in the floating window, one or more threads of the first process are closed.

9. The device according to any one of claims 6 to 8, characterized in that: The processor is further used to obtain registration parameters; Generating a second component tree of the application includes: The second component tree is generated according to the registration parameters; the registration parameters include a UI construction function of the application in a suspended state and a size parameter of the floating window; the registration parameters are included in an installation package APK of the application.

10. A computer-readable storage medium, characterized in that: The method comprises a program or an instruction. When the program or the instruction is executed, the method according to any one of claims 1 to 5 is implemented.