Resource management method and device, storage medium and electronic device

By optimizing video memory resource management through hash value lookup and resource mapping tables in cloud gaming services, the problem of wasted computing resources caused by frequent resource loading is solved, achieving efficient resource utilization and improved screen rendering efficiency.

CN122220085APending Publication Date: 2026-06-16TENCENT TECH SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In cloud gaming service scenarios, the existing technology for managing graphics card memory resources leads to frequent resource loading and waste of computing resources.

Method used

The target resource identifier is found in the resource mapping table by calculating the hash value of the resource, and the task is executed using the target resource. At the same time, the positions of the hash value and resource identifier in the resource mapping table are adjusted to manage resources in a way with different priorities, so as to avoid duplicate loading.

Benefits of technology

It saves computing resources and network bandwidth, improves screen rendering efficiency, ensures efficient use of video memory resources, and reduces ineffective resource occupation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122220085A_ABST
    Figure CN122220085A_ABST
Patent Text Reader

Abstract

The application discloses a resource management method and device, a storage medium and an electronic device. The method comprises the following steps: obtaining a target hash value of a target resource, wherein the target resource is used for executing a target task corresponding to a target application process; in the case that the target hash value is found in a resource mapping table, obtaining a target resource identifier which has a mapping relationship with the target hash value from the resource mapping table; obtaining the target resource from a resource storage space based on the target resource identifier; executing the target task by using the target resource, and adjusting a target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from a first position to a second position. The application solves the technical problem of wasting computing resources caused by frequently loading resources into the display memory in the resource management mode provided in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for managing resources, a storage medium, and an electronic device. Background Technology

[0002] In cloud gaming service scenarios, multiple users typically access games running on the same server via the network. This server uses the same high-performance graphics card to provide game rendering services for all users.

[0003] Currently, the management of rendering resources in the graphics card's display memory (VRAM) in cloud gaming service scenarios typically involves allowing the rendering resources used for rendering the game screen to be shared among multiple instances. However, the lifecycle management of these resources is based on usage counts. Once a rendering resource is no longer used by any game instance, it will be immediately reclaimed. If an instance requests the rendering resource to render the game screen, it will need to be loaded back into the VRAM.

[0004] In other words, the resource management methods provided in related technologies still have the technical problem of wasting computing resources due to the need to frequently load resources into video memory.

[0005] There is currently no effective solution to the above problems. Summary of the Invention

[0006] This application provides a resource management method and apparatus, storage medium and electronic device to at least solve the technical problem of wasted computing resources caused by the need to frequently load resources into video memory in the resource management methods provided in the related art.

[0007] According to one aspect of the embodiments of this application, a resource management method is provided, comprising: obtaining a target hash value of a target resource, wherein the target resource is used to execute a target task corresponding to a target application process; if the target hash value is found in a resource mapping table, obtaining a target resource identifier that has a mapping relationship with the target hash value from the resource mapping table, wherein the resource mapping table records the mapping relationship between the hash values ​​of M resources loaded into the target resource storage space and the resource identifiers of the M resources, where M is a positive integer; obtaining the target resource from the resource storage space based on the target resource identifier; executing the target task using the target resource, and adjusting the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from a first position to a second position, wherein the resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

[0008] According to another aspect of the embodiments of this application, a resource management device is also provided, comprising: a first acquisition unit, configured to acquire a target hash value of a target resource, wherein the target resource is used to execute a target task corresponding to a target application process; a second acquisition unit, configured to, when a target hash value is found in a resource mapping table, acquire a target resource identifier that has a mapping relationship with the target hash value from the resource mapping table, wherein the resource mapping table records the mapping relationship between the hash values ​​of M resources loaded into the target resource storage space and the resource identifiers of the M resources, where M is a positive integer; a third acquisition unit, configured to acquire the target resource from the resource storage space based on the target resource identifier; and an adjustment unit, configured to use the target resource to execute the target task and adjust the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from a first position to a second position, wherein the resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

[0009] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described resource management method when running.

[0010] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the resource management method described above.

[0011] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the resource management method described above through the computer program.

[0012] In this embodiment, the target hash value of the target resource is obtained, where the target resource is used to execute the target task corresponding to the target application process. If the target hash value is found in the resource mapping table, the target resource identifier that has a mapping relationship with the target hash value is obtained from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources already loaded into the target resource storage space and the resource identifiers of the M resources, where M is a positive integer. The target resource is obtained from the resource storage space based on the target resource identifier. The target task is executed using the target resource, and the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table is adjusted from a first position to a second position. The resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position. Using this embodiment, on the one hand, by using hash lookup, resources already existing in the resource mapping table can be directly located, avoiding duplicate loading of resources. In other words, if a resource has already been loaded into the video memory, subsequent application processes can use it immediately without having to go through the process of loading resources from the hard drive or network again, saving computing resources and network bandwidth, and improving screen rendering efficiency. On the other hand, the resource mapping table uses a Least Recently Used (LRU) mechanism. This means that used resources are relocated to the second position in the table with a lower removal priority, while resources that have not been used for a long time are gradually moved to the first position in the table, becoming potential targets for reclamation. When the resource reclamation conditions are met, the server will reclaim resources starting from the first position, ensuring efficient utilization of resources in video memory, reducing invalid resource occupation, and avoiding waste of computing resources. In summary, the embodiments of this application solve the technical problem of wasted computing resources caused by the frequent loading of resources into video memory in resource management methods provided in related technologies, achieving the technical effects of saving computing resources and improving image rendering efficiency. Attached Figure Description

[0013] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0014] Figure 1 This is a schematic diagram of an application environment for an optional resource management method according to an embodiment of this application;

[0015] Figure 2 This is a flowchart of an optional resource management method according to an embodiment of this application;

[0016] Figure 3 This is a schematic diagram of an optional resource management method according to an embodiment of this application;

[0017] Figure 4This is a schematic diagram of an optional resource management method according to an embodiment of this application;

[0018] Figure 5 This is a schematic diagram of an optional resource management method according to an embodiment of this application;

[0019] Figure 6 This is a schematic diagram of an optional resource management method according to an embodiment of this application;

[0020] Figure 7 This is a schematic diagram of an optional resource management method according to an embodiment of this application;

[0021] Figure 8 This is a flowchart of an optional resource management method according to an embodiment of this application;

[0022] Figure 9 This is a schematic diagram of the structure of an optional resource management device according to an embodiment of this application;

[0023] Figure 10 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] Optionally, the above-mentioned resource management methods can be applied to rendering scenarios, local cache cloud resource scenarios, encoding and decoding scenarios, or other related scenarios, and are not limited to this in this embodiment.

[0027] Specifically, the above-mentioned resource management methods can be applied to, but are not limited to, at least the following rendering scenarios:

[0028] 1) Cloud Gaming Service: Cloud gaming platforms support multiple users playing games online simultaneously. Each user's game instance may need to access similar or identical rendering resources. By calculating the hash value of the resources and looking them up in the resource mapping table, the cloud platform can avoid repeatedly loading resources, saving video memory and bandwidth, improving rendering efficiency, and thus optimizing the gaming experience and the platform's concurrent processing capabilities.

[0029] 2) Virtual Reality (VR) and Augmented Reality (AR) Applications: In VR / AR scenarios, multiple users may simultaneously experience the same virtual environment or scene, requiring frequent rendering of a large number of similar 3D models and textures. The above solution allows VR / AR systems to intelligently share loaded resources, reducing unnecessary resource reloading, improving rendering speed, and lowering latency.

[0030] 3) Remote Graphics Workstations: Remote graphics workstations provide designers, engineers, and other users with remote access to high-performance graphics rendering services. When multiple users are working on similar projects or using the same software simultaneously, this solution ensures that rendering resources are efficiently shared in video memory, reducing resource loading time and enhancing the responsiveness and performance of the workstation.

[0031] 4) Online Education and Training Services: Online education platforms may offer graphics-intensive courses, such as programming, engineering design, or art creation courses, which contain numerous examples and models that require real-time rendering. The solutions described above can help these platforms optimize resource loading, ensuring that graphics resources can be quickly accessed and rendered for all students while they are watching tutorials or doing exercises.

[0032] For example, assuming the above resource management method is applied to the video conferencing scenario, it can be illustrated by, but is not limited to, the following examples:

[0033] S1, when the cloud gaming server receives a rendering request from user A's game instance (representing the aforementioned target application process), the request contains the game screen information to be rendered and the resource information of the target rendering resource (e.g., resource type, resource quantity, etc.). Based on the content of the target rendering resource (e.g., textures, models, shaders), its target hash value is calculated. This hash value serves as a specific identifier for the resource and is used for subsequent resource lookup and sharing operations.

[0034] S2. Using the calculated target hash value, search the resource mapping table to see if a corresponding mapping relationship exists. The resource mapping table is a data table containing M rendering resources loaded into the graphics card's memory (used to represent the aforementioned target resource storage space), where M represents a positive integer, indicating the number of resources currently loaded on the cloud platform. If a target hash value is found in the resource mapping table, the target resource identifier (resource ID) with which the mapping relationship exists will be obtained for subsequent resource acquisition.

