Resource processing method and device for live broadcasting room

By managing download requests and pre-check tasks according to resource priorities in the live broadcast room, the problems of resource grabbing and loading delays are solved, efficient acquisition and priority processing of resources are achieved, and user experience is improved.

CN119094806APending Publication Date: 2024-12-06SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411341682.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In live broadcast scenarios, the download of gift resources may have resource grabbing problems, resulting in loading delays and display failures. It is difficult for the existing technology to effectively manage the priority and pre-check tasks of resources in different scenarios.

Method used

By receiving download requests for target resources, determining the execution order according to their priority, and performing pre-flight operations in the local resource cache pool, establishing a task queue to manage and prioritize resources, avoiding resource grabbing and duplicate queries.

Benefits of technology

It improves resource acquisition efficiency, ensures priority processing of important resources, avoids resource grabbing and repeated inquiries, and improves user experience and system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094806A_ABST
    Figure CN119094806A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a resource processing method for a live broadcast room, and the method comprises the steps: receiving a downloading request of a target business module for a target resource, and the downloading request comprises the priority of the target resource; determining an execution sequence of the target resources according to the priorities of the target resources; executing a target pre-check operation according to the execution sequence, wherein the target pre-check operation is used for querying the target resource from a local resource cache pool; under the condition that the target resource exists in the local resource cache pool, returning the target resource to the target service module; wherein the local resource cache pool is used for storing and sharing resources of each service module associated with the live broadcast room. According to the technical scheme provided by the embodiment of the invention, the target resource can be preferentially acquired from the local without downloading through a network, so that the resource acquisition efficiency is improved. In addition, the downloading requests of a plurality of resources in different scenes are prevented from simultaneously querying the target resources and mutually snatching the target resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and in particular, to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for processing resources in a live broadcast room. Background Art

[0002] With the rapid development of mobile Internet technology, changes in user content consumption patterns have led to the rapid development of live broadcast technology. In the live broadcast scenario, user interaction requires real-time loading and display of rich dynamic content, which needs to be loaded immediately upon each user request. In order to avoid loading delays and display failures caused by unprepared resources, pre-check tasks are used to query, download, check integrity, and other operations in advance to confirm the availability of required resources for the business side.

[0003] However, when downloading gift resources for multiple scenes, there will be a problem of snatching resources from each other.

