Resource management method and apparatus, and device
By generating identification information for image encoding and decoding requests, indicating whether hardware storage resources can be passively reclaimed, the resource allocation problem under limited hardware encoding and decoding resources is solved, improving user experience and application stability.
Patent Information
- Application Number
- PCT/CN2025/112160
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-30
- Filing Date
- 2025-08-01
- Publication Date
- 2026-03-05
AI Technical Summary
Given limited hardware encoding and decoding resources, how can we coordinate the demand for hardware encoding and decoding resources across various business scenarios to avoid resource allocation failures and a decline in user experience due to insufficient resources?
By generating identification information for image encoding and decoding requests, it indicates whether hardware storage resources are allowed to be passively reclaimed, and resource allocation management is carried out based on this identification information to ensure the stable operation of important applications.
It improves user experience, ensures the stable operation of critical applications, avoids resource allocation failures, and prioritizes meeting the resource needs of critical applications.
Smart Images

Figure CN2025112160_05032026_PF_FP_ABST
Abstract
Description
Resource management methods, devices and equipment
[0001] This application claims priority to Chinese Patent Application No. 202411211015.2, filed on August 30, 2024, entitled “Resource Management Method, Apparatus and Equipment”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to, but is not limited to, the field of computer technology, and in particular to a resource management method, apparatus, and device. Background Technology
[0003] Currently, electronic devices are increasingly employing video encoding and decoding technologies (such as MediaCodec) to perform video encoding and decoding processing in various scenarios and applications. Examples include camera recording, mobile phone screen recording, desktop projection (projecting screens to another device as a data stream), and various video players. Before performing video encoding and decoding, electronic devices allocate a fixed amount of hardware encoding and decoding resources to the video encoding and decoding processing application, such as allocating 2K, 4K, 8K, or even larger amounts of memory.
[0004] Because electronic devices have limited hardware encoding and decoding resources, it is difficult to meet the corresponding hardware encoding and decoding resource requirements when all business scenarios on the electronic device are used simultaneously, resulting in insufficient resources when new businesses request hardware encoding and decoding resources.
[0005] Therefore, given the limited hardware encoding and decoding resources, how to coordinate the demand for hardware encoding and decoding resources across various business scenarios has become an urgent problem to be solved. Summary of the Invention
[0006] In view of this, this application provides at least one resource management method, apparatus, and device.
[0007] The technical solution of this application is implemented as follows:
[0008] On the one hand, this application provides a resource management method, including:
[0009] In response to the first request, a second request is generated for the first application using the first service; the first request represents an image encoding or decoding request; the first service represents an image encoding / decoding service; the second request represents a hardware storage resource allocation request.
[0010] Based on the first application, the first service is used to generate corresponding identification information for the second request; the identification information is used to indicate whether the hardware storage resources allocated for the second request can be passively reclaimed;
[0011] Based on the second request, a second service is used to allocate hardware storage resources for the second request; the second service represents a hardware storage resource management service; the hardware storage resources represent storage resources used to perform image encoding or decoding.
[0012] In some embodiments, based on the first application, the first service generates corresponding identification information for the second request, including at least one of the following:
[0013] The configuration data of the first application includes the first target configuration data, and the first service is used to generate the first identification information for the second request;
[0014] In response to the application identifier of the first application being a preset first target application identifier, the first service is used to generate first identifier information for the second request;
[0015] In response to the application type of the first application being a preset first target application type, the first service is used to generate first identification information for the second request;
[0016] The first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively reclaimed.
[0017] In some embodiments, the method further includes:
[0018] Using the second service, the request identifier corresponding to the second request is added to the whitelist; the hardware storage resources corresponding to each request identifier in the whitelist are not allowed to be passively reclaimed.
[0019] In some embodiments, the method further includes:
[0020] The third request is received using the second service; wherein the third request represents a hardware storage resource allocation request corresponding to the second application.
[0021] In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources corresponding to the third request, at least a portion of the hardware storage resources other than the hardware storage resources corresponding to the second request are reclaimed.
[0022] Based on the remaining hardware storage resources after recycling, the second service is used to allocate hardware storage resources for the third request.
[0023] In some embodiments, the method further includes:
[0024] In response to the fourth request, the first service is used to generate a third request for the second application; the fourth request represents an image encoding or decoding request.
[0025] Based on the second application, the first service is used to generate second identification information for the third request; the second identification information is used to instruct the second service to reclaim all allocated hardware storage resources except for the hardware storage resources corresponding to the first identification information when the remaining hardware storage resources are insufficient.
[0026] In some embodiments, based on the second application, the second identification information is generated for the third request using the first service, including at least one of the following:
[0027] In response to the configuration data of the second application, including the second target configuration data, the first service is used to generate second identification information for the third request;
[0028] In response to the application identifier of the second application being a preset second target application identifier, the first service is used to generate second identifier information for the third request;
[0029] In response to the application type of the second application being a preset second target application type, the first service is used to generate second identification information for the third request.
[0030] In some embodiments, in response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, at least a portion of the hardware storage resources other than those corresponding to the second request are reclaimed, including:
[0031] In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources requested by the third request, the second service is used to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request.
[0032] Based on the remaining hardware storage resources after recycling, the second service is used to allocate hardware storage resources for the third request.
[0033] In some embodiments, before reclaiming all allocated hardware storage resources other than those corresponding to the second request using the second service, the method further includes:
[0034] Determine the priority information corresponding to at least one fifth request; the fifth request represents a request for allocated hardware storage resources other than the second request;
[0035] Based on priority information, determine a specified number of sixth requests with lower priority from at least one fifth request;
[0036] The second service is used to reclaim the hardware storage resources corresponding to each sixth request.
[0037] On the other hand, this application provides a resource management device, including:
[0038] The first service module is used to respond to the first request, generate a second request for the first application, and generate corresponding identification information for the second request based on the first application; the first request represents an image encoding or decoding request; the first service represents an image encoding or decoding service; the second request represents a hardware storage resource allocation request; the identification information is used to indicate whether the hardware storage resources allocated for the second request can be passively reclaimed;
[0039] The second service module is used to allocate hardware storage resources for the second request; the hardware storage resources represent the storage resources used to perform image encoding or decoding.
[0040] On the other hand, this application provides an electronic device, including: a controller and a memory; wherein,
[0041] Memory used to perform image encoding and / or decoding;
[0042] Controller, used for:
[0043] In response to the first request, a second request is generated for the first application using the first service; the first request represents an image encoding or decoding request; the first service represents an image encoding / decoding service; the second request represents a memory resource allocation request.
[0044] Based on the first application, the first service is used to generate corresponding identification information for the second request; the identification information is used to indicate whether the memory resources allocated for the second request can be passively reclaimed;
[0045] Based on the second request, the second service is used to allocate memory resources for the second request; the second service represents the memory resource management service.
[0046] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure. Attached Figure Description
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0048] Figure 1 is a schematic diagram of the implementation process of an image encoding and decoding resource management method;
[0049] Figure 2A is a schematic diagram of resource usage when performing resource reclamation according to an image encoding and decoding resource management method;
[0050] Figure 2B is a schematic diagram of resource usage when performing resource reclamation according to an image encoding and decoding resource management method;
[0051] Figure 2C is a schematic diagram of resource usage when performing resource reclamation according to an image encoding and decoding resource management method;
[0052] Figure 2D is a schematic diagram of resource usage when performing resource reclamation according to an image encoding and decoding resource management method;
[0053] Figure 3 is a schematic diagram of the implementation process of a resource management method provided in this application;
[0054] Figure 4 is a schematic diagram of the implementation process of an embodiment of a resource management method provided in this application;
[0055] Figure 5 is a schematic diagram of the implementation process of another embodiment of a resource management method provided in this application;
[0056] Figure 6 is a schematic diagram of the composition structure of a resource management device provided in this application;
[0057] Figure 7 is a schematic diagram of the composition structure of a resource management device provided in this application;
[0058] Figure 8 is a schematic diagram of the hardware structure of a resource management device provided in this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0060] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0061] The terms “first / second / third” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first / second / third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used herein is for descriptive purposes only and is not intended to limit the scope of this application.
[0063] In related technologies, when a new hardware encoding resource request appears in an electronic device and there is a shortage of hardware encoding and decoding resources, the hardware encoding and decoding resources corresponding to the lower priority requests will be released according to the priority of the current hardware encoding and decoding resource requests, and the hardware encoding and decoding resources will be reallocated to the new hardware encoding and decoding resource requests based on the released hardware encoding and decoding resources.
[0064] As shown in Figure 1, after the screen recording application's resource request 110 is sent to the system hardware codec resource manager 100, the system hardware codec resource manager 100 determines whether the remaining hardware codec resources are sufficient to meet the resource amount requested by the screen recording application's resource request 110. If the resources are sufficient, the system hardware codec resource manager 100 allocates the required hardware codec resources to the screen recording application's resource request 110. If the resources are insufficient, the system hardware codec resource manager 100 obtains the information of the currently used resources 120.
[0065] The currently used resources 120 include resources 121 used in the background of the Internet software, resources 122 used in the background of application A, resources 123 used in the background of application B, and resources 124 used in the background of application C; among them, application A, application B, and application C can be applications that require hardware encoding and decoding resources, such as video players or video editing applications.
[0066] Here, the interconnection software is used to establish a secure data channel between two devices and has at least an application casting function. That is, it transmits the image of the application page that needs to be cast to the target device frame by frame in real time in the form of a data stream. Since the casting function of the interconnection software is implemented based on the data stream, it needs to occupy encoding resources to encode and transmit the image.
[0067] Simultaneously, the system hardware codec resource manager 100 determines the priority information of the resource requests corresponding to each background resource. Here, the resource request corresponding to resource 121 used by the Internet software background has the first priority, the resource request corresponding to resource 122 used by application A background has the second priority, the resource request corresponding to resource 123 used by application B background has the second priority, and the resource request corresponding to resource 124 used by application C background has the third priority. It can be seen that among the currently used resources 120, the resource request corresponding to resource 124 used by application C background has the lowest priority.
[0068] Subsequently, the system hardware codec resource manager 100 determines the releasable resources 130 from the currently used resources 120. Here, the releasable resources 130 include resources used in the background by the interconnected software 131, resources used in the background by application A 132, resources used in the background by application B 133, and resources used in the background by application C 134.
[0069] Subsequently, the system hardware codec resource manager 100 determines the resource requests for releasing hardware codec resources based on the priority of each resource in the releasable resources 130. Here, since the resource request corresponding to application C's background use of resource 134 has the lowest priority, application C's background use of resource 134 is determined to be released, that is, application C's use of resource 140 is determined to be released;
[0070] Afterwards, application C uses resource 140; application C's resource request 150 is placed in the background, and the priority of application C's resource request 150 is updated when it is placed in the background.
[0071] After releasing the resource 140 used by application C, the system hardware codec resource manager 100 re-evaluates whether the remaining hardware codec resources are sufficient. If the resources are sufficient, hardware codec resources are allocated to the resource request 110 of the screen recording application. If the resources are insufficient, the resources in the releaseable resources 130 are released one by one according to priority.
[0072] Additionally, after performing a specified number of resource reclamations on the releasable resources 130, if the remaining resource amount is still less than the resource amount requested by the screen recording application's resource request 110, a resource request failure message is returned to the screen recording application.
[0073] As shown in Figure 2A, the total amount of hardware encoding and decoding resources in the current system is 8K, and the total amount of allocated resources is 5K. Among them, the background resources used by the interconnected software are 2K, the background resources used by application A are 1K, the background resources used by application B are 1K, and the background resources used by application C are 1K.
[0074] When the screen recording application requests 8K of resources in its resource request 110, the remaining resources (i.e., 3K remaining) do not meet the resource request requirements. Therefore, the system hardware codec resource manager 100 reclaims the resources used by the lower-priority application C in the background.
[0075] After the first resource reclamation, as shown in Figure 2B, the current remaining resource amount is 4K, which still does not meet the resource request 110 of the screen recording application. Therefore, the system hardware codec resource manager 100 continues to reclaim the resources used by the lower priority application B in the background.
[0076] After the second resource reclamation, as shown in Figure 2C, the current remaining resource amount is 5K, which still does not meet the resource request 110 of the screen recording application. Therefore, the system hardware codec resource manager 100 continues to reclaim resources used by the lower-priority application A in the background;
[0077] After the third resource reclamation, as shown in Figure 2D, the current remaining resource amount is 6K, which still does not meet the resource request requirement of 110 for the screen recording application.
[0078] The system hardware codec resource manager 100 continues to reclaim resources used in the background by the lower-priority application B.
[0079] If, according to the preset resource reclamation strategy, resources are still insufficient after three resource reclamations, a resource allocation failure message will be returned to the screen recording application's resource request 110. If, according to the preset resource reclamation strategy, a fourth resource reclamation can be performed, the resources used by the highest-priority interconnected software in the background will be reclaimed, causing the screen casting of the application based on the interconnected software to be interrupted, resulting in a poor user experience.
[0080] In the above technical solution, each application requests and manages its own hardware codec resources. When a new resource request occurs, the system's hardware codec manager determines which application's resources to release, and the application cannot react. In addition, the above technical solution only selects hardware codec resource requests to be released based on priority, which makes it impossible to customize the handling of certain special business scenarios. For example, if the hardware codec resources of business scenarios such as screen casting applications are passively reclaimed, it may result in extremely poor user experience such as process crashes and screen freezes. When high-priority requests face resource shortages, the system cannot determine whether the resource requirements of the high-priority request can be met after performing a specified number of resource reclamation operations, which may lead to resource allocation failure, also resulting in a poor user experience.
[0081] Based on this, this application provides a resource management method that can be executed by a processor of an electronic device. The electronic device refers to a server, laptop computer, tablet computer, desktop computer, smart TV, set-top box, mobile device (e.g., mobile phone, portable video player, personal digital assistant, dedicated messaging device, portable gaming device), or any other device with data processing capabilities.
[0082] Figure 3 is a schematic diagram of the implementation process of a resource management method provided in this application. As shown in Figure 3, the method includes the following steps S301 to S303:
[0083] Step S301: In response to the first request, a second request is generated for the first application using the first service; the first request represents an image encoding or decoding request; the first service represents an image encoding / decoding service; the second request represents a hardware storage resource allocation request.
[0084] Here, the first request is an image encoding or decoding request issued by an application running on an electronic device that has image and / or video encoding and decoding capabilities.
[0085] The application that generates the first request can include, for example, camera recording applications, mobile screen recording applications, desktop projection applications, various video players, and so on.
[0086] The first service refers to the image encoding and decoding service provided by the image codec.
[0087] In some embodiments, the image codec may be an image codec running on the Android platform, such as MediaCodec; or an image codec running on the Windows platform, such as the WIC (Windows Imaging Component) component; and so on.
[0088] Of course, the image encoder can also be used for image codecs in other operating systems, without any restrictions.
[0089] The first service is used to generate a second request for the first application. That is, the image encoding and decoding service provided by the image codec is used to generate a corresponding hardware storage resource allocation request based on the image encoding or decoding request generated by the application, so as to obtain the required hardware encoding and decoding resources (e.g., memory resources) based on the second request.
[0090] In some embodiments, when the first service is an image encoding / decoding service provided by MediaCodec, the image encoding / decoding service provided by MediaCodec generates a second request based on the application's image encoding or decoding request, and generates a corresponding MediaCodec process or thread.
[0091] In some embodiments, the second request includes at least the requested amount of hardware storage resources.
[0092] Step S302: Based on the first application, generate corresponding identification information for the second request using the first service; the identification information is used to indicate whether the hardware storage resources allocated for the second request are allowed to be passively reclaimed.
[0093] Here, the first service identifies the application information of the first application and generates corresponding identification information for the second request based on the application information.
[0094] In some embodiments, the application information of the first application may include the application identifier information, application configuration information, application type information, runtime environment information, runtime status information, etc.
[0095] In this way, based on the application identification information, application configuration information, application type information, operating environment information and / or operating status information of the first application, identification information is generated for the second request corresponding to the first application, so as to indicate whether the hardware storage resources allocated for the second request can be passively reclaimed.
[0096] Here, passive reclamation refers to whether the hardware storage resource manager can reclaim the hardware storage resources allocated to the second request when there is insufficient remaining hardware storage resources after allocating the corresponding hardware storage resources for the second request.
[0097] Step S303: Based on the second request, allocate hardware storage resources for the second request using a second service; the second service represents a hardware storage resource management service; the hardware storage resources represent storage resources used to perform image encoding or decoding.
[0098] Here, the second service refers to the hardware storage resource management service provided by the hardware storage resource manager in the electronic device.
[0099] Hardware storage resources characterize storage resources used to perform image encoding or decoding. In some embodiments, hardware storage resources characterize specific memory resources in the memory space of an electronic device.
[0100] In this way, the hardware storage resource management service provided by the electronic device allocates corresponding hardware storage resources to the second request based on the amount of hardware storage resources requested by the second request.
[0101] In the resource management method provided in this application, firstly, in response to a first request, a second request is generated for a first application using a first service, wherein the first request represents an image encoding or decoding request, the first service represents an image encoding / decoding service, and the second request represents a hardware storage resource allocation request; then, based on the first application, corresponding identification information is generated for the second request using the first service, and this identification information is used to indicate whether the hardware storage resources allocated for the second request are allowed to be passively reclaimed; finally, based on the second request, hardware storage resources are allocated for the second request using the second service. In this way, when the image encoding or decoding operation corresponding to the first application cannot be forcibly stopped or terminated, by generating an identifier that does not allow passive reclamation for the hardware storage resource allocation request corresponding to the first application, it can be determined not to reclaim the hardware storage resources corresponding to the first application when the remaining hardware storage resources are insufficient, thereby enabling the first application to run stably and improving the user experience. Conversely, when the image encoding or decoding operation of the first application can be stopped or terminated, by allocating an identifier that allows passive reclamation for the hardware storage resources corresponding to the first application, it can be determined to reclaim or prioritize the reclamation of the hardware storage resources corresponding to the first application when the remaining hardware storage resources are insufficient, so that new hardware storage resource allocation requests can be responded to in a timely manner.
[0102] In some embodiments, the step of generating corresponding identification information for the second request based on the first application and utilizing the first service, i.e., step S302 above, can be implemented as at least one of the following steps S3021 to S3023:
[0103] Step S3021: In response to the configuration data of the first application including the first target configuration data, the first service is used to generate the first identification information for the second request.
[0104] Here, by setting first target configuration data in the configuration data of the first application, when the first service recognizes the first target configuration data, it generates first identification information for the second request corresponding to the first application.
[0105] For example, a first target variable is set in the configuration data of each application, and first target configuration data is configured for the first target variable based on user needs or the application's operating environment.
[0106] Step S3022: In response to the application identifier of the first application being a preset first target application identifier, the first service is used to generate first identifier information for the second request.
[0107] Here, the application identifier of the first application is information that can uniquely identify the first application on the electronic device.
[0108] The first target application identifier refers to the application identifier information that is pre-stored in the image codec and is used to generate the first identifier information for the hardware storage resource allocation request of the corresponding application.
[0109] In some embodiments, the first target application identifier pre-stored by the image codec can be one or more.
[0110] Thus, when the application identifier of the first application is a preset first target application identifier, the image encoder generates first identifier information for the second request corresponding to the first application through the first service.
[0111] Step S3023: In response to the application type of the first application being a preset first target application type, the first service is used to generate first identification information for the second request.
[0112] Here, the first target application type refers to the type identifier information that is pre-stored in the image codec and generates the first identifier information for the hardware storage resource allocation request of the corresponding application.
[0113] In some embodiments, the first target application type pre-stored by the image codec can be one or more.
[0114] Thus, when the application type of the first application is a preset first target application type, the image encoder generates first identification information for the second request corresponding to the first application through the first service.
[0115] Here, the first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively reclaimed.
[0116] In some embodiments, when the image codec is MediaCodec, the first identification information can be implemented as a key-value pair "moto-media-codec-reclaim-ban"=1 added to the MediaFormat parameter in the MediaCodec.configure() function corresponding to the first application.
[0117] In some embodiments, the resource management method provided in this application further includes the following step S3024:
[0118] Step S3024: Using the second service, add the request identifier corresponding to the second request to the whitelist; the hardware storage resources corresponding to each request identifier in the whitelist are not allowed to be passively reclaimed.
[0119] Here, after the second service identifies the first identifier information in the second request, the second service adds the request identifier corresponding to the second request to the whitelist; wherein, the whitelist indicates that the hardware storage resources corresponding to the request identifier are not allowed to be passively reclaimed.
[0120] In this way, when the hardware storage resources of an electronic device are insufficient, the second service queries a whitelist and excludes the hardware storage resources corresponding to the request identifiers stored in the whitelist from the reclaimable hardware storage resources. This allows the second application corresponding to the second request to securely occupy the allocated hardware storage resources, improving the stability of the second application's operation and thus enhancing the user experience.
[0121] In some embodiments, the resource management method provided in this application further includes the following steps S304 to S306:
[0122] Step S304: Receive a third request using the second service; wherein the third request represents a hardware storage resource allocation request corresponding to the second application.
[0123] Here, in response to the image encoding or decoding request of the second application, the first service is used to generate a corresponding hardware storage resource allocation request for the second application, that is, to generate a third request.
[0124] The third request should include at least information on the amount of hardware storage resources required.
[0125] Step S305: In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources corresponding to the third request, at least a portion of the hardware storage resources other than the hardware storage resources corresponding to the second request are reclaimed.
[0126] Here, when the remaining hardware storage resources of the electronic device are insufficient, the second service reclaims the allocated hardware storage resources; at the same time, since the second request has the first identification information, the second service treats the hardware storage resources corresponding to the second request as unreclaimable resources.
[0127] Step S306: Based on the remaining hardware storage resources after the recycling, allocate hardware storage resources for the third request using the second service.
[0128] Here, after the second service performs resource reclamation, based on the remaining hardware storage resources after reclamation, the second service reallocates hardware storage resources for the third request.
[0129] In some embodiments, if the remaining hardware storage resources after the second service determines that they are still less than the amount of hardware storage resources corresponding to the third request, the second service may return to execute step S305 again, or return a resource shortage prompt to the second application; if the remaining hardware storage resources after the second service determines that they are not less than the amount of hardware storage resources corresponding to the third request, the second service allocates the corresponding hardware storage resources to the third request.
[0130] In some embodiments, before receiving the third request using the second service, i.e., before step S304 above, the resource management method provided in this application further includes the following steps S307 to S308:
[0131] Step S307: In response to the fourth request, the third request is generated for the second application using the first service; the fourth request represents an image encoding or decoding request.
[0132] Here, the fourth request is an image encoding or decoding request generated by the second application.
[0133] After the image codec of the electronic device receives the fourth request, the image codec generates a third request for the second application through the first service, that is, generates a hardware storage resource allocation request corresponding to the second application.
[0134] Step S308: Based on the second application, the first service is used to generate second identification information for the third request; the second identification information is used to instruct the second service to reclaim all allocated hardware storage resources except for the hardware storage resources corresponding to the first identification information when there are insufficient remaining hardware storage resources.
[0135] Here, the first service generates second identification information for the third request based on the application information of the second application; the second identification information is used to instruct the second service to reclaim all allocated hardware storage resources except for the hardware storage resources corresponding to the first identification information when the remaining hardware storage resources of the electronic device are insufficient.
[0136] In some embodiments, the application information of the second application may include the application identifier information, application type information, operating environment information and / or operating status information of the second application.
[0137] In this way, if the application identification information, application type information, operating environment information and / or operating status information of the second application meet the preset conditions, and the remaining hardware storage resources are less than the amount of hardware storage resources corresponding to the third request, the second service is allowed to reclaim all allocated hardware storage resources except for the hardware storage resources corresponding to the first identification information for the third request. Thus, when the second application is a highly important application, it can be guaranteed that the second application can obtain the required hardware storage resources.
[0138] In some embodiments, the step of generating second identification information for the third request based on the second application and utilizing the first service, i.e., step S308 above, can be implemented as at least one of the following steps S3081 to S3083:
[0139] Step S3081: In response to the configuration data of the second application including the second target configuration data, the second identification information is generated for the third request using the first service.
[0140] Here, by setting the second target configuration data in the configuration data of the second application, when the first service recognizes the second target configuration data contained in the second application, it generates the first identification information for the third request.
[0141] For example, a second target variable can be set in the configuration data of each application, and second target configuration data can be configured for the second target variable based on user needs or the application's operating environment.
[0142] Step S3082: In response to the application identifier of the second application being a preset second target application identifier, the second identifier information is generated for the third request using the first service.
[0143] Here, the application identifier of the second application is information that can uniquely identify the second application on the electronic device.
[0144] The second target application identifier refers to the application identifier information that is pre-stored in the image codec and is used to generate the second identifier information for the hardware storage resource allocation request of the corresponding application.
[0145] In some embodiments, the second target application identifier pre-stored by the image codec can be at least one.
[0146] Thus, when the application identifier of the second application is the preset second target application identifier, the image encoder generates second identifier information for the third request corresponding to the second application through the first service.
[0147] Step S3083: In response to the second application's application type being a preset second target application type, the second identification information is generated for the third request using the first service.
[0148] Here, the second target application type refers to the type identifier information that is pre-stored in the image codec and generates the second identifier information for the hardware storage resource allocation request of the corresponding application.
[0149] In some embodiments, the second target application type pre-stored by the image codec can be one or more.
[0150] Thus, when the application type of the second application is the preset second target application type, the image encoder generates second identification information for the third request corresponding to the second application through the first service.
[0151] In some embodiments, when the image codec is MediaCodec, the second identification information can be implemented as a key-value pair "moto-media-codec-reclaim-all"=1 added to the MediaFormat parameter in the MediaCodec.configure() function corresponding to the second application.
[0152] In some embodiments, in response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, at least a portion of the hardware storage resources other than those corresponding to the second request are reclaimed. That is, step S305 can be implemented as steps S3051 to S3052:
[0153] Step S3051: In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, the second service is used to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request.
[0154] Here, if the second service determines that the remaining amount of hardware storage resources is less than the amount of hardware storage resources requested by the third request, and the third request has the second identification information, the second service reclaims all allocated hardware storage resources except for the hardware storage resources corresponding to the second request. That is, except for the hardware storage resources corresponding to the first identification information, all allocated hardware storage resources are forcibly reclaimed.
[0155] Step S3052: Based on the remaining hardware storage resources after the recycling, allocate hardware storage resources for the third request using the second service.
[0156] Here, the second service reallocates hardware storage resources for the third request based on the remaining hardware storage resources after reclamation.
[0157] If the remaining hardware storage resources are not less than the amount of hardware storage resources requested by the third request, allocate the corresponding hardware storage resources to the third request; if the remaining hardware storage resources are still less than the amount of hardware storage resources requested by the third request, return a resource shortage message to the second application.
[0158] In the above embodiments, by generating second identification information for the third request corresponding to the second application, all hardware storage resources other than the hardware storage resources corresponding to the first identification information can be allocated to the third request when the remaining hardware storage resources are insufficient. This achieves the goal of prioritizing the resource needs of important applications and improving the user experience.
[0159] In some embodiments, before reclaiming all allocated hardware storage resources other than the hardware storage resources corresponding to the second request using the second service, that is, before step S3052 above, the resource management method further includes the following steps S3053 to S3055:
[0160] Step S3053: Determine the priority information corresponding to at least one fifth request; the fifth request represents a request for allocated hardware storage resources other than the second request.
[0161] Here, the fifth request is a request for allocated hardware storage resources other than the second request; that is, the fifth request does not include the first identification information.
[0162] The priority information corresponding to the fifth request can be generated based on the application type, application running status, or other application information of the application corresponding to the fifth request.
[0163] For example, if the application type corresponding to the fifth request is a conferencing application, the fifth request has a higher priority than the entertainment application; or if the application corresponding to the fifth request is a foreground application, then the fifth request has a higher priority than the request corresponding to a background application.
[0164] In some embodiments, the priority of the fifth request can also be determined based on the frequency and duration of the user's use of the application corresponding to the fifth request within a specified time period.
[0165] Step S3054: Based on the priority information, determine a specified number of sixth requests with lower priority from the at least one fifth request;
[0166] Step S3055: Reclaim the hardware storage resources corresponding to each of the sixth requests using the second service.
[0167] Here, before using the second service to forcibly reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request, a specified number of sixth requests with lower priorities are reclaimed according to the priority information corresponding to at least one fifth request that can reclaim hardware storage resources.
[0168] After recovering a specified number of sixth requests, if the remaining hardware storage resources are not less than the amount of hardware storage resources corresponding to the third request, the second service can be used to allocate corresponding hardware storage resources to the third request based on the remaining hardware storage resources; if the remaining hardware storage resources are still less than the amount of hardware storage resources corresponding to the third request, then the above step S3052 is continued.
[0169] The following description, with reference to Figure 4, uses an image codec in operating system M as an example to illustrate an embodiment of hardware storage resource allocation using the resource management method provided in this application. Operating system M can be any operating system.
[0170] After the screen recording application's resource request 410 is sent to the hardware storage resource manager 400, the hardware storage resource manager 400 determines whether the remaining hardware storage resources are sufficient to meet the resource amount requested by the screen recording application's resource request 410. If the resources are sufficient, the hardware encoding and decoding resources required by the screen recording application's resource request 410 are allocated. If the resources are insufficient, the hardware storage resource manager 400 obtains the resource usage information of the currently used resources 420.
[0171] In the event of insufficient resources, the hardware storage resource manager 400 determines that the currently used resources 420 include: resources used in the background of the interconnect software 421, resources used in the background of application A 422, resources used in the background of application B 423, and resources used in the background of application C 424.
[0172] Subsequently, the hardware storage resource manager 400 determines the releasable resources 430 from the currently used resources 420. Here, the resource allocation request corresponding to the background use of resource 421 by the interconnect software has first identification information, that is, the background use of resource 421 by the interconnect software is not allowed to be passively reclaimed. Therefore, the releasable resources 430 determined by the hardware storage resource manager 400 include: background use of resource 431 by application A, background use of resource 432 by application B, and background use of resource 433 by application C;
[0173] Next, the hardware storage resource manager 400 determines which hardware storage resources to release for application C based on the priorities of each resource in the releasable resources 430. Here, the resource request corresponding to resource 431 used by application A in the background has the second priority, the resource request corresponding to resource 432 used by application B in the background has the second priority, and the resource request corresponding to resource 433 used by application C in the background has the third priority. It is evident that among the releasable resources 430, the resource request corresponding to resource 433 used by application C in the background has the lowest priority, thus determining to release resource 433 used by application C in the background.
[0174] Afterwards, resource 440 used by application C in the background is released; resource request 450 of application C is placed in the background, waiting for reallocation of hardware storage resources;
[0175] After releasing the background resources 440 used by application C, the hardware storage resource manager 400 re-evaluates whether the remaining hardware encoding and decoding resources are sufficient. If the resources are sufficient, hardware encoding and decoding resources are allocated to the resource request 410 of the screen recording application. If the resources are insufficient, the lower priority resource request is re-evaluated from the available resources 430 and its corresponding resources are released.
[0176] In the above embodiments, since the resource allocation request corresponding to the resource 421 used in the background of the interconnected software has first identification information, the hardware storage resource manager 400 excludes the resource 421 used in the background of the interconnected software from the list of releasable resources, making it a resource that cannot be passively reclaimed, thereby enabling the application screen mirroring application implemented based on the interconnected software to run stably and improving the user experience.
[0177] Below, referring to Figure 5, another embodiment of hardware storage resource allocation using the resource management method provided in this application will be described, taking an image codec in any operating system as an example.
[0178] As shown in Figure 5, this embodiment includes the following steps S501 to S507:
[0179] Step S501: Generate an 8K camera resource allocation request and corresponding second identification information using an image codec; then, execute step S502.
[0180] Step S502: The hardware storage resource manager determines whether the remaining hardware storage resources are sufficient; if yes, proceed to step S507; if no, proceed to step S503.
[0181] Here, the hardware storage resource manager determines whether the remaining hardware storage resources are not less than the resource amount corresponding to the resource allocation request for the 8K camera.
[0182] Step S503: Identify recyclable hardware storage resources; then, proceed to step S504.
[0183] Here, the hardware storage resource manager determines reclaimable hardware storage resources from the allocated hardware storage resources; if there is a resource allocation request with first identification information (for example, a resource allocation request of interconnect software with first identification information), the hardware storage resource corresponding to the resource allocation request is determined as an unreclaimable hardware storage resource.
[0184] Step S504: Based on the priority of the resource allocation request corresponding to the recyclable hardware storage resource, perform resource reclamation a specified number of times; then, proceed to step S505.
[0185] Step S505: The hardware storage resource manager determines whether the remaining hardware storage resources are sufficient; if yes, proceed to step S507; if no, proceed to step S506.
[0186] Step S506: Reclaim all reclaimable hardware storage resources; then, proceed to step S507.
[0187] Step S507: Allocate hardware storage resources for the 8K camera's resource allocation request based on the remaining hardware storage resources.
[0188] In the above embodiments, when a second identifier is set for the resource allocation request corresponding to the 8K camera application, if the remaining hardware storage resources are insufficient, then: First, based on whether the first identifier is set, reclaimable hardware storage resources are determined from the allocated hardware storage resources; then, based on the priority corresponding to the reclaimable hardware storage resources, a specified number of resource reclamation operations are performed on the reclaimable hardware storage resources; if the remaining resources are still insufficient after performing the specified number of resource reclamation operations, all reclaimable hardware storage resources are reclaimed. This ensures that the 8K camera application can obtain the requested hardware storage resources, and also ensures that the hardware storage resources corresponding to the first identifier are not forcibly reclaimed, allowing the corresponding application to run stably. In other words, applications that are highly important to the user or system's operational stability can obtain hardware storage resources first, or stably occupy hardware storage resources, thereby improving the user experience.
[0189] Based on the above embodiments, this application provides a resource management device, which includes the included units and the modules included in each unit, which can be implemented by a processor in an electronic device; of course, it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0190] Figure 6 is a schematic diagram of the composition structure of a resource management device provided in this application. As shown in Figure 6, the resource management device 600 includes: a first service module 610 and a second service module 620, wherein:
[0191] The first service module 610 is configured to respond to the first request, generate a second request for the first application, and generate corresponding identification information for the second request based on the first application; the first request represents an image encoding or decoding request; the first service represents an image encoding / decoding service; the second request represents a hardware storage resource allocation request; the identification information is used to indicate whether the hardware storage resources allocated for the second request are allowed to be passively reclaimed;
[0192] The second service module 620 is used to allocate hardware storage resources for the second request; the hardware storage resources represent storage resources used to perform image encoding or decoding.
[0193] In some embodiments, the first service module 610 is configured to perform at least one of the following:
[0194] In response to the configuration data of the first application, including the first target configuration data, the first service is used to generate first identification information for the second request;
[0195] In response to the application identifier of the first application being a preset first target application identifier, the first service is used to generate first identifier information for the second request;
[0196] In response to the fact that the application type of the first application is a preset first target application type, the first service is used to generate first identification information for the second request;
[0197] The first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively reclaimed.
[0198] In some embodiments, the second service module 620 is further configured to use the second service to add the request identifier corresponding to the second request to a whitelist; the hardware storage resources corresponding to each request identifier in the whitelist are not allowed to be passively reclaimed.
[0199] In some embodiments, the second service module 620 is further configured to:
[0200] The second service is used to receive a third request; wherein the third request represents a hardware storage resource allocation request corresponding to the second application;
[0201] In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources corresponding to the third request, at least a portion of the hardware storage resources other than the hardware storage resources corresponding to the second request are reclaimed.
[0202] Based on the remaining hardware storage resources after the recycling, the second service is used to allocate hardware storage resources for the third request.
[0203] In some embodiments, the first service module 610 is further configured to:
[0204] In response to the fourth request, the third request is generated for the second application using the first service; the fourth request represents an image encoding or decoding request.
[0205] Based on the second application, the first service is used to generate second identification information for the third request; the second identification information is used to instruct the second service to reclaim all allocated hardware storage resources except for the hardware storage resources corresponding to the first identification information when there are insufficient remaining hardware storage resources.
[0206] In some embodiments, the second service module 620 is further configured to perform at least one of the following:
[0207] In response to the configuration data of the second application, including the second target configuration data, the second identification information is generated for the third request using the first service;
[0208] In response to the application identifier of the second application being a preset second target application identifier, the second identifier information is generated for the third request using the first service;
[0209] In response to the second application being a preset second target application type, the second identification information is generated for the third request using the first service.
[0210] In some embodiments, the second service module 620 is configured to:
[0211] In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources requested by the third request, the second service is used to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request.
[0212] Based on the remaining hardware storage resources after the recycling, the second service is used to allocate hardware storage resources for the third request.
[0213] In some embodiments, the second service module 620 is further configured to:
[0214] Determine the priority information corresponding to at least one fifth request; the fifth request represents a request for allocated hardware storage resources other than the second request.
[0215] Based on the priority information, a specified number of sixth requests with lower priority are determined from the at least one fifth request;
[0216] The hardware storage resources corresponding to each of the sixth requests are reclaimed using the second service.
[0217] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this disclosure can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0218] On the other hand, this application also provides an electronic device for executing the above-described resource management method embodiments. As shown in FIG7, the resource management device 700 includes a controller 710 and a memory 720; wherein,
[0219] The memory 720 is used to perform image encoding and / or decoding;
[0220] The controller 710 is used for:
[0221] In response to the first request, a second request is generated for the first application using the first service; the first request represents an image encoding or decoding request; the first service represents an image encoding / decoding service; the second request represents a memory resource allocation request.
[0222] Based on the first application, the first service is used to generate corresponding identification information for the second request; the identification information is used to indicate whether the memory resources allocated for the second request can be passively reclaimed;
[0223] Based on the second request, a second service is used to allocate memory resources for the second request; the second service represents a memory resource management service.
[0224] It should be noted that the above device embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects. In some embodiments, the functions or modules included in the device provided in this disclosure can be used to perform the methods described in the above method embodiments. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0225] It should be noted that, in the embodiments of this application, if the above-described resource management method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.
[0226] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.
[0227] This application provides a computer program including computer-readable code, wherein when the computer-readable code is run in a resource management device, a processor in the resource management device performs some or all of the steps in the above method.
[0228] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0229] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0230] It should be noted that Figure 8 is a schematic diagram of a hardware entity of the resource management device in an embodiment of this application. As shown in Figure 8, the hardware entity of the resource management device 800 includes: a processor 801, a communication interface 802, and a memory 803, wherein:
[0231] Processor 801 typically controls the overall operation of resource management device 800.
[0232] Communication interface 802 enables resource management devices to communicate with other terminals or servers over a network.
[0233] The memory 803 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 801 and various modules in the resource management device 800. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 801, the communication interface 802, and the memory 803 can be performed via bus 804.
[0234] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0235] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0236] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods 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, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0237] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0238] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0239] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0240] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence or the part that contributes to related technologies, 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 a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.
[0241] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A resource management method, comprising: In response to the first request, a second request is generated for the first application using the first service; The first request represents an image encoding or decoding request; The first service represents an image encoding / decoding service; The second request represents a hardware storage resource allocation request; Based on the first application, the first service is used to generate corresponding identification information for the second request; The identification information is used to indicate whether the hardware storage resources allocated for the second request can be passively reclaimed; Based on the second request, hardware storage resources are allocated for the second request using the second service; The second service represents hardware storage resource management services; The hardware storage resources represent the storage resources used to perform image encoding or decoding.
2. The method according to claim 1, wherein, The step of generating corresponding identification information for the second request based on the first application and the first service includes at least one of the following: In response to the configuration data of the first application, including the first target configuration data, the first service is used to generate first identification information for the second request; In response to the application identifier of the first application being a preset first target application identifier, the first service is used to generate first identifier information for the second request; In response to the fact that the application type of the first application is a preset first target application type, the first service is used to generate first identification information for the second request; The first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively reclaimed.
3. The method according to claim 2, further comprising: Using the second service, the request identifier corresponding to the second request is added to the whitelist; The hardware storage resources corresponding to each request identifier in the whitelist are not allowed to be passively reclaimed.
4. The method according to claim 2, further comprising: The second service is used to receive a third request; wherein the third request represents a hardware storage resource allocation request corresponding to the second application; In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources corresponding to the third request, at least a portion of the hardware storage resources other than the hardware storage resources corresponding to the second request are reclaimed. Based on the remaining hardware storage resources after the recycling, the second service is used to allocate hardware storage resources for the third request.
5. The method according to claim 4, further comprising: In response to the fourth request, the third request is generated for the second application using the first service; The fourth request represents an image encoding or decoding request; Based on the second application, the first service is used to generate second identification information for the third request; the second identification information is used to instruct the second service to reclaim all allocated hardware storage resources except for the hardware storage resources corresponding to the first identification information when there are insufficient remaining hardware storage resources.
6. The method according to claim 5, wherein, The step of generating second identification information for the third request based on the second application and utilizing the first service includes at least one of the following: In response to the configuration data of the second application, including the second target configuration data, the second identification information is generated for the third request using the first service; In response to the application identifier of the second application being a preset second target application identifier, the second identifier information is generated for the third request using the first service; In response to the second application being a preset second target application type, the second identification information is generated for the third request using the first service.
7. The method according to claim 5, wherein, In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources requested by the third request, the process of reclaiming at least a portion of the hardware storage resources other than those corresponding to the second request includes: In response to the fact that the remaining amount of hardware storage resources is less than the amount of hardware storage resources requested by the third request, the second service is used to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request. Based on the remaining hardware storage resources after the recycling, the second service is used to allocate hardware storage resources for the third request.
8. The method according to claim 7, wherein, Before reclaiming all allocated hardware storage resources other than the hardware storage resources corresponding to the second request using the second service, the method further includes: Determine the priority information corresponding to at least one fifth request; the fifth request represents a request for allocated hardware storage resources other than the second request. Based on the priority information, a specified number of sixth requests with lower priority are determined from the at least one fifth request; The hardware storage resources corresponding to each of the sixth requests are reclaimed using the second service.
9. A resource management device, comprising: The first service module is used to generate a second request for the first application in response to the first request; And generate corresponding identification information for the second request based on the first application; The first request represents an image encoding or decoding request; The first service represents an image encoding / decoding service; The second request represents a hardware storage resource allocation request; the identification information is used to indicate whether the hardware storage resources allocated for the second request can be passively reclaimed; The second service module is used to allocate hardware storage resources for the second request; The hardware storage resources represent the storage resources used to perform image encoding or decoding.
10. An electronic device, comprising: Controller and memory; among which, The memory is used to perform image encoding and / or decoding; The controller is used for: In response to the first request, a second request is generated for the first application using the first service; the first request represents an image encoding or decoding request; the first service represents an image encoding / decoding service; the second request represents a memory resource allocation request. Based on the first application, the first service is used to generate corresponding identification information for the second request; the identification information is used to indicate whether the memory resources allocated for the second request can be passively reclaimed; Based on the second request, a second service is used to allocate memory resources for the second request; the second service represents a memory resource management service.
Citation Information
Patent Citations
Decoding resource management method and device, equipment and medium
CN110505478A
Communication service arrangement method and device, computer equipment and storage medium
CN113361913A
GPGPU resource allocation management method and system
CN116775283A
Coding and decoding method, electronic equipment, computer readable storage medium and program product
CN118101962A
Resource management method, device and equipment
CN119155459A