[0035] After obtaining the target resource identifier, the cloud gaming server directly retrieves the target rendering resource from the video memory (VRAM) in S3, eliminating the need to reload the resource and saving VRAM space and network bandwidth. Subsequently, the retrieved target rendering resource is used to render user A's game screen, providing a lag-free gaming experience.

[0036] S4, upon completion of rendering or after rendering, adjusts the mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position. The first position has a higher priority for resource removal, while the second position has a lower priority. This adjustment reduces the probability of frequently used resources being recycled, ensuring that resources remain resident and shared in video memory, further optimizing resource management and game rendering efficiency, especially in multi-user concurrent game scenarios.

[0037] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0038] For example, assuming the above resource management method is applied to the aforementioned virtual reality (VR) and augmented reality (AR) application scenarios, the resource management method can be illustrated through, but is not limited to, the following examples:

[0039] S1, when a user enters or interacts with the VR / AR environment through a user device, the cloud server providing the VR / AR environment receives a rendering request initiated by the user's VR / AR application instance (representing the aforementioned target application process) to render the current view or the result of the user's operation. The request contains resource information (e.g., resource type, resource quantity, etc.) of the target rendering resource (representing the aforementioned target resource). The target hash value (resource identifier) ​​of the target rendering resource is calculated for subsequent resource lookup and sharing.

[0040] S2, the cloud server searches the resource mapping table for a record that matches the target hash value. The resource mapping table is a data table that records the mapping relationship between the hash values ​​of all M rendering resources loaded into video memory (used to represent the storage space of the aforementioned target resource) and their resource identifiers (resource IDs). If a match is found, the target resource identifier (resource ID) is obtained for direct access to the resource.

[0041] In S3, the cloud server directly retrieves the target rendering resource corresponding to the target resource identifier (resource ID) from the video memory, eliminating the need to reload resources from the hard drive or network. This saves bandwidth, reduces latency, and improves rendering efficiency. Subsequently, the target rendering resource is used to render the user's current view or operation result, providing a smooth VR / AR experience.

[0042] S4, after rendering is complete or during rendering, adjusts the mapping relationship between the target hash value and the target resource identifier (resource ID) in the resource mapping table from the first position to the second position. The first position is the position with higher resource removal priority, and the second position corresponds to the resource removal priority with lower priority. By adjusting the position, the probability of frequently used resources being recycled is reduced, ensuring that resources remain resident in video memory and are shared efficiently.

[0043] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0044] For example, assuming the above resource management method is applied to the above remote graphics workstation scenario, it can be illustrated by, but is not limited to, the following examples:

[0045] S1. When the cloud server of the remote graphics workstation receives a rendering request for a graphics processing task (used to represent the target application process) from a designer or engineer, if the target rendering resources in the request (such as a specific 3D model or texture) need to be loaded by the GPU memory, the target hash value of these resources is calculated as the unique identifier of the resources.

[0046] S2, the cloud server uses the calculated target hash value to search the resource mapping table for a corresponding resource identifier (resource ID). If found, it means that the resource has been loaded and used by other users, and the resource identifier will be obtained directly.

[0047] S3 cloud servers directly read target rendering resources from the rendering resource storage space based on the obtained target resource identifier (resource ID), without reloading, saving video memory space and network bandwidth, and improving graphics processing efficiency.

[0048] S4, after completing graphics rendering or design tasks (to represent the aforementioned target tasks) using the target rendering resources, or during rendering, adjusts the mapping relationship between the target hash value and the target resource identifier (resource ID) in the resource mapping table from the first position to the second position. This adjustment means that the resource has moved from a higher removal priority position to a lower removal priority position, reducing the possibility of the resource being reclaimed, ensuring the resource's resident status and sharing, and further enhancing the responsiveness and performance of the cloud server.

[0049] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0050] For example, assuming the above resource management method is applied to the above online education and training service scenario, it can be illustrated by the following examples, but is not limited to:

[0051] S1: When the course module (representing the aforementioned target application process) on the cloud server of the online education platform needs to render teaching examples or models, a rendering request is received. The request contains resource information of the target rendering resources (such as 3D models demonstrated in the course, visualizations of programming code, and templates for artistic creation). A target hash value (a unique identifier for the resource) is calculated based on the content of these resources for subsequent resource lookup and sharing operations.

[0052] S2. Using the calculated target hash value, search the resource mapping table to see if a corresponding mapping exists. The resource mapping table is a data table that records the mapping relationship between the hash values ​​of all M rendering resources loaded into the rendering resource storage space (the video memory of the cloud server of the online education platform) and their resource identifiers (resource IDs). If a mapping exists, the target resource identifier (resource ID) will be obtained.

[0053] S3 directly retrieves target rendering resources from video memory based on the target resource identifier (resource ID), eliminating the need to reload resources. This saves bandwidth, reduces latency, and improves rendering efficiency. Subsequently, these resources are used to render the target screen of the course module (to represent the aforementioned target tasks), allowing students to seamlessly watch or interact, thus enhancing the learning experience.

[0054] S4, after rendering the educational resources provided by the online education platform, or while rendering is in progress, adjusts the mapping relationship between the target hash value and the target resource identifier (resource ID) in the resource mapping table from the first position (high resource removal priority position) to the second position (low resource removal priority position). In this way, recently used resources are moved to the back of the list, reducing the possibility of them being reclaimed, ensuring that resources remain resident in GPU memory, and further optimizing resource utilization efficiency and course response speed.

[0055] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0056] Specifically, the above-mentioned resource management methods can be applied to, but are not limited to, at least the following encoding and decoding scenarios:

[0057] In services such as video conferencing, live streaming platforms, and cloud gaming streaming that require processing concurrent video streams, video encoding and decoding are resource-intensive operations. Especially when a large number of users are online simultaneously, the system needs to efficiently manage video encoding and decoding resources to maintain real-time performance, reduce latency, and avoid performance bottlenecks caused by resource waste.

[0058] For example, assuming the above resource management method is applied to the encoding and decoding scenario of the video conferencing service, the resource management method can be illustrated through, but is not limited to, the following examples:

[0059] Video conferencing services (representing the aforementioned target application processes) face immense pressure from video encoding and decoding when a large number of users participate in meetings simultaneously online. Each user's video stream (representing the aforementioned target task) needs to be encoded and decoded in real time to ensure high-quality video communication. To maintain real-time performance and reduce latency in high-concurrency scenarios, while avoiding performance bottlenecks caused by resource waste, the system needs to efficiently manage and schedule encoding and decoding resources.

[0060] S1. When the video conferencing service receives a user's video stream encoding request, it calculates the hash value of the video stream configuration (used to represent the target hash value of the aforementioned target resource) to uniquely identify the configuration (such as encoding parameters, preloaded video frames, codec instances, etc.).

[0061] S2. Query the resource mapping table to check if there is a resource record corresponding to the calculated video stream configuration hash value. The resource mapping table records the mapping relationship between the configuration hash values ​​and resource identifiers of the M codec resources loaded into the system resource pool (used to represent the above target resource storage space), where M is a positive integer representing the number of currently loaded resources.

[0062] S3. If a record corresponding to the target hash value exists in the resource mapping table, the system will obtain the resource identifier that is mapped to the hash value (used to represent the above target resource identifier), and directly obtain the target encoding / decoding resource from the system resource pool based on the resource identifier, without reconfiguration and loading, saving CPU and GPU resources and reducing latency.

[0063] S4. After obtaining the target codec resource, the video conferencing service will use the resource to perform the encoding task of the video stream (to indicate the above-mentioned use of the target resource to perform the target task) to ensure that the video is smoothly transmitted to other conference participants.

[0064] S5, after completing the encoding / decoding task using the target resource, updates the target mapping relationship in the resource mapping table (used to represent the above target mapping relationship), adjusting it from the current "first position" to the "second position". The resource removal priority corresponding to the "first position" is higher than the resource removal priority corresponding to the "second position" (used to represent the adjustment from the first position to the second position). This means that the system will increase the resource's lifetime in the resource pool and reduce its priority for recycling, so that it can be reused in subsequent video stream encoding tasks.

[0065] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0066] Specifically, the above-mentioned resource management methods can be applied to, but are not limited to, at least the following local cache cloud resource scenarios:

[0067] In cloud gaming environments, preloading and caching strategies for game resources (such as textures, models, and sound effects) are crucial for reducing latency and improving user experience. The user's device first checks local storage to determine if cached, quickly accessible game resources are available. If not, the system retrieves these resources from the cloud and caches them in local storage for later use.

[0068] For example, assuming the above resource management method is applied to the scenario of locally caching cloud resources in the cloud gaming environment, the above resource management method can be illustrated by the following examples, but not limited to:

[0069] Cloud gaming environments (representing the aforementioned target application processes) require preloading game resources (representing the aforementioned target resources) on user devices to reduce network latency and improve the gaming experience. Especially during initial user access or game resource updates, the system needs to efficiently manage local caching to ensure quick access to required resources in subsequent game processes, while avoiding redundant downloads and wasted storage.

[0070] S1. When a user device needs to load a game resource, calculate the hash value of the resource (used to represent the target hash value of the target resource mentioned above), which is used to uniquely identify the resource and serve as the basis for resource query and management.