[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for processing resources in a live broadcast room to solve or alleviate one or more of the technical problems raised above.

[0006] One aspect of an embodiment of the present application provides a method for processing resources in a live broadcast room, the method comprising: receiving a download request for a target resource from a target service module, wherein the download request includes a priority of the target resource; Determining the execution order of the target resources according to the priority of the target resources; Executing a target pre-check operation according to the execution order, wherein the target pre-check operation is used to query the target resource from a local resource cache pool; If the target resource exists in the local resource cache pool, returning the target resource to the target service module; Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

[0007] Optionally, determining the execution order of the target resources according to the priority of the target resources includes: In the case where the priority of the target resource is the first priority, generating and executing a target pre-check task for the target resource; When the priority of the target resource is other priorities: determine the target task queue according to the priority of the target resource; create a target pre-inspection task for the target resource; add the target pre-inspection task to the target task queue, and the target task queue is used to determine the execution order of each task therein.

[0008] Optionally, the target resource is stored in the form of a resource array, and the resource array includes a plurality of sub-resources; and according to the priority of the target resource, determining the target task queue includes: Traverse the resource array in reverse order to obtain the resource address of each sub-resource, where one resource address corresponds to one priority; and Determining a target task queue for each resource according to the priority of each resource; The target pre-check tasks of the sub-resources are independently added to the target task queues of their corresponding priorities.

[0009] Optionally, determining a target task queue according to the priority of the target resource includes: According to the priority of the target resource, determining whether there is a task queue of corresponding priority in a preset queue mapping table; If there is a task queue of the corresponding priority, the task queue of the corresponding priority is determined as the target task queue; If there is no task queue of the corresponding priority, a target task queue of the corresponding priority is created.

[0010] Optionally, the method further comprises: When the priority of the target resource is other priorities, executing the pre-check tasks in each of the task queues in sequence according to the priority of each of the task queues until each of the task queues is completed; Among them, after the pre-check task of the task queue of the previous priority is completed, the task queue of the next priority is executed.

[0011] Optionally, each of the task queues corresponds to a current pre-check number, wherein the current pre-check number is used to record the number of ongoing pre-check tasks; during the execution of any of the task queues: From the executed task queue, take out the pre-check tasks in order and execute them; Wherein, each time a pre-check task is taken out, the current pre-check number is increased by one, and each time a pre-check task is completed, the current pre-check number is decreased by one.

[0012] Optionally, the method further comprises: When the target resource does not exist in the local resource cache pool, a query failure result is returned to the target business module.

[0013] Optionally, the download request further includes a maximum number of requests for the target resource, and the maximum number of requests is used to indicate a maximum number of repeated requests for the target pre-check task; In the case that the target resource does not exist in the local resource cache pool, returning the query failure result to the target business module, further comprising: Each time the target pre-check task is executed, the number of requests is added by one to update the number of requests; If the target pre-check task fails to find the target resource and the updated request number is less than the maximum request number, re-execute the target pre-check task; When the number of requests is not less than the maximum number of requests, a query failure result is returned to the target business module.

[0014] Optionally, the method further comprises: In response to a download request for a subsequent resource identical to the target resource, updating the priority and maximum number of requests of the target pre-check task; When the target pre-check task is not executed, the target pre-check task is updated to a task queue of a corresponding priority.

[0015] Another aspect of an embodiment of the present application provides a resource processing device for a live broadcast room, the device comprising: A receiving module, used for receiving a download request from a target service module for a target resource, wherein the download request includes a priority of the target resource; A determination module, used to determine the execution order of the target resources according to the priority of the target resources; An execution module, used for executing a target pre-check operation according to the execution order, wherein the target pre-check operation is used for querying the target resource from a local resource cache pool; A return module, used for performing a target pre-check operation according to the execution order, wherein the target pre-check operation is used for querying the target resource from a local resource cache pool; Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

[0016] Another aspect of an embodiment of the present application provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0017] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.

[0018] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the method described above when executed by a processor.

[0019] The embodiment of the present application adopts the above technical solution and may include the following advantages: the execution order of the target resources is determined by the priority of the target resources, and the target pre-check operation is performed according to the execution order. The target resource is queried in the local resource cache pool through the target pre-check operation, so as to obtain the target resource locally first without downloading it through the network, thereby improving the resource acquisition efficiency. In addition, through priority management, important resources are given priority in pre-check operations, and it is avoided that the download requests of multiple resources in different scenarios query the target resource at the same time and snatch the target resource from each other. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0021] Figure 1 A flowchart of a method for processing resources in a live broadcast room according to Embodiment 1 of the present application is schematically shown; Figure 2 Schematically shows Figure 1 Flow chart of sub-steps of step S102; Figure 3 Schematically shows Figure 2 The sub-step flow chart of S202; Figure 4 A newly added flow chart of the resource processing method of the live broadcast room according to the first embodiment of the present application is schematically shown; Figure 5 A block diagram schematically shows a resource processing device for a live broadcast room according to the second embodiment of the present application; and Figure 6 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0023] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0024] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.

[0025] First, the following terms are explained: Queue: A data structure used to process sequential tasks or data flows.

[0026] URL (Uniform Resource Locator): is an address used to specify the location of resources on the Internet. Each URL is a path to a network resource and is used to access web pages, images, files, etc.

[0027] MP4 (MPEG-4 Part 14): is a multimedia container format used to store a variety of media content such as video, audio, subtitles, images, etc.

[0028] SVGA (Super Video Graphics Array): is a display standard that provides higher resolution and more color support and is used in computer monitors and projection devices.

[0029] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present application, the relevant technologies are described below. The applicant has learned that the download pre-check tasks of gift resources in different scenarios are executed separately, and the most important resources cannot be given priority for pre-check tasks, and the pre-check tasks repeatedly query the status of the same resource, snatching resources from each other, and the most needed resources cannot be given priority for pre-check tasks.

[0030] To this end, the embodiment of the present application provides a technical solution for resource processing in a live broadcast room. In this technical solution: (1) by setting different task queues, the pre-check tasks of resource download requests in different scenarios are uniformly managed; (2) important resources can be given priority for pre-check operations; (3) multiple resource download requests in different scenarios can be prevented from querying the target resource at the same time and competing for the target resource. See below for details.

