A dynamic resource management method, an intelligent terminal and a storage medium
By classifying, encoding, and sorting dynamic resources in the game engine, the problem of low loading efficiency is solved, and efficient loading and management of resources are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN RUNQIAN TECH CO LTD
- Filing Date
- 2023-02-02
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, game engines are inefficient when loading dynamic resources because redundant objects and redundant calculations are not effectively managed, resulting in inefficient resource traversal and loading.
By classifying dynamic resources to be loaded, encoding them according to their reference count, releasing resources with a reference code of 0, and sorting and marking the storage folders, the loading process is optimized to improve efficiency.
It effectively reduces the number of resources loaded, improves loading efficiency, reduces the probability of accidental release, and optimizes resource management.
Smart Images

Figure CN116204245B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource management, and in particular to a dynamic resource management method, a smart terminal, and a storage medium. Background Technology
[0002] An engine is a core component for developing programs or systems on an electronic platform. Developers use engines to build and implement the functions required by their programs or to assist in program operation. Common program engines include game engines, search engines, and antivirus engines. Engines store a large number of resources. For example, when a game developed using a game engine starts, it loads dynamic resources from the engine, such as texture bitmaps and model data, before the game can run normally.
[0003] In existing technologies, taking game engines as an example, a large number of redundant objects and redundant calculations are generated during game runtime. These redundant objects and redundant calculations are stored in the engine as dynamic resources. However, as the game runs for longer, the amount of useless resources, namely redundant objects and redundant calculations, stored in the engine memory increases. But when the game starts, all resources in the game engine are traversed and loaded. Therefore, the applicant believes that the method of traversing and loading all resources in the game engine will lead to low efficiency in loading dynamic resources. Summary of the Invention
[0004] To effectively improve the efficiency of loading dynamic resources, this application provides a dynamic resource management method, a smart terminal, and a storage medium.
[0005] Firstly, the dynamic resource management method provided in this application adopts the following technical solution:
[0006] A dynamic resource management method, comprising:
[0007] Obtain the resource type of each dynamic resource to be loaded, and classify all the dynamic resources to be loaded according to the resource type to obtain several resource types and several dynamic resources to be loaded under each resource type;
[0008] For each of the aforementioned resource types, allocate and store several dynamic resources to be loaded in folders.
[0009] The number of references to each dynamic resource to be loaded in each of the storage folders is obtained in real time by other dynamic resources to be loaded.
[0010] The reference count is used to encode the dynamic resource to be loaded, resulting in the reference code for each dynamic resource to be loaded.
[0011] When the reference code is 0, the dynamic resource to be loaded is marked as a released resource, and the released resource is released based on the preset release procedure, and the loading process is started.
[0012] By adopting the above technical solution, the dynamic resources to be loaded are first classified, and then the resources with a reference code of 0 are released. A reference code of 0 indicates that the dynamic resource to be loaded is not referenced by other dynamic resources to be loaded. Therefore, releasing the dynamic resources with a reference code of 0 helps to reduce the number of loaded resources and thus effectively improves the efficiency of loading dynamic resources.
[0013] Optionally, before encoding the dynamic resources to be loaded based on the number of references to obtain the reference encoding of each dynamic resource to be loaded, the following steps are included:
[0014] Monitor all the dynamic resources to be loaded and determine whether there are any new dynamic resources to be loaded.
[0015] If it exists, the newly added dynamic resource to be loaded is treated as a new resource, and the resource type of the new resource and the number of references of the new resource by other dynamic resources to be loaded are obtained. The new resource is then assigned to the storage folder corresponding to the resource type.
[0016] By adopting the above technical solution, the addition of new dynamic resources to be loaded is monitored, and the newly added dynamic resources to be loaded are allocated to the storage folder corresponding to the resource type, which is beneficial for the management of newly added dynamic resources to be loaded.
[0017] Optionally, after the dynamic resource to be loaded is released as a resource, the following steps are included:
[0018] Determine whether the released resources are used by a preset program;
[0019] If used by the preset program, the mark on the released resource is removed, resulting in an unmarked dynamic resource to be loaded, and the dynamic resource to be loaded is stored in the corresponding storage folder;
[0020] If the resource is not used by the preset program, the step of releasing the resource based on the preset release program is executed.
[0021] By adopting the above technical solution, after the dynamic resource to be loaded is released as a resource, the usage status of the resource to be loaded by the preset program is further obtained to determine whether the dynamic resource to be loaded as a release resource should be released, thereby effectively reducing the probability of the dynamic resource to be loaded being released by mistake.
[0022] Optionally, after the allocation and storage folders for several dynamic resources to be loaded under each of the resource types, the following is included:
[0023] Important loading resources are obtained based on preset loading instructions;
[0024] Traverse all the storage folders to obtain the number of important loaded resources in each storage folder;
[0025] The storage folders are sorted based on the number of resources for each important loaded resource to obtain the loading level of each storage folder.
[0026] By adopting the above technical solution, the storage folders are sorted and the loading level of each storage folder is obtained, which is beneficial for the management of the storage folders.
[0027] Optionally, after sorting the storage folders based on the number of resources for each of the important loaded resources to obtain the load level of each storage folder, the process includes:
[0028] Obtain the non-critical loading resources, excluding the critical loading resources, from each of the storage folders;
[0029] The non-critical loaded resources are marked.
[0030] By adopting the above technical solution, marking non-critical loading resources is beneficial for the management of non-critical loading resources.
[0031] Optionally, after marking the non-critical loaded resources, the following steps are included:
[0032] Obtain the reference code and reference chain of the non-critical loaded resources in each of the storage folders;
[0033] When the reference code is not 0, determine whether the reference chain is a weak reference chain;
[0034] If it is a weak reference chain, retrieve all the non-critical loaded resources on the reference chain;
[0035] Release all non-critical loaded resources on the reference chain.
[0036] By adopting the above technical solution, after marking non-critical loaded resources, if the reference chain is a weak reference chain, all non-critical loaded resources on the reference chain are released, which facilitates the improvement of the efficiency of loading dynamic resources.
[0037] Optionally, prior to the startup loading process, the following steps are included:
[0038] Based on the preset release and load procedure, the released and loaded resources among all the dynamic resources to be loaded are obtained;
[0039] Retrieve all referenced resources that have been released from the loaded resources;
[0040] Release all referenced resources and release all loaded resources.
[0041] By adopting the above technical solution, after obtaining several resources to be released in the release procedure, the released resources and several referenced resources of the released resources are released, which effectively improves the efficiency of loading dynamic resources.
[0042] Secondly, the smart terminal provided in this application adopts the following technical solution:
[0043] A smart terminal includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor loads and executes the computer program, it employs the aforementioned dynamic resource management method.
[0044] By adopting the above technical solution, a computer program is generated by the above dynamic resource management method and stored in the memory for loading and execution by the processor. Thus, a smart terminal is made based on the memory and processor, which is convenient to use.
[0045] Thirdly, the computer-readable storage medium provided in this application adopts the following technical solution:
[0046] A computer-readable storage medium storing a computer program, wherein the computer program, when loaded and executed by a processor, employs the aforementioned dynamic resource management method.
[0047] By adopting the above technical solution, a computer program is generated by the above dynamic resource management method and stored in a computer-readable storage medium for loading and execution by a processor. The computer-readable storage medium facilitates the reading and storage of the computer program.
[0048] In summary, this application has at least one of the following beneficial technical effects:
[0049] 1. Releasing dynamic resources with a reference code of 0 helps reduce the number of resources to be loaded, thereby effectively improving the efficiency of loading dynamic resources.
[0050] 2. After marking non-critical loaded resources, if the reference chain is a weak reference chain, release all non-critical loaded resources on the reference chain to improve the efficiency of loading dynamic resources.
[0051] 3. After a dynamic resource to be loaded is released, further information is obtained regarding whether the resource is being used by a pre-defined program to determine whether to release the dynamic resource to be loaded, thereby effectively reducing the probability of the dynamic resource to be loaded being released accidentally. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application.
[0053] Figure 2 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application.
[0054] Figure 3 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application.
[0055] Figure 4 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application.
[0056] Figure 5 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application.
[0057] Figure 6 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application.
[0058] Figure 7 This is a flowchart illustrating one implementation of a dynamic resource management method according to an embodiment of this application. Detailed Implementation
[0059] The following is in conjunction with the appendix Figures 1 to 7 This application will be described in further detail.
[0060] This application discloses a dynamic resource management method.
[0061] Reference Figure 1 A dynamic resource management method includes the following steps:
[0062] S101. Obtain the resource type of each dynamic resource to be loaded, and classify all dynamic resources to be loaded according to resource type to obtain several resource types and several dynamic resources to be loaded under each resource type.
[0063] Dynamic resources awaiting loading refer to dynamic resources within the engine before the program starts; at this stage, these resources are not yet loaded. The engine includes both static and dynamic resources. Dynamic resources are those whose source code may change when accessed multiple times by a user; dynamic resources typically involve one or more database operations, such as JSP pages and Servlet programs. Static resources are those whose source code does not change when accessed multiple times by a user; static resources do not require database intervention in program processing, such as HTML, CSS, JS, and images.
[0064] The types of dynamic resources to be loaded include program types and file types with different extensions, such as asp, aspx, php, jsp, etc. Categorizing the dynamic resources to be loaded according to their resource types will yield several dynamic resources to be loaded under each resource type. For example, if there are 18 files with the asp extension, then there are 18 dynamic resources to be loaded under the asp file type.
[0065] S102. Allocate and store folders for several dynamic resources to be loaded under each resource type.
[0066] A storage folder refers to a folder used to store several dynamic resources to be loaded under a resource type. That is, the dynamic resources to be loaded stored in each storage folder are of the same resource type. For example, if resource type 'a' has 275 dynamic resources to be loaded, then all 275 dynamic resources to be loaded will be stored in storage folder 'a'.
[0067] S103. Real-time acquisition of the number of references of each dynamic resource to be loaded in each storage folder that is referenced by other dynamic resources to be loaded.
[0068] In practice, each dynamic resource to be loaded may be referenced by other dynamic resources to be loaded. The number of times a dynamic resource to be loaded is referenced is the reference count. For example, if dynamic resource 'a' is referenced by 5 other dynamic resources to be loaded, then the reference count is 5. Specifically, the reference count can be automatically counted through a preset statistics program.
[0069] S104. Encode the dynamic resources to be loaded based on the number of references to obtain the reference code for each dynamic resource to be loaded.
[0070] Since the number of references may vary in each load, i.e., the number of references is not fixed, the reference code of each dynamic resource to be loaded is also not fixed. For example, if the number of references to dynamic resource b is 4, then the reference code of dynamic resource b to be loaded is 4. That is, the number of references and the reference code are the same. If the number of references to dynamic resource b to be loaded is 6 in the nth load, then the reference code of dynamic resource b to be loaded is 6.
[0071] S105. When the reference code is 0, mark the dynamic resource to be loaded as a released resource, release the released resource based on the preset release procedure, and start the loading process.
[0072] When the reference code is 0, it indicates that the dynamic resource to be loaded is not referenced by other dynamic resources to be loaded. In this case, the dynamic resource with a reference code of 0 is determined to be a useless resource. It is then marked as a released resource and released based on a pre-defined release procedure. This reduces engine memory usage and effectively improves the loading efficiency of dynamic resources. In this embodiment, the release procedure refers to the destructor. The destructor is used to release the memory space occupied by the resource.
[0073] After the resources are released, the loading process begins. Taking a game as an example, when the game starts, the resources within the engine are released first, and then the program is loaded, thus initiating the loading process.
[0074] The implementation principle of this embodiment is as follows: First, the dynamic resources to be loaded are classified. After classification, the resources with reference codes of 0 are released. A reference code of 0 indicates that the dynamic resource to be loaded is not referenced by other dynamic resources to be loaded. Therefore, releasing the dynamic resources with reference codes of 0 helps to reduce the number of loaded resources and thus effectively improves the efficiency of loading dynamic resources.
[0075] exist Figure 1 Before step S104 in the illustrated embodiment, the storage folder can be monitored to determine whether there are any newly added dynamic resources to be loaded. Specifically, this is achieved through... Figure 2 The embodiments shown will be described in detail.
[0076] Reference Figure 2 Before encoding the dynamic resources to be loaded based on the number of references to obtain the reference code for each dynamic resource to be loaded, the following steps are included:
[0077] S201. Monitor all dynamic resources to be loaded and determine whether there are any newly added dynamic resources to be loaded.
[0078] Monitoring all dynamic resources awaiting loading can be done through built-in operating system programs or monitoring tools. Taking Windows as an example, Windows offers two methods for resource monitoring: the first is using LoadRunner; the second is using the built-in Windows performance tool Perfmon. By monitoring all dynamic resources awaiting loading, it's possible to determine if any new dynamic resources have been added.
[0079] S202. If it exists, treat the newly added dynamic resource to be loaded as a new resource, obtain the resource type of the new resource and the number of references of the new resource by other dynamic resources to be loaded, and assign the new resource to the storage folder corresponding to the resource type.
[0080] If there are newly added dynamic resources to be loaded, these new dynamic resources will be treated as new resources, and a storage folder will be assigned to them. Similar to step S102, the resource type of the new resource is first obtained, and then a storage folder can be assigned according to the resource type.
[0081] The dynamic resource management method provided in this embodiment monitors the addition of new dynamic resources to be loaded and assigns the newly added dynamic resources to the storage folder corresponding to the resource type, which is beneficial for managing the newly added dynamic resources to be loaded.
[0082] exist Figure 1 The steps in the illustrated embodiment, after marking the dynamic resource to be loaded as a released resource, allow for further verification of the usage of the released resource before releasing it, thereby reducing the probability of mistakenly releasing the dynamic resource to be loaded. Specifically, through... Figure 3 The embodiments shown will be described in detail.
[0083] Reference Figure 3 After treating the dynamic resources to be loaded as resources to be released, the following steps are included:
[0084] S301. Determine whether the released resources are used by the default program.
[0085] If the released resource is used by a pre-defined program, it means that the released resource is occupied by the pre-defined program and cannot be loaded. You can determine whether the released resource is occupied by a pre-defined program by searching and judging through the operating system's pre-defined resource manager.
[0086] S302. If the resource is used by the default program, remove the mark for releasing the resource, obtain the unmarked dynamic resource to be loaded, and store the dynamic resource to be loaded in the corresponding storage folder.
[0087] If the resource being released is being used by the default program, it cannot be released at this time. Therefore, the mark for the resource being released is removed. At this time, the released resource becomes a dynamic resource to be loaded and is stored in the storage folder corresponding to the resource type of the dynamic resource to be loaded.
[0088] S303. If the resource is not used by the default program, execute the steps of releasing the resource based on the default release program.
[0089] The dynamic resource management method provided in this embodiment further acquires information on whether the dynamic resource to be loaded is being used by a preset program after the dynamic resource to be loaded is released, in order to determine whether to release the dynamic resource to be loaded as a release resource, thereby effectively reducing the probability of the dynamic resource to be loaded being released by mistake.
[0090] exist Figure 1 After step S102 in the illustrated embodiment, after allocating storage folders for several dynamic resources to be loaded under each resource type, the storage folders can be sorted to facilitate management. Specifically, this is achieved through... Figure 4 The embodiments shown will be described in detail.
[0091] Reference Figure 4 After allocating and storing several dynamic resources to be loaded under each resource type in a designated folder, the following steps are included:
[0092] S401: Obtain important loading resources based on preset loading instructions.
[0093] Loading instructions are pre-defined and include manually selected important loading resources. Therefore, important loading resources can be obtained through loading instructions. Important loading resources refer to dynamic resources that are necessary for loading.
[0094] S402. Traverse all storage folders and obtain the number of important loaded resources in each storage folder.
[0095] By sequentially sifting through all storage folders, filtering out the important loading resources in each folder, and counting the important loading resources in each folder, the number of important loading resources in each folder can be obtained.
[0096] S403. Sort the storage folders based on the number of resources for each important loaded resource to obtain the loading level of each storage folder.
[0097] Loading level refers to the priority of a storage folder during loading; the higher the level, the higher the loading priority. In this embodiment, the more important loading resources a storage folder contains, the higher its ranking, meaning its loading level is higher. For example, if there are three storage folders, folder a, folder b, and folder c, where folder a contains 5 important loading resources, folder b contains 6, and folder c contains 4, then sorting folders a, b, and c will result in folder b, folder a, and folder c. Therefore, folder b has the highest loading level, and folder c has the lowest loading level.
[0098] The dynamic resource management method provided in this embodiment sorts the storage folders and obtains the load level of each storage folder, which is beneficial for managing the storage folders.
[0099] exist Figure 4 After step S402 of the illustrated embodiment, after sorting the storage folders, non-essential loading resources in the storage folders can be marked to facilitate the management of these resources. Specifically, through... Figure 5 The embodiments shown will be described in detail.
[0100] Reference Figure 5 After sorting the storage folders based on the number of resources for each important loaded resource to obtain the load level of each storage folder, the following steps are included:
[0101] S501. Obtain non-critical loading resources (excluding critical loading resources) from each storage folder.
[0102] Since important loading resources have already been obtained in step S401, the folder containing these resources, after removing them, contains only non-important loading resources. Non-important loading resources refer to resources that are not essential during the loading process.
[0103] S502, Mark non-critical loaded resources.
[0104] Specifically, non-critical loading resources can be located and marked using the resource management module built into the operating system. In this embodiment, after being marked, the name of a non-critical loading resource will have a "marked" label added to indicate that the resource is non-critical.
[0105] The dynamic resource management method provided in this embodiment marks non-critical loading resources, which is beneficial for the management of non-critical loading resources.
[0106] exist Figure 5 After step S502 of the illustrated implementation, after marking non-critical loading resources, it can be determined whether to release the non-critical loading resources by checking whether their reference chains are weak reference chains, thereby improving loading efficiency. Specifically, through... Figure 6 The embodiments shown will be described in detail.
[0107] Reference Figure 6 After marking non-critical loaded resources, the following steps are included:
[0108] S601. Obtain the reference code and reference chain of non-critical loaded resources in each storage folder.
[0109] After marking non-critical loaded resources, their reference codes are obtained, allowing the determination of their reference count. A reference chain refers to the chain of references between a non-critical loaded resource and other dynamically loaded resources. For example, if non-critical loaded resource 'a' references dynamically loaded resource 'b', the references between 'a' and 'b' are called the reference chain of non-critical loaded resource 'b'. In other words, knowing the reference information of non-critical loaded resources allows the retrieval of their reference chains.
[0110] S602. When the reference code is not 0, determine whether the reference chain is a weak reference chain.
[0111] If the reference code of a non-critical loaded resource is 0, it means that the non-critical loaded resource is treated as a released resource and released. If the reference code of a non-critical loaded resource is not 0, it means that the non-critical loaded resource has been referenced by other dynamic resources to be loaded. In this case, the reachability analysis algorithm can be used to determine whether the reference chain is a weak reference chain.
[0112] Reachability analysis algorithms determine whether a resource's reference chain is a strong or weak reference chain by judging whether it can be linked to a predefined GC Root node. Specifically, a weak reference, as opposed to a strong reference, refers to a reference whose weak reference does not guarantee that the referenced resource will not be released. A resource referenced only by a weak reference is considered inaccessible and may be released at any time.
[0113] S603. If it is a weak reference chain, retrieve all non-critical loaded resources on the reference chain.
[0114] If it is a weak reference chain, it means that the resources referenced by the non-critical loaded resources cannot be guaranteed not to be released. In this case, all non-critical loaded resources on the reference chain are retrieved. It should be noted that in this embodiment, there may be critical loaded resources on the reference chain of non-critical loaded resources. In this case, only all non-critical loaded resources on the reference chain are retrieved.
[0115] S604. Release all non-critical loaded resources on the reference chain.
[0116] After acquiring all non-critical loaded resources on the reference chain, all non-critical loaded resources on the reference chain are released to improve the loading efficiency of dynamic resource loading.
[0117] The dynamic resource management method provided in this embodiment, after marking non-critical loaded resources, releases all non-critical loaded resources on the reference chain if the reference chain is a weak reference chain, thereby improving the efficiency of loading dynamic resources.
[0118] exist Figure 1 Before initiating the loading process in the illustrated embodiment, the dynamic resources to be loaded can be released via a release procedure. Specifically, through... Figure 7 The embodiments shown will be described in detail.
[0119] Reference Figure 7 Before initiating the loading process, the following steps are included:
[0120] S701. Based on the preset release and loading procedure, obtain the released and loaded resources among all dynamic resources to be loaded.
[0121] The release loader is a pre-defined feature. It includes dynamic resources that need to be released by the user and is used to release these dynamic resources. Therefore, the release loader can be used to obtain the released resources among all dynamic resources to be loaded.
[0122] S702, Get and release all referenced resources that are loaded.
[0123] The reference resource refers to the dynamic resource to be loaded that is being released, and can be obtained through the reference chain of the released resource.
[0124] S703, Release all referenced resources and release all loaded resources.
[0125] Release all referenced resources and all unloaded resources to improve the efficiency of loading dynamic resources.
[0126] The dynamic resource management method provided in this embodiment releases the released resources and the referenced resources of the released resources after obtaining a number of released resources in the release procedure, which effectively improves the efficiency of loading dynamic resources.
[0127] This application also discloses a smart terminal, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program using the dynamic resource management method described in the above embodiments.
[0128] The smart terminal can be a computer device such as a desktop computer, a laptop computer, or a cloud server. The smart terminal includes, but is not limited to, a processor and a memory. For example, the smart terminal may also include input / output devices, network access devices, and buses.
[0129] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it.
[0130] The memory can be an internal storage unit of the smart terminal, such as a hard disk or memory of the smart terminal, or an external storage device of the smart terminal, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD) or flash memory card (FC) equipped on the smart terminal. Furthermore, the memory can also be a combination of internal storage units and external storage devices of the smart terminal. The memory is used to store computer programs and other programs and data required by the smart terminal. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0131] In this smart terminal, the dynamic resource management method described in the above embodiments is stored in the smart terminal's memory and loaded and executed on the smart terminal's processor for convenient use.
[0132] This application also discloses a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, it employs the dynamic resource management method described in the above embodiments.
[0133] The computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or certain middleware. The computer-readable medium includes any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the computer-readable medium includes, but is not limited to, the above-mentioned components.
[0134] The dynamic resource management method described in the above embodiments is stored in the computer-readable storage medium and loaded and executed on the processor to facilitate the storage and application of the method.
[0135] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A dynamic resource management method, characterized in that, include: Obtain the resource type of each dynamic resource to be loaded, and classify all the dynamic resources to be loaded according to the resource type to obtain several resource types and several dynamic resources to be loaded under each resource type; For each of the aforementioned resource types, allocate and store several dynamic resources to be loaded in folders. The number of references to each dynamic resource to be loaded in each of the storage folders is obtained in real time by other dynamic resources to be loaded. The reference count is used to encode the dynamic resource to be loaded, resulting in the reference code for each dynamic resource to be loaded. When the reference code is 0, the dynamic resource to be loaded is marked as a released resource, and the released resource is released based on the preset release procedure, and the loading process is started; The section following the allocation and storage folders for the dynamic resources to be loaded under each resource type includes: Important loading resources are obtained based on preset loading instructions; Traverse all the storage folders to obtain the number of important loaded resources in each storage folder; The storage folders are sorted based on the number of resources in each of the important loaded resources to obtain the loading level of each storage folder; Obtain the non-critical loading resources, excluding the critical loading resources, from each of the storage folders; The non-critical loaded resources are marked; Obtain the reference code and reference chain of the non-critical loaded resources in each of the storage folders; When the reference code is not 0, determine whether the reference chain is a weak reference chain; If it is a weak reference chain, retrieve all the non-critical loaded resources on the reference chain; Release all non-critical loaded resources on the reference chain.
2. The dynamic resource management method according to claim 1, characterized in that, Before encoding the dynamic resources to be loaded based on the number of references to obtain the reference encoding of each dynamic resource to be loaded, the process includes: Monitor all the dynamic resources to be loaded and determine whether there are any new dynamic resources to be loaded. If it exists, the newly added dynamic resource to be loaded is treated as a new resource, and the resource type of the new resource and the number of references of the new resource by other dynamic resources to be loaded are obtained. The new resource is then assigned to the storage folder corresponding to the resource type.
3. The dynamic resource management method according to claim 1, characterized in that, After marking the dynamic resource to be loaded as a released resource, the following steps are included: Determine whether the released resources are used by a preset program; If used by the preset program, the mark on the released resource is removed, resulting in an unmarked dynamic resource to be loaded, and the dynamic resource to be loaded is stored in the corresponding storage folder; If the resource is not used by the preset program, the step of releasing the resource based on the preset release program is executed.
4. The dynamic resource management method according to claim 1, characterized in that: Prior to the startup loading process, the following is included: Based on the preset release and load procedure, the released and loaded resources among all the dynamic resources to be loaded are obtained; Retrieve all referenced resources that have been released from the loaded resources; Release all referenced resources and release all loaded resources.
5. A smart terminal, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor loads and executes the computer program, it employs the method described in any one of claims 1 to 4.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is loaded and executed by the processor, it employs the method described in any one of claims 1 to 4.