[0071] S2, query the resource mapping table in local storage (used to represent the above resource mapping table) to check if there is a record corresponding to the calculated resource hash value. The resource mapping table records the mapping relationship between the hash values ​​and resource identifiers of M game resources cached in local storage (used to represent the above target resource storage space), where M is a positive integer representing the number of currently cached resources.

[0072] S3. If a record corresponding to the target hash value exists in the resource mapping table, the resource identifier that is mapped to the hash value (used to represent the target resource identifier) ​​will be obtained, and the target resource will be directly obtained from the local storage based on the resource identifier, without having to download it from the cloud again, thereby saving network bandwidth and reducing the latency of resource loading.

[0073] S4. After obtaining the target resource, the game engine (used to represent the above-mentioned use of the target resource to perform the target task) will use the resource to perform tasks such as game rendering and scene switching, thereby improving the game's running efficiency and user experience.

[0074] S5, after completing the game task using the target resource, updates the target mapping relationship in the resource mapping table (used to represent the above target mapping relationship), adjusting it from the current "first position" to "second position". The resource at the "first position" has a higher removal priority than the resource at the "second position" (used to represent the adjustment from the first position to the second position). This means the system will increase the resource's lifespan in local storage and decrease its removal priority, preparing it for reuse in subsequent games.

[0075] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0076] According to one aspect of the embodiments of this application, a resource management method is provided. Optionally, as an optional implementation method, taking the above-mentioned resource management method applied to a cloud gaming service scenario as an example, the above-mentioned resource management method can be applied to, but is not limited to, scenarios such as... Figure 1 In the environment shown. For example... Figure 1 As shown, the terminal device 102 includes a memory 104 for storing various data generated during the operation of the terminal device 102, a processor 106 for processing and calculating the aforementioned data, and a display 108 for displaying the target screen corresponding to the target application process. The terminal device 102 can interact with the server 112 via the network 110. The server 112 is connected to a database 114, which is used to store various data.

[0077] Furthermore, the above method in Figure 1 The specific application process in the environment shown is as follows:

[0078] S102, as Figure 1 As shown in (a), when the terminal device 102 determines that the launch control of the target application (i.e., the game application provided by the target cloud gaming platform) is selected in the game application selection interface of the target cloud gaming platform, it sends a request information for launching the target application process of the target game application to the server 112 through the network 110.

[0079] S104, Upon receiving the request information, server 112 starts the target game process and obtains the rendering request initiated by the target game process to render the corresponding target screen of the target application process.

[0080] S106, Server 112 calculates the target hash value of the target rendering resource, wherein the target rendering resource is used to render the target image;

[0081] S108, if the server 112 finds the target hash value in the resource mapping table, it retrieves the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M rendering resources that have been loaded into the rendering resource storage space and the resource identifiers of M rendering resources, where M is a positive integer.

[0082] S110, Server 112 obtains the target rendering resource from the rendering resource storage space based on the target resource identifier;

[0083] S112, server 112 renders the target image using the target rendering resource, and adjusts the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position, wherein the resource removal priority of the rendering resource corresponding to the first position is greater than the resource removal priority of the rendering resource corresponding to the second position;

[0084] S114, server 112 sends the target image to terminal device 102 via network 110;

[0085] S116, such as Figure 1 As shown in (b), the terminal device 102 displays the target screen.

[0086] By employing the embodiments of this application, on the one hand, hash lookup can directly locate resources already existing in the resource mapping table, avoiding duplicate loading of resources. In other words, if a resource has already been loaded into video memory, subsequent application processes can use it immediately without having to go through the process of loading resources from the hard drive or network again, saving computing resources and network bandwidth, and improving screen rendering efficiency. On the other hand, the resource mapping table uses a least recently used mechanism, meaning that used resources are relocated to the second position in the table with a lower removal priority, while resources that have not been used for a long time are gradually moved to the first position in the table, becoming potential targets for reclamation. When the resource reclamation conditions are met, the server will reclaim resources starting from the first position, ensuring efficient utilization of resources in video memory, reducing invalid resource occupation, and avoiding waste of computing resources. In summary, by employing the embodiments of this application, the technical problem of wasted computing resources caused by the frequent loading of resources into video memory in the resource management methods provided in related technologies is solved, achieving the technical effects of saving computing resources and improving screen rendering efficiency.

[0087] Optionally, in this embodiment, the terminal device can be a terminal device configured with a target client, which may include, but is not limited to, at least one of the following: mobile phone (such as Android phone, iOS phone, etc.), laptop computer, tablet computer, PDA, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The target client may be a video client, instant messaging client, browser client, educational client, etc. The network may include, but is not limited to, wired network and wireless network, wherein the wired network includes: local area network, metropolitan area network and wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that enable wireless communication. The server may be a single server, a server cluster composed of multiple servers, or a cloud server. The above is only an example, and no limitation is made in this embodiment.

[0088] Alternatively, as an alternative solution, such as Figure 2 As shown, the management methods for the above resources include:

[0089] S202, Obtain the target hash value of the target resource, wherein the target resource is used to execute the target task corresponding to the target application process.

[0090] Optionally, taking the above resource management method applied to a rendering scenario as an example, before obtaining the target hash value of the target resource, the method may, but is not limited to, further include: obtaining a request message for requesting the execution of a target task. This request message may, but is not limited to, instructing the target application process to issue a rendering request whenever the process needs to update or display a screen during its operation, for rendering the corresponding screen (i.e., executing the target task). For example, taking the above resource management method applied to a cloud gaming service scenario as an example, the rendering request may, but is not limited to, instructing the game screen to issue a rendering request whenever the game screen needs to be updated or a new screen needs to be displayed during game operation, for rendering the corresponding game screen.

[0091] Furthermore, the aforementioned target application process can, but is not limited to, instructing a process created for the target application to provide application services to a specific terminal device. For example, taking the above resource management method applied to a cloud gaming service scenario, the process created by the target application can, but is not limited to, be a game process created for the target game to provide game services to a specified user.

[0092] It should be noted that, in some embodiments, the target hash value of the target resource can be, but is not limited to, calculated by performing a hash algorithm on the target resource. It is one of the unique identifiers of the target resource and can be used to quickly find and identify resources, avoiding duplicate loading of resources.

[0093] Optionally, taking the above resource management method applied to a rendering scene as an example, the target resource can be, but is not limited to, the specific resource used to indicate the target image corresponding to the target application being rendered, such as textures, models, shaders, etc. For example, in a cloud gaming scene, the target rendering resource can be the texture map of the player character, a 3D model in the current game virtual scene, or a specific shader effect.

[0094] Optionally, taking the above resource management method applied to a rendering scene as an example, obtaining the target hash value of the target resource includes: transferring the initial rendering resource from the first storage space to the second storage space, wherein the storage resource amount of the first storage space is greater than the storage resource amount of the second storage space; and performing hash calculation on the initial rendering resource to obtain the target hash value.

[0095] S204. If the target hash value is found in the resource mapping table, obtain the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources that have been loaded into the target resource storage space and the resource identifiers of M resources, where M is a positive integer.

[0096] It should be noted that, taking the above resource management method applied to a rendering scene as an example, the target resource storage space can, but is not limited to, indicate the display content of the cloud server's graphics card, and is used to store resources required during the rendering process, such as textures, models, and shaders. Furthermore, the target resource identifier can, but is not limited to, indicate a unique ID allocated to the target rendering resource, used to directly locate and retrieve the target rendering resource in video memory.

[0097] Optionally, taking the above resource management method applied to a rendering scene as an example, the resource mapping table is a data structure used to store the mapping relationship between the hash values ​​of rendering resources loaded into the rendering resource storage space and their corresponding resource identifiers. The resource mapping table can be a hash table, a linked list, or other data structures. The key is that it can quickly locate the resource identifier based on the resource's hash value, thereby finding the resource stored in the video memory.

[0098] Furthermore, taking the above resource management method applied to a rendering scenario as an example, the resource mapping table includes: application resource mapping tables corresponding to each application managed by the cloud server and a global resource mapping table. Each application resource mapping table records the mapping relationships of rendering resources loaded into the rendering resource storage space and used to render a specified application. The global resource mapping table records the mapping relationships of rendering resources loaded into the rendering resource storage space and used to render all applications managed by the cloud server. It should be noted that each application resource mapping table is identified by an application ID; for example, the target resource mapping table is identified by the application ID of the target application, facilitating quick location of the target resource mapping table when searching for target rendering resources. It should be noted that both the application resource mapping table and the global resource mapping table are resource mapping tables used to store resource mapping relationships, but they each have their own characteristics and play different roles in resource management.

[0099] Optionally, assuming the above resource management method is applied to the rendering scenario of cloud gaming services, the above application resource mapping table can be used to indicate the game resource mapping table for a specified game for managing and maintaining the resource information of a specific game; the above global resource mapping table is a global game resource mapping table shared by all games for managing and maintaining the information of shared resources of all games.

[0100] For example, the target game resource map (used to represent the target resource map) is as follows: Figure 3 As shown in (a), the hash values ​​and resource identifiers of all rendering resources loaded into video memory in the target game (representing the target application) are recorded. Each line represents information about one rendering resource.