[0031] The technical solutions of the present application are described below through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be construed as being limited to the embodiments described here.

[0032] Embodiment 1 Figure 1 The flowchart of the resource processing method of the live broadcast room according to the first embodiment of the present application is schematically shown.

[0033] like Figure 1 As shown, the resource processing method of the live broadcast room may include steps S100 to S106, wherein: Step S100: receiving a download request for a target resource from a target service module, wherein the download request includes a priority of the target resource.

[0034] Step S102: determining the execution order of the target resources according to the priority of the target resources.

[0035] Step S104: performing a target pre-check operation according to the execution order, wherein the target pre-check operation is used to query the target resource from the local resource cache pool.

[0036] Step S106: if the target resource exists in the local resource cache pool, return the target resource to the target service module.

[0037] Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

[0038] The resource processing method for the live broadcast room provided in this embodiment determines the execution order of the target resources by the priority of the target resources, and performs the target pre-check operation according to the execution order. The target pre-check operation determines to query the target resource in the local resource cache pool, so as to obtain the target resource locally first without downloading it through the network, thereby improving the resource acquisition efficiency. In addition, through priority management, important resources are given priority to pre-check operations, and it is avoided that the download requests of multiple resources in different scenarios query the target resources at the same time and snatch the target resources from each other.

[0039] The following combination Figure 1 , each step in steps S100~S106 and other optional steps are explained in detail.

[0040] Step S100 , receiving a download request for a target resource from a target service module, wherein the download request includes a priority of the target resource.

[0041] A business module corresponds to a different business scenario, and the business scenarios can be preloading for entering the room, displaying the gift panel, selecting the gift panel, and triggering the display of gift animation by gift broadcast, etc. The target resources can be picture resources, MP4 format resources, SVGA format resources, etc. The priority is used to indicate the importance or urgency of the download request for the target resource. The priority of the target resource can be high priority, medium priority, and low priority, and other priorities can also be set according to actual conditions. The priority of the target resource is determined according to the importance of the business in different scenarios. In some embodiments, download requests related to preloading for entering the room and animation playback are low priority, download requests related to the gift panel are medium priority, and download requests related to gift giving are high priority.

[0042] Step S102 , determine the execution order of the target resources according to the priority of the target resources.

[0043] In actual applications, multiple resource download requests are usually received at the same time, such as preloading for entering a room, animation playback, gift panel, and gift delivery. Resources with higher priority are more critical to the current business scenario and may affect the user interaction experience. For example, during a live broadcast, resources related to gift delivery are more urgent and need to be executed first, so they will be assigned a high priority.

[0044] In an optional embodiment, if Figure 2 As shown, step S102 may include: Step S200 , when the priority of the target resource is the first priority, generating and executing a target pre-check task of the target resource.

[0045] Step S202, when the priority of the target resource is other priorities: determine the target task queue according to the priority of the target resource; create a target pre-inspection task for the target resource; add the target pre-inspection task to the target task queue, and the target task queue is used to determine the execution order of each task therein.

[0046] Exemplarily, the target pre-check task is a local file query task generated by the URL in the target resource, and the query result of the local resource pool is returned through the query task. If the priority of the target resource is the first priority (highest priority), the target pre-check task of the target resource will be generated and executed immediately, and it will not be put into the task queue to wait.

[0047] If the priority of the target resource is not the first priority, the target task queue of the corresponding priority will be selected according to the priority of the target resource. The target pre-check task of the target resource is generated and added to the target task queue. Pre-check tasks of the same priority are added to the same task queue.

[0048] In this embodiment, when the target resource is the first priority, a target pre-check task for the target resource will be immediately generated and executed. Before the user uses the key resource, it can be pre-queried whether the corresponding resource has been cached to the local device and whether it can be obtained and used, thereby improving the resource query and return efficiency and improving the user experience.

[0049] When the target resource is not the first priority, the target pre-check task of the target resource is added to the corresponding target task queue, and the pre-check task is processed according to the execution order of the task queue, so that the pre-check tasks of other priorities can be executed in order.

