Display device, task preloading method and computer readable storage medium
By registering after the display device is powered on and performing preload tasks in an idle thread, the problem of cold start stuttering of the display device is solved, achieving a faster startup process and a better user experience.
Patent Information
- Application Number
- CN202410905567.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-07-08
AI Technical Summary
The display device often stutters during cold start, which affects the user experience. The cold start stuttering time usually exceeds 1 minute.
By receiving the target startup phase broadcast after powering on the display device, preload tasks are registered with the target queue managed by the idle loader, and these tasks are executed when the target thread is detected to be idle, thus achieving the execution of preload tasks when the thread is idle.
Reduces the cold start stuttering time and improves the user experience. By executing some tasks in advance without affecting the normal start of the thread, the power-on startup process is optimized.
Smart Images

Figure CN119562096A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to computer technology, and more specifically, to a display device, a task preloading method, and a computer-readable storage medium. Background Art
[0002] After the display device is turned on, the user needs to wait for the display device to complete the cold start. During the waiting period, the user cannot operate the application and can clearly feel the obvious lag problems such as the application interface not being displayed or being displayed but the operation is not smooth. According to actual performance tests, the cold start lag time of most models can reach 1 minute or more, which seriously affects the user experience. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a display device, a task preloading method and a computer-readable storage medium, which can shorten the cold start freeze time of the display device.
[0004] In a first aspect, an embodiment of the present application provides a display device, including:
[0005] A display configured to: display a user interface;
[0006] The controller is configured to: after the display device is powered on and a target startup phase broadcast is received, register the first preloading task to a target queue managed by an idle loader through a first business component, the target queue being a queue corresponding to a target thread type, the target queue including at least one preloading task arranged according to the earliest loadable time of the corresponding preloading task, the at least one preloading task including a first preloading task, and the at least one preloading task being a task corresponding to the target thread type; when it is detected that the first thread is idle and the type of the first thread is the target thread type, read the second preloading task from the target queue through the idle loader, and load the second preloading task through the first thread, the second preloading task being the first preloading task in the target queue whose earliest loadable time is earlier than the current time; send a notification of completion of loading of the second preloading task to the second business component through the idle loader; mark the completion of loading of the second preloading task through the second business component, the second business component being a component that registers the second preloading task with the target queue.
[0007] In the second aspect, an embodiment of the present application provides a task preloading method, comprising: after the display device is powered on and a target startup phase broadcast is received, registering a first preloading task to a target queue managed by an idle loader through a first business component, the target queue being a queue corresponding to a target thread type, the target queue including at least one preloading task arranged according to the earliest loadable time of the corresponding preloading task, the at least one preloading task including a first preloading task, and the at least one preloading task being a task corresponding to the target thread type; when it is detected that the first thread is idle and the type of the first thread is the target thread type, reading a second preloading task from the target queue through an idle loader, and loading the second preloading task through the first thread, the second preloading task being the first of the preloading tasks in the target queue whose earliest loadable time is earlier than the current moment; sending a notification of completion of loading of the second preloading task to the second business component through the idle loader; marking completion of loading of the second preloading task through the second business component, the second business component being a component that registers the second preloading task with the target queue.
[0008] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the task preloading method shown in the second aspect is implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a computer program product, including: when the computer program product runs on a computer, the computer implements the task preloading method shown in the second aspect.
[0010] The technical solution provided by the embodiment of the present application has the following advantages over the prior art: In the embodiment of the present application, after the display device is powered on and a target startup phase broadcast is received, the first preloading task is registered in a target queue managed by an idle loader through a first business component, the target queue is a queue corresponding to a target thread type, the target queue includes at least one preloading task arranged according to the earliest loadable time of the corresponding preloading task, the at least one preloading task includes a first preloading task, and the at least one preloading task is a task corresponding to the target thread type; when it is detected that the first thread is idle and the type of the first thread is the target thread type, the second preloading task is read from the target queue through the idle loader, and the second preloading task is loaded through the first thread, the second preloading task is the first of the preloading tasks in the target queue whose earliest loadable time is earlier than the current time; a notification of completion of loading of the second preloading task is sent to the second business component through the idle loader; the completion of loading of the second preloading task is marked through the second business component, and the second business component is a component that registers the second preloading task with the target queue. In this way, the preloading task corresponding to the target thread type registered with the idle loader is managed through the target queue, and when it is detected that the thread corresponding to the target thread type is idle, the preloading task is executed by the idle thread, thereby realizing the execution of the preloading task when the thread is idle. Without affecting the normal startup task of the thread, the preloading of some tasks is realized during the power-on startup process, thereby reducing the cold start lag time. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0012] Figure 1 An operation scenario between a display device and a control device according to some embodiments is shown;
[0013] Figure 2 shows a hardware configuration block diagram of a control device 100 according to some embodiments;
[0014] Figure 3 shows a hardware configuration block diagram of a display device 200 according to some embodiments;
[0015] Figure 4 shows a software configuration diagram in a display device 200 according to some embodiments;
[0016] Figure 5One of the flowcharts of the task preloading method according to some embodiments is shown;
[0017] Figure 6 A second flowchart of a task preloading method according to some embodiments is shown;
[0018] Figure 7 A third flowchart of a task preloading method according to some embodiments is shown;
[0019] Figure 8 A fourth flowchart of a task preloading method according to some embodiments is shown;
[0020] Fig. 9 FIG5 shows a fifth flow chart of a task preloading method according to some embodiments;
[0021] Fig.10 FIG6 shows a sixth flowchart of a task preloading method according to some embodiments. DETAILED DESCRIPTION
[0022] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0023] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0024] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0025] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0026] The display device provided in the embodiments of the present application may have various implementation forms, for example, it may be a television, a smart television, a laser projection device, a monitor, an electronic bulletin board, an electronic table, a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, etc.
[0027] Figure 1 FIG. 1 is a schematic diagram of an operation scenario between a display device and a control device according to an embodiment, wherein the control device includes an intelligent device or a control apparatus. Figure 1 As shown, the user can operate the display device 200 through the smart device 300 or the control apparatus 100 .
[0028] In some embodiments, the control device 100 may be a remote controller, and the communication between the remote controller and the display device includes infrared protocol communication or Bluetooth protocol communication, and other short-range communication methods, and the display device 200 is controlled wirelessly or wired. The user may control the display device 200 by inputting user commands through buttons on the remote controller, voice input, control panel input, etc.
[0029] In some embodiments, a smart device 300 (such as a mobile terminal, a tablet computer, a computer, a laptop computer, etc.) may also be used to control the display device 200. For example, the display device 200 is controlled using an application running on the smart device.
[0030] In some embodiments, the display device may not use the above-mentioned smart device or control device to receive instructions, but may receive user control through touch or gestures.
[0031] In some embodiments, the display device 200 can also be controlled in a manner other than the control device 100 and the smart device 300. For example, the user's voice command control can be directly received through a module for obtaining voice commands configured inside the display device 200, or the user's voice command control can be received through a voice control device set outside the display device 200.
[0032] In some embodiments, the display device 200 also communicates data with the server 400. The display device 200 may be allowed to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks. The server 400 may provide various content and interactions to the display device 200. The server 400 may be one cluster or multiple clusters, and may include one or more types of servers.
[0033] Figure 2 Schematically shows a block diagram of a configuration of the control device 100 according to an exemplary embodiment. Figure 2 As shown, the control device 100 includes a controller 110, a communication interface 130, a user input / output interface 140, an external memory, and a power supply. The control device 100 can receive an input operation instruction from a user, and convert the operation instruction into an instruction that can be recognized and responded to by the display device 200, playing the role of an interactive intermediary between the user and the display device 200.
[0034] like Figure 3 The display device 200 includes at least one of a tuner and demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a user interface 280, an external memory, and a power supply.
[0035] In some embodiments, the controller includes a processor, a video processor, an audio processor, a graphics processor, a RAM, a ROM, and a first interface to an nth interface for input / output.
[0036] The display 260 includes a display screen component for presenting images, and a driving component for driving image display, which is used to receive image signals output from the controller, and display video content, image content, and menu control interface components and user control UI interface.
[0037] 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.
[0038] The communicator 220 is a component for communicating with an external device or server according to various communication protocol types. For example, the communicator may include at least one of a Wifi module, a Bluetooth module, a wired Ethernet module, and other network communication protocol chips or near field communication protocol chips, and an infrared receiver. The display device 200 can establish transmission and reception of control signals and data signals with the external control device 100 or the server 400 through the communicator 220.
[0039] The user interface 280 can be used to receive control signals from the control device 100 (such as an infrared remote controller, etc.) It can also be used to directly receive user input operation instructions and convert the operation instructions into instructions that the display device 200 can recognize and respond to, which can be called a user input interface.
[0040] The detector 230 is used to collect signals from the external environment or the external interaction. For example, the detector 230 includes a light receiver, a sensor for collecting the intensity of ambient light; or, the detector 230 includes an image collector, such as a camera, which can be used to collect external environment scenes, user attributes or user interaction gestures; or, the detector 230 includes a sound collector, such as a microphone, etc., for receiving external sounds.
[0041] The external device interface 240 may include, but is not limited to, any one or more of the following interfaces: a high-definition multimedia interface (HDMI), an analog or digital high-definition component input interface (component), a composite video input interface (CVBS), a USB input interface (USB), an RGB port, etc. It may also be a composite input / output interface formed by the above multiple interfaces.
[0042] The tuner-demodulator 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.
[0043] In some embodiments, the controller 250 and the tuner-demodulator 210 may be located in different separate devices, that is, the tuner-demodulator 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.
[0044] The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in the memory (internal memory or external memory). The controller 250 controls the overall operation of the display device 200. For example, in response to receiving a user command for selecting a UI object to be displayed on the display 260, the controller 250 can perform operations related to the object selected by the user command.
[0045] In some embodiments, the controller includes a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), and at least one of a random access memory (RAM), a read-only memory (ROM), a first interface to an nth interface for input / output, a communication bus, etc.
[0046] Among them, RAM, also called main memory, is an internal memory that directly exchanges data with the controller. It can be read and written at any time (except when refreshed), and it is very fast. It is usually used as a temporary data storage medium for operating systems or other running programs. The biggest difference between it and ROM is the volatility of data, that is, once the power is cut off, the stored data will be lost. RAM is used in computers and digital systems to temporarily store programs, data and intermediate results. ROM works in a non-destructive read-out mode and can only read but not write information. Once the information is written, it is fixed, and even if the power is cut off, the information will not be lost, so it is also called fixed memory.
[0047] The user may input a user command through a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input command through the graphical user interface (GUI). Alternatively, the user may input a user command through a specific sound or gesture, and the user input interface recognizes the sound or gesture through a sensor to receive the user input command.
[0048] "User interface" is the medium interface for interaction and information exchange between applications or operating systems and users. It realizes the conversion between the internal form of information and the form acceptable to users. The commonly used form of user interface is the Graphical User Interface (GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be an icon, window, control or other interface element displayed on the display screen of a display device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
[0049] In the embodiment of the present application, the cold start jamming is not limited to the jamming during the cold start phase of the display device, and may also include the jamming within a preset time after the boot. That is to say, in the embodiment of the present application, the cold start jamming is the jamming that occurs during the process from the power-on of the display device to the user being able to smoothly operate the display device.
[0050] The embodiment of the present application provides a display device and a method for preloading tasks, wherein the display device can implement the method for preloading tasks provided by the embodiment of the present application or the functional module or functional entity in the display device can implement the method for preloading tasks provided by the embodiment of the present application. The display device includes: a controller and a display, respectively corresponding to the above Figure 3 The controller 250 and the display 260 are shown in FIG.
[0051] In some embodiments of the present application, the controller is configured to: after the display device is powered on and a target startup phase broadcast is received, register the first preloading task to the target queue managed by the idle loader through the first business component, the target queue is a queue corresponding to the target thread type, the target queue includes at least one preloading task arranged according to the earliest loadable time of the corresponding preloading task, the at least one preloading task includes the first preloading task, and the at least one preloading task is a task corresponding to the target thread type.
[0052] Among them, the target startup phase broadcast can be a broadcast in the power-on phase, before plug-in loading, system required plug-ins have been loaded, the home page has been displayed, after the home page is displayed, additional initialization, etc. The specific broadcast can be determined according to actual conditions and is not limited here.
[0053] The idle loader may manage one or more queues, where different queues are queues corresponding to different thread types, that is, tasks in different queues belong to tasks of different thread types.
[0054] The preload tasks in a queue can be arranged according to the earliest loadable time of the preload tasks. The earliest loadable time is the earliest time that the task is allowed to be loaded. Before the earliest loadable time, the corresponding preload task cannot be loaded. At or after the earliest loadable time, the corresponding preload task can be loaded.
[0055] The first service component may be any service component that needs to register a preload task with the idle loader during the power-on startup of the display device. The specific service component may be determined according to actual conditions and is not limited here.
[0056] Among them, the first business component can register one or more preloading tasks (including the first preloading task) with the idle loader. When the first business component registers multiple preloading tasks with the idle loader, the multiple preloading tasks can be tasks of the same thread type or tasks of different thread types. The specific type can be determined based on actual conditions and is not limited here.
[0057] Among them, at least one preload task included in the target queue can be registered with the same business component, or can be registered with different business components. The specific number can be determined according to actual conditions and is not limited here.
[0058] In some embodiments of the present application, during the startup phase of the electronic device being powered on, one or more business components can register preload tasks to the idle loader respectively, and preload tasks of different thread types can be registered in queues corresponding to different thread types. For example, preload tasks of the main thread type are registered in the queue corresponding to the main thread type, preload tasks of the CPU thread type are registered in the queue corresponding to the CPU thread type, preload tasks of the IO (Input / Output) thread type are registered in the queue corresponding to the IO thread type, and preload tasks of other thread types are registered in the queues corresponding to other thread types. The specific details can be determined according to the actual situation and are not limited here.
[0059] When a business component registers a preloading task with the idle loader, it will carry the earliest loadable time of the preloading task and the thread type on which the preloading needs to be performed.
[0060] When it is detected that the first thread is idle and the type of the first thread is the target thread type, the second preloading task is read from the target queue through the idle loader, and the second preloading task is loaded through the first thread. The second preloading task is the first of the preloading tasks in the target queue whose earliest loadable time is earlier than the current time.
[0061] The second preloading task is the first preloading task in the target queue, and can be the first preloading task or a task other than the first preloading task, which can be determined according to actual conditions and is not limited here.
[0062] In some embodiments of the present application, each time the idle loader detects that a thread is idle, it only loads one preload task in the corresponding queue (the queue corresponding to the type of the thread) through the thread. In this way, it can avoid loading multiple preload tasks through one idle thread, resulting in a long cumulative loading time, affecting the execution of normal loading tasks in the idle thread, and thus affecting the normal startup process.
[0063] In some embodiments of the present application, after a preloading task is executed by a thread, if the queue corresponding to the type of the thread is empty (there is no preloading task), an indication message of "execute only once" is returned to the thread, that is, the thread no longer needs to execute the preloading task when it is idle subsequently; if the queue corresponding to the type of the thread is not empty (there is a preloading task), an indication message of "execute every time the thread is idle" is returned to the thread, that is, the thread still needs to execute the preloading task when it is idle subsequently (it needs to wait in a loop to execute the preloading task).
[0064] In some embodiments of the present application, after the first business component registers the first preload task with the idle loader, if the detection of the thread of the corresponding thread type (the thread type corresponding to the queue) has been started, the first preload task is added to the target queue, waiting for the idle thread to execute the first preload task. If there is no preload task in the current target queue, after the first preload task is added to the target queue, the detection of the thread of the corresponding thread type (the thread type corresponding to the queue) is started, waiting for the idle thread to execute the first preload task. Since the preload tasks are not registered in the queue at the same time, after the last preload task in a queue is loaded, the queue is empty, and an indication of "only execute once" can be returned to the thread executing the last preload task. However, when a business component registers a new preload task with the queue, the detection of the thread of the corresponding thread type (the thread type corresponding to the queue) can be restarted, and then the preload task in the queue is executed when the thread is idle.
[0065] For example, IdleHandler can be used to monitor thread idleness. The following steps can be followed: Create a class that implements the MessageQueue.IdleHandler interface, override the queueIdle method, and write specific monitoring logic in the method: When the message queue of the corresponding thread is idle, that is, when there are no new messages to be processed, the system will automatically call the queueIdle method of MyIdleHandler to execute a preload task in the queue of the corresponding thread type. After the preload task is loaded, return "return false" (i.e. "execute only once") or "returnfalse" (i.e. execute every time the thread is idle).
[0066] In the embodiment of the present application, because the thread running IdleHandler is only related to the thread where the current MessageQueue's Looper is located. The main thread type thread (hereinafter referred to as the main thread) has its own looper, which can realize cyclic detection of whether the main thread is idle, and then each time the main thread is detected to be idle, the preload task can be executed through the main thread; but the child thread (CPU thread type thread and IO thread type thread) itself does not have a looper, so in the case of executing preload tasks based on the child thread, it is necessary to create a child thread and construct a looper to realize cyclic detection of whether the child thread is idle, and then each time the child thread is detected to be idle, the preload task is executed through the child thread.
[0067] The idle loader sends a notification of completion of loading of the second preloading task to the second service component; the second service component marks completion of loading of the second preloading task, and the second service component is a component that registers the second preloading task with the target queue.
[0068] The second business component may be the first business component, or a business component other than the first business component, which may be determined according to actual conditions and is not limited here.
[0069] In an embodiment of the present application, the idle loader sends a notification of the completion of loading the second preloading task to the second business component; the second business component marks the completion of loading the second preloading task, thereby avoiding the second business component from repeatedly loading the preloading task during the startup phase and avoiding waste of resources.
[0070] In some embodiments of the present application, the controller is specifically configured to: send the loading status of the second preloading task to the second business component through the idle loader; when the loading status received by the second business component is loading completion, the second business component marks the second preloading task loading completion. It can be understood that between the start of the second preloading task and the completion of the second preloading task loading, the idle loader can synchronize the loading status of the second preloading task to the second business component multiple times, so that the second business component can obtain the loading status of the second preloading task in a timely manner.
[0071] In an embodiment of the present application, the preloading task corresponding to the target thread type registered with the idle loader is managed through the target queue, and when it is detected that the thread corresponding to the target thread type is idle, the preloading task is executed by the idle thread, thereby realizing the execution of the preloading task when the thread is idle. Without affecting the normal startup task of the thread, the preloading of some tasks is realized during the power-on startup process, thereby reducing the cold start lag time.
[0072] In some embodiments of the present application, the idle loader manages multiple queues, the multiple queues respectively correspond to multiple thread types, the multiple thread types include the target thread type, and the multiple queues include the target queue.
[0073] Therein, the multiple queues correspond one-to-one to the multiple thread types, that is, the preload tasks corresponding to different thread types are registered in different queues.
[0074] In the case where the first preload task is a main thread type task, the target thread type is the main thread type, the corresponding first thread is a main thread type thread, and the second preload task is a main thread type task. That is, the tasks in the target queue are all main thread type tasks, and need to wait for an idle main thread type thread to execute the preload tasks in the target queue.
[0075] In the case where the first preload task is a task of the CPU thread type, the target thread type is the CPU thread type, the corresponding first thread is a thread of the CPU thread type, and the second preload task is a task of the CPU thread type. That is, the tasks in the target queue are all tasks of the CPU thread type, and it is necessary to wait for an idle CPU thread type thread to execute the preload tasks in the target queue.
[0076] In the case where the first preload task is an IO thread type task, the target thread type is an IO thread type, the corresponding first thread is an IO thread type thread, and the second preload task is an IO thread type task. That is, the tasks in the target queue are all IO thread type tasks, and it is necessary to wait for an idle IO thread type thread to execute the preload tasks in the target queue.
[0077] In the embodiment of the present application, multiple queues are used to manage tasks of multiple thread types respectively, so that preloading tasks of corresponding thread types are executed by idle threads of different thread types. Preloading tasks with different time requirements can be executed by threads that can undertake them. On the one hand, tasks corresponding to multiple thread types are shared to different idle threads for execution, thereby improving the efficiency of successful execution of preloading tasks. On the other hand, it can avoid executing all tasks through the main thread, causing serious time consumption of the main thread, affecting the normal loading tasks of the main thread, and causing problems such as freezes.
[0078] In some embodiments of the present application, when the first preloading task is a main thread type task, the preloading time corresponding to the first preloading task is less than or equal to the first duration threshold.
[0079] The value of the first duration threshold may be determined based on actual conditions. The first duration thresholds corresponding to display devices of different models and manufacturers may be the same or different, and are not limited here.
[0080] In some embodiments of the present application, when the first preloading task is a CPU thread type task, the preloading time corresponding to the first preloading task is less than or equal to the second duration threshold.
[0081] Among them, the value of the second duration threshold can be determined according to actual conditions. The second duration thresholds corresponding to display devices of different models and different manufacturers may be the same or different, and are not limited here.
[0082] In a case where the first preloading task is an IO thread type task, the preloading time corresponding to the first preloading task is less than or equal to the third duration threshold;
[0083] Among them, the value of the third duration threshold can be determined according to actual conditions. The third duration thresholds corresponding to display devices of different models and different manufacturers may be the same or different, and are not limited here.
[0084] The first duration threshold is smaller than the second duration threshold, and the first duration threshold is smaller than the third duration threshold.
[0085] In an embodiment of the present application, the preloading task registered with the idle loader generally cannot be too time-consuming. Therefore, the preloading time of the main thread type preloading task is set to be less than or equal to the first duration threshold, the preloading time of the CPU thread type preloading task is set to be less than or equal to the first duration threshold, and the preloading time of the IO thread type preloading task is set to be less than or equal to the first duration threshold, so as to avoid affecting the execution of normal loading tasks and the responsiveness of the UI during the startup process of the display device.
[0086] In some embodiments of the present application, the startup phase broadcast is a broadcast of the first startup phase in the power-on startup process, and the first preload task is a task whose earliest loadable time is any time in the power-on startup process.
[0087] It can be understood that in an embodiment of the present application, after receiving the broadcast of the first startup stage (such as the power-on stage) in the power-on startup process, the preloading tasks can be registered with the idle loader through different business components one after another. For example, the preloading task can be registered with the idle loader within a preset time before the earliest loadable time of the preloading task, or the preloading task can be registered with the idle loader after the earliest loadable time of the preloading task; multiple preloading tasks can be registered with the idle loader in the order of the earliest loadable time, or they can be randomly registered with the idle loader. The specific details can be determined according to the actual situation and are not limited here.
[0088] In some embodiments of the present application, the startup phase broadcast is a broadcast of a target startup phase during the power-on startup process, and the first preloading task is a task whose earliest loadable time is any time during the target startup phase.
[0089] The target startup phase is any one of multiple startup phases in the power-on startup process.
[0090] It can be understood that in the embodiment of the present application, the preloading tasks can be registered with the idle loader according to different startup stages in the power-on startup process. Exemplarily, in the power-on phase (starting from receiving the broadcast of the power-on phase), the preloading task whose earliest loadable time falls into the power-on phase is registered with the idle loader; in the pre-plugin loading phase (starting from receiving the broadcast of the pre-plugin loading phase), the preloading task whose earliest loadable time falls into the pre-plugin loading phase is registered with the idle loader; after the system-required plug-in has been loaded (starting from receiving the broadcast of the system-required plug-in has been loaded), the preloading task whose earliest loadable time falls into the system-required plug-in has been loaded is registered with the idle loader; in the home page displayed phase (starting from receiving the broadcast of the home page displayed phase), the preloading task whose earliest loadable time falls into the home page displayed phase is registered with the idle loader; in the post-home page displayed phase (starting from receiving the broadcast of the post-home page displayed phase), the preloading task whose earliest loadable time falls into the post-home page displayed phase is registered with the idle loader; in the additional initialization phase (starting from receiving the broadcast of the additional initialization phase), the preloading task whose earliest loadable time falls into the additional initialization phase is registered with the idle loader; and so on.
[0091] In the embodiment of the present application, the preloading tasks are registered with the idle loader respectively at different startup stages, so as to facilitate the idle loader to manage the preloading tasks.
[0092] In some embodiments of the present application, the startup phase broadcast is a broadcast of the target startup phase, and the controller is further configured to: delete, through the idle loader, the preloaded tasks registered to the target queue before the target startup phase.
[0093] It can be understood that for the scheme of registering preloading tasks with the idle loader respectively through different startup stages, the timing at which the preloading tasks registered in different startup stages can be executed by the idle thread can be limited to the corresponding startup stage. When the broadcast of the next startup stage is received, the preloading tasks previously registered in the idle loader are deleted, and the preloading tasks with the earliest loading time during the next startup stage are registered with the idle loader, thereby facilitating the management of the preloading tasks in the queue and avoiding the accumulation of preloading tasks in the queue.
[0094] In some embodiments of the present application, the startup phase broadcast is a broadcast of the target startup phase, and the controller is further configured to: obtain at least one target preloading task registered to the target queue before the target startup phase; based on the priority of the at least one target preloading task, update the earliest loadable time corresponding to the at least one target preloading task; based on the updated earliest loadable time corresponding to the at least one target preloading task, update the arrangement order of the at least one target preloading task in the target queue.
[0095] Among them, the target preloading task with a higher priority has an earlier updated earliest loadable time (instantially, different preset durations can be added to the earliest loadable time of different target preloading tasks according to the priority, so as to re-determine the earliest loadable time of the target preloading task). The earliest loadable time corresponding to the preloading task registered to the target queue after the broadcast in the target startup phase is the earliest time that the preloading task is actually allowed to be loaded.
[0096] It can be understood that at least one target preloading task is registered to the target queue before the target startup phase, and the preloading task has not been executed. Then, the earliest loadable time of the at least one target preloading task can be re-determined according to the priority of the at least one target preloading task, and then the at least one target preloading task can be sorted with the preloading tasks registered to the target queue after the broadcast of the target startup phase according to the updated earliest loadable time, and during the target startup phase, the preloading tasks in the target queue are executed in sequence by the idle thread according to the arrangement order of the preloading tasks in the target queue, so as to determine which preloading task to load first through the idle thread for at least one target preloading task and the preloading task registered to the target queue after the broadcast of the target startup phase, so that the preloading task that needs to be executed most can be determined according to actual conditions.
[0097] In some embodiments of the present application, the first preloading task is any one of the following: a task to be loaded during the power-on startup process, a task to be loaded within a preset time after the power-on startup process; a task to be loaded after the power-on startup process determined based on the user profile of the current user.
[0098] Among them, the preloading task can be the necessary plug-in loading task during the cold start process, the loading task related to the first frame data; the public template loading task after the cold start, the public recommended position loading task, and the player loading task.
[0099] The user portrait may include the user's identification and the identification of the applications that the user likes to watch. Among them, the tasks to be loaded after the power-on startup process determined according to the user portrait of the current user may include the startup tasks of the applications that the user likes to watch, the home page UI display tasks, etc. The specific tasks can be determined based on actual conditions and are not limited here.
[0100] In an embodiment of the present application, during the cold start process, an idle thread is used to preload the tasks to be loaded during the power-on start process, the tasks to be loaded within a preset time after the power-on start process, and the tasks to be loaded after the power-on start process are determined according to the user profile of the current user. This can speed up the cold start process of the display device, the interface display or the startup of the application after the cold start, etc., thereby shortening the freeze time and improving the user experience.
[0101] In some embodiments of the present application, the controller is further configured to: upon receiving a broadcast indicating the end of the power-on startup process, delete the unloaded preloaded tasks in the target queue.
[0102] It is understandable that if the power-on startup process is always under high load, the message queue is always not empty. In this case, the tasks that can be loaded in advance are limited, and the processing timing is uncontrollable. Because, in the embodiment of the present application, for any queue managed by the idle loader, when the end broadcast of the power-on startup process is received, the preloaded tasks that have not been loaded in the queue are cleared. This can prevent memory leaks and avoid interfering with normal business.
[0103] In the embodiment of the present application, the application system message queue is a priority linked list based on the message trigger time. When the message queue is empty or there are no messages to be processed recently, an idle scene will occur. The embodiment of the present application uses the idle state of the message queue to preload subsequent tasks that affect the cold start jam, thereby making full use of the system resources in the startup phase and shortening the cold start jam time.
[0104] See also Figure 4In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (Applications) layer (referred to as "application layer"), the application framework layer (Application Framework) layer (referred to as "framework layer"), the Android runtime (Android runtime) and system library layer (referred to as "system runtime library layer"), and the kernel layer.
[0105] In some embodiments, at least one application is running in the application layer, and these applications can be window programs, system settings programs, clock programs, etc. provided by the operating system, or applications developed by third-party developers. In specific implementations, the application packages in the application layer are not limited to the above examples.
[0106] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications. The application framework layer includes some predefined functions. The application framework layer is equivalent to a processing center that determines the actions that applications in the application layer take. Through the API interface, applications can access system resources and obtain system services during execution.
[0107] like Figure 4 As shown, in the embodiment of the present application, the application framework layer includes managers, content providers, etc., wherein the manager includes at least one of the following modules: an activity manager (ActivityManager) is used to interact with all activities running in the system; a location manager (Location Manager) is used to provide system services or applications with access to system location services; a package manager (Package Manager) is used to retrieve various information related to the application package currently installed on the device; a notification manager (NotificationManager) is used to control the display and clearing of notification messages; a window manager (Window Manager) is used to manage icons, windows, toolbars, wallpapers, and desktop components on the user interface.
[0108] In some embodiments, the activity manager is used to manage the life cycle of each application and the common navigation back function, such as controlling the exit, opening, and back of the application. The window manager is used to manage all window programs, such as obtaining the display screen size, determining whether there is a status bar, locking the screen, capturing the screen, and controlling the display window changes (for example, reducing the display window, shaking the display, distorting the display, etc.).
[0109] In some embodiments, the system runtime layer provides support for the upper layer, namely the framework layer. When the framework layer is used, the Android operating system will run the C / C++ library contained in the system runtime layer to implement the functions to be implemented by the framework layer.
[0110] In some embodiments, the kernel layer is a layer between hardware and software. Figure 4 As shown, the kernel layer includes at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0111] In order to explain this scheme in more detail, the following will be combined in an exemplary manner Figures 5 to 10 To explain, it is understandable that Figures 5 to 10 The steps involved may include more steps or fewer steps in actual implementation, and the order of these steps may also be different, so as to implement the task preloading method provided in the embodiment of the present application. The task preloading method is applied to a display device controlled by a control device, and the execution subject of the task preloading method may be a display device, or a functional module or functional entity in the display device that can implement the task preloading method, which is not limited here. Moreover, the specific description of the task preloading method provided in the embodiment of the present application can refer to the relevant description of the above-mentioned display device, and the same or similar technical effects can be achieved, which will not be repeated here.
[0112] Figure 5 A flowchart of the steps of implementing a task preloading method according to one or more embodiments of the present application is provided. The task preloading method may include the following S501 to S505.
[0113] S501: After the display device is powered on and a target startup phase broadcast is received, a first preloading task is registered in a target queue managed by an idle loader through a first service component.
[0114] Among them, the target queue is a queue corresponding to the target thread type, and the target queue includes at least one preloading task arranged according to the earliest loading time of the corresponding preloading task, and the at least one preloading task includes a first preloading task, and the at least one preloading task is a task corresponding to the target thread type.
[0115] S502: When it is detected that the first thread is idle and the type of the first thread is the target thread type, read the second preload task from the target queue through the idle loader.
[0116] S503: Load the second preloading task through the first thread.
[0117] The second preloading task is the first one of the preloading tasks in the target queue whose earliest loadable time is earlier than the current time.
[0118] S504: Send a notification of completion of loading the second preloading task to the second business component through the idle loader.
[0119] S505: Mark the second preloading task loading completion by a second business component, where the second business component is a component that registers the second preloading task with the target queue.
[0120] In some embodiments of the present application, Figure 5 ,like Figure 6 As shown, the above S504 can be specifically implemented through the following S504a, and the above S505 can be specifically implemented through the following S505a.
[0121] S504a: Send the loading status of the second preloading task to the second business component through the idle loader.
[0122] S505a: When the loading status received by the second service component is loading completed, the second service component marks the second preloading task loading completed.
[0123] In some embodiments of the present application, the idle loader manages multiple queues, which respectively correspond to multiple thread types, the multiple thread types include the target thread type, and the multiple queues include the target queue; when the first preloading task is a task of the main thread type, the target thread type is the main thread type; when the first preloading task is a task of the CPU thread type, the target thread type is the CPU thread type; when the first preloading task is a task of the IO thread type, the target thread type is the IO thread type.
[0124] In some embodiments of the present application, when the first preloading task is a main thread type task, the preloading time corresponding to the first preloading task is less than or equal to the first duration threshold; when the first preloading task is a CPU thread type task, the preloading time corresponding to the first preloading task is less than or equal to the second duration threshold; when the first preloading task is an IO thread type task, the preloading time corresponding to the first preloading task is less than or equal to the third duration threshold; wherein the first duration threshold is less than the second duration threshold, and the first duration threshold is less than the third duration threshold.
[0125] In some embodiments of the present application, the startup phase broadcast is a broadcast of the first startup phase in the power-on startup process, and the first preloading task is a task whose earliest loadable time is any time during the power-on startup process; the startup phase broadcast is a broadcast of the target startup phase in the power-on startup process, and the first preloading task is a task whose earliest loadable time is any time during the target startup phase.
[0126] In some embodiments of the present application, the startup phase broadcast is the target startup phase broadcast, combined with Figure 5 ,like Figure 7 As shown, before the above S501, the task preloading method provided in the embodiment of the present application may further include the following S506 to S510, and the above S501 may be specifically implemented by the following S501a.
[0127] S506: After the display device is powered on and receives the broadcast of the first startup phase, register the third preloading task to the target queue managed by the idle loader through the third service component.
[0128] S507: When it is detected that the second thread is idle and the type of the second thread is the target thread type, read the fourth preload task from the target queue through the idle loader.
[0129] S508: Load the fourth preloading task through the second thread.
[0130] The fourth preloading task is the first one of the preloading tasks in the target queue whose earliest loadable time is earlier than the current time.
[0131] S509: Sending a notification of completion of loading of the fourth preloading task to the fourth business component through the idle loader.
[0132] S510: Mark the loading completion of the fourth preloading task by a fourth business component, where the fourth business component is a component that registers the fourth preloading task with the target queue.
[0133] S501a: When a broadcast of a target startup phase is received, a first preloading task is registered in a target queue managed by an idle loader through a first service component.
[0134] It should be noted that the specific description of the above S507 to S510 can refer to the relevant description of the above S501 to S505 in the embodiment of the above display device, which will not be repeated here. In practice, after the above S506, the above S507 to S510 may be executed, or may not be executed, which is not limited here.
[0135] In some embodiments of the present application, the startup phase broadcast is the broadcast of the target startup phase, combined with Figure 7 ,like Figure 8 As shown, before the above S501, the task preloading method provided by the embodiment of the present application may further include the following S511.
[0136] S511. Deleting, by the idle loader, the preload task registered to the target queue before the target startup phase.
[0137] In some embodiments of the present application, the startup phase broadcast is the target startup phase broadcast; combined Figure 7 ,like Fig. 9 As shown, before the above S501, the task preloading method provided in the embodiment of the present application may further include the following S512 to S514.
[0138] S512: Acquire at least one target preloading task registered to the target queue before the target startup phase.
[0139] S513: Based on the priority of the at least one target preloading task, update the earliest loadable time corresponding to the at least one target preloading task.
[0140] S514: Update the arrangement order of the at least one target preloading task in the target queue based on the updated earliest loadable time corresponding to the at least one target preloading task.
[0141] In some embodiments of the present application, the first preloading task is any one of the following: a task to be loaded during the power-on startup process, a task to be loaded within a preset time after the power-on startup process; a task to be loaded after the power-on startup process determined based on the user profile of the current user.
[0142] In some embodiments of the present application, Figure 7 ,like Fig.10 As shown, after the above S505, the task preloading method provided in the embodiment of the present application may further include the following S515.
[0143] S515: When receiving the end broadcast of the power-on startup process, delete the unloaded preload tasks in the target queue.
[0144] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the above-mentioned task preloading method and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0145] The computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0146] The present invention provides a computer program product, comprising: when the computer program product is run on a computer, the computer is enabled to implement the above-mentioned task preloading method.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0148] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A display device, characterized in that: include: A display configured to: display a user interface; The controller is configured to: after the display device is powered on and a target startup phase broadcast is received, register the first preloading task to a target queue managed by the idle loader through a first service component, the target queue being a queue corresponding to a target thread type, the target queue including at least one preloading task arranged according to the earliest loadable time of the corresponding preloading task, the at least one preloading task including the first preloading task, and the at least one preloading task being a task corresponding to the target thread type; When it is detected that the first thread is idle and the type of the first thread is the target thread type, a second preload task is read from the target queue by an idle loader, and the second preload task is loaded by the first thread, wherein the second preload task is the first one of the preload tasks in the target queue whose earliest loadable time is earlier than the current time; Sending a notification of completion of loading of the second preloading task to the second service component through the idle loader; The second preloading task is marked as loaded completed by the second business component, where the second business component is a component that registers the second preloading task with the target queue.
2. The display device according to claim 1, characterized in that The idle loader manages a plurality of queues, the plurality of queues respectively corresponding to a plurality of thread types, the plurality of thread types including the target thread type, and the plurality of queues including the target queue; In the case where the first preload task is a task of the main thread type, the target thread type is the main thread type; In the case where the first preload task is a task of a CPU thread type, the target thread type is a CPU thread type; In the case that the first preloading task is an IO thread type task, the target thread type is an IO thread type.
3. The display device according to claim 2, characterized in that In the case where the first preloading task is a main thread type task, the preloading time corresponding to the first preloading task is less than or equal to a first duration threshold; In a case where the first preloading task is a task of a CPU thread type, the preloading time corresponding to the first preloading task is less than or equal to a second duration threshold; In a case where the first preloading task is an IO thread type task, the preloading time corresponding to the first preloading task is less than or equal to a third duration threshold; The first duration threshold is smaller than the second duration threshold, and the first duration threshold is smaller than the third duration threshold.
4. The display device according to claim 1, characterized in that The startup phase broadcast is a broadcast of the first startup phase in the power-on startup process, and the first preload task is a task whose earliest loadable time is any time in the power-on startup process; The startup phase broadcast is a broadcast of a target startup phase in the power-on startup process, and the first preload task is a task whose earliest loadable time is any time in the target startup phase.
5. The display device according to claim 4, characterized in that The startup phase broadcast is a broadcast of the target startup phase, and the controller is further configured to: The idle loader deletes the preload task registered to the target queue before the target startup phase.
6. The display device according to claim 4, characterized in that The startup phase broadcast is a broadcast of the target startup phase, and the controller is further configured to: Obtain at least one target preloading task registered to the target queue before the target startup phase; Based on the priority of the at least one target preloading task, updating the earliest loadable time respectively corresponding to the at least one target preloading task; Based on the updated earliest loadable time respectively corresponding to the at least one target preloading task, the arrangement order of the at least one target preloading task in the target queue is updated.
7. The display device according to claim 1, characterized in that The first preloading task is any one of the following: Tasks to be loaded during power-on startup, Tasks to be loaded within a preset time after the power-on startup process; The tasks to be loaded after the power-on startup process are determined based on the user profile of the current user.
8. The display device according to claim 1, characterized in that The controller is further configured to: When receiving the end broadcast of the power-on startup process, the unloaded preload tasks in the target queue are deleted.
9. A task preloading method, characterized in that: Applied to display devices, including: After the display device is powered on and a target startup phase broadcast is received, a first preloading task is registered to a target queue managed by an idle loader through a first service component, the target queue is a queue corresponding to a target thread type, the target queue includes at least one preloading task arranged according to the earliest loadable time of the corresponding preloading task, the at least one preloading task includes the first preloading task, and the at least one preloading task is a task corresponding to the target thread type; When it is detected that the first thread is idle and the type of the first thread is the target thread type, a second preload task is read from the target queue by an idle loader, and the second preload task is loaded by the first thread, wherein the second preload task is the first one of the preload tasks in the target queue whose earliest loadable time is earlier than the current time; Sending a notification of completion of loading of the second preloading task to the second service component through the idle loader; The second preloading task is marked as loaded completed by the second business component, where the second business component is a component that registers the second preloading task with the target queue.
10. A computer-readable storage medium, characterized in that: include: A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the task preloading method as claimed in claim 9 is implemented.
Citation Information
Patent Citations
Task processing method and device, electronic equipment and readable storage medium
CN111782293A
Task processing method and device, storage medium and electronic equipment
CN111831410A
Optimization method and device for accelerating startup based on Android system
CN112395015A
Preloading method and device, equipment and storage medium
CN117667247A
Starting-up method and electronic equipment
CN117687708A