[0101] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0102] For example, the global game resource map (used to represent the above global resource map) is as follows: Figure 3 As shown in (b), the shared rendering resource information of all games managed by the cloud server is maintained. It also records the hash value, resource identifier and recent usage time, but additionally includes a game ID field to identify which game the resource belongs to, and a usage count field to indicate how many game instances are currently using the resource.

[0103] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0104] It should be noted that, in the case where the target hash value is found in the resource mapping table, obtaining the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table may include, but is not limited to: obtaining the target resource identifier that has a mapping relationship with the target hash value from the target resource mapping table when the target hash value is found in the target resource mapping table; or, obtaining the target resource identifier that has a mapping relationship with the target hash value from the global resource mapping table when the target hash value is found in the global resource mapping table. In this embodiment, this is not limited.

[0105] S206, Obtain the target resource from the resource storage space based on the target resource identifier.

[0106] Optionally, obtaining the target resource from the target resource storage space based on the target resource identifier may include, but is not limited to, finding the resource corresponding to the resource identifier and the target resource identifier from the target resource storage space and identifying it as the target resource.

[0107] S208, execute the target task using the target resource, and adjust the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position, wherein the resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

[0108] Optionally, taking the above resource management method applied to a rendering scene as an example, the above-mentioned use of target resources to perform target tasks may include, but is not limited to, rendering the target screen corresponding to the target application process using target rendering resources. Further, the above-mentioned use of target rendering resources to render the target screen corresponding to the target application process may be used, but is not limited to, to instruct the mapping of target rendering resources to the rendering context corresponding to the target application process for rendering the target screen.

[0109] Optionally, in some embodiments, the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table may be adjusted from the first position to the second position when the target task is performed using the target resource; or the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table may be adjusted from the first position to the second position after the target task is performed using the target resource. This embodiment does not limit this.

[0110] Optionally, adjusting the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position may include, but is not limited to, adjusting the target mapping relationship in the global resource mapping table from the first position to the second position. The global resource mapping table includes the mapping relationship between each rendering resource loaded into the rendering resource storage space and the resource identifier of each rendering resource. The resource mapping table includes the global resource mapping table.

[0111] It should be noted that the first and second positions mentioned above are record positions in the resource mapping table, and these positions are related to the resource's removal priority. The first position corresponds to a high removal priority, meaning the resource is more likely to be reclaimed; the second position corresponds to a low removal priority, meaning the resource is less likely to be reclaimed. For example, when a resource is used, its position in the resource mapping table is adjusted from near the head (first position) to near the tail (second position) to reduce the likelihood of it being reclaimed. It should be noted that the first position can also be set to near the tail, and correspondingly, the second position can also be set to near the head; this is not limited in this embodiment.

[0112] Optionally, in some embodiments, the resource reclamation priority corresponding to different positions in the resource mapping table is different. For example, the resource reclamation priority at earlier positions in the resource mapping table can be set to gradually increase, and the resource reclamation priority at later positions can be set to gradually decrease. Alternatively, the resource reclamation priority at earlier positions in the resource mapping table can be set to gradually decrease, and the resource reclamation priority at later positions can be set to gradually increase. It should be noted that, in this embodiment, it is preferred that the resource reclamation priority at earlier positions in the resource mapping table is set to gradually increase, and the resource reclamation priority at later positions is set to gradually decrease.

[0113] As an optional example, when applying the above resource management method to a cloud gaming service scenario, the steps described above can be illustrated and explained in general, but not limited to, based on the following examples:

[0114] Suppose a cloud gaming server is used to run game instances (representing application processes) of multiple game applications, such as game application A and game application B. The graphics cards of the cloud gaming server are optimized to support concurrent operation of multiple gaming devices on the same card, and the resource management method aims to improve video memory utilization and game performance.

[0115] S1. When the cloud gaming server receives a rendering request from game process A (representing the target application process) of game device A, requesting to render a specific scene (e.g., game map) in game application A, the cloud gaming server will start the resource loading process.

[0116] S2, the cloud gaming server calculates a unique target hash value based on the content of the requested rendering resources (such as textures, vertex data, shader programs, etc.). For example, for the texture resources of the game map in game application A, the calculated hash value is 0x123456789ABCDEF0.

[0117] S3, the cloud gaming server looks up the target hash value in the game resource mapping table (used to represent the target resource mapping table) corresponding to game A and determines that it has a mapping relationship with a resource identifier RID001.

[0118] S4, the cloud gaming server retrieves the target rendering resource from the rendering resource storage space (i.e., the resource pool in video memory) based on the resource identifier RID001. Then, it uses this resource to render the game map screen requested by game device A (to represent the aforementioned target screen).

[0119] S4. After rendering is complete, the cloud gaming server adjusts the mapping relationship between 0x123456789ABCDEF0 and RID001 in the global resource mapping table from the first position to the second position. In this example, the global resource mapping table is maintained according to the Least Recently Used (LRU) principle, so RID001 will be moved from the front of the table to the back of the table, indicating that RID001 has been used recently and its resource removal priority has been reduced.

[0120] S5, the global resource mapping table before adjustment is as follows: Figure 4 As shown in (a), the adjusted global resource mapping is as follows: Figure 4 As shown in (b), the mapping relationship between RID001 and the hash value 0x123456789ABCDEF0 has been adjusted from position 1 (highest priority for resource removal) to position 3 (lower priority for resource removal), indicating that resource RID001 was recently used, so its removal priority has been reduced, which helps to avoid reclaiming the resource in the case of frequent use in the near future.

[0121] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0122] In this embodiment, the target hash value of the target resource is obtained, where the target resource is used to execute the target task corresponding to the target application process. If the target hash value is found in the resource mapping table, the target resource identifier that has a mapping relationship with the target hash value is obtained from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources already loaded into the target resource storage space and the resource identifiers of the M resources, where M is a positive integer. The target resource is obtained from the resource storage space based on the target resource identifier. The target task is executed using the target resource, and the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table is adjusted from a first position to a second position. The resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position. Using this embodiment, on the one hand, by using hash lookup, resources already existing in the resource mapping table can be directly located, avoiding duplicate loading of resources. In other words, if a resource has already been loaded into the video memory, subsequent application processes can use it immediately without having to go through the process of loading resources from the hard drive or network again, saving computing resources and network bandwidth, and improving screen rendering efficiency. On the other hand, the resource mapping table uses a Least Recently Used (LRU) mechanism. This means that used resources are relocated to the second position in the table with a lower removal priority, while resources that have not been used for a long time are gradually moved to the first position in the table, becoming potential targets for reclamation. When the resource reclamation conditions are met, the server will reclaim resources starting from the first position, ensuring efficient utilization of resources in video memory, reducing invalid resource occupation, and avoiding waste of computing resources. In summary, the embodiments of this application solve the technical problem of wasted computing resources caused by the frequent loading of resources into video memory in resource management methods provided in related technologies, achieving the technical effects of saving computing resources and improving image rendering efficiency.

[0123] Optionally, as an alternative approach, if the target hash value is found in the resource mapping table, retrieving the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table includes:

[0124] If the target hash value is found in the target resource mapping table of the target application, the target resource identifier is obtained from the target resource mapping table. The target resource mapping table records N mapping relationships between N candidate resources that are used to execute the target task and have been loaded into the target resource storage space and N resource identifiers of the N candidate resources. The resource mapping table includes the target resource mapping table.

[0125] It should be noted that, in some embodiments, the target resource mapping table is a subset of the global resource mapping table, specifically used to record and manage the rendering resources of the target application that have been loaded into video memory. In other words, the target application's target resource mapping table records the mapping relationships of historical rendering resources that the cloud server has loaded into video memory for the target application's application process.

[0126] In this embodiment, when a target hash value is found in the target resource mapping table of the target application, the target resource identifier is obtained from the target resource mapping table. The target resource mapping table records N mapping relationships between N candidate rendering resources that have been loaded into the rendering resource storage space and are used to execute the target task, and N resource identifiers of those N candidate rendering resources. The resource mapping table includes the target resource mapping table itself. In other words, by using this embodiment, on the one hand, by searching for the target hash value in the target resource mapping table, candidate rendering resources already loaded into the rendering resource storage space can be quickly located, thereby avoiding the overhead of repeatedly loading and converting resources, significantly improving the speed and efficiency of game rendering. On the other hand, since the target resource mapping table contains the mapping relationship between the hash values ​​and resource identifiers of rendering resources related to the target application process (such as a specific game, design software, or educational course module), resources related to the target application can be directly located during resource lookup, without needing to search for target resources in a large resource pool, thereby improving the accuracy and speed of resource location.

[0127] Optionally, as an alternative approach, adjusting the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position includes:

[0128] The target mapping relationship in the global resource mapping table is adjusted from the first position to the second position. The global resource mapping table includes the mapping relationship between each resource loaded into the target resource storage space and the resource identifier of each resource. The resource mapping table includes the global resource mapping table.