[0050] In an optional embodiment, the target resource is saved in the form of a resource array, and the resource array includes multiple sub-resources. Each sub-resource has a resource address (such as a URL) pointing to the actual location of the resource, which is used to query the resource during the pre-check operation. For example, the target resource of a single gift needs to be displayed on different devices or different states (horizontal screen, vertical screen), so there can be two MP4 resource URLs corresponding to the horizontal screen and the vertical screen respectively, two SVGA resource URLs corresponding to the horizontal screen and the vertical screen respectively, and three picture resource URLs. According to the priority of the target resource, the target task queue is determined, including: traversing the resource array in reverse order to obtain the resource address of each sub-resource, and one resource address corresponds to one priority. The reverse traversal is to make the pre-check task corresponding to the first screen resource of the gift panel enter the task queue later in the scene such as the gift panel, and put it at the end of the queue, and make it out of the queue first by dequeuing at the end of the queue. At the same time, in the scene where other new services are generated, the pre-check task corresponding to the new resource can be executed first. The first screen refers to the interface part that the user sees for the first time when opening an application or visiting a page. According to the priority of each resource, the target task queue of each resource is determined. The target pre-check tasks of each sub-resource are added to the target task queues of their corresponding priorities independently. Each sub-resource generates its own independent pre-check task, so that the pre-check tasks of each sub-resource will not affect each other.

[0051] In this embodiment, by traversing the resource array in reverse order and obtaining the resource address of each sub-resource, the pre-inspection task corresponding to the first screen resource can be executed with priority in the task queue. At the same time, in the scenario where other new services are generated, the pre-inspection task corresponding to the new resource can be executed with priority in the corresponding task queue, so that users can see the content they are interested in more quickly.

[0052] In an optional embodiment, if Figure 3 As shown, step S202 may include: Step S300: Determine whether there is a task queue of corresponding priority in a preset queue mapping table according to the priority of the target resource.

[0053] Step S302: If there is a task queue of the corresponding priority, the task queue of the corresponding priority is determined as the target task queue.

[0054] Step S304: if there is no task queue of the corresponding priority, then create a target task queue of the corresponding priority.

[0055] Exemplarily, a pre-set queue mapping table can be used to record task queues of different priorities. Multiple priorities can be defined in the queue mapping table, and each priority corresponds to a task queue. Look up in the queue mapping table whether there is already a task queue of the corresponding priority to the target resource. In the case where there is a task queue of the corresponding priority, the found task queue is designated as the target task queue and the target pre-check task is added to the target task queue. In the case where there is a task queue of the corresponding priority, after creating the target task queue of the corresponding priority, the target pre-check task is added to the target task queue. While creating the target task queue of the corresponding priority, the target task queue is updated to the queue mapping table so that it can serve subsequent tasks at the same time.

[0056] In this embodiment, by means of a preset queue mapping table, it is possible to avoid repeatedly creating a task queue of the same priority, and in the case where there is a task queue of a corresponding priority, the task queue of the corresponding priority can be quickly found.

[0057] Step S104 , performing a target pre-check operation according to the execution order, wherein the target pre-check operation is used to query the target resource from a local resource cache pool.

[0058] The pre-check operation refers to checking whether the target resource has been cached in the local resource cache pool and whether it can be obtained and used before using the target resource. In some embodiments, before the gift resource is used, it is pre-queried whether the corresponding resource has been cached in the local resource cache pool, such as querying whether the corresponding static image resource, dynamic image resource and animation resource are cached in the local resource cache pool, and querying the availability of the corresponding resource, such as whether the image file can be displayed, whether the size or frame number of the SVAG file is zero, and whether the MP4 file is complete and can be displayed. The pre-check operation for gift resources can enable users to quickly display the corresponding style and animation when using the gift resource, thereby improving the user experience.

[0059] In this embodiment, the target pre-check operation is performed according to the execution order, so that the user can quickly obtain the content of the target resource when using the target resource, reducing the user's waiting time, and helping to reasonably allocate resources, so that key content is displayed first, improving the user experience.

[0060] Step S106 , when the target resource exists in the local resource cache pool, returning the target resource to the target business module.

[0061] Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

