Play control method, system and display device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU SHIZHEN INFORMATION TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]然而,本地服务需先作为HTTP代理搭建环境,Service Worker再基于该代理执行非视频资源缓存,本地服务和Service Worker之间需要通过接口调用、状态同步、请求转发等多步交互完成缓存任务,导致数据交互环节冗余,降低了缓存执行效率与响应速度
[0016]The beneficial effects of the embodiments of this application are as follows: Unlike the prior art, the embodiments of this application provide a playback control method. This method obtains a first resource configuration file, which includes the capacity of the file to be published. If the capacity of the file to be published is less than or equal to the available storage capacity, the file to be published is cached in the cache space based on the first resource configuration file, and the online address of the content of the file to be published is converted into a local storage address for local playback. If the capacity of the file to be published is greater than the available storage capacity, a resource acquisition request is sent to the server to obtain the file to be published in real time for online playback. This improves the execution efficiency of caching, enables seamless switching between online and offline playback, and improves the stability of video playback.
Smart Images

Figure CN122534271A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a playback control method, system and display device. Background Technology
[0002] Currently, when playing video content, offline caching is achieved through an architecture that combines local services and Service Workers. The local service acts as a proxy, and the Service Worker caches all resources except for videos based on the proxy. Video resources directly access online resources to reduce the device's dependence on the network for playing content.
[0003] However, the local service needs to first set up an environment as an HTTP proxy, and then the Service Worker performs non-video resource caching based on this proxy. The local service and the Service Worker need to complete the caching task through multiple steps of interaction, such as interface calls, state synchronization, and request forwarding, which leads to redundancy in the data interaction process and reduces the caching execution efficiency and response speed. Summary of the Invention
[0004] This application provides a playback control method, system, and display device that can improve the execution efficiency of caching, achieve seamless switching between online and offline modes, and enhance the stability of video playback.
[0005] The embodiments of this application provide the following technical solutions: In a first aspect, embodiments of this application provide a playback control method applied to a display device, the display device being communicatively connected to a server, the display device including a cache space, the method comprising: Obtain the first resource configuration file, which includes the size of the file to be published; If the size of the file to be published is less than or equal to the available storage capacity, the file to be published will be cached in the cache space based on the first resource configuration file, and the online address of the content of the file to be published will be converted to the local storage address for local playback of the content of the file to be published. If the size of the file to be published is greater than the available storage capacity, a resource acquisition request is sent to the server to obtain the file in real time so that its content can be played online.
[0006] In some embodiments, the first resource configuration file includes a resource mapping table, which includes a content list of files to be published and a resource list. The content list of files to be published includes at least one content package, and the resource list includes at least one first resource. Each content package includes at least one first resource, and each first resource corresponds to a first resource number. Based on the first resource configuration file, the files to be published are cached in the cache space, including: Based on the first resource number of the first resource in the content package of the file to be published, determine whether the resource corresponding to the file to be published exists in the cache space; If it is determined that the resource corresponding to the file to be published does not exist in the cache space, a resource retrieval request is sent to the server to cache the resource corresponding to the resource retrieval request in the cache space; The method also includes: If it is determined that the resource corresponding to the file to be published exists in the cache space, then the resource corresponding to the file to be published is retrieved from the cache space and the content of the file to be published is played locally.
[0007] In some embodiments, the cache space includes at least one second resource, each second resource corresponding to a second resource number. Determining whether the resource corresponding to the file to be published exists in the cache space based on the first resource number of the first resource in the content package of the file to be published includes: If the first resource number and the second resource number are the same, then it is determined that the resource corresponding to the file to be published exists in the cache space; If the first resource number and the second resource number are different, it is determined that the resource corresponding to the file to be published does not exist in the cache space.
[0008] In some embodiments, the method further includes, before sending a resource acquisition request to the server: If the cache space meets the clearing conditions, then the resources in the cache space are cleared based on the clearing policy; The clearing conditions include at least one of the following: the available storage capacity of the cache space is less than the capacity of the file to be published, the file to be published in the cache space is updated, or an inspection instruction is received. The clearing strategy includes at least one of the following: clearing resources in the cache space in ascending order of business priority, clearing resources whose usage frequency is lower than a preset frequency threshold, and clearing resources whose most recent usage time is greater than a preset time threshold.
[0009] In some embodiments, after caching the file to be published in the cache space, the method further includes: Convert the online address of the file to be published to a local storage address, specifically including: Intercept online resource requests, which include online addresses and are used to obtain resources for files to be published from the server; Obtain the local storage address of the resources for the file to be published; The local storage address is filled into the preset label, and the online address in the online resource request is redirected to the local storage address based on the local storage address in the preset label.
[0010] In some embodiments, the method further includes, before caching the file to be published in the cache space: Get real-time device performance information; Based on device performance information, determine whether to cache the file to be published.
[0011] In some embodiments, device performance information includes at least one of load, network bandwidth, and memory usage. Based on device performance information, determine whether to cache the file to be published, including: If the load is less than the preset load threshold, the network transmission bandwidth is greater than or equal to the preset bandwidth threshold, and the memory utilization is less than the preset utilization threshold, then the file to be published is to be cached.
[0012] If the load is greater than or equal to the preset load threshold, or the network transmission bandwidth is less than the preset bandwidth threshold, or the memory utilization is greater than or equal to the preset utilization threshold, then it is determined that the file to be published will not be cached.
[0013] In some embodiments, after caching the file to be published in the cache space, the method further includes: Obtain the second resource configuration file; If the third resource number of a portion of the resources of the file to be published recorded in the second resource configuration file is different from the fourth resource number of a portion of the resources of the file to be published in the cache space, a resource acquisition request is sent to the server to obtain the resource corresponding to the third resource number, the resource corresponding to the fourth resource number is cleared from the cache space, and the resource corresponding to the third resource number is saved to the cache space.
[0014] Secondly, embodiments of this application provide a display device, including: At least one processor; and, A memory that is communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, such that the instructions are executed by at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0015] Thirdly, embodiments of this application provide a playback control system, which includes: Such as the display device in the second aspect; Server, communication connection display device.
[0016] The beneficial effects of the embodiments of this application are as follows: Unlike the prior art, the embodiments of this application provide a playback control method. This method obtains a first resource configuration file, which includes the capacity of the file to be published. If the capacity of the file to be published is less than or equal to the available storage capacity, the file to be published is cached in the cache space based on the first resource configuration file, and the online address of the content of the file to be published is converted into a local storage address for local playback. If the capacity of the file to be published is greater than the available storage capacity, a resource acquisition request is sent to the server to obtain the file to be published in real time for online playback. This improves the execution efficiency of caching, enables seamless switching between online and offline playback, and improves the stability of video playback. Attached Figure Description
[0017] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0018] Figure 1 This is a schematic diagram of the structure of a playback control system provided in an embodiment of this application; Figure 2 This is a schematic flowchart of a playback control method provided in an embodiment of this application; Figure 3 This is an example diagram illustrating a mapping relationship between a content package and resources provided in an embodiment of this application; Figure 4 This is a schematic diagram of a process for determining whether to cache a file to be published, provided in an embodiment of this application; Figure 5 yes Figure 2 A detailed flowchart of step S203 in the process; Figure 6 yes Figure 5 A detailed flowchart of step S231 in the process; Figure 7 yes Figure 2 Another detailed flowchart of step S203 in the process; Figure 8 This is a schematic diagram of the structure of a display device provided in an embodiment of this application.
[0019] Explanation of icon numbers: Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. In addition, the terms "first" and "second" used in this application do not limit the data, but only distinguish the same or similar items with basically the same function and effect.
[0022] The technical solution of this application is described in detail below with reference to the accompanying drawings: Please see Figure 1 , Figure 1 This is a schematic diagram of a playback control system provided in an embodiment of this application.
[0023] like Figure 1 As shown, the playback control system 300 includes a display device 100 and a server 200. The display device 100 is connected to the server 200 via a wired network or a wireless network. The wireless network includes Wi-Fi, Bluetooth, WiDi, Miracast, and other wireless networks. The wired network includes HDMI, DVI, VGA, Ethernet, and other wired networks.
[0024] Specifically, the display device 100 is used to acquire resources such as videos and images in order to play video, image, and other content on the display screen of the display device 100.
[0025] In this embodiment, the display device 100 is a large-size display device, such as one that is typically 55 inches or larger. The display device 100 includes, but is not limited to, cloud-based display devices, commercial display screens, tablets, and computer terminals.
[0026] Specifically, server 200 is used to store resources such as videos and images.
[0027] In this embodiment of the application, when the content that the display device 100 needs to play does not exist in the local cache, a resource acquisition request is sent to the server 200 to realize online playback in the display device 100, or the content that needs to be played is cached locally in the display device 100 and then played locally.
[0028] In this embodiment, server 200 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0029] Please see Figure 2 , Figure 2 This is a schematic flowchart of a playback control method provided in an embodiment of this application.
[0030] The playback control method is applied to a display device. Specifically, the execution subject of the playback control method is one or at least two processors of the display device.
[0031] The display device communicates with the server.
[0032] like Figure 2 As shown, the playback control method includes the following steps S201-S204: Step S201: Obtain the first resource configuration file.
[0033] In this embodiment of the application, the display device includes a cache space. When it is necessary to play the content of a file to be published on the display screen of the display device, the resources in the cache space are accessed first. If the resources corresponding to the content of the file to be published do not exist in the local cache space, a resource acquisition request is sent to the server to obtain the resources corresponding to the content of the file to be published. The content of the file to be published includes, but is not limited to, videos, pictures, articles and other content.
[0034] In this embodiment of the application, in order to ensure that there is no lag during playback and to determine that the content of the file to be published is being played on the display device for the first time, a resource acquisition request is sent to the server to download the resource corresponding to the content of the file to be published to the cache space of the display device. Before downloading, it is necessary to ensure that the available storage capacity of the cache space of the display device is sufficient to ensure that the resource download is successful.
[0035] Specifically, the status of the display device is monitored in real time to obtain the status information of the display device. At the same time, the first resource configuration file can be obtained. The status information of the display device includes the available storage capacity of the cache space, and the first resource configuration file includes the capacity of the file to be published.
[0036] In this embodiment, the first resource configuration file is generated by the server. After the server obtains a new resource, it updates the information corresponding to the new resource to the first resource configuration file. The display device obtains the list of resources to be cached by parsing the first resource file. The first resource configuration file includes a content list, a resource list, and a resource version number. The content list includes the content package number and the resource corresponding to the content package. The resource list includes the resource number. There is a mapping relationship between the content list and the resource list. The content package in the content list usually includes multiple resources.
[0037] Please see Figure 3 , Figure 3 This is an example diagram illustrating the mapping relationship between content packages and resources provided in an embodiment of this application.
[0038] like Figure 3 As shown, the content list includes multiple content packages, and the resource list includes multiple resources. Each content package corresponds to a content number, and each resource corresponds to a resource number. A content package can include multiple resources, and different content packages can share resources. For example, content package X includes resources A, B, and C, and content package X includes resources A, D, and E, thereby constructing a mapping relationship between content packages and several resources.
[0039] In this embodiment of the application, by constructing a mapping relationship between content packages and resources, it is possible to ensure that the same resource referenced by different content (determined by FileKey) is stored only once on the display device, thereby saving cache space and improving the reusability of resources.
[0040] In this embodiment of the application, by obtaining the first resource configuration file, it is possible to determine the resources required for the content of the file to be published, and to determine whether the resources for the content of the file to be published exist in the cache space of the display device.
[0041] Step S202: Determine whether the size of the file to be published is greater than the available storage capacity.
[0042] Specifically, obtain the available storage capacity of the cache space, determine whether the capacity of the file to be published is greater than the available storage capacity, if the capacity of the file to be published is less than or equal to the available storage capacity, then proceed to step S203, if the capacity of the file to be published is greater than the available storage capacity, then proceed to step S204.
[0043] In this embodiment of the application, by pre-determining the size of the file to be published and the available storage capacity of the cache space, cache failure caused by insufficient cache space can be avoided.
[0044] In this embodiment of the application, before caching the file to be published in the cache space, the method further includes: determining whether to cache the file to be published.
[0045] Please see Figure 4 , Figure 4 This is a schematic diagram of a process for determining whether to cache a file to be published, provided in an embodiment of this application.
[0046] like Figure 4 As shown, the process for determining whether to cache the file to be published includes the following steps S401-S404: Step S401: Obtain device performance information in real time.
[0047] Specifically, device performance information includes at least one of the following: load, network bandwidth, and memory usage.
[0048] Understandably, before caching the file to be published in the cache space, a feasibility assessment needs to be conducted based on the current operating status of the display device. Specifically, this involves obtaining device performance information, which is core data reflecting the display device's current computing power, data transmission capabilities, and memory usage. This device performance information includes: (1) Load: The load includes CPU utilization, which is the level of CPU activity per unit time. The data is collected by using the performance monitoring interface provided by the operating system of the display device (such as the Performance Counter interface of Windows system or the top command interface of Linux system) to read the CPU utilization data in real time. The sampling frequency is set to 1 second / time, and the average value of 5 consecutive samples is taken as the current device load value to avoid judgment deviation caused by instantaneous fluctuations.
[0049] (2) Network transmission bandwidth: refers to the actual available transmission rate of the network link between the display device and the server. The data is collected by sending test data packets through a network transmission protocol (such as TCP protocol), counting the number of data packets transmitted per unit time, and calculating the actual available bandwidth. At the same time, interference factors such as network delay and packet loss rate are excluded to ensure the accuracy of the bandwidth data.
[0050] (3) Memory utilization rate: refers to the proportion of physical memory occupied by the display device. It is collected by reading the total physical memory capacity and the used capacity data through the operating system memory management interface, and then calculating the memory utilization rate. The used capacity needs to exclude the necessary memory occupied by the system core processes. It is understandable that the memory utilization rate only counts the memory occupied by application layer processes to avoid misjudgment caused by including the necessary memory of the operating system.
[0051] Step S402: Does the equipment performance information meet the first condition?
[0052] Specifically, the first condition includes: the load is less than the preset load threshold, the network transmission bandwidth is greater than or equal to the preset bandwidth threshold, and the memory utilization rate is less than the preset utilization rate threshold.
[0053] If the load is less than the preset load threshold, and the network transmission bandwidth is greater than or equal to the preset bandwidth threshold, and the memory utilization rate is less than the preset utilization rate threshold, then the device performance information meets the first condition, and it is determined to cache the file to be published.
[0054] If the load is greater than or equal to the preset load threshold, or the network transmission bandwidth is less than the preset bandwidth threshold, or the memory utilization rate is greater than or equal to the preset utilization rate threshold, then the device performance information does not meet the first condition, and it is determined that the file to be published will not be cached.
[0055] Step S403: Determine the cached files to be published.
[0056] Specifically, if the load on the display device is less than a preset load threshold, and the network transmission bandwidth is greater than or equal to a preset bandwidth threshold, and the memory usage is less than a preset usage threshold, then it is determined that the file to be published will be cached.
[0057] Step S404: Determine not to cache the file to be published.
[0058] Specifically, if the load is greater than or equal to the preset load threshold, or the network transmission bandwidth is less than the preset bandwidth threshold, or the memory usage is greater than or equal to the preset usage threshold, then it is determined that the file to be published will not be cached.
[0059] In this embodiment, the preset load threshold can be set according to specific needs, for example, 80%; similarly, the preset bandwidth threshold can be set according to specific needs, for example, 10Mbps; similarly, the preset utilization threshold can be set according to specific needs, for example, 70%.
[0060] In this embodiment, by obtaining device performance information, forced caching when the display device is under resource pressure is avoided, which could lead to device lag, playback abnormalities, and other problems, thereby ensuring the overall stability of the display device's operation.
[0061] Step S203: Based on the first resource configuration file, cache the file to be published in the cache space, and convert the online address of the content of the file to be published into the local storage address for local playback of the content of the file to be published.
[0062] Specifically, if the size of the file to be published is less than or equal to the available storage capacity, the file to be published is cached in the cache space based on the first resource configuration file. After caching the file to be published in the cache space, the online address of the content of the file to be published is converted into the local storage address so as to enable the content of the file to be published to be played locally on the display screen of the display device.
[0063] In this embodiment of the application, if the file to be published is the first time it has been published, it needs to be cached in the local cache space of the display device.
[0064] Please see Figure 5 , Figure 5 yes Figure 2 A detailed flowchart of step S203 in the process.
[0065] like Figure 5 As shown, step S203 includes the following steps S231-S233: Step S231: Determine whether the resource corresponding to the file to be published exists in the cache space.
[0066] In this embodiment of the application, the first resource configuration file includes a content list of files to be published and a resource list. The content list of files to be published includes at least one content package, and the resource list includes at least one first resource. Each content package may include at least one first resource, and each first resource corresponds to a first resource number.
[0067] The resources include at least one of HTML, JS, CSS, images, and videos.
[0068] Specifically, determine whether the resource corresponding to the file to be published exists in the cache space. If it is determined that the resource corresponding to the file to be published does not exist in the cache space, proceed to step S232. If it is determined that the resource corresponding to the file to be published exists in the cache space, proceed to step S233.
[0069] Please see Figure 6 , Figure 6 yes Figure 5 A detailed flowchart of step S231 is shown.
[0070] like Figure 6 As shown, step S231 includes: Step S2311: Obtain the first resource number and the second resource number.
[0071] In this embodiment of the application, the cache space includes at least one second resource, and each second resource corresponds to a second resource number.
[0072] In this embodiment of the application, the first resource number is the number of the resource corresponding to the content to be published, and the second resource number is the number of the resource in the cache space.
[0073] The resource number includes the resource's unique identifier (FileKey) and version number. This resource number is used to ensure the uniqueness and accuracy of the resource.
[0074] Step S2312: Determine whether the first resource number and the second resource number are the same.
[0075] Specifically, determine whether the first resource number and the second resource number are the same. If the first resource number and the second resource number are different, proceed to step S2313. If the first resource number and the second resource number are the same, proceed to step S2314.
[0076] Step S2313: Determine that the resource corresponding to the file to be published does not exist in the cache space.
[0077] Specifically, if it is determined that the first resource number and the second resource number are different, then it is determined that the resource corresponding to the file to be published does not exist in the cache space.
[0078] Step S2314: Determine that the resource corresponding to the file to be published exists in the cache space.
[0079] Specifically, if the first resource number and the second resource number are determined to be the same, then the resource corresponding to the file to be published is determined to exist in the cache space.
[0080] In this embodiment of the application, if it is determined that the resource corresponding to the file to be published exists in the cache space, the resource corresponding to the file to be published is directly obtained from the cache space to play the content of the file to be published locally, such as playing video, images and other content on the display screen of the display device.
[0081] Step S232: Send a resource acquisition request to the server to cache the resource corresponding to the resource acquisition request in the cache space.
[0082] Before sending a resource retrieval request to the server, the method also includes: If the cache space meets the clearing conditions, then the resources in the cache space are cleared based on the clearing policy; The clearing conditions include at least one of the following: the available storage capacity of the cache space is less than the capacity of the file to be published, the file to be published in the cache space is updated, or an inspection instruction is received.
[0083] Specifically, when space is insufficient, the clearing conditions are met, such as real-time monitoring of the available cache space capacity. When the available capacity is lower than a preset threshold, or when the available capacity cannot meet the caching requirements of the content to be played, the clearing process is automatically triggered. The preset threshold can be dynamically configured based on parameters such as the total cache capacity of the device and the business playback requirements.
[0084] Specifically, after the files to be published in the cache space are updated, the clearing conditions are met. For example, when the playback content in the cache space is updated (such as iterating the content displayed in the exhibition hall, upgrading the desktop content, updating the case center data, etc.), the display device recognizes the update instruction and triggers the clearing process, prioritizing the clearing of the old version cache of the corresponding content to make room for the new version cache.
[0085] Specifically, after receiving the inspection command sent by the server, if the clearing conditions are met, such as through scheduled inspection or manual triggering of the inspection command, when the display device receives the inspection command, it starts the cache clearing process to comprehensively sort out and clear the cache space, remove invalid and low-value cache content, and ensure the health of the cache space.
[0086] The clearing strategy includes at least one of the following: clearing resources in the cache space in ascending order of business priority, clearing resources whose usage frequency is lower than a preset frequency threshold, and clearing resources whose most recent usage time is greater than a preset time threshold.
[0087] In this embodiment, a multi-dimensional composite strategy of "business priority + usage frequency + most recent usage time" is adopted to determine the order of cached content clearing, ensuring that the clearing operation takes into account business needs, user habits, and resource value. The specific strategy includes: (1) Business Priority Ranking: Based on the importance of the business scenarios corresponding to the cached content, business priorities are divided, with the priority from high to low as follows: Exhibition Hall Content > Desktop Content > Screensaver Content > Case Center Content. Among them, Exhibition Hall Content is the core business display resource, which directly affects the display effect and user experience, and has the highest priority; Desktop Content is the basic content for daily operation of the device, and has the next highest priority; Screensaver Content is auxiliary display content, and has a lower priority; Case Center Content is reference material that is not played in real time, and has the lowest priority. When clearing, content with low business priority is cleared first, and core business content is only considered for partial clearing in extreme cases (such as when clearing other low-priority content still cannot meet the target available space).
[0088] (2) Frequency filtering: For cached content with the same business priority, calculate its historical usage frequency (such as the number of accesses and playbacks per unit time), prioritize retaining content with high usage frequency, and prioritize clearing content with low usage frequency or zero usage. By using frequency filtering, high-value resources frequently used by users can be retained, improving the cache hit rate for subsequent playback.
[0089] (3) Sorting by most recent usage time: For cached content with the same business priority and similar usage frequency, the least recently used content is cleared first, based on the most recent usage time and following the Least Recently Used (LRU) principle. By sorting by this dimension, low-value resources that have been idle for a long time can be further filtered out, and the resource allocation of cache space can be optimized.
[0090] Preferably, the clearing order execution logic is as follows: First, the clearing candidate pool is divided according to business priority from low to high, and the content in the low priority candidate pool is cleared first; within the same candidate pool, it is sorted from low to high usage frequency to filter out low-frequency usage content; for low-frequency usage content, it is sorted from earliest to latest usage time to determine the final clearing order, and the clearing operation is performed in sequence until the available capacity of the cache space reaches the preset target. The preset target includes: the available storage capacity of the cache space is greater than the capacity of the file to be published, for example: the total amount of currently playing content resources.
[0091] Furthermore, to ensure that the display device can operate normally and display basic content under any clearing scenario, this application further establishes a backup guarantee scheme, including: A portion of core basic resources (i.e., default content or homepage resources) are reserved in the cache space and marked as non-clearable resources. These resources will not be deleted under any clearing conditions. Among them, the default content or homepage resources include the basic interface displayed by default after the device starts up, the minimized display content of core business, etc., to ensure that even if the cache space is extremely tight, the display device can still start up normally and display basic content.
[0092] By reserving some core basic resources, this application can avoid abnormal situations such as black screens and no content to play, thus ensuring the operational stability and reliability of the display device.
[0093] In this embodiment of the application, by clearing the resources of the cache space, the available capacity of the cache space can meet the caching requirements of the total amount of resources of the currently playing content.
[0094] Step S233: Obtain the resources corresponding to the file to be published from the cache space, and play the content of the file to be published locally.
[0095] In this embodiment of the application, after caching the file to be published in the cache space, the method further includes: Convert the online address of the file to be published to a local storage address.
[0096] Please see Figure 7 , Figure 7 yes Figure 2 Another detailed flowchart of step S203 in the process.
[0097] like Figure 7 As shown, step S203 includes: Step S234: Intercept online resource requests, whereby the online resource request includes an online address and is used to obtain resources of the file to be published from the server.
[0098] Specifically, when a display device initiates an online resource request to the server, the display device's operating system intercepts the request through a pre-defined request interception module, such as a network request hook function based on the display device's operating system. The online resource request contains the online address of the file to be published, and this request is used to obtain the resource of the file from the server.
[0099] Understandably, the blocking timing can be set after the display device initiates an online resource request, and before the server transmits data through the network link, in order to avoid invalid network requests consuming bandwidth resources.
[0100] Step S235: Obtain the local storage address of the resources of the file to be published.
[0101] Specifically, the display device extracts the online address from the intercepted online resource request and matches it with the file's unique identifier in the cache index table using preset address resolution rules (such as resolving the filename "file1.mp4" in the online address). If a match is found, the local storage address corresponding to the file to be published is read from the cache index table. If no match is found (e.g., due to a delay in updating the cache index table), the address conversion process is paused, and the online resource request is allowed to ensure uninterrupted playback. At the same time, the background triggers a synchronous update of the cache index table.
[0102] Step S236: Fill the local storage address into the preset label, and based on the local storage address in the preset label, redirect the online address in the online resource request to the local storage address.
[0103] Specifically, the display device fills the obtained local storage address into a preset label, such as an address mapping label (e.g., ...).<local_path> In the tag, the address mapping tag is used to store the mapping relationship between local addresses and online addresses. Subsequently, based on the local storage address in the address mapping tag, the target address of the online resource request is modified by the request redirection module, redirecting the original online address to the local storage address. This enables the switching of resource links, achieving seamless switching between online and offline modes. After redirection, the playback component of the display device will directly obtain the resource of the file to be published from the local cache space and play it, without needing to request it from the server again, thereby reducing dependence on the network and further improving playback smoothness.
[0104] It should be noted that, to avoid discrepancies between the files to be published in the cache space and the latest resources on the server (e.g., the server's resources have been updated but the local cache has not been synchronized), and to ensure the accuracy of the playback content, after caching the files to be published in the cache space, the method also includes: Obtain the second resource configuration file; If the third resource number of a portion of the resources of the file to be published recorded in the second resource configuration file is different from the fourth resource number of a portion of the resources of the file to be published in the cache space, a resource acquisition request is sent to the server to obtain the resource corresponding to the third resource number, the resource corresponding to the fourth resource number is cleared from the cache space, and the resource corresponding to the third resource number is saved to the cache space.
[0105] The second resource configuration file refers to a configuration file stored on a server or a preset local path that records complete resource information of the file to be published. The second resource configuration file includes the unique identifier (i.e., the third resource number), resource version, resource storage path, and other information of each component resource (such as video clips, image materials, text resources, etc.) of the file to be published, which is used as a benchmark for resource consistency verification.
[0106] The third resource number is the latest unique identifier of each part of the file to be published, recorded in the second resource configuration file (e.g., using the format "resource type-timestamp-version number", e.g., video-20240520-001), used to identify the server-side or latest version of the resource.
[0107] Among them, the fourth resource number is a unique identifier for each part of the file to be published that has been stored in the cache space. It is the resource identity information recorded synchronously during caching and corresponds one-to-one with the cached resources. It is used to compare with the third resource number to determine whether the cached resources have expired.
[0108] Specifically, the comparison process includes the following steps (1)-(3): (1) Obtain the second resource configuration file.
[0109] Specifically, timed retrieval can be set to a fixed period (such as every 30 minutes), whereby the display device actively sends a configuration file retrieval request to the server; or, when the server's resources are updated, the server actively pushes a second resource configuration file to the display device to trigger the verification process.
[0110] (2) Compare the resource numbers.
[0111] Specifically, after obtaining the second resource configuration file, the display device parses the second resource configuration file and extracts the third resource number of each part of the file to be published; at the same time, it reads the storage metadata of the corresponding resources of the file to be published in the cache space and extracts the fourth resource number of each resource; then, according to the matching rule of "resource type + resource location" (such as matching the third resource number of the video resource "file1_clip1.mp4" with the fourth resource number of the video resource in the same position in the cache one by one), it compares whether the third resource number and the fourth resource number are consistent.
[0112] (3) Resource update processing.
[0113] Specifically, if the comparison reveals at least one set of third resource IDs that differ from fourth resource IDs, it indicates that the corresponding resource in the cache space is an expired version and an update operation needs to be performed, including: ① Send a resource acquisition request to the server. For example, organize inconsistent third-party resource IDs into an updated resource list, send a resource acquisition request to the server carrying the list, and clearly inform the server of the identity of the resource to be acquired, so as to ensure that the resource matching the latest configuration is acquired.
[0114] ② Clear expired cached resources: To avoid expired resources occupying cache space, while requesting new resources from the server (or after confirming that new resources have started downloading), the display device locates the expired resources in the cache space according to the fourth resource number and clears them from the cache space; during the clearing process, if it is detected that the expired resource is being used by the playback component (such as when the resource segment is currently being played), the clearing is temporarily suspended and will be executed after the playback is completed to ensure that the playback is not interrupted.
[0115] ③ Save the new resource and update the metadata. For example, after the server returns the new resource corresponding to the third resource number, the display device saves it to the corresponding directory in the cache space (consistent with the original resource storage path, so that the playback component can access it accurately). After saving, the cache metadata is updated synchronously, the original fourth resource number is replaced with the third resource number, and the corresponding resource identifier and storage address mapping relationship in the cache index table is updated to ensure the accuracy of subsequent address conversion and resource access.
[0116] Specifically, if all third resource numbers are consistent with the fourth resource number, it means that the cached resource is the latest version and no update operation is required. The display device will end the consistency verification process, record the verification result log, and then run normally.
[0117] In this embodiment of the application, by comparing configuration files, the application can promptly detect and update expired cached resources, avoiding playback content disorder (such as missing images, incorrect subtitles, discontinuous video segments, etc.) caused by inconsistent resource versions.
[0118] Step S204: Send a resource acquisition request to the server to obtain the file to be published in real time, so as to play the content of the file to be published online.
[0119] In this embodiment, a playback control method is provided, applied to a display device. The display device is communicatively connected to a server and includes a cache space. The method includes: obtaining a first resource configuration file, wherein the first resource configuration file includes the capacity of a file to be published; if the capacity of the file to be published is less than or equal to the available storage capacity, then based on the first resource configuration file, the file to be published is cached in the cache space for local playback; if the capacity of the file to be published is greater than the available storage capacity, then a resource acquisition request is sent to the server to acquire the file to be published in real time for online playback.
[0120] By obtaining the first resource configuration file, which includes the capacity of the file to be published, if the capacity of the file to be published is less than or equal to the available storage capacity, the file to be published is cached in the cache space based on the first resource configuration file for local playback. If the capacity of the file to be published is greater than the available storage capacity, a resource acquisition request is sent to the server to obtain the file to be published in real time for online playback. This improves the efficiency of caching and enhances the stability of video playback.
[0121] The following section uses a specific scenario to illustrate the processing procedure of the playback control method in this application: Take a cloud screen device in a shopping mall as an example: (1) At night, when the network of the display device is idle, it automatically receives a new marketing program update instruction.
[0122] (2) The display device first downloads the resource configuration file and finds that the total size of the marketing program is 2GB, while the available space of the display device after cleaning is 3GB. Then, it starts the cache download.
[0123] (3) During the download process, the display device recognizes that the background video of the new program is the same as that of the old program (the FileKey is the same). Therefore, the previously existing local video file is reused, and only the changed pictures and HTML scripts are downloaded, saving 1.5GB of traffic and time.
[0124] (4) The mall opened the next day, and the display devices started playing new programs. All resources were loaded from the local machine at high speed, the screen switching was smooth, and there was no network delay.
[0125] (5) A week later, the new program was released, triggering cache cleanup. According to the cleanup strategy, the interactive game resource with the most plays in the past week was retained first, while old marketing images that had not been used for two weeks were cleared to make room for the new program.
[0126] As can be seen, throughout the entire process, even with network fluctuations or background resource updates, the display device's screen always had content playing normally due to the fallback solution and configuration consistency guarantee, and there was never a black screen or white screen, which improved the stability of video playback.
[0127] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a display device provided in an embodiment of this application.
[0128] like Figure 8 As shown, the display device 100 includes one or more processors 101 and a memory 102. Wherein, Figure 8 Take a processor 101 as an example.
[0129] Processor 101 and memory 102 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0130] A processor is used to execute the playback control method in the embodiments of this application. The method is applied to a display device, which is communicatively connected to a server. The display device includes a cache space. The method includes: obtaining a first resource configuration file, wherein the first resource configuration file includes the capacity of a file to be published; if the capacity of the file to be published is less than or equal to the available storage capacity, then based on the first resource configuration file, caching the file to be published in the cache space, and converting the online address of the content of the file to be published to a local storage address for local playback of the content of the file to be published; if the capacity of the file to be published is greater than the available storage capacity, then sending a resource acquisition request to the server to acquire the file to be published in real time for online playback of the content of the file to be published.
[0131] By obtaining the first resource configuration file, which includes the capacity of the file to be published, if the capacity of the file to be published is less than or equal to the available storage capacity, the file to be published is cached in the cache space based on the first resource configuration file for local playback. If the capacity of the file to be published is greater than the available storage capacity, a resource acquisition request is sent to the server to obtain the file to be published in real time for online playback. This improves the efficiency of caching, enables seamless switching between online and offline playback, and enhances the stability of video playback.
[0132] The memory 102, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the playback control method in the embodiments of this application. The processor 101 executes various functional applications and data processing of the display device by running the non-volatile software programs, instructions, and modules stored in the memory 102, thereby implementing the playback control method of the above-described method embodiments.
[0133] Memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 102 may optionally include memory remotely located relative to processor 101. Examples of the above-described networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0134] One or more modules are stored in memory 102. When executed by one or more processors 101, they perform the playback control method in the above method embodiments, for example, the method described above. Figure 2 The steps shown.
[0135] This application also provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors. For example, the one or more processors can execute the playback control method in any of the above method embodiments, such as performing the steps described above.
[0136] This application also provides a computer program product, which includes one or more lines of program code stored in a non-volatile computer-readable storage medium. The processor of the display device reads the program code from the non-volatile computer-readable storage medium and executes the program code to complete the steps of the playback control method provided in the above embodiments.
[0137] Based on the above description of the embodiments, those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program or program code related to hardware. The program can be stored in a non-volatile computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The non-volatile computer-readable storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations as described above in different aspects of this application, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A playback control method, characterized in that, Applied to a display device, the display device being communicatively connected to a server, the display device including a cache space, the method includes: Obtain the first resource configuration file, wherein the first resource configuration file includes the size of the file to be published; If the size of the file to be published is less than or equal to the available storage capacity of the cache space, then based on the first resource configuration file, the file to be published is cached in the cache space, and the online address of the content of the file to be published is converted into a local storage address for local playback of the content of the file to be published. If the size of the file to be published is greater than the available storage capacity, a resource acquisition request is sent to the server to acquire the file to be published in real time so that the content of the file to be published can be played online.
2. The method according to claim 1, characterized in that, The first resource configuration file includes a resource mapping table, which includes a content list of files to be published and a resource list. The content list of files to be published includes at least one content package, and each content package includes at least one first resource. The resource list includes at least one first resource, and each first resource corresponds to a first resource number. The step of caching the file to be published in the cache space based on the first resource configuration file includes: Based on the first resource number of the first resource in the content package of the file to be published, determine whether the resource corresponding to the file to be published exists in the cache space; If it is determined that the resource corresponding to the file to be published does not exist in the cache space, a resource acquisition request is sent to the server to cache the resource corresponding to the resource acquisition request in the cache space; The method further includes: If it is determined that the resource corresponding to the file to be published exists in the cache space, then the resource corresponding to the file to be published is retrieved from the cache space to play the content of the file to be published locally.
3. The method according to claim 2, characterized in that, The cache space includes at least one second resource, each second resource corresponding to a second resource number. Determining whether the resource corresponding to the file to be published exists in the cache space based on the first resource number of the first resource in the content package of the file to be published includes: If the first resource number and the second resource number are the same, then it is determined that the resource corresponding to the file to be published exists in the cache space; If the first resource number and the second resource number are different, then it is determined that the resource corresponding to the file to be published does not exist in the cache space.
4. The method according to claim 1, characterized in that, Before sending a resource acquisition request to the server, the method further includes: If the cache space meets the clearing conditions, then the resources in the cache space are cleared based on the clearing strategy; The clearing conditions include at least one of the following: the available storage capacity of the cache space is less than the capacity of the file to be published, the file to be published in the cache space is updated, or an inspection instruction is received. The clearing strategy includes at least one of the following: clearing resources in the cache space in ascending order of business priority, clearing resources whose usage frequency is lower than a preset frequency threshold, and clearing resources whose most recent usage time is greater than a preset time threshold.
5. The method according to claim 1, characterized in that, The step of converting the online address of the content of the file to be published to a local storage address includes: Intercepting online resource requests, wherein the online resource request includes the online address, and the online resource request is used to obtain the resource of the file to be published from the server; Obtain the local storage address of the resources for the file to be published; The local storage address is filled into a preset label, and the online address in the online resource request is redirected to the local storage address based on the local storage address in the preset label.
6. The method according to claim 1, characterized in that, Before caching the file to be published in the cache space, the method further includes: Get real-time device performance information; Based on the device performance information, determine whether to cache the file to be published.
7. The method according to claim 6, characterized in that, The device performance information includes at least one of load, network transmission bandwidth, and memory usage. The step of determining whether to cache the file to be published based on the device performance information includes: If the load is less than a preset load threshold, the network transmission bandwidth is greater than or equal to a preset bandwidth threshold, and the memory utilization is less than a preset utilization threshold, then it is determined to cache the file to be published. If the load is greater than or equal to a preset load threshold, or the network transmission bandwidth is less than a preset bandwidth threshold, or the memory utilization rate is greater than or equal to a preset utilization rate threshold, then it is determined that the file to be published will not be cached.
8. The method according to claim 1, characterized in that, After caching the file to be published in the cache space, the method further includes: Obtain the second resource configuration file; If the third resource number of a portion of the resources of the file to be published recorded in the second resource configuration file is different from the fourth resource number of a portion of the resources of the file to be published in the cache space, a resource acquisition request is sent to the server to acquire the resource corresponding to the third resource number, the resource corresponding to the fourth resource number is cleared from the cache space, and the resource corresponding to the third resource number is saved to the cache space.
9. A display device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.
10. A playback control system, characterized in that, The playback control system includes: The display device as described in claim 9; The server is connected to the display device via a communication link.