[0129] In this embodiment, the target mapping relationship in the global resource mapping table is adjusted from a first position to a second position. The global resource mapping table includes the mapping relationship between each resource already loaded into the target resource storage space and its resource identifier. In other words, by adjusting the position of resources in the global resource mapping table, the resource recycling priority is changed. This moves recently used resources to the second position in the table, reducing the likelihood of them being removed in subsequent recycling operations. This ensures that resources can be quickly obtained when resource demands recur, improving rendering efficiency and avoiding the waste of computing resources caused by reloading resources.

[0130] Optionally, as an alternative approach, after calculating the target hash value of the target rendering resource, the following steps are also included:

[0131] S1. If the target hash value is not found in the resource mapping table, create a reference resource identifier for the target resource.

[0132] S2, load the target resource into the target resource storage space, and record the reference mapping relationship between the reference resource identifier and the target hash value into the resource mapping table;

[0133] S3, obtain the target resource from the target resource storage space based on the reference resource identifier;

[0134] S4, Utilize target resources to execute target tasks.

[0135] Optionally, in some embodiments, the aforementioned creation of a reference resource identifier for the target resource may, but is not limited to, indicating the creation of a resource ID or resource name that can identify the target resource; this is not limited in this embodiment. The aforementioned loading of the target resource into the target resource storage space may, but is not limited to, loading the target resource from the cloud server's memory space into the graphics card's video memory.

[0136] It should be noted that recording the reference mapping relationship between the reference resource identifier and the target hash value in the resource mapping table may include, but is not limited to, recording the reference mapping relationship in the target resource mapping table and recording the reference mapping relationship in the second position of the global resource mapping table.

[0137] In this embodiment, when the target hash value is not found in the resource mapping table, a reference resource identifier is created for the target resource; the target resource is loaded into the target resource storage space, and the reference mapping relationship between the reference resource identifier and the target hash value is recorded in the resource mapping table; the target resource is retrieved from the target resource storage space based on the reference resource identifier; and the target task is executed using the target resource. In other words, using this embodiment, when the target hash value is not found in the resource mapping table, a reference resource identifier is created for the target rendering resource, and the resource is loaded into the rendering resource storage space. This ensures that all rendering resources, regardless of whether it is the first request, can be effectively managed and recorded. Even if a new resource does not yet exist in the resource mapping table, it can be included in the resource management system by creating a reference resource identifier and recording the reference mapping relationship. This guarantees the integrity and consistency of resource management and avoids resource omissions or mismanagement.

[0138] Optionally, as an alternative approach, recording the reference mapping relationship between the reference resource identifier and the target hash value in the resource mapping table includes:

[0139] The reference mapping relationship is recorded in the target resource mapping table and in the second position of the global resource mapping table. The target resource mapping table records N mapping relationships between N candidate resources that have been loaded into the target resource storage space for executing the target task and N resource identifiers of the N candidate resources. The resource mapping table includes the target resource mapping table. The global resource mapping table includes the mapping relationship between each resource that has been loaded into the target resource storage space and the resource identifier of each resource. The resource mapping table includes the global resource mapping table.

[0140] As an optional example, it can be, but is not limited to, by means of, such as Figure 5 The following example illustrates the steps described above:

[0141] like Figure 5 As shown in (a), before a rendering request is received, the mapping relationships recorded in the game resource mapping table A (used to represent the target application) of game A (used to represent the target resource mapping table) include the mapping relationships of resource 1 and resource 2; the mapping relationships recorded in the game resource mapping table B of game B include resource 3; the mapping relationships recorded in the global table resource mapping table include the mapping relationships of resource 1, resource 2 and resource 3.

[0142] Next, upon receiving the rendering request sent by game process A (representing the target application process) of game A, the hash value A (representing the target hash value) of resource 4 (representing the target resource) used to render the game screen (representing the target screen) corresponding to game process A is calculated.

[0143] Then, no mapping relationship was found between the resource identifier of the aforementioned resource 4 and the aforementioned hash value A in the game resource mapping table A, and thus... Figure 5 As shown in (b), the mapping relationship between the resource identifier of resource 4 and the hash value A is added to the game resource mapping table A, and the mapping relationship between the resource identifier of resource 4 and the hash value A is added to the end of the global resource mapping table (to indicate the second position mentioned above).

[0144] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0145] By employing the embodiments of this application, on the one hand, the dual mapping of resource identifiers and hash values ​​ensures the effective utilization of resources in the rendering resource storage space. On the other hand, the reference mapping relationship between the reference resource identifier and the target hash value is simultaneously recorded in a specific location (the second location) in both the target resource mapping table and the global resource mapping table. In other words, recording the reference mapping relationship in the second location of the global resource mapping table essentially assigns a higher residency priority to newly loaded or used resources in the Least Recently Used strategy. Thus, even under conditions of scarce video memory resources, these resources are less likely to be prematurely reclaimed, ensuring their availability in subsequent use and improving resource reuse rate.

[0146] Optionally, as an alternative approach, after loading the target resource into the target resource storage space, the following steps are also included:

[0147] S1, if the resource reclamation function of the target resource mapping table is enabled and the target application meets the first resource reclamation condition, clear the target resource mapping table and remove N mapping relationships from the global resource mapping table.

[0148] Optionally, the first resource reclamation condition mentioned above may be used, but is not limited to, to indicate that all application processes created by the target application have been shut down.

[0149] S2 removes N candidate resources from the target resource storage space.

[0150] For example, suppose that X application processes belonging to the target application have been created. If the process status of these X application processes is all closed, it is determined that the target application has met the first resource reclamation condition mentioned above. Then, all contents of the target application's target resource mapping table are cleared, and N mapping relationships that have been loaded into the video memory for the target application are removed from the global resource mapping table.

[0151] In this embodiment, when the resource reclamation function of the target resource mapping table is enabled and the target application meets the first resource reclamation condition, the target resource mapping table is cleared, and N mapping relationships are removed from the global resource mapping table; N candidate resources are removed from the target resource storage space. In other words, this embodiment allows for clearing the target resource mapping table and removing all mapping relationships related to the application from the global resource mapping table when the target resource mapping table resource reclamation function is enabled and the target application meets the first resource reclamation condition, followed by removing the corresponding candidate rendering resources from the rendering resource storage space. In other words, this embodiment allows for dynamic release of no longer needed resources based on current resource usage and preset resource reclamation conditions, thereby freeing up video memory and optimizing resource management.

[0152] Optionally, as an alternative approach, before clearing the target resource mapping table, the following steps are also included:

[0153] The target application is determined to have met the first resource reclamation condition after all application processes created for the target application have been closed.

[0154] As an optional example, the above steps can be illustrated using, but not limited to, the following examples:

[0155] If the target game (target application) still has a running game process, such as Figure 6 As shown in (a), the mapping relationships recorded in the game resource mapping table A of the target game (used to represent the target resource mapping table) include the mapping relationship between resource 1 and resource 2; the global resource mapping table includes the mapping relationship between resource 1, resource 2 and resource 3.

[0156] If all game processes of the target game are closed, such as Figure 6 As shown in (b), all content in the target game's game resource mapping table is cleared, and the mapping relationships of resource 1 and resource 2 included in the global resource mapping table are also removed.

[0157] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0158] By adopting the embodiments of this application, after determining that all processes of the target application have completely exited, the rendering resources for that application are reclaimed, thereby ensuring that the reclamation of resources will not affect the running application instances and improving the accuracy of resource management.

[0159] Optionally, as an alternative approach, after loading the target resource into the target resource storage space, the following steps are also included:

[0160] S1, if the target resource storage space is determined to meet the second resource reclamation condition, P resources mapped by the P mapping relationships of the candidate reclamation positions in the global resource mapping table are determined as resources to be reclaimed, wherein the resource removal priority of the resource corresponding to the candidate reclamation position is greater than the target priority.

[0161] It should be noted that in some embodiments, the total storage occupied by the above-mentioned P resources may be, but is not limited to, matching the target capacity. That is, in some embodiments, the resource capacity to be reclaimed (i.e., the above-mentioned target capacity) can be determined based on indicators such as the total capacity of the video memory. Then, when the video memory reaches the above-mentioned second resource reclamation condition, the P resources with the highest reclamation priority in the global resource mapping table (e.g., located at the beginning of the table) whose total capacity matches the target capacity are reclaimed, so as to release the video memory storage capacity and reduce the video memory pressure.

[0162] S2, remove P mapping relationships from the global resource mapping table, and if the target resource mapping table includes a recycling mapping relationship, remove the recycling mapping relationship from the target resource mapping table, where the P mapping relationships include a recycling mapping relationship.

[0163] S3 removes P resources from the target resource storage space.

[0164] Optionally, the second resource recycling condition mentioned above may be used, but is not limited to, to indicate that the space usage parameter of the target resource storage space is greater than the target threshold, wherein the space usage parameter is obtained based on the occupied space and the unoccupied space in the target resource storage space.

