Display device and method for updating media content
By dividing the memory queue in the smart TV and using the target thread to handle the media asset update task, the problem of inaccurate media asset updates in multi-threaded parallel processing is solved, thereby improving the accuracy and success rate of updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 青岛聚看云科技有限公司
- Filing Date
- 2022-08-19
- Publication Date
- 2026-04-17
AI Technical Summary
In smart TVs, when multiple threads process media asset update tasks in parallel, it is difficult to guarantee the execution order of update tasks for the same media asset resource, resulting in inaccurate updates and a high failure rate.
The controller receives the list of media asset update tasks from the server, divides the memory queue, determines the target memory sub-queue based on the media asset album identifier, and uses the target thread to execute the update task, ensuring that tasks for the same media asset album are processed by the same thread.
It ensures the execution order of each update task in multi-threaded parallel processing, improving the accuracy and success rate of media asset updates.
Smart Images

Figure CN115550735B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic device technology, and more particularly to a display device and a media asset updating method. Background Technology
[0002] Smart TVs play a vital role in home life. To meet users' entertainment needs for watching TV programs, movies, and other media resources on smart TVs, they typically obtain media resource update tasks from a server and process these tasks in parallel using multiple threads to achieve rapid updates. However, in multi-threaded parallel processing, there is an order of execution for update tasks of the same media resource. When multiple threads process the same update task simultaneously, it's difficult to guarantee the correct order. For example, if the first thread and the second thread simultaneously execute the update task for the same media resource (including Task 1 and Task 2, with Task 1 scheduled to execute before Task 2), and if the first thread pauses execution of Task 1 due to network fluctuations while the second thread continues execution of Task 2 unaffected, then for this single media resource update task, the result of the second thread will be overwritten by the result of the first thread. This leads to inaccurate media resource updates and a high failure rate for updating media resources. Summary of the Invention
[0003] To address, or at least partially address, the aforementioned technical problems, this disclosure provides a display device and a media asset updating method that can improve the accuracy and success rate of media asset updates.
[0004] To achieve the above objectives, the technical solutions provided by the embodiments of this disclosure are as follows:
[0005] In a first aspect, this disclosure provides a display device, the display device comprising:
[0006] The controller is configured to receive a list of media asset update tasks sent by the server via a communicator. The list of media asset update tasks includes multiple update tasks.
[0007] Obtain the target media asset album identifier corresponding to the target update task. The target update task can be any one of multiple update tasks.
[0008] Get the number of threads in the memory queue, and divide the memory queue into multiple memory sub-queues based on the number of threads;
[0009] Based on the target media asset album identifier, determine the target memory subqueue from multiple memory subqueues;
[0010] The media assets corresponding to the target update task are obtained from the server through the communicator and cached in the target memory sub-queue. The target thread corresponding to the target memory sub-queue then executes the target update task to update the media assets.
[0011] Secondly, this disclosure provides a media asset updating method, which includes:
[0012] The communicator receives a list of media asset update tasks sent by the server. The list of media asset update tasks includes multiple update tasks.
[0013] Obtain the target media asset album identifier corresponding to the target update task. The target update task can be any one of multiple update tasks.
[0014] Get the number of threads in the memory queue, and divide the memory queue into multiple memory sub-queues based on the number of threads;
[0015] Based on the target media asset album identifier, determine the target memory subqueue from multiple memory subqueues;
[0016] The media assets corresponding to the target update task are obtained from the server through the communicator and cached in the target memory sub-queue. The target thread corresponding to the target memory sub-queue then executes the target update task to update the media assets.
[0017] Thirdly, this disclosure provides a computer-readable storage medium, including: storing a computer program on the computer-readable storage medium, wherein when the computer program is executed by a processor, it implements a media asset updating method as described in the second aspect or any of its optional embodiments.
[0018] Fourthly, this disclosure provides a computer program product, including: when the computer program product is run on a computer, causing the computer to implement a media asset update method as described in the second aspect or any of its optional embodiments.
[0019] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0020] This disclosure provides a display device and a media asset update method. The display device includes a controller that receives a list of media asset update tasks sent by a server via a communicator, obtains the target media asset album identifier corresponding to the target update task, obtains the number of threads in the memory queue, divides the memory queue into multiple memory sub-queues based on the number of threads, determines the target sub-queue from the multiple memory sub-queues based on the target media asset album identifier, further obtains the media asset corresponding to the target update task from the server via the communicator, and caches the media asset in the target memory sub-queue. The target thread corresponding to the target memory sub-queue then executes the target update task to update the media asset. This method caches update tasks with the same media asset album identifier in the same memory sub-queue, and the same target thread corresponding to the same memory queue executes the update task, ensuring the execution order of each update task while allowing multi-threaded parallel processing, thus improving the accuracy of media asset updates. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0022] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A schematic diagram of existing media asset update methods;
[0024] Figure 2 This is a schematic diagram illustrating the operational scenario between the display device and the control device in an embodiment of this disclosure.
[0025] Figure 3 A configuration block diagram of the control device 100 provided in an embodiment of this disclosure;
[0026] Figure 4 This is a hardware configuration block diagram of a display device according to an embodiment of the present disclosure;
[0027] Figure 5 This is a schematic diagram of the software configuration in the display device described in the embodiments of this disclosure;
[0028] Figure 6 This is a schematic flowchart of a media asset updating method according to an embodiment of this disclosure;
[0029] Figure 7 A schematic diagram of a memory queue provided in an embodiment of this disclosure. Figure 1 ;
[0030] Figure 8 A schematic diagram of a memory queue provided in an embodiment of this disclosure. Figure 2 ;
[0031] Figure 9 A schematic diagram of the target thread executing the target update task provided in the embodiments of this disclosure. Figure 1 ;
[0032] Figure 10 A schematic diagram of the target thread executing the target update task provided in the embodiments of this disclosure. Figure 2 ;
[0033] Figure 11 A schematic diagram of the target thread executing the target update task provided in the embodiments of this disclosure. Figure 3 ;
[0034] Figure 12 This is a schematic diagram of the updated media assets provided in the embodiments of this disclosure. Detailed Implementation
[0035] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0036] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0037] The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses. Those skilled in the art will understand the specific meaning of the above terms in this disclosure based on the specific circumstances. Additionally, in the description of this disclosure, unless otherwise stated, "a plurality of" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0038] Currently, smart TVs obtain media resource update tasks from the server and process these tasks in parallel using multiple threads to achieve rapid updates. However, in multi-threaded parallel processing, there is an order of execution for each update task related to the same media resource. When multiple threads process the same update task simultaneously, it's difficult to guarantee this order. For example, if the first thread and the second thread simultaneously execute the same update task (including Task 1 and Task 2, with Task 1 scheduled to execute before Task 2), and the first thread pauses execution of Task 1 due to network fluctuations while the second thread continues execution of Task 2 unaffected, then for this single media resource update task, the result of the second thread will be overwritten by the result of the first thread. This leads to inaccurate media resource updates and a high failure rate.
[0039] For example, such as Figure 1 As shown, Figure 1 This diagram illustrates an existing media asset update method. It includes an internal queue 101, a memory queue 101 containing a download queue 11, a formatting queue 12, and an output queue 13. After receiving a media resource update task, the smart TV processes it in parallel using multiple threads. First thread 11A and second thread 11B, corresponding to download queue 11, simultaneously extract relevant data for the media resource from download queue 11, and then call the interface to download detailed information about the media resource from server 400. The update task includes Task 1: updating the media resource status to online, and Task 2: updating the media resource status to offline. Task 1 is executed first, followed by Task 2. During the process of third thread 12A and fourth thread 12B simultaneously extracting detailed information from formatting queue 12 and executing the formatting task, if third thread 12A pauses execution due to network fluctuations while executing Task 1, while fourth thread 12B successfully executes Task 2 unaffected, and after third thread 12A resumes normal execution of Task 1, the media resource's current status is online, but its status should be updated to offline. This results in a discrepancy between the media resource update status on the smart TV and the server, causing the update to fail.
[0040] To address the aforementioned technical problems, this disclosure provides a display device and a media asset update method. The display device includes a controller. The controller receives a list of media asset update tasks sent by a server via a communicator, then obtains the target media asset album identifier corresponding to the target update task, obtains the number of threads in the memory queue, and divides the memory queue into multiple memory sub-queues based on the number of threads. Next, based on the target media asset album identifier, it determines the target sub-queue from the multiple memory sub-queues. Further, it obtains the media asset corresponding to the target update task from the server via the communicator and caches the media asset in the target memory sub-queue. The target thread corresponding to the target memory sub-queue then executes the target update task to update the media asset. This method caches update tasks with the same media asset album identifier in the same memory sub-queue, and the same target thread corresponding to the same memory queue executes the update task, ensuring the execution order of each update task while allowing multi-threaded parallel processing, thus improving the accuracy of media asset updates.
[0041] like Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the operational scenario between the display device and the control device in an embodiment of this disclosure.
[0042] In some embodiments, a user can operate a display device 200 through a smart device 300 or a control device 100, and the display device 200 can communicate with a server 400.
[0043] like Figure 2 As shown, taking the operation of display device 200 via smart device 300 as an example, the application scenarios of the display device provided in this disclosure are explained. In one application scenario, the user turns on display device 200 via smart device 300.
[0044] In some embodiments, the control device 100 may be a remote control. Communication between the remote control and the terminal 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.
[0045] Figure 3 This is a configuration block diagram of the control device 100 provided in an embodiment of this disclosure. (See diagram below.) Figure 3As 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 commands and convert them into commands that the display device 200 can recognize and respond to, acting as an intermediary for interaction between the user and the display device 200. The communication interface 130 is used for external communication and includes at least one of a Wi-Fi chip, a Bluetooth module, NFC, or a replacement module. The user input / output interface 140 includes at least one of a microphone, a touchpad, a sensor, a button, or a replacement module.
[0046] In some embodiments, the display device 200 may receive instructions not through the aforementioned smart device or control device, but through touch or gestures.
[0047] 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.
[0048] In some embodiments, 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 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. Alternatively, it may be a cloud server. The above is merely an example, and no limitation is made in this embodiment.
[0049] Figure 4 This is a hardware configuration block diagram of a display device according to an embodiment of this disclosure. Figure 4The display device shown includes at least one of a tuner / 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 memory, a power supply, and a user interface 280. The controller includes a central processing unit, a video processor, an audio processor, a graphics processor, random access memory (RAM), read-only memory (ROM), and a first to nth interface for input / output. The display 260 can be at least one of a liquid crystal display, an OLED display, a touch display, and a projection display, and can also be a projection device and a projection screen. The tuner / demodulator 210 receives broadcast television signals via wired or wireless means, and demodulates audio and video signals, such as Electronic Program Guide (EPG) data signals, from multiple wireless or wired broadcast television signals. The detector 230 is used to collect signals from the external environment or signals interacting with the external environment. The controller 250 and the tuner 210 can be located in different separate devices, that is, the tuner 210 can also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0050] In some embodiments, the controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200. The user can input commands through a graphical user interface (GUI) displayed on the monitor 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.
[0051] In some embodiments, a "user interface" is the medium through which an application or operating system interacts and exchanges information with a user, realizing the conversion between the internal form of information 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 at least one of the following visual interface elements: icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and web widgets (widgets).
[0052] 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), a RAM (random access memory), a ROM (read-only memory), a digital signal processor (DSP) for input / output, a first to an nth interface, a communication bus, etc.
[0053] 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.
[0054] This disclosure provides a display device, which includes:
[0055] Controller 250 is configured to: receive a list of media asset update tasks sent by the server via a communicator, the list including multiple update tasks; obtain the target media asset album identifier corresponding to the target update task, the target update task being any one of the multiple update tasks; obtain the number of threads in the memory queue, and divide the memory queue into multiple memory sub-queues based on the number of threads; determine the target memory sub-queue from the multiple memory sub-queues based on the target media asset album identifier; obtain the media asset corresponding to the target update task from the server via the communicator, and cache the media asset in the target memory sub-queue, so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media asset.
[0056] The aforementioned display device is based on a multi-threaded parallel processing mode. It updates media assets according to the media asset update task list issued by the server. During the process, based on the target media asset album identifier corresponding to the target update task, the target memory subqueue is determined from multiple memory subqueues divided according to the number of threads in the memory queue. Then, the media assets to be updated are cached in the target subqueue so that the target thread corresponding to the target subqueue can execute the target update task. This enables the same thread to process the same media asset update task in the case of multi-threaded parallel processing of multiple media asset update tasks, which is accurate and efficient, ensures the consistency of media asset updates between the display device and the server, and improves the success rate of media asset updates.
[0057] In some embodiments, the update task includes: a download task, a formatting task, and an output task;
[0058] Controller 250 obtains the number of threads in the memory queue and divides the memory queue into multiple memory sub-queues based on the number of threads. It is configured to divide the memory queue into a first memory queue, a second memory queue, and a third memory queue for update tasks. The first memory queue corresponds to download tasks, the second memory queue corresponds to formatting tasks, and the third memory queue corresponds to output tasks.
[0059] The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue. The second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue. The third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue.
[0060] In some embodiments, the controller 250 obtains the media assets corresponding to the target update task from the server via a communicator and caches the media assets in a target memory subqueue so that the target thread corresponding to the target memory subqueue can execute the target update task to update the media assets. This is configured to: obtain the media assets corresponding to the target update task from the server; cache the media assets in a first target memory subqueue corresponding to the target media asset album identifier so that a first target thread corresponding to the first target memory subqueue can execute a download task to obtain the details of the media assets; determine a second target memory subqueue from multiple second memory subqueues based on the target media asset album identifier, cache the details of the media assets in the second target memory subqueue, so that a second target thread corresponding to the second target memory subqueue can execute a formatting task to obtain formatted data of the media assets; determine a third target memory subqueue from multiple third memory subqueues based on the target media asset album identifier, cache the formatted data of the media assets in the third target memory subqueue, so that a third target thread corresponding to the third target memory subqueue can execute an output task to obtain the updated media assets, and store the updated media assets in a database.
[0061] In some embodiments, before obtaining the number of threads in the memory queue, the controller 250 is further configured to: detect the execution duration of a first thread in the memory queue, wherein the first thread is at least one thread in the memory queue; increase the number of threads if the execution duration is greater than or equal to a first preset duration; decrease the number of threads if the execution duration is less than or equal to a second preset duration; and maintain the number of threads if the execution duration is greater than the second preset duration but less than the first preset duration.
[0062] In some embodiments, the controller 250 is configured to increase the number of threads when the execution duration is greater than or equal to a first preset duration and the resource utilization rate is less than or equal to a preset threshold.
[0063] Resource utilization includes at least one of the following: CPU utilization, memory utilization, disk utilization, and network utilization.
[0064] In some embodiments, the controller 250 is configured to obtain the media asset album identifier corresponding to the target update task, and in the case that the target update task does not have a corresponding media asset album identifier, generate a queue index value using a random number as the media asset album identifier corresponding to the target update task.
[0065] In some embodiments, after updating the media assets, the controller 250 is further configured to: generate an update notification to notify other components or devices in the display device, other than the controller 250, that the media assets have been updated; and / or clear the cache of the target memory subqueue and release the target memory subqueue to perform other update tasks besides the target update task.
[0066] In some embodiments, the media asset update task list includes update tasks for different media asset albums, and / or different update tasks for the same media asset album.
[0067] Figure 5 This is a schematic diagram of the software configuration in the display device described in the embodiments of this disclosure, as shown below. Figure 5 As shown, the system is divided into four layers, from top to bottom: the Applications layer (referred to as the "Application Layer"), the Application Framework layer (referred to as the "Framework Layer"), the Android runtime and system library layer (referred to as the "System Runtime Library Layer"), and the kernel layer. The kernel layer contains at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, Wi-Fi driver, Universal Serial Bus (USB) driver, High Definition Multimedia Interface (HDMI) driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver.
[0068] It should be noted that the protection scope of the media asset updating method described in this disclosure is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this disclosure is included within the protection scope of this disclosure.
[0069] like Figure 6 As shown, Figure 6 This is a flowchart illustrating a media asset updating method according to an embodiment of the present disclosure. The method includes the following steps S601 to S605:
[0070] S601, Receive the list of media asset update tasks sent by the server via the communicator.
[0071] The media asset update task list includes multiple update tasks. Media assets include different types such as video, audio, text, and images. The media asset update task carries the metadata of the media assets, including tags, copyright information, playback address, etc., which are not limited in this disclosure.
[0072] The media asset list may include multiple update tasks that are update tasks for different media asset albums, and / or different update tasks for the same media asset album. Whether the media asset albums are the same is determined by the media asset album identifier. If the media asset album identifiers corresponding to the update tasks match, then these update tasks are update tasks for the same media asset album. If the media asset album identifiers corresponding to the update tasks do not match, then the update tasks are update tasks for different media asset albums.
[0073] In some embodiments, each media asset update task includes: a download task, a formatting task, and an output task. The external environment and specific operations required for these three types of tasks each have their own characteristics. The download task instructs the display device to download the media asset details from the server, primarily relying on third-party interfaces. The formatting task instructs the conversion of the media asset details into formatted data, mainly involving computational operations including but not limited to image download verification calculations and data model mapping calculations. The formatted data is a data format supported by the display device. The output task instructs the storage of formatted data in a database, primarily relying on the display device's internal data storage system.
[0074] S602. Obtain the target media asset album identifier corresponding to the target update task.
[0075] The target update task can be any one of multiple update tasks.
[0076] The media asset album identifier includes the Media Asset Album Identity Document (ID), which is not limited in this disclosure.
[0077] In practical applications, there are cases where the target update task does not carry a media asset album identifier. In order to ensure that the same target update task is executed by the same link, this disclosure provides an implementation method that uses random numbers to generate a queue index value. This queue index value can uniquely identify the target update task and can be used as the target media asset album identifier of the target update task.
[0078] S603. Obtain the number of threads in the memory queue, and divide the memory queue into multiple memory sub-queues based on the number of threads.
[0079] In some embodiments, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue according to update tasks (download tasks, formatting tasks, and output tasks), wherein the first memory queue corresponds to download tasks, the second memory queue corresponds to formatting tasks, and the third memory queue corresponds to output tasks. Figure 7 As shown, Figure 7 A schematic diagram of a memory queue provided in an embodiment of this disclosure. Figure 1 The diagram includes memory queue 701, which is divided into first memory queue 71, second memory queue 72, and third memory queue 73.
[0080] After dividing the memory queue into a first memory queue, a second memory queue, and a third memory queue according to tasks, step S603 includes: obtaining the number of threads in the first memory queue, and dividing the first memory queue into multiple first memory sub-queues according to the number of threads in the first memory queue; obtaining the number of threads in the second memory queue, and dividing the second memory queue into multiple second memory sub-queues according to the number of threads in the second memory queue; obtaining the number of threads in the third memory queue, and dividing the third memory queue into multiple third memory sub-queues according to the number of threads in the third memory queue.
[0081] The number of threads in the first memory queue, the second memory queue, and the third memory queue can be preset by technicians.
[0082] For example, such as Figure 8 As shown, Figure 8 A schematic diagram of a memory queue provided in an embodiment of this disclosure. Figure 2 . Figure 8 The diagram shows memory queue 701, first memory queue 71, second memory queue 72, and third memory queue 73. The number of threads in the first memory queue 71 is pre-set to be m, the number of threads in the second memory queue 72 is n, and the number of threads in the third memory queue 73 is s. After dividing the memory queues according to the number of threads, m first memory sub-queues 81, n second memory sub-queues 82, and s third memory sub-queues 83 are obtained.
[0083] In some embodiments, the number of threads in the first memory queue, the second memory queue, and the third memory queue can be increased or decreased based on the execution duration of the threads. This disclosure provides an implementation method where, before obtaining the number of threads in the memory queues, the execution duration of a first thread in the memory queue is detected. The first thread is at least one thread in the memory queue. The number of threads is then determined based on the execution duration. Next, it is determined whether the execution duration is greater than or equal to a first preset duration, which is a pre-set maximum duration for instructing threads in the memory queue to continuously execute tasks; typically, this can be set to five minutes.
[0084] If the execution duration is greater than or equal to the first preset duration, it indicates that the first thread is in a long-running task execution state, and the thread execution pressure is relatively high. It is necessary to increase the number of threads to share the workload. Therefore, if the execution duration is greater than or equal to the first preset duration, the number of threads in the memory queue is increased. Specifically, a correspondence between the execution duration and the number of threads is established, and the number of threads in the memory queue is increased according to this correspondence.
[0085] If the execution duration is less than the first preset duration, it is determined whether the execution duration is less than or equal to the second preset duration. The second preset duration is a pre-set minimum duration used to indicate the continuous execution of tasks by threads in the memory queue; it can be understood that the second preset duration is less than the first preset duration. If the execution duration is less than or equal to the second preset duration, it indicates that the first thread in the memory queue is in a state of rapidly executing tasks for a short period. To ensure accurate task execution, the task execution speed can be controlled within an appropriate range. This can be achieved by reducing the number of threads in the memory queue, increasing the amount of tasks handled by each thread, and thus slowing down the task execution speed. Therefore, if the execution duration is less than or equal to the second preset duration, the number of threads in the memory queue is reduced.
[0086] When the execution duration is greater than the second preset duration but less than the first preset duration, the time consumed by the threads in the memory queue to execute tasks is within the preset range, the task execution speed is appropriate, and the number of threads in the memory queue can be maintained.
[0087] The method of increasing or decreasing the number of threads based on the execution duration described above applies to the first memory queue, the second memory queue, and the third memory queue. For example, the execution duration of at least one thread in the second memory queue is detected. If the execution duration is greater than or equal to a first preset duration, the number of threads in the second memory queue is increased; if the execution duration is less than or equal to the second preset duration, the number of threads in the second memory queue is decreased; if the execution duration is greater than the second preset duration but less than the first preset duration, the number of threads in the second memory queue remains unchanged.
[0088] By determining the execution duration of at least one thread in the memory queue, it is determined whether the execution duration falls within a preset duration range. Specifically, it is determined whether the execution duration is greater than or equal to a first preset duration and / or less than or equal to a second preset duration. If it is within the preset duration range, the number of threads in the memory queue is maintained. If it is less than or equal to the minimum value of the preset duration range (the second preset duration), the number of threads is reduced. If it is greater than or equal to the maximum value of the preset duration range (the first preset duration), the number of threads is increased. This real-time adjustment of the number of threads improves the execution efficiency of the update task.
[0089] In some embodiments, the number of threads in the memory queue can be adjusted according to the resource utilization rate of the display device. Resource utilization rate refers to the utilization rate of other resources configured in the display device, such as storage resources and network resources. Resource utilization rate includes at least one of the following: CPU utilization rate, memory utilization rate, disk utilization rate, and network utilization rate. Resource utilization rate is not limited to the above four items, and this disclosure does not impose any limitation on them.
[0090] This disclosure provides an implementation method in which, before obtaining the number of threads in the memory queue, the resource utilization rate of the display device is detected to determine whether the remaining storage and network resources of the display device support increasing the number of threads. If the resource utilization rate is less than or equal to a preset threshold, it indicates that the display device's resource reserves support increasing the number of threads, and the number of threads in the memory queue is increased. The preset threshold, which is a pre-defined resource utilization rate used to indicate support for increasing the number of threads, includes at least one of the following: a threshold for CPU utilization, a threshold for memory utilization, a threshold for disk utilization, and a threshold for network utilization. The lower the resource utilization rate, the greater the remaining resource reserves of the display device. If the resource utilization rate is greater than the preset threshold, it indicates that the display device's resource reserves do not support increasing the number of threads, and the original number of threads in the memory queue can be maintained.
[0091] It is important to emphasize that the resource utilization rates detected differ for the first, second, and third memory queues. For the first memory queue, resource utilization includes network utilization and memory utilization; for the second memory queue, it includes CPU utilization and memory utilization; and for the third memory queue, it includes CPU utilization, memory utilization, and network utilization.
[0092] In some embodiments, the number of threads in the first memory queue, the second memory queue, and the third memory queue can be adjusted based on the execution duration of the threads and the resource utilization of the display device. This disclosure provides an implementation method where, before obtaining the number of threads in the memory queues, the execution duration of the first thread in the memory queues is first detected, and the resource utilization is also detected; it is then determined whether the execution duration is greater than or equal to a first preset duration and whether the resource utilization is less than or equal to a preset threshold. If the execution duration is greater than or equal to the first preset duration and the resource utilization is less than or equal to the preset threshold, it indicates that the first thread is in a long-running task execution state, and the display device has sufficient resource reserves, allowing the number of threads in the memory queues to be increased.
[0093] If the execution duration is greater than or equal to the first preset duration and the resource utilization rate is greater than the preset threshold, it indicates that the first thread is in a long-running task execution state. However, if the display device's resource reserves do not support increasing the number of threads in the memory queue, then the number of threads in the memory queue will be maintained.
[0094] If the execution duration is less than or equal to the second preset duration, it indicates that the first thread is in a short-term, fast-execution task state. At this time, regardless of whether the resource utilization rate is less than or equal to the preset threshold, the number of threads in the memory queue is reduced.
[0095] If the execution duration is greater than the second preset duration but less than the first preset duration, and the resource utilization rate is less than or equal to the preset threshold, the display device has sufficient resource reserves. To improve the execution efficiency of the update task, the number of threads in the memory queue can be increased. If the execution duration is greater than the second preset duration but less than the first preset duration, and the resource utilization rate is greater than the preset threshold, the number of threads in the memory queue is maintained.
[0096] S604. Determine the target memory subqueue from multiple memory subqueues based on the target media asset album identifier.
[0097] In some embodiments, the target memory subqueue is determined from multiple memory subqueues by calculating the hash value of the target album identifier. Optionally, during media asset updates, the target memory subqueue determined based on the target media asset album identifier is a subqueue within the first memory queue executing the download task.
[0098] S605. Obtain the media assets corresponding to the target update task from the server through the communicator, and cache the media assets in the target memory sub-queue so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets.
[0099] In some embodiments, the display device first obtains the media assets corresponding to the target update task from the server via a communicator. Based on the target media asset album identifier corresponding to the target update task, a first target memory subqueue is determined from multiple first memory subqueues. The media assets are cached in the first target memory subqueue, and then a first target thread corresponding to the first target memory subqueue executes a download task to obtain the media asset details. Next, based on the target media asset album identifier, a second target memory subqueue is determined from multiple second memory subqueues. The media asset details are cached in the second target memory subqueue, and a formatting task is executed by a second target thread corresponding to the second target memory subqueue to obtain formatted data of the media assets, thus converting the details of the media assets downloaded from the server into a data format supported by the display device. Further, based on the target media asset album identifier, a third target memory subqueue is determined from multiple third memory subqueues. The formatted data of the media assets is cached in the third target memory subqueue, and an output task is executed by a third thread corresponding to the third target memory subqueue to obtain the updated media assets and store them in the database. This achieves the synchronization of the update status of the server's media assets to the display device.
[0100] For example, such as Figure 9 As shown, Figure 9 A schematic diagram of the target thread executing the target update task provided in the embodiments of this disclosure. Figure 1The diagram shows that memory queue 701 includes a first memory queue 71, a second memory queue 72, and a third memory queue 73. The first memory queue 71 is divided into m first memory subqueues 81, the second memory queue 72 is divided into n second memory subqueues 82, and the third memory queue 73 is divided into s third memory subqueues 83. Based on the target media asset album identifier of the target update task, the media asset is cached in the first target memory subqueue, so that the first target thread 91 corresponding to the first target memory subqueue executes the download task to obtain the media asset details. Then, based on the target media asset album identifier, the media asset is cached in the second target memory subqueue, so that the second target thread 92 corresponding to the second target memory subqueue executes the formatting task to obtain the formatted data of the media asset. Further, based on the target media asset album identifier, the formatted data of the media asset is cached in the third target memory subqueue, so that the third target thread 93 corresponding to the third target memory subqueue executes the output task to obtain the updated media asset.
[0101] When multiple update tasks are for different media asset albums, the memory queue is divided, and processes in multiple memory queues are processed in parallel, thereby executing multiple update tasks for different media assets simultaneously and ensuring the efficiency of media asset updates.
[0102] For example, such as Figure 10 As shown, Figure 10 A schematic diagram of the target thread executing the target update task provided in the embodiments of this disclosure. Figure 2In the diagram, media asset 1 is cached in the first target memory subqueue 81A according to the target media asset album identifier of target update task 1. Simultaneously, media asset 2 is cached in the first target memory subqueue 81B according to the target media asset album identifier of target update task 2. Then, the first target thread 91A corresponding to the first target memory subqueue 81A executes a download task to obtain the details of media asset 1. Next, the details of media asset 1 are cached in the second target memory subqueue 82A, and the corresponding second target thread 92A executes a formatting task to obtain the formatted data of media asset 1. Finally, the formatted data of media asset 1 is cached in the third target memory subqueue 83A, and the corresponding third target thread 93A executes an output task to obtain the updated media asset 1. While the aforementioned target thread is updating media asset 1, media asset 2 is being updated by other different target threads: the first target thread 91B corresponding to the first target memory subqueue 81B downloads the details of media asset 2, then the second target memory subqueue 82B caches the details of media asset 2, and the corresponding second target thread 92B performs a formatting task to obtain formatted data for media asset 2. Finally, the third target memory subqueue 83B caches the formatted data of media asset 2, and the corresponding third target thread 93B performs an output task to obtain the updated media asset 2. Multiple threads concurrently process the update tasks of media asset 1 and media asset 2 without interfering with each other, thus achieving rapid updates.
[0103] When multiple update tasks are different update tasks for the same media asset album, the update tasks are executed serially by threads in the same memory queue according to the execution order of the different update tasks for the same media asset album. This avoids inconsistencies with the server update status and improves the accuracy of media asset updates.
[0104] For example, such as Figure 11 As shown, Figure 11 A schematic diagram of the target thread executing the target update task provided in the embodiments of this disclosure. Figure 3 The update task for media asset 1 includes Task 1 and Task 2, and Task 1 and Task 2 have a specific order. Based on the media asset album identifier of media asset 1, it is determined that media asset 1 will be cached in the first target memory subqueue. The first target thread 91 corresponding to the first target memory subqueue executes the download task of Task 1 to obtain the details of media asset 1. Then, the details of media asset 1 are cached by the second target memory subqueue 82, and the corresponding second target thread 92 executes the formatting task to obtain the formatted data of media asset 1. Next, the formatted data of media asset 1 is cached by the third target memory subqueue 83, and the corresponding third target thread 93 executes the output task to obtain the updated media asset 1. Afterwards, Task 2 is executed, and the execution process is similar to the above, which will not be elaborated upon here. After the update task is completed, the updated media asset 1 is the execution result corresponding to Task 2.
[0105] In the above embodiments, the target update task is determined based on the target media asset album identifier: the first target memory sub-queue, the second target memory sub-queue, and the third target memory sub-queue. The target update task is then executed by this link, so that the update task of the same media asset is executed by the same link, ensuring the sequential execution order of the update task of the same media asset.
[0106] In some embodiments, after updating the media assets, an update notification is generated to notify other components or devices in the display device other than the controller, and / or the cache of the target memory subqueue is cleared and the target memory subqueue is released to perform other update tasks besides the target update task.
[0107] For example, such as Figure 12 As shown, Figure 12 This is a schematic diagram of the updated media assets provided in the embodiments of this disclosure.
[0108] After the media asset is updated by the target thread corresponding to the target memory subqueue included in the memory queue 701, the updated media asset is stored in the database 10A, an update notification is generated and cached in the message queue 10B, so as to notify other components or devices in the display device in the order of updates.
[0109] In summary, the media asset update method provided in this disclosure first receives a list of media asset update tasks sent by the server via a communicator. Then, it obtains the target media asset album identifier corresponding to the target update task, acquires the number of threads in the memory queue, and divides the memory queue into multiple memory sub-queues based on the number of threads. Next, it determines the target sub-queue from these sub-queues based on the target media asset album identifier. Finally, it retrieves the media asset corresponding to the target update task from the server via the communicator and caches the media asset in the target memory sub-queue. The target thread corresponding to the target memory sub-queue then executes the target update task to update the media asset. This method caches update tasks with the same media asset album identifier in the same memory sub-queue, and the same target thread in the same memory queue executes the update task, ensuring the execution order of each update task while allowing for multi-threaded parallel processing, thus improving the accuracy of media asset updates.
[0110] This disclosure provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the media asset update method described in the above method embodiments and achieves the same technical effect. To avoid repetition, further details are omitted here.
[0111] The computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0112] This disclosure provides a computer program product that stores a computer program. When the computer program is executed by a processor, it implements the various processes of the media asset update method in the above-described method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0113] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media containing computer-usable program code.
[0114] In this disclosure, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0115] In this disclosure, memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0116] In this disclosure, computer-readable media includes both permanent and non-permanent, removable and non-removable storage media. Storage media can store information using any method or technology; the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.
[0117] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0118] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A display device, characterized in that, include: The controller is configured to receive a list of media asset update tasks sent by the server via a communicator, the list of media asset update tasks including multiple update tasks; The update tasks include: download tasks, formatting tasks, and output tasks; Obtain the target media asset album identifier corresponding to the target update task, wherein the target update task is any one of the plurality of update tasks; Obtain the number of threads in the memory queue, and divide the memory queue into multiple memory sub-queues based on the number of threads; Based on the target media asset album identifier, determine the target memory subqueue from the plurality of memory subqueues; The media assets corresponding to the target update task are obtained from the server through the communicator, and the media assets are cached in the target memory sub-queue so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets. The controller, which obtains the number of threads in the memory queue and divides the memory queue into multiple memory sub-queues based on the number of threads, is configured as follows: For the update task, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue, wherein the first memory queue corresponds to the download task, the second memory queue corresponds to the formatting task, and the third memory queue corresponds to the output task; The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue; the second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue; and the third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue.
2. The display device according to claim 1, characterized in that, The controller obtains the media assets corresponding to the target update task from the server via the communicator, caches the media assets in the target memory sub-queue, and then executes the target update task by the target thread corresponding to the target memory sub-queue to update the media assets, configured as follows: Obtain the media assets corresponding to the target update task from the server; The media asset is cached in the first target memory subqueue corresponding to the target media asset album identifier, so that the first target thread corresponding to the first target memory subqueue can execute the download task to obtain the detailed information of the media asset; The second target memory subqueue is determined from the plurality of second memory subqueues based on the target media asset album identifier, and the details of the media asset are cached in the second target memory subqueue, so that the second target thread corresponding to the second target memory subqueue executes the formatting task to obtain the formatted data of the media asset; Based on the target media asset album identifier, a third target memory subqueue is determined from the plurality of third memory subqueues, and the formatted data of the media asset is cached in the third target memory subqueue. The third target thread corresponding to the third target memory subqueue executes the output task to obtain the updated media asset, and the updated media asset is stored in the database.
3. A display device, characterized in that, include: The controller is configured to receive a list of media asset update tasks sent by the server via a communicator, the list of media asset update tasks including multiple update tasks; The update tasks include: download tasks, formatting tasks, and output tasks; Obtain the target media asset album identifier corresponding to the target update task, wherein the target update task is any one of the plurality of update tasks; detect the execution duration of the first thread in the memory queue, wherein the first thread is at least one thread in the threads of the memory queue; If the execution duration is greater than or equal to a first preset duration, the number of threads in the memory queue is increased; If the execution duration is less than or equal to the second preset duration, the number of threads is reduced. If the execution duration is greater than the second preset duration but less than the first preset duration, the number of threads is maintained. For the update task, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue, wherein the first memory queue corresponds to the download task, the second memory queue corresponds to the formatting task, and the third memory queue corresponds to the output task; The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue; the second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue; and the third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue. Based on the target media asset album identifier, determine the target memory subqueue from the plurality of memory subqueues; The media assets corresponding to the target update task are obtained from the server through the communicator, and the media assets are cached in the target memory sub-queue, so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets.
4. A display device, characterized in that, include: The controller is configured to receive a list of media asset update tasks sent by the server via a communicator, the list of media asset update tasks including multiple update tasks; The update tasks include: download tasks, formatting tasks, and output tasks; Obtain the target media asset album identifier corresponding to the target update task, wherein the target update task is any one of the plurality of update tasks; The execution duration of the first thread in the memory queue is detected, where the first thread is at least one thread in the memory queue. If the execution duration is greater than or equal to a first preset duration and the resource utilization is less than or equal to a preset threshold, the number of threads in the memory queue is increased. The resource utilization rate includes at least one of the following: CPU utilization rate, memory utilization rate, disk utilization rate, and network utilization rate; If the execution duration is less than or equal to the second preset duration, the number of threads is reduced. If the execution duration is greater than the second preset duration but less than the first preset duration, the number of threads is maintained. For the update task, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue, wherein the first memory queue corresponds to the download task, the second memory queue corresponds to the formatting task, and the third memory queue corresponds to the output task; The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue; the second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue; and the third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue. Based on the target media asset album identifier, determine the target memory subqueue from the plurality of memory subqueues; The media assets corresponding to the target update task are obtained from the server through the communicator, and the media assets are cached in the target memory sub-queue, so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets.
5. A display device, characterized in that, include: The controller is configured to receive a list of media asset update tasks sent by the server via a communicator, the list of media asset update tasks including multiple update tasks; The update tasks include: download tasks, formatting tasks, and output tasks; If no corresponding media asset album identifier exists for the target update task, a queue index value is generated using a random number to serve as the media asset album identifier for the target update task; the target update task is any one of the plurality of update tasks; For the update task, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue, wherein the first memory queue corresponds to the download task, the second memory queue corresponds to the formatting task, and the third memory queue corresponds to the output task; The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue; the second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue; and the third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue. Based on the media asset album identifier corresponding to the target update task, the target memory subqueue is determined from multiple memory subqueues; The media assets corresponding to the target update task are obtained from the server through the communicator, and the media assets are cached in the target memory sub-queue, so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets.
6. A display device, characterized in that, include: The controller is configured to receive a list of media asset update tasks sent by the server via a communicator, the list of media asset update tasks including multiple update tasks; The update tasks include: download tasks, formatting tasks, and output tasks; Obtain the target media asset album identifier corresponding to the target update task, wherein the target update task is any one of the plurality of update tasks; For the update task, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue, wherein the first memory queue corresponds to the download task, the second memory queue corresponds to the formatting task, and the third memory queue corresponds to the output task; The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue; the second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue; and the third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue. Based on the target media asset album identifier, determine the target memory subqueue from the plurality of memory subqueues; The media assets corresponding to the target update task are obtained from the server through the communicator, and the media assets are cached in the target memory sub-queue so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets. Generate an update notification to inform other components or devices in the display device, other than the controller, that their media data has been updated; And / or, Clear the cache of the target memory subqueue and release the target memory subqueue to execute other update tasks besides the target update task.
7. The display device according to any one of claims 1 to 6, characterized in that, The media asset update task list includes update tasks for different media asset albums, and / or different update tasks for the same media asset album.
8. A media asset updating method, characterized in that, include: The communicator receives a list of media asset update tasks sent by the server, the list of media asset update tasks including multiple update tasks; The update tasks include: download tasks, formatting tasks, and output tasks; Obtain the target media asset album identifier corresponding to the target update task, wherein the target update task is any one of the plurality of update tasks; Obtain the number of threads in the memory queue, and divide the memory queue into multiple memory sub-queues based on the number of threads; Based on the target media asset album identifier, determine the target memory subqueue from the plurality of memory subqueues; The media assets corresponding to the target update task are obtained from the server through the communicator, and the media assets are cached in the target memory sub-queue, so that the target thread corresponding to the target memory sub-queue can execute the target update task to update the media assets. The process of obtaining the number of threads in the memory queue and dividing the memory queue into multiple memory sub-queues based on the number of threads includes: For the update task, the memory queue is divided into a first memory queue, a second memory queue, and a third memory queue, wherein the first memory queue corresponds to the download task, the second memory queue corresponds to the formatting task, and the third memory queue corresponds to the output task; The first memory queue is divided into multiple first memory sub-queues based on the number of threads in the first memory queue. The second memory queue is divided into multiple second memory sub-queues based on the number of threads in the second memory queue. The third memory queue is divided into multiple third memory sub-queues based on the number of threads in the third memory queue.
Citation Information
Patent Citations
Live-streaming list data updating method and device, electronic equipment and storage medium
CN111031336A