[0062] The target business module refers to the specific functional module that issues the resource request, which can be the gift display module of the live broadcast room, or other functional modules. In some embodiments, the local resource cache pool contains resource caches of various file types, and the local resource cache pool can be a total collection of various resource channels such as picture channels, SVGA channels, and MP4 channels. When the target resource generates a target pre-inspection task, the file type related to the target pre-inspection task is assigned according to the file type of the target resource. According to the file type related to the target pre-inspection task, the target resource is queried from the relevant resource channel.

[0063] In this embodiment, when the target resource exists in the local resource cache pool, it is directly returned to the target business module from the local resource cache pool without the need to download it again from the server, thereby achieving rapid acquisition and loading of the target resource and improving user experience.

[0064] In an optional embodiment, the resource processing method of the live broadcast room also includes: when the priority of the target resource is other priorities, the pre-inspection tasks in each of the task queues are executed in sequence according to the priority of each task queue until each task queue is completed. The pre-inspection task can be taken out of the task queue and executed by dequeuing at the end of the queue. The dequeuing at the end of the queue combined with the reverse traversal of the resource array can give priority to the execution of the pre-inspection task corresponding to the first screen resource. Among them, after the pre-inspection task of the task queue of the previous priority is completed, the task queue of the next priority is executed. All pre-inspection tasks in the task queue corresponding to the previous priority are processed first. Only when all pre-inspection tasks in the task queue of this priority are completed, will the task queue corresponding to the next priority be switched to continue executing the pre-inspection tasks in this task queue.

[0065] In this embodiment, after the pre-check task of the task queue with the previous priority is completed, the task queue with the next priority is executed, thereby giving priority to the pre-check tasks in the task queue corresponding to the high priority, and allowing the pre-check tasks in the task queue corresponding to each priority to be executed in sequence, thereby achieving orderly and unified management of multiple tasks with different request times and different priorities.

[0066] In an optional embodiment, each of the task queues corresponds to a current pre-check number, wherein the current pre-check number is used to record the number of pre-check tasks in progress. Different types of resources have different maximum pre-check numbers, and pre-check tasks of different types of resources need to consume different bandwidths, and bandwidth refers to the amount of data that can be transmitted per unit time. For example, multiple pre-check tasks related to image resources can be executed simultaneously, and MP4 resources are large, so the number of pre-check tasks related to MP4 resources that can be executed simultaneously is reduced accordingly. In the process of executing any of the task queues: pre-check tasks are taken out and executed in sequence from the executed task queue; wherein, the current pre-check number is increased by one for each pre-check task taken out, and the current pre-check number is reduced by one for each pre-check task completed. In the case of taking out a pre-check task from the task queue and starting to execute it, a new pre-check task enters the execution state, indicating that the number of pre-check tasks being processed has increased, so the current pre-check number is increased by one. In the case of a pre-check task being executed, it means that one pre-check task being executed has been reduced, and the current pre-check number is reduced by one.

[0067] In this embodiment, the number of ongoing pre-check tasks and the maximum number of pre-checks that can be performed simultaneously by different types of resources are recorded through the current pre-check number, so as to achieve concurrency of pre-check tasks of different types of resources and improve the efficiency of pre-check tasks.

[0068] In an optional embodiment, the resource processing method of the live broadcast room further includes: when the target resource does not exist in the local resource cache pool, returning a query failure result to the target business module. The query failure result indicates that the target resource does not exist in the current local resource cache pool, and the target business module performs the next resource request. The next resource request may be to download the target resource from the server or to download the target resource through a downloader. The downloader is a tool or software for downloading files or resources from the Internet.

[0069] In this embodiment, when there is no target resource in the local cache pool, the query failure result is returned to the target business module, which then notifies the target business module that there is no available target resource in the local resource cache pool and implements the download.

[0070] In an optional embodiment, the download request also includes a maximum request number for the target resource, and the maximum request number is used to indicate a maximum number of repeated requests for the target pre-check task. Figure 4 In the case where the target resource does not exist in the local resource cache pool, returning the query failure result to the target business module may include: Step S400 , each time the target pre-check task is executed, the request number is added by one to update the request number.

[0071] Step S402: if the target pre-check task fails to find the target resource and the updated request number is less than the maximum request number, re-execute the target pre-check task.

[0072] Step S404: When the number of requests is not less than the maximum number of requests, a query failure result is returned to the target business module.