[0165] In this embodiment, when the target resource storage space reaches the second resource reclamation condition, P resources mapped by P mapping relationships at candidate reclamation positions in the global resource mapping table are identified as resources to be reclaimed, wherein the resource removal priority of the resources corresponding to the candidate reclamation positions is greater than the target priority; the P mapping relationships are removed from the global resource mapping table, and if the target resource mapping table includes a reclamation mapping relationship, the reclamation mapping relationship is removed from the target resource mapping table, wherein the P mapping relationships include a reclamation mapping relationship; the P resources are then removed from the target resource storage space. In other words, by adopting this embodiment, the resource reclamation mechanism is activated when the rendering resource storage space reaches the second resource reclamation condition, which can promptly release unnecessary video memory occupation, alleviate the pressure on video memory resources, and ensure efficient utilization of video memory. This is particularly important for multi-user, multi-game concurrent scenarios on cloud gaming servers, because video memory resources are limited, and reasonable reclamation can avoid resource bottleneck problems and maintain service stability and response speed.

[0166] Optionally, as an alternative approach, before determining the P resources mapped by the P mapping relationships at the candidate reclamation locations in the global resource mapping table as resources to be reclaimed, the method further includes:

[0167] S1, obtain the space usage parameters of the target resource storage space, wherein the space usage parameters are obtained based on the occupied space and the unoccupied space in the target resource storage space.

[0168] It should be noted that in some embodiments, the above-mentioned space usage parameters may be used, but are not limited to, to characterize the usage of the target resource storage space (such as video memory). For example, they may be the ratio of used space to total space, the amount of remaining space, etc. This embodiment does not limit this.

[0169] S2, if the space usage parameter is greater than the target threshold, determine that the target resource storage space has reached the second resource reclamation condition.

[0170] As an optional example, the above steps can be illustrated using, but not limited to, the following examples:

[0171] Suppose a cloud gaming server is running two games, game C and game D. One instance of game C is making a rendering request, and the video memory resources are gradually reaching saturation.

[0172] S1, the cloud gaming server monitors the usage of video memory and calculates the current space usage parameters. For example, if the used video memory is 10GB and the total video memory is 12GB, then the space usage parameter is 10GB / 12GB = 83.33%.

[0173] S2, assuming the target threshold is 80%, since the current space usage parameter of 83.33% is greater than the target threshold of 80%, the cloud gaming server determines that the rendering resource storage space has reached the second resource reclamation condition, and thus begins searching for rendering resources in the global resource mapping table that are located in candidate reclamation positions. Candidate reclamation positions are determined according to the LRU principle, that is, the least recently used resource positions in the table. Assuming P=3, the server considers reclamating the top 3 least recently used rendering resources, such as... Figure 7 As shown in (a), three rendering resources (RID010, RID011, and RID012) were identified as resources to be reclaimed in the global resource mapping table.

[0174] S3, then, the cloud gaming server, based on the identified rendering resources to be reclaimed (i.e., RID010, RID011, and RID012), releases the space they occupy in video memory, updates the global resource mapping table, and removes these rendering resources from the game resource mapping table corresponding to their game IDs. The reclaimed global resource mapping table is as follows: Figure 7 As shown in (b).

[0175] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0176] In this embodiment, space usage parameters of the target resource storage space are obtained. These parameters are based on the ratio of occupied to unoccupied space within the target resource storage space. If the space usage parameters exceed a target threshold, the target resource storage space is determined to have met a second resource reclamation condition. In other words, this embodiment automatically determines whether the second resource reclamation condition has been met based on the space usage parameters of the target resource storage space (such as the ratio of occupied to unoccupied space). This allows for dynamic adjustment of the resource reclamation strategy based on actual memory usage, effectively preventing performance degradation caused by excessive memory usage and achieving intelligent management of memory resources.

[0177] Optionally, as an alternative approach, calculating the target hash value of the target rendering resource includes:

[0178] S1, the initial rendering resources are transferred from the first storage space to the second storage space, wherein the amount of storage resources in the first storage space is greater than the amount of storage resources in the second storage space.

[0179] S2, perform hash calculation on the initial rendering resources to obtain the target hash value.

[0180] It should be noted that the aforementioned initial rendering resources may, but are not limited to, refer to the original rendering resources used to render the target image, typically stored in a large storage space. Furthermore, the aforementioned first storage space may, but is not limited to, refer to a large storage area, such as main memory or a hard drive, which stores all the resources required for the game to run. Due to its large storage capacity but relatively slow read speed, resources need to be transferred to a second storage space to improve rendering efficiency. Optionally, compared to the first storage space, the aforementioned second storage space is a storage area with a smaller amount of stored resources but a faster read speed, such as the memory of a cloud server.

[0181] In this embodiment, the initial rendering resources are transferred from a first storage space to a second storage space, wherein the storage resources in the first storage space are greater than those in the second storage space; a target hash value is obtained by hashing the initial rendering resources. In other words, by using this embodiment, transferring the initial rendering resources from a first storage space (such as a hard disk or large-capacity memory) with larger storage resources to a second storage space (such as a cache or video memory) with smaller storage resources for hashing can reduce data transfer time and bandwidth consumption.

[0182] Optionally, as an alternative approach, loading the target rendering resource into the rendering resource storage space includes:

[0183] S1, in the second storage space, the initial rendering resource is converted to obtain the target rendering resource.

[0184] Optionally, in some embodiments, the above-described format conversion processing operations may, but are not limited to, including those performed in the CPU's memory, such as converting initial rendering resources into a format directly supported by the graphics card, compressing resources, etc., to ensure that resources can be rendered and used efficiently. This embodiment does not limit this. For example, some resources may be stored in a format that the CPU can process more efficiently (such as PNG texture files), but require a different format (such as DDS or TGA format) on the graphics card. The CPU will convert the resources into a format supported by the graphics card so that the graphics card can load and use them directly. Compression and decompression: To save storage space or accelerate transmission, resources may be compressed. The CPU is responsible for decompressing these resources so that the CPU can load and render them.

[0185] Furthermore, the second storage space can also perform the following operations on the initial rendering resources: Data transformation: such as converting the vertex data of the model from one data structure to another so that the GPU can process it more efficiently. Pre-computation: such as lighting calculations, collision detection, etc., which may be pre-computed by the central processing unit before the game runs, and the generated data is directly used by the graphics card. Resource loading and management: such as reading resources from the hard drive or other storage media and loading them into memory, as well as memory management of resources (allocation and release). This embodiment does not impose any limitations on these aspects.

[0186] S2 transfers the target rendering resource from the second storage space to the rendering resource storage space.

[0187] It should be noted that, in some embodiments, the target rendering resource can be transferred from the second storage space to the rendering resource storage space through, but is not limited to, the following methods:

[0188] S1, Resource Request and Allocation: The game engine or rendering system sends a resource loading request to the graphics card driver (usually running in kernel space), including the size and type of the resource. The driver is responsible for pre-allocating enough space in the graphics card's video memory to store the resource.

[0189] S2, Direct Memory Access (DMA) initialization: The DMA controller receives a resource transfer request and initializes the transfer parameters, such as the source address (the resource location in memory), the destination address (the pre-allocated location in video memory), and the number of bytes to be transferred.

[0190] S3, Transfer Channel Settings: The DMA controller sets up the transfer channel to ensure that data can be transferred directly from system memory to video memory. This includes setting address mapping, transfer direction, data size, etc.

[0191] S4, Data Transfer: Once DMA initialization is complete, the transfer process begins. The DMA controller directly controls the memory bus, reading the target rendering resources from memory and writing them to a predetermined location in the GPU's video memory. During this process, the CPU can continue to perform other tasks, such as game logic processing and network communication, without being blocked by data transfer.

[0192] S5, Transfer Complete Notification: When the DMA transfer is complete, the DMA controller sends an interrupt signal to the CPU, notifying it that the target rendering resource transfer has been completed. At this time, the CPU can continue to process other tasks or update the resource management table with the result of the DMA transfer (i.e., the resource location in video memory).

[0193] It should be further noted that, in some embodiments, the target hash value may be sent to the kernel driver in order to look up the target hash value in the resource mapping table.

[0194] In this embodiment, the initial rendering resource is format-converted in the second storage space to obtain the target rendering resource; the target rendering resource is then transferred from the second storage space to the rendering resource storage space. In other words, by performing format conversion on the initial rendering resource in the second storage space using this embodiment, it can be ensured that all resources loaded into the video memory (rendering resource storage space) use a uniform format. This uniformity improves the compatibility and sharing efficiency of resources between different application processes, and avoids additional processing overhead and latency caused by format mismatch.

[0195] Optionally, as an alternative solution, the management methods for the above resources may include, but are not limited to:

[0196] S1, upon receiving a resource reclamation request for an object resource, removes the resource identifier and object mapping relationship of the object resource from the resource mapping table. The resource reclamation request for the object resource is used to request the reclamation of the object rendering resource.

[0197] S2 removes the object resource from the target resource storage space.

[0198] It should be noted that the above-mentioned object resource reclamation request may be used, but is not limited to, to indicate signals or instructions received by the cloud server through the target interface, which are used to indicate that specific resources (i.e., object resources) are no longer needed, thereby triggering the reclamation mechanism.

[0199] Optionally, removing the resource identifier and object mapping relationship of the object resource from the resource mapping table may include, but is not limited to: removing the resource identifier and object mapping relationship of the object resource from the global resource mapping table; removing the resource identifier and object mapping relationship of the object resource from the object resource mapping table, wherein the object resource performs application tasks related to the object application (e.g., rendering the application screen of the object application), and the object resource mapping table is a resource mapping table created for the object application.

