Resource release method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202211664851.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-12-23
AI Technical Summary
[0003]本公开提供一种资源释放方法、装置、电子设备及存储介质,以至少解决相关技术中无法对容器内存进行自动化管理的问题
本公开基于资源释放请求,确定多个候选容器标识;每个候选容器标识对应的候选容器用于存储多媒体资源;每个候选容器标识基于每个候选容器对应的类别标识确定;解析每个候选容器标识,得到每个候选容器标识中预设位置的候选类别标识;基于类别等级关联关系,确定每个候选类别标识对应的优先等级,得到每个候选容器标识对应的优先等级;类别等级关联关系表征类别标识与优先等级的对应关系;基于多个候选容器标识各自对应的优先等级,确定目标容器标识;目标容器标识对应的优先等级高于预设容器标识对应的优先等级;预设容器标识为多个候选容器标识中除目标容器标识之外的容器标识;释放目标容器标识所对应的目标容器中的目标多媒体资源。本公开在生成容器标识的过程中加入了容器对应的级别信息,可以根据容器的级别信息确定容器优先级,从而从多个候选容器中筛选出级别较低的容器作为目标容器,并释放目标容器中的多媒体资源;实现了自动确定内存释放容器,实现了内存的自动化释放管理,并且提高了内存释放效率。
Smart Images