[0073] Exemplarily, the maximum number of requests for the target resource can be set according to the corresponding priority, such as the maximum number of requests for the pre-check task corresponding to the high priority is 3, and the maximum number of requests for the pre-check task corresponding to the low priority is 1. It should be noted that the maximum number of requests for the pre-check task of the corresponding priority can be set according to the actual situation. The number of requests is used to record the number of requests that have been attempted. If the target resource is not queried when executing the pre-check task, and the current number of requests is less than the maximum number of requests, the pre-check task will be re-executed until the target resource is successfully queried or the updated number of requests reaches the maximum number of requests. If the query is still unsuccessful after reaching the maximum number of requests, a failure result will be returned to the target business module to facilitate the target business module to make the next resource download decision.

[0074] In this embodiment, when the target pre-check task fails to query the target resource, the target pre-check task is repeatedly executed within the range of the maximum number of requests until the target resource is successfully queried or the number of updated requests reaches the maximum number of requests, thereby achieving automatic repeated query of the target resource within a reasonable range, thereby increasing the query hit rate and avoiding excessive consumption of internal device resources due to excessive automatic repeated queries.

[0075] In an optional embodiment, the resource processing method of the live broadcast room may also include: in response to a download request for a subsequent resource that is the same as the target resource, updating the priority and maximum number of requests of the target pre-check task. In some embodiments, if there is already a pre-check task corresponding to the URL of a resource, and other subsequent business scenarios generate download requests for the URL of the same resource, when the corresponding priority of the subsequent download request for the same resource is greater than the priority of the existing pre-check task, the priority and maximum number of requests of the pre-check task are updated. In the case that the target pre-check task is not executed, the target pre-check task is updated to the task queue of the corresponding priority. The target pre-check task will enter the task queue of the corresponding priority for processing in the updated priority order.

[0076] In this embodiment, the priority and maximum number of requests of the pre-check task of the target resource can be dynamically adjusted according to the download requests of subsequent resources with the same target resource, so that the pre-check tasks with higher priority are executed faster. At the same time, different tasks generated by the same URL in different scenarios can be shared, and progress can be shared, so that unified management of multi-scenario tasks of gift animation resources can be performed.

[0077] In order to make the present application easier to understand, an exemplary application is provided below.

[0078] In this exemplary application, in the scenario where a gift is selected, the priority of the target resource is the first priority (the highest priority), and a target pre-check task of the target resource is immediately generated and executed.

[0079] In the scenario of requesting a gift panel, the priority of the target resource is not the first priority. The target resource is saved in the form of a resource array. The target resource array contains multiple sub-resources. The corresponding resource address (URL) of the sub-resource can be the URL of an MP4 resource, the URL of an SVGA resource, or the URL of an image resource. Traverse the resource array in reverse order and generate the corresponding pre-check task according to the URL. Each pre-check task has its own corresponding priority, and there is also a corresponding maximum number of pre-checks according to the corresponding priority.

[0080] If there is a task queue of the corresponding priority in the preset queue mapping table, the corresponding pre-check task is added to the task queue of the corresponding priority. If there is no task queue of the corresponding priority in the queue mapping table, after creating the task queue of the corresponding priority, the corresponding pre-check task is added to the task queue of the corresponding priority.

[0081] According to the priority of each task queue, the pre-check tasks in the task queue are executed in order from high to low. The pre-check tasks are taken from the end of the task queue to cooperate with the previous operation of traversing the resource array in reverse order, so that the pre-check tasks corresponding to the first screen resources can be executed first in the task queue. At the same time, in the scenario of generating other new services, the pre-check tasks corresponding to the new resources can be executed first in the corresponding task queue.

[0082] Each time a pre-check task is taken out from the task queue, the current pre-check number is increased by one, and each time a pre-check task is completed, the current pre-check number is reduced by one. The maximum number of pre-checks that can be performed simultaneously for different types of resources is set to achieve concurrency of pre-check tasks for different types of resources.

[0083] When the pre-check task starts to execute, the request count of the pre-check task will increase by 1. If the executed pre-check task does not find the corresponding resource, the pre-check task will be repeatedly executed within the maximum request count until the corresponding resource is successfully found or the update request count reaches the maximum request count.