[0200] For example, as an optional illustration, the following examples, but not limited to, can be used to illustrate the following steps:

[0201] Suppose cloud gaming server A is running multiple games, including game E and game F. The graphics card memory of the cloud gaming server stores various rendering resources for games E and F, such as textures, models, and shader programs. Suppose the central server (the management center for all cloud gaming servers) receives a message indicating that cloud gaming server A is no longer needed to run game E. The central server determines that cloud gaming server A no longer needs to store the object rendering resources corresponding to game E, and therefore sends an object rendering resource reclamation request to cloud gaming server A.

[0202] Then, when cloud gaming server A receives an object rendering resource reclamation request, it removes the resource identifier and object hash value of the object rendering resource from the global resource mapping table, and removes the resource identifier and object hash value of the object rendering resource from the object resource mapping table; thereby removing the object rendering resource from the target resource storage space.

[0203] It should be noted that the above examples are optional examples provided to facilitate the explanation of the above resource management method, and there are no limitations on the specific implementation of the above resource management method.

[0204] By employing the embodiments of this application, rendering resources on the cloud server are intelligently managed, achieving efficient resource utilization, reducing video memory fragmentation, supporting dynamic resource management, improving the gaming experience, increasing application concurrency capabilities, and reducing the operating costs of cloud services.

[0205] As an optional example, taking the above resource management method applied to a rendering scene as an example, it can be implemented, but is not limited to, through methods such as... Figure 8 The following example illustrates the overall management method for the above resources:

[0206] Execute step S802 to transfer the initial rendering resources from the first storage space to the second storage space, wherein the amount of storage resources in the first storage space is greater than the amount of storage resources in the second storage space;

[0207] Then, step S804 is executed. If a rendering request for rendering the target screen corresponding to the target application process is obtained, the initial rendering resource is hashed to obtain the target hash value.

[0208] Then, step S806 is executed to determine whether the target application's target resource mapping table includes a target hash value. The target resource mapping table records N mapping relationships between N candidate rendering resources that are used to render the application screen of the target application and have been loaded into the rendering resource storage space (used to represent the above-mentioned target resource storage space) and N resource identifiers of the N candidate rendering resources.

[0209] If the target hash value is found in the target resource mapping table, execute steps S808-1, S808-1-1, and S808-1-2:

[0210] Step S808-1: Obtain the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table;

[0211] Step S808-1-1: Obtain the target rendering resource (used to represent the above target resource) from the rendering resource storage space based on the target resource identifier;

[0212] Step S808-1-2: Render the target image using the target rendering resource, and adjust the target mapping relationship between the target hash value and the target resource identifier in the global resource mapping table from the first position to the second position. The resource removal priority of the rendering resource corresponding to the first position is greater than the resource removal priority of the rendering resource corresponding to the second position.

[0213] If the target hash value is not found in the target resource mapping table, execute steps S808-2, S808-2-1, S808-2-2, S808-2-3, and S808-2-4:

[0214] Step S808-2: The initial rendering resource is converted into a target rendering resource in the second storage space.

[0215] Step S808-2-1: Create a reference resource identifier for the target rendering resource, record the reference mapping relationship in the target resource mapping table, and record the reference mapping relationship in the second position of the global resource mapping table.

[0216] Step S808-2-2: Transfer the target rendering resource from the second storage space to the rendering resource storage space;

[0217] Step S808-2-3: Obtain the target rendering resource from the rendering resource storage space based on the reference resource identifier;

[0218] Step S808-2-4: Render the target image using the target rendering resources;

[0219] Next, step S810 is executed, whereby the target application is determined to have met the first resource reclamation condition after all application processes created for the target application have been closed.

[0220] Next, execute step S812. If the resource reclamation function of the target resource mapping table is enabled, clear the target resource mapping table and remove N mapping relationships from the global resource mapping table.

[0221] Next, step S814 is executed to remove N candidate rendering resources from the rendering resource storage space;

[0222] Next, step S816 is executed. If the space usage parameters of the rendering resource storage space reach the target threshold, the P rendering resources mapped by the P mapping relationships located at the candidate recycling positions in the global resource mapping table are determined as rendering resources to be recycled. The resource removal priority of the rendering resources corresponding to the candidate recycling positions is greater than the target priority. The space usage parameters are obtained based on the space already occupied in the rendering resource storage space and the space not yet occupied in the rendering resource storage space.

[0223] Then, step S818 is executed to remove P mapping relationships from the global resource mapping table, and if the target resource mapping table includes a recycling mapping relationship, the recycling mapping relationship is removed from the target resource mapping table, wherein the P mapping relationships include a recycling mapping relationship;

[0224] Then, step S820 is executed to remove P rendering resources from the rendering resource storage space;

[0225] In step S822, upon receiving an object rendering resource recycling request, the resource identifier of the object rendering resource and the object mapping relationship of the object rendering resource are removed from the resource mapping table. The object rendering resource recycling request is used to request the recycling of the object rendering resource.

[0226] Next, step S824 is executed to remove the object rendering resources from the rendering resource storage space.

[0227] By employing the embodiments of this application, on the one hand, resources already existing in the resource mapping table can be directly located through hash lookup, avoiding duplicate loading of resources. In other words, if a resource has already been loaded into video memory, subsequent application processes can use it immediately without having to go through the process of loading resources from the hard drive or network again, saving computing resources and network bandwidth, and improving screen rendering efficiency. On the other hand, the resource mapping table uses a least recently used mechanism, meaning that used resources are relocated to the second position in the table with a lower removal priority, while resources that have not been used for a long time are gradually moved to the first position in the table, becoming potential targets for reclamation. When the resource reclamation conditions are met, the server will reclaim resources starting from the first position, ensuring efficient utilization of resources in video memory, reducing invalid resource occupation, and avoiding waste of computing resources. In summary, by employing the embodiments of this application, the technical problem of wasted computing resources caused by the frequent loading of resources into video memory in the resource management methods provided in related technologies is solved, achieving the technical effects of saving computing resources and improving screen rendering efficiency.

[0228] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0229] According to another aspect of the embodiments of this application, a resource management apparatus for implementing the above-described resource management method is also provided. For example... Figure 9 As shown, the device includes:

[0230] The first acquisition unit 902 is used to acquire the target hash value of the target resource, wherein the target resource is used to execute the target task corresponding to the target application process;

[0231] The second acquisition unit 904 is used to retrieve the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table when the target hash value is found in the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources that have been loaded into the target resource storage space and the resource identifiers of M resources, where M is a positive integer.

[0232] The third acquisition unit 906 is used to acquire the target resource from the resource storage space based on the target resource identifier;

[0233] The adjustment unit 908 is used to execute the target task using the target resource and adjust the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position, wherein the resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

[0234] Optionally, in this embodiment, the second acquisition unit includes: a first acquisition module, used to acquire a target resource identifier from the target resource mapping table when a target hash value is found in the target resource mapping table of the target application, wherein the target resource mapping table records N mapping relationships between N candidate resources used to perform the target task and loaded into the target resource storage space and N resource identifiers of the N candidate resources, and the resource mapping table includes the target resource mapping table.

[0235] Optionally, in this embodiment, the adjustment unit includes: an adjustment module, used to adjust the target mapping relationship in the global resource mapping table from a first position to a second position, wherein the global resource mapping table includes the mapping relationship between each resource loaded into the target resource storage space and the resource identifier of each resource, and the resource mapping table includes the global resource mapping table.

[0236] Optionally, in this embodiment, the above-mentioned apparatus further includes: a first creation unit, configured to create a reference resource identifier for the target resource when the target hash value is not found in the resource mapping table; a recording unit, configured to load the target resource into the target resource storage space and record the reference mapping relationship between the reference resource identifier and the target hash value into the resource mapping table; a fourth acquisition unit, configured to acquire the target resource from the target resource storage space based on the reference resource identifier; and a task processing unit, configured to execute the target task using the target resource.

[0237] Optionally, in this embodiment, the recording unit includes: a recording module, used to record the reference mapping relationship to the target resource mapping table and to record the reference mapping relationship at a second position in the global resource mapping table, wherein the target resource mapping table records N mapping relationships between N candidate resources that are loaded into the target resource storage space for executing the target task and N resource identifiers of the N candidate resources, and the resource mapping table includes the target resource mapping table, and the global resource mapping table includes the mapping relationship between each resource loaded into the target resource storage space and the resource identifier of each resource, and the resource mapping table includes the global resource mapping table.

[0238] Optionally, in this embodiment, the above-mentioned device further includes: a first removal unit, configured to clear the target resource mapping table and remove N mapping relationships from the global resource mapping table when the resource reclamation function of the target resource mapping table is enabled and the target application meets the first resource reclamation condition; and a second removal unit, configured to remove N candidate resources from the target resource storage space.

[0239] Optionally, in this embodiment, the above-mentioned apparatus further includes: a second creation unit, configured to determine that the target application has reached the first resource reclamation condition when all application processes created for the target application have been closed.