Figure CN116010028B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a resource release method, apparatus, electronic device, and storage medium. Background Technology
[0002] In related technologies, in the process of multimedia resource management, especially for audio resources in game applications, a container (bank) resource management scheme is usually written according to the game type and game logic, without considering how to automatically manage the bank memory. Summary of the Invention
[0003] This disclosure provides a resource release method, apparatus, electronic device, and storage medium to at least solve the problem of the inability to automatically manage container memory in related technologies. The technical solution of this disclosure is as follows: According to a first aspect of the present disclosure, a resource release method is provided, comprising: Based on the resource release request, multiple candidate container identifiers are determined; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container. Parse each candidate container identifier to obtain the candidate category identifier at a preset position in each candidate container identifier; Based on the category-level association relationship, the priority level corresponding to each candidate category identifier is determined, and the priority level corresponding to each candidate container identifier is obtained; the category-level association relationship represents the correspondence between category identifiers and priority levels; A target container identifier is determined based on the priority levels corresponding to the multiple candidate container identifiers; the priority level of the target container identifier is higher than the priority level of a preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers. Release the target multimedia resources in the target container corresponding to the target container identifier.
[0004] In one exemplary embodiment, the method for generating the candidate container identifier includes: Determine the candidate category identifier corresponding to the candidate container; the multimedia resources stored in the candidate container are matched with the candidate category identifier; Based on the candidate category identifier, a candidate container identifier corresponding to the candidate container is generated; the candidate category identifier is located at the preset position in the candidate container identifier.
[0005] In one exemplary embodiment, the method further includes: Determine the resource identifier of the multimedia resource; A multimedia resource library is constructed based on the correspondence between the multimedia resources and the resource identifiers; Obtain the candidate container identifier and event identifier corresponding to the multimedia resource; A resource configuration database is constructed based on the correspondence between the resource identifier, candidate container identifier, and event identifier of the multimedia resources.
[0006] In one exemplary embodiment, the method further includes: Receive a resource acquisition request sent by a first terminal, wherein the resource acquisition request carries a first resource identifier; Based on the first resource identifier, a multimedia resource matching the first resource identifier is searched in the multimedia resource library to obtain the first resource; Send the first resource to the first terminal.
[0007] In one exemplary embodiment, the method further includes: Receive an identifier update request sent by a second terminal, the identifier update request carrying a second resource identifier and an identifier to be updated, the identifier to be updated including at least one of an identifier to be updated container identifier and an identifier to be updated event identifier; Based on the identifier update request, a second identifier matching the second resource identifier is searched from the resource configuration database; the second identifier includes at least one of a second container identifier and a second event identifier; the second identifier is of the same type as the identifier to be updated. Replace the second identifier in the resource configuration database with the identifier to be updated.
[0008] In one exemplary implementation, determining a plurality of candidate container identifiers includes: Obtain multiple initial container identifiers; Based on the playback status of the multimedia resources in the initial container corresponding to each initial container identifier, determine the reference count corresponding to each of the multiple initial container identifiers. Multiple initial container identifiers with reference counts less than a preset threshold are identified as the multiple candidate container identifiers.
[0009] In one exemplary implementation, releasing the target multimedia resource in the target container corresponding to the target container identifier includes: The container corresponding to the target container identifier is identified as the target container; Obtain the target multimedia resources in the target container; Delete the target multimedia resource from the target container.
[0010] According to a second aspect of the present disclosure, a resource release device is provided, comprising: The container identifier determination module is configured to determine multiple candidate container identifiers based on resource release requests; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container. The category identifier determination module is configured to parse each candidate container identifier to obtain the candidate category identifier at a preset position in each candidate container identifier; The priority determination module is configured to determine the priority level corresponding to each candidate category identifier based on the category-level association relationship, thereby obtaining the priority level corresponding to each candidate container identifier; the category-level association relationship represents the correspondence between category identifiers and priority levels; The target identifier determination module is configured to determine a target container identifier based on the priority levels corresponding to the plurality of candidate container identifiers; the priority level of the target container identifier is higher than the priority level of a preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the plurality of candidate container identifiers. The resource release module is configured to release the target multimedia resources in the target container corresponding to the target container identifier.
[0011] In one exemplary embodiment, the apparatus further includes: The candidate category identifier determination module is configured to determine the candidate category identifier corresponding to the candidate container; the multimedia resources stored in the candidate container are matched with the candidate category identifier; The candidate container identifier generation module is configured to generate a candidate container identifier corresponding to the candidate container based on the candidate category identifier; the candidate category identifier is located at the preset position in the candidate container identifier.
[0012] In one exemplary embodiment, the apparatus further includes: The resource identifier determination module is configured to determine the resource identifier of the multimedia resource; The multimedia resource library construction module is configured to construct a multimedia resource library based on the correspondence between the multimedia resources and the resource identifiers; The identifier acquisition module is configured to acquire the candidate container identifier and event identifier corresponding to the multimedia resource; The database construction module is configured to construct a resource configuration database based on the correspondence between the resource identifier, candidate container identifier, and event identifier of the multimedia resources.
[0013] In one exemplary embodiment, the apparatus further includes: The first request receiving module is configured to receive a resource acquisition request sent by a first terminal, wherein the resource acquisition request carries a first resource identifier; The first resource search module is configured to perform a search for multimedia resources that match the first resource identifier in the multimedia resource library based on the first resource identifier, and obtain the first resource. The first resource sending module is configured to send the first resource to the first terminal.
[0014] In one exemplary embodiment, the apparatus further includes: The identifier update request receiving module is configured to receive an identifier update request sent by a second terminal. The identifier update request carries a second resource identifier and an identifier to be updated. The identifier to be updated includes at least one of an identifier to be updated container identifier and an identifier to be updated event identifier. The second identifier lookup module is configured to perform a search for a second identifier that matches the second resource identifier in the resource configuration database based on the identifier update request; the second identifier includes at least one of a second container identifier and a second event identifier; the second identifier is of the same type as the identifier to be updated. The identifier replacement module is configured to replace the second identifier in the resource configuration database with the identifier to be updated.
[0015] In one exemplary embodiment, the container identification determination module includes: The identifier acquisition unit is configured to acquire multiple initial container identifiers; The reference count determination unit is configured to determine the reference count corresponding to each of the plurality of initial container identifiers based on the playback status of the multimedia resources in the initial container corresponding to each initial container identifier. The candidate container identifier determination unit is configured to determine a plurality of initial container identifiers with reference counts less than a preset threshold as the plurality of candidate container identifiers.
[0016] In one exemplary embodiment, the resource release module includes: The target container determination unit is configured to determine the container corresponding to the target container identifier as the target container; The target multimedia resource acquisition unit is configured to acquire the target multimedia resources in the target container. The deletion unit is configured to delete the target multimedia resource from the target container.
[0017] According to a third aspect of the present disclosure, an electronic device is provided, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the resource release method described above.
[0018] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by an electronic device processor, enables the electronic device to perform the resource release method as described above.
[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the resource release method as described above.
[0020] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects: This disclosure determines multiple candidate container identifiers based on resource release requests; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container; each candidate container identifier is parsed to obtain a candidate category identifier at a preset position within each candidate container identifier; based on category level association, the priority level corresponding to each candidate category identifier is determined, thus obtaining the priority level corresponding to each candidate container identifier; the category level association represents the correspondence between category identifiers and priority levels; based on the priority levels corresponding to each of the multiple candidate container identifiers, a target container identifier is determined; the priority level corresponding to the target container identifier is higher than the priority level corresponding to the preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers; the target multimedia resources in the target container corresponding to the target container identifier are released. This disclosure incorporates the level information corresponding to the container during the container identifier generation process, which can determine the container priority based on the container level information, thereby selecting the lower-level container as the target container from multiple candidate containers and releasing the multimedia resources in the target container; it achieves automatic determination of the memory release container, realizes automated memory release management, and improves memory release efficiency.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0023] Figure 1 This is an application environment diagram illustrating a resource release method according to an exemplary embodiment.
[0024] Figure 2 This is a flowchart illustrating a resource release method according to an exemplary embodiment.
[0025] Figure 3 This is a flowchart illustrating a method for generating candidate container identifiers according to an exemplary embodiment.
[0026] Figure 4 This is a flowchart illustrating a method for determining multiple candidate container identifiers according to an exemplary embodiment.
[0027] Figure 5 This is a flowchart illustrating a method for determining a reference count according to an exemplary embodiment.
[0028] Figure 6 This is a flowchart illustrating an audio resource release method according to an exemplary embodiment.
[0029] Figure 7 This is a flowchart illustrating a method for releasing target multimedia resources in a target container corresponding to the aforementioned target container identifier, according to an exemplary embodiment.
[0030] Figure 8 This is a flowchart illustrating a method for constructing a resource configuration database according to an exemplary embodiment.
[0031] Figure 9 This is a flowchart illustrating an information editing page of a second terminal according to an exemplary embodiment.
[0032] Figure 10 This is a block diagram illustrating a resource release device according to an exemplary embodiment.
[0033] Figure 11 This is a block diagram illustrating an electronic device for resource release according to an exemplary embodiment. Detailed Implementation
[0034] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0035] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0036] To improve memory release efficiency, this disclosure provides a resource release method, apparatus, electronic device, and storage medium.
[0037] Please see Figure 1 The diagram illustrates an application environment for a resource release method according to an exemplary embodiment. The application environment may include a server 01 and a client 02.
[0038] Specifically, in the embodiments of this specification, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. It may also be a cloud server providing 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, and memory, etc. Specifically, server 01 can be used to determine multiple candidate container identifiers, filter out the target container identifier from the multiple candidate container identifiers, and release memory.
[0039] Specifically, in the embodiments of this specification, the aforementioned client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, and in-vehicle terminals, and may also include software running on the physical device, such as web pages provided to users by some service providers, or applications provided to users by these service providers. Specifically, the aforementioned client 02 can be used to display the target container identifier and the multimedia resource identifier corresponding to the target container identifier.
[0040] Figure 2 This is a flowchart illustrating a resource release method according to an exemplary embodiment, such as... Figure 2 As shown, this method can be applied to Figure 1 The server 01 shown includes the following steps.
[0041] In step S201, based on the resource release request, multiple candidate container identifiers are determined; the candidate container corresponding to each candidate container identifier is used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container. In this embodiment of the disclosure, each candidate container identifier corresponds to a candidate container used to store a type of multimedia resource; the category identifier corresponding to each candidate container is used to characterize the resource category of the multimedia resource stored in the candidate container; when the multimedia resource is an audio resource in a game application or other application, the resource category of the audio resource may include, but is not limited to, music, character voices, character skill sound effects, ambient sounds, interactive control sounds, plot sound effects, etc. After determining the resource category of the multimedia resource, a category identifier can be determined based on the resource category; in some embodiments, an abbreviation of the resource category can be used as the category identifier, or the resource category can be digitized to obtain the category identifier, which may include, but is not limited to, characters or images.
[0042] In some embodiments, the resource release request may be generated in response to a memory release instruction or based on internal alarm information of the device; if the resource release request is an alarm message of the device, the memory capacity to be released may be determined according to the urgency of the alarm message and carried in the resource release request.
[0043] In the embodiments disclosed herein, such as Figure 3 As shown, the method for generating the above candidate container identifiers includes: In step S301, the candidate category identifier corresponding to the above candidate container is determined; the multimedia resources stored in the above candidate container match the above candidate category identifier; In this embodiment of the disclosure, multimedia resources can be divided into multiple resource categories, and multiple containers can be set to store multimedia resources of different resource categories. Each resource category corresponds to a category identifier, and each container stores multimedia resources of one category. For audio resources, for example, for a sound engine (wwise), the container can be a bank file. The candidate category identifier can be used to characterize the resource category of the multimedia resources stored in the candidate container corresponding to the candidate container identifier. The multimedia resources stored in the candidate container match the candidate category identifier of the candidate container.
[0044] In step S303, a candidate container identifier corresponding to the candidate container is generated based on the candidate category identifier; the candidate category identifier is located at a preset position in the candidate container identifier.
[0045] In this embodiment of the disclosure, a candidate container identifier can be generated based on the candidate category identifier; the candidate category identifier can be set in a preset position in the candidate container identifier, and the preset position may include, but is not limited to, a prefix or suffix in the candidate container identifier, that is, the candidate container identifier uses the candidate category identifier as a prefix or suffix.
[0046] In this embodiment of the disclosure, a candidate container identifier can be generated by using the category identifier of the multimedia resources stored in the candidate container. The candidate container identifier includes a candidate category identifier, which facilitates the subsequent determination of the priority level of the candidate container based on the candidate category identifier, thereby enabling the rapid selection of the target container identifier from multiple candidate container identifiers.
[0047] In some embodiments, such as Figure 4 As shown, the above identifies multiple candidate container identifiers, including: In step S20101, multiple initial container identifiers are obtained; In this embodiment of the disclosure, all initial container identifiers in the application platform can be obtained based on the application platform targeted by the resource release request; and multiple candidate container identifiers can be selected from them. The method for generating each initial container identifier is similar to the method for generating candidate container identifiers.
[0048] In step S20103, the reference count corresponding to each of the above initial container identifiers is determined according to the playback status of the multimedia resources in the initial container corresponding to each initial container identifier. In some embodiments, determining the reference count corresponding to each of the plurality of initial container identifiers based on the playback status of the multimedia resources in the initial container corresponding to each initial container identifier includes: Get the playback status of multimedia resources in the initial container corresponding to each initial container identifier; In this embodiment of the disclosure, if the initial container includes a multimedia resource, the reference count of the multimedia resource can be determined according to the playback status of the multimedia resource in the initial container, and the reference count of the multimedia resource can be determined as the reference count corresponding to the initial container identifier.
[0049] Determine the reference count for each of the aforementioned initial container identifiers; In this embodiment of the disclosure, the reference count of each initial container can be determined based on the reference count of the multimedia resources in each initial container.
[0050] In some embodiments, such as Figure 5 As shown, Figure 5 A flowchart of a method for determining reference counts, including: In step S501, the terminal responds to the audio resource playback request and determines whether the audio resource is in memory based on the first audio resource identifier carried in the request; In step S503, if the audio resource is not in memory, the terminal loads the audio resource synchronously or asynchronously. In step S505, if the audio resource is in memory, the terminal locates and plays the audio resource; In step S507, the terminal sends a playback message to the container to increment the container's reference count by 1 based on the current reference count, thereby obtaining an updated reference count; In step S509, the terminal responds to the audio resource stop playback request and determines the second audio resource identifier; In step S5011, the terminal stops playing the audio resource corresponding to the second audio resource identifier according to the second audio resource identifier carried in the request; In step S5013, the terminal sends a playback stop message to the container, or sends a playback end message to the container when the audio resource corresponding to the first audio resource identifier finishes playing, so that the container decrements the current reference count by 1 and obtains an updated reference count.
[0051] In this embodiment of the disclosure, the reference count for each container can be determined based on the playback status of the multimedia resources in the terminal corresponding to each container.
[0052] In step S20105, multiple initial container identifiers with reference counts less than a preset threshold are identified as the multiple candidate container identifiers.
[0053] In this embodiment of the disclosure, the preset threshold can be 1, which can determine multiple initial container identifiers with a reference count of 0 as candidate container identifiers.
[0054] In some embodiments, if the initial container includes multiple multimedia resources, the reference count corresponding to each multimedia resource is determined; and the multimedia resource with a reference count of 0 is determined as the target multimedia resource, thereby determining the initial container including the target multimedia resource as a candidate container and obtaining the candidate container identifier; the reference count can characterize the reference status of the multimedia resource; if the reference count is 0, it is determined that no one references the multimedia resource.
[0055] In some embodiments, such as Figure 6 As shown, Figure 6 A flowchart of an audio resource release method includes: In step S601, an audio resource release request is received; In step S603, without setting container priority, the target container identifier is determined from multiple container identifiers based on the reference count, and the audio resources with a reference count of 0 in the memory of the target container corresponding to the target container identifier are released. In step S605, with container priority set, multiple candidate container identifiers corresponding to audio resources with a reference count of 0 are obtained; and the target container identifier is determined according to the priority corresponding to each candidate container identifier, and the audio resources with a reference count of 0 in the memory of the target container corresponding to the target container identifier are released. In step S607, a resource release request is generated based on the device's memory alarm information. The memory capacity to be released can be determined according to the urgency of the memory alarm. Then, the process jumps to step S605. Based on the memory capacity to be released, the number of target container identifiers can be determined, and memory release can be performed.
[0056] In this embodiment of the disclosure, the reference count corresponding to each initial container identifier can be determined based on the playback status of the multimedia resources in the containers corresponding to the multiple initial container identifiers; thereby, multiple initial container identifiers with reference counts less than a preset threshold are identified as candidate container identifiers, thus ensuring that the released resources are idle resources.
[0057] In step S203, each candidate container identifier is parsed to obtain the candidate category identifier at a preset position in each candidate container identifier.
[0058] In this embodiment of the disclosure, the preset position may include, but is not limited to, a prefix or suffix of the candidate container identifier. The preset position can be determined according to the method for generating the candidate container identifier, thereby determining the candidate category identifier. The candidate category identifier is used to characterize the category of multimedia resources stored in the container corresponding to the candidate container identifier.
[0059] In step S205, based on the category-level association relationship, the priority level corresponding to each candidate category identifier is determined, and the priority level corresponding to each candidate container identifier is obtained; the above category-level association relationship represents the correspondence between category identifiers and priority levels.
[0060] In this embodiment of the disclosure, category-level association relationships can be pre-constructed and stored; priority levels corresponding to each category identifier can be pre-set to construct category-level association relationships; the category-level association relationships include the mapping relationship between category identifiers and priority levels.
[0061] In an exemplary embodiment, as shown in Table 1, Table 1 is a category-level association table of audio resources in a game application; wherein, the category identifier is an abbreviation of the resource category, and when generating the container identifier, the category identifier is a prefix in the container identifier.
[0062] Table 1
[0063] The smaller the number corresponding to the priority, the higher the priority level. You can also set a larger value for a higher priority level according to actual needs.
[0064] In step S207, a target container identifier is determined based on the priority levels corresponding to the multiple candidate container identifiers. The priority level of the target container identifier is higher than the priority level of the preset container identifier. The preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers.
[0065] In this embodiment of the disclosure, the number of target container identifiers can be determined based on the memory capacity to be released carried in the resource release request; multiple candidate container identifiers can be sorted according to their respective priority levels to obtain a sorting result; for example, multiple candidate container identifiers can be sorted from high to low according to their respective priority levels, and one or more candidate container identifiers at the top of the sorting can be determined as target container identifiers; the number of target container identifiers is determined based on the number of multimedia resources in each target container and the memory capacity to be released; if the memory capacity to be released is small, the number of target container identifiers is small; if the memory capacity to be released is large, the number of target container identifiers is large.
[0066] In step S209, the target multimedia resources in the target container corresponding to the target container identifier are released.
[0067] In some embodiments, such as Figure 7 As shown, releasing the target multimedia resources in the target container corresponding to the target container identifier includes: In step S2091, the container corresponding to the above target container identifier is identified as the target container; In step S2093, the target multimedia resources in the target container are obtained; In this embodiment of the disclosure, the target multimedia resource is a resource with a reference count of 0; when the target container includes multiple target multimedia resources, the number of target multimedia resources can be determined according to the memory capacity to be released carried in the resource release request.
[0068] In step S2095, the target multimedia resource is deleted from the target container.
[0069] In this embodiment of the disclosure, after determining the target container and the target multimedia resources in the target container, the target multimedia resources can be deleted from the target container.
[0070] In this embodiment of the disclosure, after determining the target container identifier, the target multimedia resource in the target container corresponding to the target container identifier can be deleted, thereby achieving automatic memory release without affecting the user's experience of browsing multimedia resources.
[0071] In this embodiment of the disclosure, such as Figure 8 As shown, the above method also includes: In step S801, the resource identifier of the aforementioned multimedia resource is determined; In this embodiment of the disclosure, the resource identifier is a unique identifier for the allocation of multimedia resources. The resource identifier of a multimedia resource is fixed relative to the multimedia resource and will not change with the change of the candidate container identifier and the event identifier.
[0072] In step S803, a multimedia resource library is constructed based on the correspondence between the multimedia resources and the resource identifiers. In this embodiment of the disclosure, the correspondence between multimedia resources and resource identifiers can be stored in the multimedia resource library; the relationship between the two can be one-to-one or many-to-one.
[0073] In step S805, the candidate container identifier and event identifier corresponding to the above multimedia resources are obtained; In this embodiment of the disclosure, the candidate container identifier corresponding to the multimedia resource represents the storage container corresponding to the multimedia resource, and the event identifier represents the identifier of the multimedia resource in the storage container; one candidate container identifier corresponds to one or more event identifiers.
[0074] In step S807, a resource configuration database is constructed based on the correspondence between the resource identifier, candidate container identifier, and event identifier of the multimedia resources.
[0075] In this embodiment, the resource identifier, candidate container identifier, and event identifier of the multimedia resource can have a one-to-one correspondence. The resource identifier is a unique identifier configured by the system for the multimedia resource and will not change due to changes in the candidate container identifier and event identifier, thus facilitating developers to query the multimedia resource. The candidate container identifier and event identifier are identifiers set by the developers of the multimedia resource, and the developers of the multimedia resource can change the candidate container identifier and event identifier at any time.
[0076] In some embodiments, constructing a resource configuration database based on the correspondence between the resource identifier, candidate container identifier, and event identifier of the multimedia resources includes: Obtain the event number of the aforementioned multimedia resource and the candidate container number of the corresponding candidate container for the multimedia resource; In this embodiment of the disclosure, the resource identifier is the Event Number, which is an identifier automatically configured by the system; the event identifier corresponding to the multimedia resource is the Event Name, and the event number is the Event ID; the candidate container number is the Bank ID, which can be set independently by the developer of the multimedia resource.
[0077] A first database is constructed based on the resource identifier, event identifier, candidate container number, and the correspondence between event numbers corresponding to multimedia resources. In some embodiments, as shown in Table 2, which is a schematic diagram of the first database, the resource identifier is the Event Number, the event identifier corresponding to the multimedia resource is the Event Name, the candidate container number is the Bank ID, and the event number is the EventID.
[0078] Table 2
[0079] Based on the correspondence between the candidate container numbers and candidate container identifiers of the aforementioned multimedia resources, a second database is constructed; In this embodiment of the disclosure, the category identifier of the candidate container can be determined based on the prefix of the candidate container identifier, thereby determining the priority level corresponding to the candidate container identifier; and a second database can be constructed based on the correspondence between the candidate container number, the candidate container identifier and the priority level of the multimedia resource.
[0080] In some embodiments, as shown in Table 3, which is a schematic diagram of the second database, the candidate container number is Bank ID and the candidate container identifier is Bank Name; the priority includes five levels from 0 to 4, with the smaller the value, the higher the priority level.
[0081] Table 3
[0082] Based on the first database and the second database, determine the resource configuration database.
[0083] In this embodiment of the disclosure, the first database and the second database can be identified as resource configuration databases. During the application process, the candidate container number can be determined first based on the first database, and then the candidate container identifier corresponding to the candidate container number can be found based on the second database, thereby determining the priority information corresponding to the candidate container.
[0084] In this embodiment of the disclosure, compared with the related technology that uses two fields, container identifier and event identifier, to store resources, this disclosure uses only one field, resource identifier, to store resources, which reduces the requirements for resource storage space; and a multimedia resource library is constructed based on the resource identifier of the multimedia resources, so that application platform program developers can quickly find multimedia resources based on the resource identifier.
[0085] In some embodiments, the above method further includes: Receive a resource acquisition request sent by the first terminal, wherein the resource acquisition request carries a first resource identifier; In this embodiment of the disclosure, the first terminal can be the terminal corresponding to the program developer of the application platform, which can quickly find the corresponding resource through the first resource identifier.
[0086] Based on the aforementioned first resource identifier, a multimedia resource matching the aforementioned first resource identifier is searched in the aforementioned multimedia resource library to obtain the first resource; In this embodiment of the disclosure, a pre-built multimedia resource library facilitates the quick search for multimedia resources that match the aforementioned first resource identifier, thereby obtaining the first resource.
[0087] Send the first resource to the first terminal.
[0088] In this embodiment of the disclosure, after the first resource is found, the first resource can be sent to the first terminal.
[0089] In this embodiment of the disclosure, the first terminal user can search for the required resources in the multimedia resource library through the resource identifier, thereby achieving rapid acquisition of the first resource.
[0090] In some embodiments, the above method further includes: Receive an identifier update request sent by a second terminal, wherein the identifier update request carries a second resource identifier and an identifier to be updated, wherein the identifier to be updated includes at least one of an identifier to be updated container identifier and an identifier to be updated event identifier; In this embodiment, the second terminal can be a developer of multimedia resources, and the user of the second terminal can update and adjust the container identifier and event identifier of the resources at any time. The second resource identifier is the identifier of the multimedia resource that needs to be updated, and the second resource identifier will not change during the information update process.
[0091] In some embodiments, an information editing page may be displayed on the second terminal, the page including a second resource identifier, a container identifier filter control, and an event identifier filter control; in an exemplary embodiment, such as Figure 9 As shown, Figure 9This is an information editing page for a second terminal; this page is an audio resource settings page in a game application, including a first area and a second area. The first area displays multiple audio-related information setting controls, making it easy for users to quickly set audio effects; the second area displays a second resource identifier, a container identifier filter control, and an event identifier filter control. The filtered container identifier is SCIN-xx.bnk, and the filtered event identifier is xxx01.
[0092] Based on the aforementioned identifier update request, a second identifier matching the aforementioned second resource identifier is searched from the aforementioned resource configuration database; the aforementioned second identifier includes at least one of a second container identifier and a second event identifier; the aforementioned second identifier is of the same type as the aforementioned identifier to be updated. In some embodiments, a second identifier matching the second resource identifier can be found from the resource configuration database according to the identifier update request; when the identifier to be updated is the container identifier to be updated, the second identifier is the second container identifier; when the identifier to be updated is the event identifier to be updated, the second identifier is the second event identifier; when the identifier to be updated is both the container identifier to be updated and the event identifier to be updated, the second identifier is both the second container identifier and the second event identifier.
[0093] Replace the second identifier in the resource configuration database with the identifier to be updated.
[0094] In this embodiment of the disclosure, when the identifier to be updated is the identifier of the container to be updated and the second identifier is the identifier of the second container, the identifier of the second container in the resource configuration database is replaced with the identifier of the container to be updated; when the identifier to be updated is the identifier of the event to be updated and the second identifier is the identifier of the second event, the identifier of the second event in the resource configuration database is replaced with the identifier of the event to be updated; when the identifier to be updated is both the identifier of the container to be updated and the identifier of the event to be updated, and the second identifier is both the identifier of the second container and the identifier of the second event, the identifier of the second container in the resource configuration database is replaced with the identifier of the container to be updated and the identifier of the second event is replaced with the identifier of the event to be updated.
[0095] In this embodiment of the disclosure, the developers of multimedia resources can update the container identifier and event identifier in the resource configuration database at any time, while keeping the resource identifier unchanged during the information update process; thereby improving the efficiency of information configuration and not affecting the application platform's program developers in querying multimedia resources.
[0096] This disclosure determines multiple candidate container identifiers based on resource release requests; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container; each candidate container identifier is parsed to obtain a candidate category identifier at a preset position within each candidate container identifier; based on category level association, the priority level corresponding to each candidate category identifier is determined, thus obtaining the priority level corresponding to each candidate container identifier; the category level association represents the correspondence between category identifiers and priority levels; based on the priority levels corresponding to each of the multiple candidate container identifiers, a target container identifier is determined; the priority level corresponding to the target container identifier is higher than the priority level corresponding to the preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers; the target multimedia resources in the target container corresponding to the target container identifier are released. This disclosure incorporates the level information corresponding to the container during the container identifier generation process, which can determine the container priority based on the container level information, thereby selecting the lower-level container as the target container from multiple candidate containers and releasing the multimedia resources in the target container; it achieves automatic determination of the memory release container, realizes automated memory release management, and improves memory release efficiency.
[0097] Figure 10 This is a block diagram illustrating a resource release device according to an exemplary embodiment. (Refer to...) Figure 10 The device includes: The container identifier determination module 1010 is configured to determine multiple candidate container identifiers based on resource release requests; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container. The category identifier determination module 1020 is configured to parse each candidate container identifier to obtain the candidate category identifier at a preset position in each candidate container identifier; The grade determination module 1030 is configured to perform a priority level determination based on the category grade association relationship, thereby obtaining the priority level corresponding to each candidate category identifier; the above category grade association relationship represents the correspondence between category identifiers and priority levels; The target identifier determination module 1040 is configured to determine a target container identifier based on the priority levels corresponding to the multiple candidate container identifiers; the priority level of the target container identifier is higher than the priority level of a preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers. The resource release module 1050 is configured to release the target multimedia resources in the target container corresponding to the target container identifier mentioned above.
[0098] In one exemplary embodiment, the above-described apparatus further includes: The candidate category identifier determination module is configured to determine the candidate category identifier corresponding to the above candidate container; the multimedia resources stored in the above candidate container match the above candidate category identifier; The candidate container identifier generation module is configured to generate a candidate container identifier corresponding to the candidate container based on the candidate category identifier; the candidate category identifier is located at the preset position in the candidate container identifier.
[0099] In one exemplary embodiment, the above-described apparatus further includes: The resource identifier determination module is configured to determine the resource identifier of the aforementioned multimedia resources; The multimedia resource library construction module is configured to construct a multimedia resource library based on the correspondence between the multimedia resources and the resource identifiers mentioned above. The identifier acquisition module is configured to acquire the candidate container identifier and event identifier corresponding to the aforementioned multimedia resources; The database construction module is configured to construct a resource configuration database based on the correspondence between the resource identifiers, candidate container identifiers, and event identifiers of the aforementioned multimedia resources.
[0100] In one exemplary embodiment, the above-described apparatus further includes: The first request receiving module is configured to receive a resource acquisition request sent by the first terminal, wherein the resource acquisition request carries a first resource identifier. The first resource search module is configured to perform a search for multimedia resources that match the first resource identifier in the multimedia resource library based on the first resource identifier, and obtain the first resource. The first resource sending module is configured to send the first resource to the first terminal.
[0101] In one exemplary embodiment, the above-described apparatus further includes: The identifier update request receiving module is configured to receive an identifier update request sent by a second terminal. The identifier update request carries a second resource identifier and an identifier to be updated. The identifier to be updated includes at least one of an identifier to be updated container identifier and an identifier to be updated event identifier. The second identifier lookup module is configured to perform an operation based on the identifier update request to search the resource configuration database for a second identifier that matches the second resource identifier; the second identifier includes at least one of a second container identifier and a second event identifier; the second identifier is of the same type as the identifier to be updated. The identifier replacement module is configured to replace the second identifier in the resource configuration database with the identifier to be updated.
[0102] In one exemplary embodiment, the container identification determination module includes: The identifier acquisition unit is configured to acquire multiple initial container identifiers; The reference count determination unit is configured to determine the reference count corresponding to each of the multiple initial container identifiers based on the playback status of the multimedia resources in the initial container corresponding to each initial container identifier. The candidate container identifier determination unit is configured to determine multiple initial container identifiers with reference counts less than a preset threshold as the aforementioned multiple candidate container identifiers.
[0103] In one exemplary embodiment, the resource release module includes: The target container determination unit is configured to determine the container corresponding to the aforementioned target container identifier as the target container; The target multimedia resource acquisition unit is configured to acquire the target multimedia resources in the aforementioned target container; The deletion unit is configured to delete the aforementioned target multimedia resource from the aforementioned target container.
[0104] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0105] In one exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, it implements the resource release method provided in any of the above embodiments.
[0106] The electronic device can be a terminal, a server, or a similar computing device. Taking a server as an example... Figure 11 This is a block diagram illustrating an electronic device according to an exemplary embodiment, such as... Figure 11As shown, the server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1110 (CPUs 1110 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1130 for storing data, and one or more storage media 1120 (e.g., one or more mass storage devices) for storing application programs 1123 or data 1122. The memory 1130 and storage media 1120 may be temporary or persistent storage. The program stored in the storage media 1120 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 1110 may be configured to communicate with the storage media 1120 and execute the series of instruction operations stored in the storage media 1120 on the server 1100. Server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1140, and / or one or more operating systems 1121, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0107] The input / output interface 1140 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1100. In one example, the input / output interface 1140 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1140 may be a radio frequency (RF) module used for wireless communication with the Internet.
[0108] Those skilled in the art will understand that Figure 11 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1100 may also include... Figure 11 The more or fewer components shown, or having the same Figure 11 The different configurations shown.
[0109] In one exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as memory 1130 including instructions, which can be executed by the processor of server 1100 to perform the above-described method. Optionally, the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0110] In one exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the resource release method provided in any of the above embodiments.
[0111] This disclosure determines multiple candidate container identifiers based on resource release requests; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container; each candidate container identifier is parsed to obtain a candidate category identifier at a preset position within each candidate container identifier; based on category level association, the priority level corresponding to each candidate category identifier is determined, thus obtaining the priority level corresponding to each candidate container identifier; the category level association represents the correspondence between category identifiers and priority levels; based on the priority levels corresponding to each of the multiple candidate container identifiers, a target container identifier is determined; the priority level corresponding to the target container identifier is higher than the priority level corresponding to the preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers; the target multimedia resources in the target container corresponding to the target container identifier are released. This disclosure incorporates the level information corresponding to the container during the container identifier generation process, which can determine the container priority based on the container level information, thereby selecting the lower-level container as the target container from multiple candidate containers and releasing the multimedia resources in the target container; it achieves automatic determination of the memory release container, realizes automated memory release management, and improves memory release efficiency.
[0112] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0113] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0114] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A resource release method, characterized in that, include: Based on the resource release request, multiple candidate container identifiers are determined; each candidate container identifier corresponds to a candidate container used to store multimedia resources. Each candidate container identifier is determined based on the category identifier corresponding to each candidate container; Parse each candidate container identifier to obtain the candidate category identifier at a preset position in each candidate container identifier; Based on the category-level association relationship, the priority level corresponding to each candidate category identifier is determined, and the priority level corresponding to each candidate container identifier is obtained. The category hierarchy relationship represents the correspondence between category identifiers and priority levels; A target container identifier is determined based on the priority levels corresponding to the multiple candidate container identifiers; the priority level of the target container identifier is higher than the priority level of a preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the multiple candidate container identifiers. Release the target multimedia resources in the target container corresponding to the target container identifier; The method for generating the candidate container identifier includes: Determine the candidate category identifier corresponding to the candidate container; the multimedia resources stored in the candidate container are matched with the candidate category identifier; Based on the candidate category identifier, a candidate container identifier corresponding to the candidate container is generated; the candidate category identifier is located at the preset position in the candidate container identifier.
2. The method according to claim 1, characterized in that, The method further includes: Determine the resource identifier of the multimedia resource; A multimedia resource library is constructed based on the correspondence between the multimedia resources and the resource identifiers; Obtain the candidate container identifier and event identifier corresponding to the multimedia resource; A resource configuration database is constructed based on the correspondence between the resource identifier, candidate container identifier, and event identifier of the multimedia resources.
3. The method according to claim 2, characterized in that, The method further includes: Receive a resource acquisition request sent by a first terminal, wherein the resource acquisition request carries a first resource identifier; Based on the first resource identifier, a multimedia resource matching the first resource identifier is searched in the multimedia resource library to obtain the first resource; Send the first resource to the first terminal.
4. The method according to claim 2, characterized in that, The method further includes: Receive an identifier update request sent by a second terminal, the identifier update request carrying a second resource identifier and an identifier to be updated, the identifier to be updated including at least one of an identifier to be updated container identifier and an identifier to be updated event identifier; Based on the identifier update request, a second identifier matching the second resource identifier is searched from the resource configuration database; the second identifier includes at least one of a second container identifier and a second event identifier; the second identifier is of the same type as the identifier to be updated. Replace the second identifier in the resource configuration database with the identifier to be updated.
5. The method according to any one of claims 1-4, characterized in that, The determination of multiple candidate container identifiers includes: Obtain multiple initial container identifiers; Based on the playback status of the multimedia resources in the initial container corresponding to each initial container identifier, determine the reference count corresponding to each of the multiple initial container identifiers. Multiple initial container identifiers with reference counts less than a preset threshold are identified as the multiple candidate container identifiers.
6. The method according to any one of claims 1-4, characterized in that, Releasing the target multimedia resources in the target container corresponding to the target container identifier includes: The container corresponding to the target container identifier is identified as the target container; Obtain the target multimedia resources in the target container; Delete the target multimedia resource from the target container.
7. A resource release device, characterized in that, include: The container identifier determination module is configured to determine multiple candidate container identifiers based on resource release requests; each candidate container identifier corresponds to a candidate container used to store multimedia resources; each candidate container identifier is determined based on the category identifier corresponding to each candidate container. The category identifier determination module is configured to parse each candidate container identifier to obtain the candidate category identifier at a preset position in each candidate container identifier; The priority determination module is configured to determine the priority level corresponding to each candidate category identifier based on the category-level association relationship, and obtain the priority level corresponding to each candidate container identifier. The category hierarchy relationship represents the correspondence between category identifiers and priority levels; The target identifier determination module is configured to determine a target container identifier based on the priority levels corresponding to the plurality of candidate container identifiers; the priority level of the target container identifier is higher than the priority level of a preset container identifier; the preset container identifier is a container identifier other than the target container identifier among the plurality of candidate container identifiers. The resource release module is configured to release the target multimedia resources in the target container corresponding to the target container identifier; The candidate category identifier determination module is configured to determine the candidate category identifier corresponding to the candidate container; the multimedia resources stored in the candidate container are matched with the candidate category identifier; The candidate container identifier generation module is configured to generate a candidate container identifier corresponding to the candidate container based on the candidate category identifier. The candidate category identifier is located at the preset position in the candidate container identifier.
8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the resource release method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device is able to perform the resource release method as described in any one of claims 1-6.
Citation Information
Patent Citations
A memory release method and system
CN109947571A
Resource allocation method and system for cloud service and medium
CN112988377A