A method for optimizing application startup performance and a display device
By preserving and reusing application resources as it moves from the background to the foreground on the display device, the problem of excessively long application startup time is solved, improving application startup speed and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2026-03-13
AI Technical Summary
On display devices, it takes too long for background applications to restart, resulting in long waiting times for users and affecting the user experience.
When an application switches from the background to the foreground, the resources used by the application in the foreground are retained and these resources are reused during the switching process. This includes not releasing decoded image resources, not destroying rendering threads, and not cleaning up EGL graphics resources, thereby shortening the application startup time.
By reusing resources from the foreground, the startup time of the application from the background to the foreground is significantly shortened, improving the user experience.
Smart Images

Figure CN116208792B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of application startup, and more particularly to a method and display device for optimizing application startup performance. Background Technology
[0002] Display devices refer to terminal devices capable of outputting specific display images, such as smart TVs, mobile terminals, smart advertising screens, and projectors. Taking smart TVs as an example, smart TVs are television products based on Internet application technologies, possessing open operating systems and chips, and having open application platforms. They enable two-way human-computer interaction and integrate multiple functions such as audio-visual, entertainment, and data to meet diverse and personalized user needs.
[0003] Different applications installed on a display device can provide users with various entertainment resources. For example, users can watch video resources provided by resource providers through video applications. In some cases, when an application starts running, it receives a command from the user to launch another application. At this time, the original application exits, but in order to respond quickly when the application is launched again, the original application does not truly exit, but enters a background state, and the exited application cannot be seen in the foreground page.
[0004] However, it is often found that when an application running in the background is restarted, it takes too long, causing users to wait for too long and affecting the user experience. Summary of the Invention
[0005] Some embodiments of this application provide a method and display device for optimizing application startup performance. The method preserves as many resources as possible used when the application is in the foreground and reuses these resources when the application is brought from the background to the foreground, thereby shortening the application startup time and enabling the application screen to be displayed quickly.
[0006] In a first aspect, a display device is provided, comprising:
[0007] A monitor is used to display the user interface.
[0008] User interface, used to receive input signals;
[0009] The controllers, connected to the display and user interface respectively, are used to perform:
[0010] When the application is running in the default environment, it receives the first instruction to switch the application to run in the background, stops the web component from running, and stops the resource loading module from running; when it receives the second instruction to switch the application to run in the foreground, it restarts the resource loading module and the web component, controls the rendering thread to rasterize the layers, and controls the layer composition and display.
[0011] In some embodiments, the controller, upon receiving the first instruction, is further configured to: not release the decoded image resources.
[0012] In some embodiments, the controller, upon receiving the second instruction, is further configured to: not decode the image resource.
[0013] In some embodiments, the controller, upon receiving the first instruction, is further configured to: not destroy the rendering thread.
[0014] In some embodiments, the controller, upon receiving the second instruction, is also configured to: not initialize the rendering thread.
[0015] In some embodiments, the controller, upon receiving the first instruction, is further configured to: not clean up EGL graphics resources.
[0016] In some embodiments, the controller, upon receiving the second instruction, is also configured to: not create EGL graphics resources.
[0017] Secondly, a method for optimizing application startup performance is provided, the method comprising:
[0018] When the application is running in the default environment, it receives the first instruction to switch the application to run in the background, stops the web component from running, and stops the resource loading module from running; when it receives the second instruction to switch the application to run in the foreground, it restarts the resource loading module and the web component, controls the rendering thread to rasterize the layers, and controls the layer composition and display.
[0019] In some embodiments, after receiving the first instruction, the method further includes: not releasing the decoded image resources.
[0020] In some embodiments, after receiving the second instruction, the method further includes: not decoding the image resource.
[0021] In the above embodiments, a method and display device for optimizing application startup performance are provided. This method preserves as many resources as possible used when the application is in the foreground, and reuses these resources when the application is brought from the background to the foreground, thus shortening application startup time and enabling rapid display of the application screen. The method includes: upon receiving a first instruction to switch the application to the background during preset application runtime, stopping the web component and the resource loading module; upon receiving a second instruction to switch the application to the foreground, re-running the resource loading module and the web component, controlling the rendering thread to rasterize the layers, and controlling layer compositing and display. Attached Figure Description
[0022] Figure 1 An operational scenario between a display device and a control device according to some embodiments is illustrated;
[0023] Figure 2 A hardware configuration block diagram of a control device 100 according to some embodiments is shown;
[0024] Figure 3 A hardware configuration block diagram of a display device 200 according to some embodiments is shown;
[0025] Figure 4 A software configuration diagram of a display device 200 according to some embodiments is shown;
[0026] Figure 5 The diagram illustrates, exemplarily, a state change diagram of an application according to some embodiments;
[0027] Figure 6 The diagram illustrates, exemplarily, a user interaction diagram of receiving a startup command according to some embodiments;
[0028] Figure 7 The diagram illustrates another user interaction diagram of receiving a startup command according to some embodiments;
[0029] Figure 8 The diagram illustrates, exemplarily, a user interaction diagram of receiving a first instruction according to some embodiments;
[0030] Figure 9 The diagram illustrates, exemplarily, another user interaction diagram of receiving a first instruction according to some embodiments;
[0031] Figure 10 The diagram illustrates, exemplarily, a user interaction diagram of receiving a second instruction according to some embodiments;
[0032] Figure 11 The diagram illustrates, exemplarily, a user interaction diagram of receiving a close command according to some embodiments;
[0033] Figure 12 The diagram above exemplifies a flowchart of a method for optimizing application startup performance according to some embodiments;
[0034] Figure 13 The diagram illustrates a flowchart of another method for optimizing application startup performance according to some embodiments. Detailed Implementation
[0035] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0036] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0037] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0038] The terms “include” and “have”, and any variations thereof, are intended to cover but not exclusively include, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0039] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0040] Figure 1 This is a schematic diagram illustrating the operational scenario between the display device and the control unit according to the embodiment. Figure 1 As shown, the user can operate the display device 200 through the smart device 300 or the control device 100.
[0041] In some embodiments, the control device 100 may be a remote control. Communication between the remote control and the display device includes infrared protocol communication, Bluetooth protocol communication, and other short-range communication methods, controlling the display device 200 wirelessly or via wired means. Users can control the display device 200 by inputting user commands through buttons on the remote control, voice input, control panel input, etc.
[0042] In some embodiments, a smart device 300 (such as a mobile terminal, tablet computer, computer, laptop computer, etc.) may also be used to control the display device 200. For example, an application running on the smart device may be used to control the display device 200.
[0043] In some embodiments, the display device 200 can also be controlled in ways other than the control device 100 and the smart device 300. For example, it can be controlled by directly receiving the user's voice commands through a module configured inside the display device 200 for acquiring voice commands, or it can be controlled by receiving the user's voice commands through a voice control device set outside the display device 200.
[0044] In some embodiments, the display device 200 also communicates with the server 400. The display device 200 may communicate via a local area network (LAN), wireless local area network (WLAN), and other networks. The server 400 may provide various content and interactive features to the display device 200. The server 400 may be a cluster or multiple clusters, and may include one or more types of servers.
[0045] Figure 2 An exemplary block diagram of the configuration of the control device 100 according to an exemplary embodiment is shown. Figure 2 As shown, the control device 100 includes a controller 110, a communication interface 130, a user input / output interface 140, a memory, and a power supply. The control device 100 can receive user input operation commands and convert the operation commands into commands that the display device 200 can recognize and respond to, thus acting as an intermediary for interaction between the user and the display device 200.
[0046] Figure 3 A hardware configuration block diagram of a display device 200 according to an exemplary embodiment is shown.
[0047] In some embodiments, the display device 200 includes at least one of a tuner 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface.
[0048] In some embodiments, the controller includes a processor, a video processor, an audio processor, a graphics processor, RAM, ROM, and a first interface to an nth interface for input / output.
[0049] In some embodiments, the display 260 includes a display screen component for presenting an image, a driving component for driving image display, a component for receiving image signals from the controller output, and a user control UI interface for displaying video content, image content, menu control interface, and user control UI interface.
[0050] In some embodiments, the display 260 may be a liquid crystal display, an OLED display, or a projection display, and may also be a projection device and a projection screen.
[0051] In some embodiments, the communicator 220 is a component used to communicate with external devices or servers according to various communication protocol types. For example, the communicator may include at least one of a Wi-Fi module, a Bluetooth module, a wired Ethernet module, other network communication protocol chips or near-field communication protocol chips, and an infrared receiver. The display device 200 can establish the transmission and reception of control signals and data signals with the external control device 100 or the server 400 through the communicator 220.
[0052] In some embodiments, the user interface can be used to receive control signals from the control device 100 (e.g., an infrared remote control).
[0053] In some embodiments, detector 230 is used to acquire signals from the external environment or to interact with the outside world. For example, detector 230 includes a light receiver, a sensor for acquiring ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to acquire external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.
[0054] In some embodiments, the external device interface 240 may include, but is not limited to, one or more interfaces such as: High Definition Multimedia Interface (HDMI), analog or data high-definition component input interface (component), composite video input interface (CVBS), USB input interface (USB), RGB port, etc. It may also be a composite input / output interface formed by multiple interfaces mentioned above.
[0055] In some embodiments, the tuner 210 receives broadcast television signals via wired or wireless reception and demodulates audio and video signals, such as EPG data signals, from a plurality of wireless or wired broadcast television signals.
[0056] In some embodiments, the controller 250 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0057] In some embodiments, the controller 250 controls the operation of the display device and responds to user operations via various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200. For example, in response to receiving a user command to select a UI object to display on the display 260, the controller 250 can perform operations related to the object selected by the user command.
[0058] In some embodiments, the object can be any of the optional objects, such as a hyperlink, an icon, or other operable controls. Operations related to the selected object include: displaying links to hyperlinked pages, documents, images, etc., or performing operations corresponding to the program associated with the icon.
[0059] In some embodiments, the controller includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM (random access memory), ROM (read-only memory), a first to an nth interface for input / output, a communication bus, etc.
[0060] A CPU (CPU) processor is used to execute operating system and application instructions stored in memory, as well as various interactive instructions received from external input, to execute various applications, data, and content, ultimately for the display and playback of various audio and video content. A CPU processor can include multiple processors, such as a main processor and one or more sub-processors.
[0061] In some embodiments, a graphics processor is used to generate various graphical objects, such as icons, operation menus, and graphics displayed based on user input commands. The graphics processor includes an arithmetic logic unit (ALU) that performs calculations based on various user-input interactive commands and displays various objects according to display attributes; it also includes a renderer that renders the various objects obtained from the ALU, and the rendered objects are used to display on a monitor.
[0062] In some embodiments, the video processor is configured to receive external video signals and perform video processing such as decompression, decoding, scaling, noise reduction, frame rate conversion, resolution conversion, and image synthesis according to the standard encoding and decoding protocol of the input signals, so as to obtain a signal that can be directly displayed or played on the display device 200.
[0063] In some embodiments, the video processor includes a demultiplexing module, a video decoding module, an image compositing module, a frame rate conversion module, and a display formatting module. The demultiplexing module demultiplexes the input audio and video data streams. The video decoding module processes the demultiplexed video signal, including decoding and scaling. The image compositing module, such as an image synthesizer, overlays and blends a GUI signal generated by a graphics generator based on user input or its own generation with the scaled video image to generate a displayable image signal. The frame rate conversion module converts the input video frame rate. The display formatting module modifies the received frame rate-converted video output signal to conform to a display format, such as outputting RGB data signals.
[0064] In some embodiments, the audio processor is configured to receive external audio signals, and according to the standard codec protocol of the input signals, perform decompression and decoding, as well as noise reduction, digital-to-analog conversion, and amplification processing, to obtain a sound signal that can be played in a speaker.
[0065] In some embodiments, the user can input user commands through a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input commands through the GUI. Alternatively, the user can input user commands by inputting specific sounds or gestures, and the user input interface receives the user input commands by recognizing the sounds or gestures through sensors.
[0066] In some embodiments, a "user interface" is the medium through which an application or operating system interacts and exchanges information with a user. It converts information between its internal form and a form acceptable to the user. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0067] In some embodiments, the display device's system may include a kernel, a command interpreter (shell), a file system, and applications. The kernel, shell, and file system together form the basic operating system structure, allowing users to manage files, run programs, and use the system. Upon power-up, the kernel starts, activates the kernel space, abstracts hardware, initializes hardware parameters, and runs and maintains virtual memory, the scheduler, signals, and inter-process communication (IPC). After the kernel starts, the shell and user applications are loaded. Applications are compiled into machine code after startup, forming a process.
[0068] like Figure 4 As shown, a display device's system can include a kernel, a command interpreter (shell), a file system, and applications. The kernel, shell, and file system together form the basic operating system structure, allowing users to manage files, run programs, and use the system. Upon power-up, the kernel starts, activates the kernel space, abstracts hardware, initializes hardware parameters, and runs and maintains virtual memory, the scheduler, signals, and inter-process communication (IPC). After the kernel starts, the shell and user applications are loaded. Applications are compiled into machine code after startup, forming a process.
[0069] like Figure 4 As shown, the display device system is divided into three layers, from top to bottom: the application layer, the middleware layer, and the hardware layer.
[0070] The application layer mainly includes commonly used applications on TVs, as well as the application framework. The commonly used applications are mainly browser-based applications, such as HTML5 apps, and native apps.
[0071] An application framework is a complete program model that has all the basic functions required by standard application software, such as file access, data exchange, etc., as well as the user interface for these functions (toolbar, status bar, menu, dialog box).
[0072] Native apps can support online or offline access, push notifications, or access to local resources.
[0073] The middleware layer includes various television protocols, multimedia protocols, and system components. Middleware can use the basic services (functions) provided by system software to connect different parts of application systems or different applications on the network, achieving resource sharing and function sharing.
[0074] The hardware layer mainly includes the HAL interface, hardware, and drivers. The HAL interface is a unified interface for all TV chips, with the specific logic implemented by each chip. The drivers mainly include: audio drivers, display drivers, Bluetooth drivers, camera drivers, Wi-Fi drivers, USB drivers, HDMI drivers, sensor drivers (such as fingerprint sensors, temperature sensors, pressure sensors, etc.), and power drivers.
[0075] Different applications installed on display devices can provide users with a variety of entertainment resources. For example, users can watch video resources provided by resource providers through video applications.
[0076] In some cases, when an application is running—for example, YouTube, a commonly used video application—and receives a user's instruction to launch another application, such as Netflix, another popular video application, the original YouTube application exits, and the user interface switches from displaying the YouTube interface to displaying the Netflix interface. However, to ensure a quick response when launching YouTube again (i.e., being quickly brought back to the foreground), the original application doesn't truly exit but remains in the background. However, it's often observed that when a background application is launched and brought back to the foreground (i.e., switching from the Netflix interface to the YouTube interface), it takes excessive time. This results in long wait times for users when instructing them to restart YouTube, negatively impacting the user experience.
[0077] To address the aforementioned technical problems, this application provides a method for optimizing application startup performance. The method preserves as many resources as possible that are used when the application is in the foreground, and reuses these resources when the application is brought from the background to the foreground. This can shorten the application startup time and quickly display the application screen.
[0078] This application's embodiments pertain to browser-based applications, exemplified by the YouTube application running on the Cobalt browser. For example... Figure 5 As shown, upon receiving a command to start the application, the browser puts the application in the started state. Upon receiving a first command to switch the application to the background, the browser performs a stop operation (suspend operation), switching the application from the started state to the suspend state (stopped state), and the application moves from the foreground to the background. It's important to note that the suspend state means the application is in the background but not truly stopped; the application process still exists in this state. Upon receiving a second command to switch the application back to the foreground, the browser performs a resume operation, switching the application from the suspend state to the started state, and the application moves from the background to the foreground. Finally, upon receiving a close command, the application enters the close state, completely destroying the resources of the application that was running in the background.
[0079] In some embodiments, the user can control the application to start via a control device, sending a start command to bring the application to the foreground in a started state. In one example, the user can press a preset button on the control device, which is used only to indicate the start of the application. When the display device receives the key value corresponding to the preset button sent by the control device, it generates a command to start the application, and the application's user interface is displayed on the user interface. For example, the control device can be equipped with a button dedicated to starting the YouTube application. Specifically, the control device displays several buttons, including conventional "up," "down," "left," "right," "confirm," and "power" buttons, as well as a button labeled "YouTube." The user presses the "YouTube" button on the control device, generating a command to start the YouTube application, and the YouTube application is launched. Figure 6 As shown in ①, when the user presses the button on the control device used to launch application A, the user interface jumps to the following... Figure 6 The user interface shown in ② is currently displaying the user interface of application A.
[0080] In another example, a user can use a control on the user interface to move focus to an application control and press an confirmation button on the control to generate a command to launch the application. For example... Figure 7 As shown in ①, the user moves the focus to application A control (with a thickened border) via the control device and presses the confirmation button on the control device to generate a start command. The user interface then jumps to the following... Figure 7 The user interface is shown in ②. It should be noted that in this embodiment, moving the focus to a control can thicken the control's border. Alternatively, other methods can be used to indicate that the control is selected. For example, when the focus moves to a control, the control can change its shape, such as from a square to a circle. Alternatively, when a control is selected, it can be enlarged according to a preset ratio. For instance, the display area of controls in the application's control list can be the same, and when a control is selected, its display area increases by 1.2 times compared to the original control's display area. Since this application does not restrict the shape of the control when the focus is on it, other forms that facilitate user identification of a selected control are acceptable.
[0081] In some embodiments, the first instruction for switching the application to run in the background can be generated by the user control device. After generating the first instruction, the operation corresponding to the first instruction is executed. At this time, other applications are in the foreground, and the application that was originally in the foreground is switched to run in the background. In one example, such as... Figure 8As shown in ①, when the user presses the button to launch application B, the first instruction is generated to switch application A to run in the background, and the user interface jumps to the following... Figure 8 The user interface is shown in Figure ②. For example, the control device may have a button dedicated to launching Netflix applications. Specifically, the control device displays several buttons, including the conventional "Up," "Down," "Left," "Right," "OK," and "Power" buttons, as well as a button labeled "Netflix." When the user presses the "Netflix" button on the control device, a command is generated to launch the Netflix application. Simultaneously, a first command is generated to switch the application originally displayed on the user interface to background operation. For example, if the application originally displayed on the user interface is the YouTube application, a first command is generated to switch the YouTube application to background operation.
[0082] In another example, such as Figure 9 As shown in ①, when the user presses the down button on the control device, the user interface jumps to the following... Figure 9 The user interface shown in ② displays a list of launchable application controls. These controls can be selected to launch an application. The list can be displayed as a floating layer on the application's user interface, which is displayed on a video layer. The floating layer is positioned above the video layer and is transparent except for the area containing the launchable application control list. Specifically, the launchable application control list can be located at the bottom of the user interface. In some embodiments, it can also be located at other boundaries of the user interface to avoid obscuring the application content. The user uses the control device to move the focus to the application B control (with a thickened border) and presses the confirmation button, generating a command to launch application B and a first command to switch application A to the background. At this time, application B is displayed in the foreground, and the user interface is as follows. Figure 9 As shown in ③, application A is switched to run in the background.
[0083] In some embodiments, the second instruction for switching the application back to the foreground can be generated by a user-operated control device. The process of generating the second instruction can refer to the process of generating a launch instruction. When the application is in the background, pressing the launch button on the control device generates the second instruction for switching the application back to the foreground. When the application is not in the background, pressing the launch button on the control device generates a launch instruction. For example, as shown... Figure 10 As shown in ①, the current user interface displays the user interface of application B. When the user presses the button on the control device to launch application A, the user interface jumps to the following... Figure 10 The user interface in section ② pulls application A from the background to the foreground for display.
[0084] In some embodiments, the user can select the close control for a background application from a menu that displays background applications, at which point a close command is generated. For example, such as... Figure 11 As shown in ①, in the user interface, when the user presses and holds the home button, the key value and press duration corresponding to the button are sent to the display device. The display device receives the key value and press duration and controls the display to show the application management interface, i.e., jump to the following... Figure 11 The user interface shown in ② displays an application management interface, which includes all applications running in the foreground and background, or only displays applications that can be closed.
[0085] In some embodiments, the application management interface can be displayed as a floating layer on the user interface of application B. In other embodiments, the application management interface can be displayed in the video layer, replacing the user interface of application B originally displayed in the video layer. In some embodiments, the application displayed in the application management interface can be centered on the user interface. When there are many application controls and the user interface cannot fully display them, a scroll bar can be set on the user interface. The scroll bar can remind the user that not all application controls are fully displayed on the current page. The user can move the focus to the selected control using the buttons on the control device. For example, if the application control the user wants to select is not currently displayed on the user interface, the user can move the focus to the edge of the controls displayed on the current page, which could be the application control in the bottom row. Then, the user can press the down button on the control device. At this time, other application controls that are not currently displayed will be displayed on the user interface. If the desired application control still does not appear, the user can continue to use this method to select it. The edge of the control can also refer to the rightmost column of application controls. Pressing the right button on the control device will display other application controls that are not currently displayed on the user interface. If the desired application control does not appear, the user can continue to search using the right button. It is understood that the user can also press the left button on the control device to repeatedly search for application controls.
[0086] In some embodiments, the application management interface may also display page number prompts. For example, if there are many application controls that can be closed, they cannot all be displayed even if they fill the entire user interface. At least two pages are needed to display all the application controls. If the current focus is on the first page, the page prompt can be 1 / 2, where 1 represents the page number where the focus is currently located and 2 represents the total number of pages.
[0087] The user can move the focus to the close control corresponding to application A using the control device (the control changes color) and press the confirmation button. At this time, application A running in the background will be closed, and the user interface will jump to the user interface shown in Figure 11 ③. The user interface will then continue to display the user interface of application B, as shown below. Figure 11 As shown in ④.
[0088] It should be noted that the embodiments of this application do not limit the specific operations of generating instructions to pull an application from the foreground to the background or from the background to the foreground.
[0089] This application embodiment improves upon the browser's methods for performing stop and continue operations mentioned above.
[0090] In related technologies, such as Figure 12 As shown, when the application starts, it is in the startup state. Upon receiving the first instruction, the web component stops running (webmodule suspend), releases the decoded image resources, the resource loading module stops running, the rendering thread is destroyed, and the EGL graphics resources are cleaned up, causing the application to be in the stopped state.
[0091] Upon receiving the second instruction, EGL graphics resources are created, the rendering thread is initialized, the resource loading module continues to execute and acquires encoded image resources, decodes image resources, the web component continues to execute and performs layout calculations, the rendering thread rasterizes each layer, the rendering thread composites and displays, and the application is restarted.
[0092] The operations performed after receiving the first instruction correspond to the operations performed after receiving the second instruction. For example, after receiving the first instruction, the web component stops running, but after receiving the second instruction, the web component continues to execute and perform layout calculations, etc., so as to ensure that the application is displayed normally on the screen.
[0093] It's important to note that the process of suspending the web module, releasing decoded image resources, stopping the resource loading module, destroying the rendering thread, and cleaning up EGL (Enterprise Generation Language) graphics resources does not restrict the execution order of each step. However, the processes of creating EGL graphics resources, initializing the rendering thread, the resource loading module continuing to execute and acquire encoded image resources, decoding image resources, the web component continuing to execute and perform layout calculations, and the rendering thread rasterizing each layer and compositing and displaying the final result must be executed sequentially. This is because the final display on the user interface requires the execution of these steps one by one to achieve the desired result.
[0094] Among them, web components are used for DOM tree construction, style calculation, layout calculation, and page layer layering.
[0095] The Document Object Model (DOM) is a standard interface specification defined by the W3C. It's a standard API for processing HTML (Hypertext Markup Language, a markup language) and XML (Extensible Markup Language) files. The DOM provides an access model for the entire document, treating it as a tree structure. Each node in the tree represents an HTML tag or a text item within a tag. The DOM tree structure precisely describes the relationships between tags in an HTML document. The process of converting an HTML or XML document into a DOM tree is called parsing. Since an HTML document is parsed and transformed into a DOM tree, processing of the HTML document can be achieved through operations on the DOM tree. The DOM model not only describes the document's structure but also defines the behavior of node objects. Using the methods and properties of these objects, nodes and content in the DOM tree can be easily accessed, modified, added, and deleted.
[0096] Styles are a set of decoration parameters stored by name used to decorate decoration objects. Decoration objects include: characters, paragraphs, linked paragraphs and characters (paragraphs and characters used for hyperlinks), tables, and lists. Decoration parameters include: font, font size, borders and shading, alignment, indentation, borders, etc. Browsers not only need to convert HTML into a recognizable DOM tree structure, but also the corresponding CSS styles need to be converted into a recognizable stylesheet structure.
[0097] Layout is the process by which the browser calculates and lays out the data based on the DOM tree and styleSheets data structure.
[0098] The next step is to implement page layering because there are many complex effects on the page, such as complex 3D transformations, page scrolling, or z-indexing for z-axis sorting. To make it easier to implement these effects, the rendering engine also needs to generate dedicated layers for specific nodes and generate a corresponding layer tree.
[0099] Stopping a web component means stopping the web component from performing operations such as DOM tree construction, style calculation, layout calculation, and page layer layering.
[0100] Releasing decoded image resources can be understood as using decoded image resources when the application is running in the foreground. Therefore, when the application is moved from the foreground to the background, the decoded image resources need to be cleaned up.
[0101] The resource loading module is used to acquire page-related resources, such as image resources. When the resource loading module stops running, it can be understood that it no longer acquires page-related resources.
[0102] EGL is the interface between OpenGL ES (OpenGL for Embedded Systems, a subset of the OpenGL 3D graphics API) and the underlying native platform windowing system (native windowing system).
[0103] The initialization of the rendering thread refers to starting and initializing the rendering thread. The rendering thread is responsible for rendering the browser interface, parsing HTML and CSS, building the DOM tree and RenderObject tree, layout and drawing, etc. The thread will be executed when the interface needs to be repainted or when a reflow is triggered due to some operation.
[0104] The continued execution of the resource loading module means that the resource loading module has been started, but it does not mean that the encoded image resources have been obtained. For example, obtaining the encoded image resources can be obtaining image resources from the server, or the content provider provides image resources to the server.
[0105] Decoding image resources refers to decoding image resources acquired using the resource loading module. Encoding is the process of converting information from one form or format to another; it is also called the code in computer programming languages, or simply encoding. It involves using pre-defined methods to encode text, numbers, or other objects into digital codes, or to convert information or data into specified electrical pulse signals. Encoding is widely used in electronic computers, television, remote control, and communications. Decoding is the reverse process of encoding.
[0106] Continuing to execute a web component means enabling the web component to continue performing tasks such as DOM tree construction, style calculation, layout calculation, page layer layering, and providing drawing instructions.
[0107] The rasterization of each layer by the rendering thread can be understood as follows: First, a tile is a block of 512x512 or 256x256 pixels within the rendering process, i.e., the compositing thread in the browser kernel, dividing the layer into blocks. Second, the bitmap is the rasterization process: the compositing thread prioritizes generating bitmaps based on tiles near the viewport; the actual bitmap generation is performed by rasterization, converting tiles into bitmaps. Rasterization is a technical term; a raster is a pixel, and rasterization converts vector graphics into bitmaps (raster images).
[0108] The rendering thread's process of compositing and displaying can be understood as follows: once all tiles have been rasterized, a command to draw the tiles is generated, a page is generated based on the tile drawing command, and then displayed on the monitor.
[0109] In the embodiments of this application, such as Figure 13 As shown, when the application is running in the default environment, upon receiving the first instruction to switch the application to the background, the web component and the resource loading module are stopped. Upon receiving the second instruction to switch the application to the foreground, the resource loading module and the web component are restarted, the rendering thread is controlled to rasterize the layers, and layer compositing and display are controlled.
[0110] In this embodiment, since the user interface of the default application does not change within a short period of time, in order to improve the speed of bringing the application from the background to the foreground, resources used by the application when it is in the foreground are preserved as much as possible, and these resources are reused when the application is brought from the background to the foreground. For example, when YouTube is in the background, if the user restarts the YouTube application within 10 minutes, the YouTube server will not change the homepage resources. The resources required to restart the YouTube application are the same as those before it was in the background, and the screen layout and display effect are exactly the same as before it was in the background. If resources before it was in the background are preserved as much as possible, these steps are not required when restarting YouTube, which can greatly save startup time.
[0111] In this embodiment, releasing the decoded image resources, destroying the rendering thread, and cleaning up the EGL graphics resources are no longer executed. The corresponding creation of EGL graphics resources, initialization of the rendering thread, and decoding of image resources are also no longer executed, thus improving the speed of restarting the application.
[0112] In some embodiments, if a second instruction to switch the application back to the foreground is not received within a short period, the decoded image resources can be released periodically, the rendering thread destroyed, and EGL graphics resources cleaned up. Specifically, a timer is started after the first instruction is received. The time interval between the current time and the receipt of the first instruction is used to determine the time difference. If the time interval is less than a preset time interval, the decoded image resources are not released, the rendering thread is not destroyed, and the EGL graphics resources are not cleaned up. If the time interval is not less than the preset time interval and a second instruction is received, the application is pulled from the background to the foreground according to the existing technology, releasing the decoded image resources, destroying the rendering thread, and cleaning up the EGL graphics resources. This ensures that the original resources are reused when the second instruction is received within a short period, while also ensuring that excessive resources of the display device are not occupied when the second instruction is not received within a short period.
[0113] In some embodiments, the scope of the preset application is not limited, as long as the application runs on a browser.
[0114] In some embodiments, users can preset applications as needed. When executing the method of this application embodiment, it is first determined whether the application corresponding to the second instruction is a preset application. If the application is a preset application, the method of this application embodiment is executed. If the application is not a preset application, the process of moving the application to the background and bringing it to the foreground still uses the methods mentioned in related technologies. In some embodiments, the method for determining whether the application corresponding to the second instruction is a preset application includes: storing application identifiers corresponding to preset applications. The number of preset applications can be multiple, and multiple application identifiers corresponding to preset applications can be stored in a list. When a second instruction is received, the second instruction carries a corresponding application identifier. The carried application identifier is compared with the application identifiers in the list. If there is a matching application identifier, only the web component and the resource loading module are stopped, but the decoded image resources are not released, the rendering thread is not destroyed, and the EGL graphics resources are not cleaned up. If there is no matching application identifier, in addition to stopping the web component and the resource loading module, the decoded image resources are released, the rendering thread is destroyed, and the EGL graphics resources are cleaned up.
[0115] In some embodiments, the decoded image resource is not released after receiving the first instruction. The image resource is not decoded after receiving the second instruction.
[0116] In related technologies, image resources are released during the stop operation. In this embodiment, the decoded image resources are retained during the browser's stop operation. This eliminates the need to decode the image resources during the continuation of the operation. For example, when entering the YouTube application homepage, due to the homepage's design, 22 image resources are typically loaded. Decoding each image resource takes 9ms, totaling approximately 190-200ms for decoding all 22 images. In this embodiment, upon receiving the first instruction, the decoded image resources are not released; consequently, upon receiving the second instruction, the image resources are not decoded. This optimization reduces the 190-200ms startup time for bringing the application from the background to the foreground.
[0117] In some embodiments, the rendering thread is not destroyed after receiving the first instruction. The rendering thread is not initialized after receiving the second instruction.
[0118] In related technologies, during the stop operation, the rendering thread is destroyed, releasing and destroying both the rendering thread and its resources. During the continuation of the operation, the rendering thread needs to be initialized, recreated, and its resources rebuilt. In this embodiment, the rendering thread is retained during the browser's stop operation, and the EGL layer resources are not destroyed. This eliminates the need to recreate and initialize the rendering thread during the continuation of the operation. Recreating and initializing the rendering thread takes approximately 260ms. In this embodiment, the rendering thread is not destroyed upon receiving the first instruction. The rendering thread is not initialized upon receiving the second instruction. This optimization reduces the application startup time from the background to the foreground by 260ms.
[0119] In some embodiments, EGL graphics resources are not cleaned up after receiving the first instruction. EGL graphics resources are not created after receiving the second instruction.
[0120] In related technologies, during the stop operation, EGL layer resources are cleaned up, which destroys EGL drawing resources. These resources need to be recreated when the operation resumes. In this embodiment, EGL graphics resources are retained during the browser's stop operation. This eliminates the need to recreate EGL graphics resources when the operation resumes. Recreating EGL graphics resources takes approximately 70ms. In this embodiment, EGL graphics resources are not cleaned up after receiving the first instruction. EGL graphics resources are not created after receiving the second instruction. This optimization reduces the application startup time from the background to the foreground by 70ms.
[0121] In related technologies, rasterizing layers is a relatively time-consuming process. For a fully displayed image, the rasterization process takes approximately 560ms. When rendering a frame, browsers typically use an oil painting algorithm, rendering layers from bottom to top onto the screen in a far-to-near manner. If a layer, after passing through the shading pipeline, needs to be recalculated with the result of another layer to produce a special effect before being rendered to the screen, the GPU needs to allocate an additional buffer to store the results twice. This process is called off-screen rasterization. If multiple layers in a single frame require off-screen rasterization, the GPU needs to switch contexts multiple times, increasing execution time.
[0122] In this embodiment, during the stop operation, rendering thread-related resources are not destroyed. This means that during the continuation of the operation, the rendering thread does not need to re-rasterize many layers, thus significantly saving rendering time. In related technologies, the rasterization process takes 560ms, while in this embodiment, it only takes approximately 12ms, compared to the previous 560ms. In this embodiment, EGL graphics resources are not cleared after receiving the first instruction. Upon receiving the second instruction, EGL graphics resources are not created. This measure greatly improves application startup performance.
[0123] Thus, by comparing the embodiments of this application with related technologies, it is found that the embodiments of this application can save more than 1000ms of time, and the startup time of the application from the background to the foreground is shortened from 1370ms to 167ms, which greatly shortens the startup speed and performance of the preset application and improves the user experience.
[0124] In the above embodiments, a method and display device for optimizing application startup performance are provided. This method preserves as many resources as possible used when the application is in the foreground, and reuses these resources when the application is brought from the background to the foreground, thus shortening application startup time and enabling rapid display of the application screen. The method includes: upon receiving a first instruction to switch the application to the background during preset application runtime, stopping the web component and the resource loading module; upon receiving a second instruction to switch the application to the foreground, re-running the resource loading module and the web component, controlling the rendering thread to rasterize the layers, and controlling layer compositing and display.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0126] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A display device, characterized by comprising: The application comprises: a display for displaying a user interface; a user interface for receiving an input signal; a controller connected to the display and the user interface respectively, for performing: when a preset application is running, receiving a first instruction for switching the application to run in the background, stopping the running of a web component and a resource loading module, and within a preset time period after receiving the first instruction, not releasing decoded picture resources, not destroying a rendering thread, and not cleaning up EGL graphics resources; within the preset time period, receiving a second instruction for switching the application to run in the foreground, re-running the resource loading module, and re-running the web component, controlling the rendering thread to rasterize a layer, and controlling layer composition and display.
2. The display device of claim 1, wherein, After receiving the second instruction, the controller is further configured to perform: not decoding the picture resources.
3. The display device of claim 1, wherein, After receiving the second instruction, the controller is further configured to perform: not initializing the rendering thread.
4. The display device of claim 1, wherein, After receiving the second instruction, the controller is further configured to perform: not creating the EGL graphics resources.
5. A method of optimizing application launch performance, the method comprising: The method comprises: when a preset application is running, receiving a first instruction for switching the application to run in the background, stopping the running of a web component and a resource loading module, and within a preset time period after receiving the first instruction, not releasing decoded picture resources, not destroying a rendering thread, and not cleaning up EGL graphics resources; within the preset time period, receiving a second instruction for switching the application to run in the foreground, re-running the resource loading module, and re-running the web component, controlling the rendering thread to rasterize a layer, and controlling layer composition and display.
6. The method of claim 5, wherein, After receiving the second instruction, the method further comprises: not decoding the picture resources.
Citation Information
Patent Citations
Systems and methods for suspending and resuming of a stateful Web application
US20070050449A1