[0240] Optionally, in this embodiment, the above-mentioned device further includes: a first determining unit, configured to determine P resources mapped by P mapping relationships located at candidate recycling positions in the global resource mapping table as resources to be recycled when the target resource storage space is determined to meet the second resource recycling condition, wherein the resource removal priority of the resource corresponding to the candidate recycling position is greater than the target priority; a third removing unit, configured to remove the P mapping relationships from the global resource mapping table, and if the target resource mapping table includes recycling mapping relationships, remove the recycling mapping relationships from the target resource mapping table, wherein the P mapping relationships include recycling mapping relationships; and a fourth removing unit, configured to remove the P resources from the target resource storage space.

[0241] Optionally, in this embodiment, the above-mentioned device further includes: a fifth acquisition unit, used to acquire space usage parameters of the target resource storage space, wherein the space usage parameters are obtained based on the occupied space and the unoccupied space in the target resource storage space; and a second determination unit, used to determine that the target resource storage space has reached the second resource recycling condition when the space usage parameters are greater than the target threshold.

[0242] Optionally, in this embodiment, the above-mentioned apparatus further includes: a receiving unit, configured to remove the resource identifier of the object resource and the object mapping relationship of the object resource from the resource mapping table when receiving an object resource recycling request, wherein the object resource recycling request is used to request the recycling of the object resource; and a fifth removal unit, configured to remove the object resource from the target resource storage space.

[0243] For specific implementation examples, please refer to the examples shown in the resource management method above. This embodiment will not be repeated here.

[0244] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described resource management method is also provided. This embodiment uses a server as an example for illustration. Figure 10 As shown, the electronic device includes a memory 1002 and a processor 1004. The memory 1002 stores a computer program, and the processor 1004 is configured to execute the steps of any of the above method embodiments via the computer program.

[0245] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.

[0246] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0247] S1, obtain the target hash value of the target resource, where the target resource is used to execute the target task corresponding to the target application process;

[0248] S2, if the target hash value is found in the resource mapping table, retrieve the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources that have been loaded into the target resource storage space and the resource identifiers of M resources, where M is a positive integer.

[0249] S3, retrieve the target resource from the resource storage space based on the target resource identifier;

[0250] S4. Execute the target task using the target resource, and adjust the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position. The resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

[0251] Alternatively, as those skilled in the art will understand, Figure 10The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 10 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 10 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 10 The different configurations shown.

[0252] The memory 1002 can be used to store software programs and modules, such as the program instructions / modules corresponding to the resource management method and apparatus in this embodiment. The processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, thereby realizing the aforementioned resource management method. The memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1002 may further include memory remotely located relative to the processor 1004, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. As an example, such as... Figure 10 As shown, the memory 1002 may include, but is not limited to, the first acquisition unit 902, the second acquisition unit 904, the third acquisition unit 906, and the adjustment unit 908 in the resource management device. Furthermore, it may include, but is not limited to, other module units in the resource management device, which will not be elaborated upon in this example.

[0253] Optionally, the transmission device 1006 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1006 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1006 is a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0254] In addition, the aforementioned electronic device also includes a display 1008 and a connection bus 1010 for connecting the various module components in the aforementioned electronic device.

[0255] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a point-to-point network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this point-to-point network.

[0256] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit, it performs various functions provided in the embodiments of this application.

[0257] According to one aspect of this application, another computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the methods in various embodiments of this application.

[0258] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described method.

[0259] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0260] S1, obtain the target hash value of the target resource, where the target resource is used to execute the target task corresponding to the target application process;

[0261] S2, if the target hash value is found in the resource mapping table, retrieve the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources that have been loaded into the target resource storage space and the resource identifiers of M resources, where M is a positive integer.

[0262] S3, retrieve the target resource from the resource storage space based on the target resource identifier;

[0263] S4. Execute the target task using the target resource, and adjust the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position. The resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

[0264] It should be noted that the data collection and processing described in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0265] Optionally, in the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0266] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0267] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0268] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0269] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0270] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0271] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0272] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A resource management method, characterized in that, include: Obtain the target hash value of the target resource, wherein the target resource is used to execute the target task corresponding to the target application process; If the target hash value is found in the resource mapping table, the target resource identifier that has a mapping relationship with the target hash value is obtained from the resource mapping table. The resource mapping table records the mapping relationship between the hash values ​​of M resources that have been loaded into the target resource storage space and the resource identifiers of the M resources, where M is a positive integer. The target resource is obtained from the resource storage space based on the target resource identifier; The target task is executed using the target resource, and the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table is adjusted from the first position to the second position, wherein the resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

2. The method according to claim 1, characterized in that, When the target hash value is found in the resource mapping table, obtaining the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table includes: If the target hash value is found in the target resource mapping table of the target application, the target resource identifier is obtained from the target resource mapping table. The target resource mapping table records N mapping relationships between N candidate resources used to execute the target task and loaded into the target resource storage space and N resource identifiers of the N candidate resources. The resource mapping table includes the target resource mapping table.

3. The method according to claim 2, characterized in that, The step of adjusting the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from the first position to the second position includes: The target mapping relationship in the global resource mapping table is adjusted from the first position to the second position. The global resource mapping table includes the mapping relationship between each resource loaded into the target resource storage space and the resource identifier of each resource. The resource mapping table includes the global resource mapping table.

4. The method according to claim 1, characterized in that, After obtaining the target hash value of the target resource, the process also includes: If the target hash value is not found in the resource mapping table, a reference resource identifier is created for the target resource; The target resource is loaded into the target resource storage space, and the reference mapping relationship between the reference resource identifier and the target hash value is recorded in the resource mapping table; The target resource is obtained from the target resource storage space based on the reference resource identifier; The target task is executed using the target resources.

5. The method according to claim 4, characterized in that, The step of recording the reference mapping relationship between the reference resource identifier and the target hash value into the resource mapping table includes: The reference mapping relationship is recorded in the target resource mapping table, and the reference mapping relationship is also recorded in the second position of the global resource mapping table. The target resource mapping table records N mapping relationships between N candidate resources that are used to execute the target task and have been loaded into the target resource storage space and N resource identifiers of the N candidate resources. The resource mapping table includes the target resource mapping table. The global resource mapping table includes the mapping relationship between each resource that has been loaded into the target resource storage space and the resource identifier of each resource. The resource mapping table includes the global resource mapping table.

6. The method according to claim 5, characterized in that, After loading the target resource into the target resource storage space, the method further includes: If the resource reclamation function of the target resource mapping table is enabled and the target application meets the first resource reclamation condition, the target resource mapping table is cleared and the N mapping relationships are removed from the global resource mapping table. Remove the N candidate resources from the target resource storage space.

7. The method according to claim 6, characterized in that, Before clearing the target resource mapping table, the method further includes: If all application processes created for the target application have been closed, the target application is determined to have met the first resource reclamation condition.

8. The method according to claim 5, characterized in that, After loading the target resource into the target resource storage space, the method further includes: If the target resource storage space is determined to meet the second resource reclamation condition, P resources mapped by P mapping relationships located at candidate reclamation positions in the global resource mapping table are determined as resources to be reclaimed, wherein the resource removal priority of the resource corresponding to the candidate reclamation position is greater than the target priority. Remove the P mapping relationships from the global resource mapping table, and if the target resource mapping table includes a recycling mapping relationship, remove the recycling mapping relationship from the target resource mapping table, wherein the P mapping relationships include the recycling mapping relationship; Remove the P resources from the target resource storage space.

9. The method according to claim 8, characterized in that, Before determining the P resources mapped by the P mapping relationships located at the candidate reclamation positions in the global resource mapping table as resources to be reclaimed, the method further includes: Obtain the space usage parameters of the target resource storage space, wherein the space usage parameters are obtained based on the occupied space and the unoccupied space in the target resource storage space; If the space usage parameter is greater than the target threshold, the target resource storage space is determined to meet the second resource reclamation condition.

10. The method according to any one of claims 1 to 9, characterized in that, The resource management method also includes: Upon receiving an object resource reclamation request, the resource identifier of the object resource and the object mapping relationship of the object resource are removed from the resource mapping table, wherein the object resource reclamation request is used to request the reclamation of the object resource. Remove the object resource from the target resource storage space.

11. A resource management device, characterized in that, include: The first acquisition unit is used to acquire the target hash value of the target resource, wherein the target resource is used to execute the target task corresponding to the target application process; The second acquisition unit is used to, when the target hash value is found in the resource mapping table, acquire the target resource identifier that has a mapping relationship with the target hash value from the resource mapping table, wherein the resource mapping table records the mapping relationship between the hash values ​​of M resources that have been loaded into the target resource storage space and the resource identifiers of the M resources, where M is a positive integer; The third acquisition unit is used to acquire the target resource from the resource storage space based on the target resource identifier; An adjustment unit is configured to execute the target task using the target resource and adjust the target mapping relationship between the target hash value and the target resource identifier in the resource mapping table from a first position to a second position, wherein the resource removal priority of the resource corresponding to the first position is greater than the resource removal priority of the resource corresponding to the second position.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program is executed by a processor to perform the method described in any one of claims 1 to 10.

13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 10.

14. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 10 through the computer program.