[0084] If there is already a pre-check task corresponding to a resource URL, and other business scenarios subsequently initiate download requests for the same resource URL, if the priority of the subsequent download request for the same resource is greater than the priority of the existing pre-check task, update the priority and maximum number of requests of the pre-check task. If the pre-check task is not executed, update the pre-check task to the task queue of the corresponding priority.

[0085] Embodiment 2 Figure 5 The block diagram of the resource processing device of the live broadcast room according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 5 As shown, the device 1600 may include: a receiving module 1610, a determining module 1620, an executing module 1630 and a returning module 1640, wherein: The receiving module 1610 is used to receive a download request from a target service module for a target resource, where the download request includes a priority of the target resource.

[0086] The determination module 1620 is used to determine the execution order of the target resources according to the priority of the target resources.

[0087] The execution module 1630 is used to execute a target pre-check operation according to the execution order, wherein the target pre-check operation is used to query the target resource from the local resource cache pool.

[0088] The return module 1640 is used to perform a target pre-check operation according to the execution order, and the target pre-check operation is used to query the target resource from the local resource cache pool.

[0089] Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

[0090] As an optional embodiment, determining the execution order of the target resources according to the priority of the target resources includes: In the case where the priority of the target resource is the first priority, generating and executing a target pre-check task for the target resource; When the priority of the target resource is other priorities: determine the target task queue according to the priority of the target resource; create a target pre-inspection task for the target resource; add the target pre-inspection task to the target task queue, and the target task queue is used to determine the execution order of each task therein.

[0091] As an optional embodiment, the target resource is stored in the form of a resource array, and the resource array includes multiple sub-resources; according to the priority of the target resource, determining the target task queue includes: Traverse the resource array in reverse order to obtain the resource address of each sub-resource, where one resource address corresponds to one priority; and Determining a target task queue for each resource according to the priority of each resource; The target pre-check tasks of the sub-resources are independently added to the target task queues of their corresponding priorities.

[0092] As an optional embodiment, determining the target task queue according to the priority of the target resource includes: According to the priority of the target resource, determining whether there is a task queue of corresponding priority in a preset queue mapping table; If there is a task queue of the corresponding priority, the task queue of the corresponding priority is determined as the target task queue; If there is no task queue of the corresponding priority, a target task queue of the corresponding priority is created.

[0093] As an optional embodiment, the method further includes: When the priority of the target resource is other priorities, executing the pre-check tasks in each of the task queues in sequence according to the priority of each of the task queues until each of the task queues is completed; Among them, after the pre-check task of the task queue of the previous priority is completed, the task queue of the next priority is executed.

[0094] As an optional embodiment, each of the task queues corresponds to a current pre-check number, wherein the current pre-check number is used to record the number of ongoing pre-check tasks; during the execution of any of the task queues: From the executed task queue, take out the pre-check tasks in order and execute them; Wherein, each time a pre-check task is taken out, the current pre-check number is increased by one, and each time a pre-check task is completed, the current pre-check number is decreased by one.

[0095] As an optional embodiment, the method further includes: When the target resource does not exist in the local resource cache pool, a query failure result is returned to the target business module.

[0096] As an optional embodiment, the download request further includes a maximum request number of the target resource, and the maximum request number is used to indicate a maximum number of repeated requests for the target pre-check task; In the case that the target resource does not exist in the local resource cache pool, returning the query failure result to the target business module, further comprising: Each time the target pre-check task is executed, the number of requests is added by one to update the number of requests; If the target pre-check task fails to find the target resource and the updated request number is less than the maximum request number, re-execute the target pre-check task; When the number of requests is not less than the maximum number of requests, a query failure result is returned to the target business module.

[0097] As an optional embodiment, the method further includes: In response to a download request for a subsequent resource identical to the target resource, updating the priority and maximum number of requests of the target pre-check task; When the target pre-check task is not executed, the target pre-check task is updated to a task queue of a corresponding priority.

[0098] Embodiment 3 Figure 6 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the resource processing method of a live broadcast room according to the third embodiment of the present application is shown schematically. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 6 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 10000, such as a hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 can also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed on the computer device 10000, such as the program code of the resource processing method of the live broadcast room, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.

[0099] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.

[0100] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0101] It should be pointed out that Figure 6 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0102] In this embodiment, the resource processing method of the live broadcast room stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.

[0103] Embodiment 4 An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the resource processing method for the live broadcast room in the embodiment are implemented.

[0104] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Of course, the computer-readable storage medium may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the resource processing method of the live broadcast room in the embodiment. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.

[0105] Embodiment 5 An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.

[0106] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0107] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A resource processing method for a live broadcast room, It is characterized in that include: receiving a download request for a target resource from a target service module, wherein the download request includes a priority of the target resource; Determining the execution order of the target resources according to the priority of the target resources; Executing a target pre-check operation according to the execution order, wherein the target pre-check operation is used to query the target resource from a local resource cache pool; If the target resource exists in the local resource cache pool, returning the target resource to the target service module; Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

2. The method according to claim 1, It is characterized in that Determining the execution order of the target resources according to the priority of the target resources includes: In the case where the priority of the target resource is the first priority, generating and executing a target pre-check task for the target resource; When the priority of the target resource is other priorities: determine the target task queue according to the priority of the target resource; create a target pre-inspection task for the target resource; add the target pre-inspection task to the target task queue, and the target task queue is used to determine the execution order of each task therein.

3. The method according to claim 2, It is characterized in that The target resource is stored in the form of a resource array, and the resource array includes a plurality of sub-resources; according to the priority of the target resource, a target task queue is determined, including: Traverse the resource array in reverse order to obtain the resource address of each sub-resource, where one resource address corresponds to one priority; and Determining a target task queue for each resource according to the priority of each resource; The target pre-check tasks of the sub-resources are independently added to the target task queues of their corresponding priorities.

4. The method according to claim 2, It is characterized in that Determining a target task queue according to the priority of the target resource includes: According to the priority of the target resource, determining whether there is a task queue of corresponding priority in a preset queue mapping table; If there is a task queue of the corresponding priority, the task queue of the corresponding priority is determined as the target task queue; If there is no task queue of the corresponding priority, a target task queue of the corresponding priority is created.

5. The method according to claim 2, It is characterized in that The method further comprises: When the priority of the target resource is other priorities, executing the pre-check tasks in each of the task queues in sequence according to the priority of each of the task queues until each of the task queues is completed; Among them, after the pre-check task of the task queue of the previous priority is completed, the task queue of the next priority is executed.

6. The method according to claim 5, It is characterized in that Each of the task queues has a corresponding current pre-check number, wherein the current pre-check number is used to record the number of ongoing pre-check tasks; during the execution of any of the task queues: From the executed task queue, take out the pre-check tasks in order and execute them; Wherein, each time a pre-check task is taken out, the current pre-check number is increased by one, and each time a pre-check task is completed, the current pre-check number is decreased by one.

7. The method according to claim 1, It is characterized in that The method further comprises: When the target resource does not exist in the local resource cache pool, a query failure result is returned to the target business module.

8. The method according to claim 7, It is characterized in that The download request also includes a maximum request number for the target resource, where the maximum request number is used to indicate a maximum number of repeated requests for the target pre-check task; In the case that the target resource does not exist in the local resource cache pool, returning the query failure result to the target business module, further comprising: Each time the target pre-check task is executed, the number of requests is added by one to update the number of requests; If the target pre-check task fails to find the target resource and the updated request number is less than the maximum request number, re-execute the target pre-check task; When the number of requests is not less than the maximum number of requests, a query failure result is returned to the target business module.

9. The method according to claim 8, It is characterized in that The method further comprises: In response to a download request for a subsequent resource identical to the target resource, updating the priority and maximum number of requests of the target pre-check task; When the target pre-check task is not executed, the target pre-check task is updated to a task queue of a corresponding priority.

10. A resource processing device for a live broadcast room, It is characterized in that The device comprises: A receiving module, used for receiving a download request from a target service module for a target resource, wherein the download request includes a priority of the target resource; A determination module, used to determine the execution order of the target resources according to the priority of the target resources; An execution module, used for executing a target pre-check operation according to the execution order, wherein the target pre-check operation is used for querying the target resource from a local resource cache pool; A return module, used for performing a target pre-check operation according to the execution order, wherein the target pre-check operation is used for querying the target resource from a local resource cache pool; Among them, the local resource cache pool is used to store and share resources of various business modules associated with the live broadcast room.

11. A computer device, It is characterized in that include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to claims 1 to 9 are implemented.