Resource management method, device and equipment

By generating identification information for applications on electronic devices and managing the allocation and recycling of hardware storage resources, the problem of insufficient hardware encoding and codec resources is solved, and the stability and user experience of the application are improved.

CN119155459APending Publication Date: 2024-12-17LENOVO (BEIJING) LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411211015.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

On electronic devices, hardware encoding and decoding resources are limited, which makes it difficult to meet the hardware encoding and decoding resources requirements when used simultaneously in multiple business scenarios, resulting in insufficient resources.

Method used

Through a resource management method, the service is used to generate identification information for the application, indicating whether hardware storage resources allow passive recycling, and resource allocation and recycling processing are performed according to priority and configuration data to ensure the reasonable allocation and use of resources.

Benefits of technology

Improve user experience, ensure the stable operation of the application and the reasonable allocation of resources, and avoid failed resource allocation and poor user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155459A_ABST
    Figure CN119155459A_ABST
Patent Text Reader

Abstract

The invention discloses a resource management method, device and equipment, and the method comprises the steps: responding to a first request, and generating a second request for a first application through a first service; the first request represents an image coding or decoding request; the first service represents an image coding and decoding service; the second request represents a hardware storage resource allocation request; based on the first application, generating corresponding identification information for the second request by using the first service; the identification information is used for indicating whether the hardware storage resources allocated for the second request are allowed to be passively recycled or not; allocating hardware storage resources to the second request by using a second service based on the second request; the second service represents a hardware storage resource management service; the hardware storage resource characterizes a storage resource for performing image encoding or decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to, but is not limited to, the field of computer technology, and in particular to a resource management method, device, and equipment. Background Art

[0002] At present, electronic devices use video codec technology (e.g., audio and video codec technology (MediaCodec)) to perform video codec processing in more and more scenarios and services, such as camera recording, mobile phone screen recording, desktop screen projection (screen projection to another device in the form of data stream), various video players, etc. Before performing video codec, the electronic device will allocate a fixed size of hardware codec resources for the video codec processing application, for example, 2K, 4K, 8K or a larger amount of memory resources.

[0003] Since the hardware codec resources of electronic devices are limited, it is difficult to meet the corresponding hardware codec resource requirements when all business scenarios on the electronic devices are used at the same time, resulting in insufficient resources when new businesses apply for hardware codec resources.

[0004] Therefore, given the limited hardware encoding and decoding resources, how to coordinate the demand for hardware encoding and decoding resources in various business scenarios has become an urgent problem that needs to be solved. Summary of the invention

[0005] In view of this, the present application at least provides a resource management method, device and equipment.

[0006] The technical solution of this application is implemented as follows:

[0007] On the one hand, the present application provides a resource management method, comprising:

[0008] In response to the first request, generating a second request 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 and decoding service; the second request represents a hardware storage resource allocation request;

[0009] Based on the first application, using the first service 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 allow passive recovery;

[0010] Based on the second request, a hardware storage resource is allocated to the second request using a second service; the second service represents a hardware storage resource management service; and the hardware storage resource represents a storage resource used to perform image encoding or decoding.

[0011] In some embodiments, based on the first application, generating corresponding identification information for the second request using the first service includes at least one of the following:

[0012] In response to the configuration data of the first application including the first target configuration data, generating first identification information for the second request using the first service;

[0013] In response to the application identifier of the first application being a preset first target application identifier, generating first identification information for the second request using the first service;

[0014] In response to the application type of the first application being a preset first target application type, generating first identification information for the second request using the first service;

[0015] The first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively recovered.

[0016] In some embodiments, the method further comprises:

[0017] The request identifier corresponding to the second request is added to a whitelist by using the second service; the hardware storage resources corresponding to each request identifier in the whitelist are not allowed to be passively recovered.

[0018] In some embodiments, the method further comprises:

[0019] Receiving a third request using the second service; wherein the third request represents a hardware storage resource allocation request corresponding to the second application;

[0020] In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources corresponding to the third request, performing recycling processing on at least part of the hardware storage resources other than the hardware storage resources corresponding to the second request;

[0021] Based on the remaining hardware storage resources after the recycling, the hardware storage resources are allocated to the third request using the second service.

[0022] In some embodiments, the method further comprises:

[0023] In response to the fourth request, generating a third request for the second application using the first service; the fourth request represents an image encoding or decoding request;

[0024] 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 for the third request except the hardware storage resources corresponding to the first identification information when the remaining hardware storage resources are insufficient.

[0025] In some embodiments, based on the second application, generating the second identification information for the third request using the first service includes at least one of the following:

[0026] In response to the configuration data of the second application including the second target configuration data, generating second identification information for the third request using the first service;

[0027] In response to the application identifier of the second application being a preset second target application identifier, generating second identification information for the third request using the first service;

[0028] In response to the application type of the second application being a preset second target application type, second identification information is generated for the third request using the first service.

[0029] 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, performing recycling processing on at least part of the hardware storage resources other than the hardware storage resources corresponding to the second request includes:

[0030] In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, using the second service to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request;

[0031] Based on the remaining hardware storage resources after the recycling, the hardware storage resources are allocated to the third request using the second service.

[0032] In some embodiments, before using the second service to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request, the method further includes:

[0033] Determine 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;

[0034] determining, based on the priority information, a specified number of sixth requests having lower priorities from the at least one fifth request;

[0035] The hardware storage resource corresponding to each sixth request is reclaimed by using the second service.

[0036] On the other hand, the present application provides a resource management device, including:

[0037] 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 and 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 allow passive recovery;

[0038] The second service module 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.

[0039] On the other hand, the present application provides an electronic device, comprising: a controller and a memory; wherein,

[0040] Memory for performing image encoding and / or decoding;

[0041] Controller for:

[0042] 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 and decoding service; the second request represents a memory resource allocation request;

[0043] Based on the first application, using the first service 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 allow passive recovery;

[0044] Based on the second request, memory resources are allocated to the second request using a second service; the second service represents a memory resource management service.

[0045] 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 the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0047] Figure 1 A schematic diagram of an implementation flow of a method for managing image encoding and decoding resources;

[0048] Figure 2A A schematic diagram of resource usage when resource recycling is performed according to a method for managing image encoding and decoding resources;

[0049] Figure 2B A schematic diagram of resource usage when resource recycling is performed according to a method for managing image encoding and decoding resources;

[0050] Figure 2C A schematic diagram of resource usage when resource recycling is performed according to a method for managing image encoding and decoding resources;

[0051] Figure 2D A schematic diagram of resource usage when resource recycling is performed according to a method for managing image encoding and decoding resources;

[0052] Figure 3 A schematic diagram of the implementation process of a resource management method provided in this application;

[0053] Figure 4A schematic diagram of an implementation flow of an embodiment of a resource management method provided by the present application;

[0054] Figure 5 A schematic diagram of an implementation flow of another embodiment of a resource management method provided by the present application;

[0055] Figure 6 A schematic diagram of the composition structure of a resource management device provided in this application;

[0056] Figure 7 A schematic diagram of the composition structure of a resource management device provided for this application;

[0057] Figure 8 A schematic diagram of the hardware structure of a resource management device provided in this application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0059] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be 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.

[0060] The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged with a specific order or sequence where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.

[0062] In the related art, when a new hardware encoding resource request appears in an electronic device and insufficient hardware codec resources occur, the hardware codec corresponding to the request with a lower priority will be released according to the priority of the current request for obtaining hardware codec resources, and the hardware codec resources will be reallocated to the new hardware codec resource request based on the released hardware codec resources.

[0063] like Figure 1As shown, after the resource request 110 of the screen recording application is sent to the system hardware codec resource manager 100, the system hardware codec resource manager 100 determines whether the currently remaining hardware codec resources meet the resource amount requested by the resource request 110 of the screen recording application; if the resources are sufficient, the required hardware codec resources are allocated to the resource request 110 of the screen recording application; if the resources are insufficient, the system hardware codec resource manager 100 obtains the information of the currently used resources 120;

[0064] The currently used resources 120 include Internet software background use resources 121, Jianying background use resources 122, Douyin background use resources 123 and Kuaishou background use resources 124;

[0065] Here, the interconnection software is used to establish a secure data channel between the two devices, and at least has an application screen projection function, that is, the image of the page of the application that needs to be projected to the output of the projected device is transmitted frame by frame and in real time to the projected device in the form of a data stream. Since the screen projection function of the interconnection software is implemented in the form of a data stream, it is necessary to occupy encoding resources to encode and transmit the image.

[0066] At the same time, the system hardware codec resource manager 100 determines the priority information of the resource request corresponding to each background resource. Here, the priority of the resource request corresponding to the background resource 121 of the Internet software is the first priority, the priority of the resource request corresponding to the background resource 122 of Jianying is the second priority, the priority of the resource request corresponding to the background resource 123 of Douyin is the second priority, and the priority of the resource request corresponding to the background resource 124 of Kuaishou is the third priority. It can be seen that among the currently used resources 120, the resource request corresponding to the background resource 121 of Kuaishou has the lowest priority;

[0067] Afterwards, the system hardware codec resource manager 100 determines the releasable resources 130 from the currently used resources 120. Here, the releasable resources 130 include the background use resources 131 of the Internet software, the background use resources 132 of the Jianying, the background use resources 133 of the Douyin, and the background use resources 134 of the Kuaishou;

[0068] Afterwards, the system hardware codec resource manager 100 determines the resource request for releasing the hardware codec resource according to the priority corresponding to each resource in the releasable resources 130. Here, since the resource request corresponding to the Kuaishou background use resource 134 has the lowest priority, the Kuaishou background use resource 134 is determined as the resource to be released, that is, the released Kuaishou use resource 140 is determined;

[0069] Afterwards, the released Kuaishou uses the resource 140; the resource request 150 of Kuaishou is placed in the background, and the resource request 150 of Kuaishou is placed in the background time, and the priority of the resource request 150 of Kuaishou is updated;

[0070] After releasing the resources 140 used by Kuaishou, the system hardware codec resource manager 100 re-determines whether the currently remaining hardware codec resources are sufficient; if the resources are sufficient, the hardware codec resources are allocated to the resource request 110 of the screen recording application; if the resources are insufficient, the resources in the releasable resources 130 are released one by one according to priority.

[0071] In addition, after executing a specified number of recycling operations on the releasable resources 130 , if the remaining amount of resources is still less than the amount of resources requested by the resource request 110 of the screen recording application, information indicating that the resource request failed is returned to the screen recording application.

[0072] like Figure 2A As shown, the total amount of hardware codec resources of the current system is 8K, and the total amount of allocated resources is 5K, among which 2K of resources are used by the background of Internet software, 1K of resources are used by the background of Jianying, 1K of resources are used by the background of Douyin, and 1K of resources are used by the background of Kuaishou.

[0073] When the resource amount requested by the screen recording application resource request 110 is 8K, the current remaining resource amount (i.e., the remaining 3K) does not meet the resource request requirement, so the system hardware codec resource manager 100 reclaims the Kuaishou background use resources with a lower priority;

[0074] After the first resource recycling, Figure 2B As shown, 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 recycle the Douyin background use resources with lower priority;

[0075] After the second resource recycling, Figure 2C As shown, 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 the background resources used by the screen recording application with a lower priority;

[0076] After the third resource recycling, Figure 2D As shown, the current remaining resource amount is 6K, which still does not meet the resource request 110 requirement of the screen recording application.

[0077] The system hardware codec resource manager 100 continues to reclaim the lower-priority Douyin background usage resources.

[0078] At this time, if according to the preset resource recycling strategy, there are still insufficient resources after three resource recyclings, the resource allocation failure information will be returned to the resource request 110 of the screen recording application; if according to the preset resource recycling strategy, the fourth resource recycling can be performed, then the resources used by the background of the highest priority interconnected software will be recycled, resulting in the interruption of the screen projection of the application based on the interconnected software, which brings a bad user experience.

[0079] In the above technical solution, each application applies for and manages its own hardware codec resources. When a new resource application appears, the system hardware codec manager determines which application's corresponding resources should be released, and the application cannot respond. In addition, the above technical solution only selects the hardware codec resource request for the released resources based on priority, which makes it impossible to customize the processing of certain special business scenarios. For example, once the hardware codec resources of business scenarios such as screen projection applications are passively recovered, extremely poor user experience such as process crashes and frozen screens may occur. When facing the problem of insufficient resources for requests with higher priority, the system cannot determine whether the resource requirements of the request with higher priority can be met after executing a specified number of resource recovery operations, which may cause resource allocation failure, which also brings a poor user experience to users.

[0080] Based on this, the present application provides a resource management method, which can be executed by a processor of an electronic device. The electronic device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device) and other devices with data processing capabilities.

[0081] Figure 3 A schematic diagram of the implementation process of a resource management method provided in this application, such as Figure 3 As shown, the method includes the following steps S301 to S303:

[0082] Step S301, in response to a first request, generating a second request for a first application using a first service; the first request represents an image encoding or decoding request; the first service represents an image encoding and decoding service; the second request represents a hardware storage resource allocation request.

[0083] Here, the first request is an image encoding or decoding request issued by an application running on the electronic device and having image and / or video encoding and decoding capabilities.

[0084] The application that generates the first request may include, for example, a camera recording application, a mobile phone screen recording application, a desktop screen projection application, various video players, and the like.

[0085] The first service refers to an image encoding and decoding service provided by an image codec.

[0086] In some embodiments, the image codec may be an image codec running on an Android platform, such as MediaCodec; it may also be an image codec running on a Windows platform, such as a WIC (Windows Imaging Component, WIC) component; and so on.

[0087] 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 (for example, memory resources) based on the second request.

[0088] In some embodiments, when the first service is an image coding and decoding service provided by MediaCodec, the image coding and decoding service provided by MediaCodec generates a second request based on an image coding or decoding request of an application, and generates a corresponding MediaCodec process or thread.

[0089] In some embodiments, the second request includes at least a requested amount of hardware storage resources.

[0090] Step S302: Based on the first application, use the first service 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 allow passive recovery.

[0091] Here, the first service identifies application information of the first application, and generates corresponding identification information for the second request based on the application information.

[0092] In some embodiments, the application information of the first application may include application identification information, application configuration information, application type information, operating environment information, operating status information, etc. of the first application.

[0093] 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 use the identification information to indicate whether the hardware storage resources allocated for the second request allow passive recovery.

[0094] Here, passive recycling refers to whether the hardware storage resource manager can recycle the hardware storage resources allocated for the second request when the remaining hardware storage resources are insufficient after the corresponding hardware storage resources are allocated for the second request.

[0095] Step S303: Based on the second request, allocate hardware storage resources to 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.

[0096] Here, the second service refers to the hardware storage resource management service provided by the hardware storage resource manager in the electronic device.

[0097] The hardware storage resource represents a storage resource used to perform image encoding or decoding. In some embodiments, the hardware storage resource represents a specified memory resource in the memory space of the electronic device.

[0098] In this way, the hardware storage resource management service provided by the electronic device allocates corresponding hardware storage resources to the second request according to the amount of hardware storage resources requested by the second request.

[0099] In the resource management method provided in the present application, first, 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 and 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 the identification information is used to indicate whether passive recovery is allowed for the hardware storage resources allocated for the second request; 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 suspended or terminated, by generating identification information that does not allow passive recovery for the hardware storage resource allocation request corresponding to the first application, when the remaining hardware storage resources are insufficient, it can be determined based on the identification information not to recover the hardware storage resources corresponding to the first application, so that the first application can run stably to improve the user experience; on the contrary, when the image encoding or decoding operation of the first application can be suspended or terminated, by allocating identification information that allows passive recovery for the hardware storage resource corresponding to the first application, when the remaining hardware storage resources are insufficient, it can be determined based on the identification information to recover or prioritize the recovery of the hardware storage resources corresponding to the first application, so that new hardware storage resource allocation requests can be responded to in a timely manner.

[0100] In some embodiments, based on the first application, using the first service to generate corresponding identification information for the second request, that is, the above step S302, can be implemented as at least one of the following steps S3021 to S3023:

[0101] Step S3021: In response to the configuration data of the first application including first target configuration data, generate first identification information for the second request using the first service.

[0102] Here, by setting the first target configuration data in the configuration data of the first application, when the first service identifies the first target configuration data, the first identification information is generated for the second request corresponding to the first application.

[0103] 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 requirements or the operating environment of the application.

[0104] Step S3022: In response to the application identifier of the first application being a preset first target application identifier, using the first service to generate first identification information for the second request.

[0105] Here, the application identifier of the first application is information that can uniquely identify the first application on the electronic device.

[0106] The first target application identifier refers to application identifier information pre-stored in the image codec and used to generate first identifier information for a hardware storage resource allocation request of an application corresponding to the application.

[0107] In some embodiments, the first target application identifier pre-stored in the image codec may be one or more.

[0108] In this way, when the application identifier of the first application is the preset first target application identifier, the image encoder generates first identification information for the second request corresponding to the first application through the first service.

[0109] Step S3023: In response to the application type of the first application being a preset first target application type, generating first identification information for the second request using the first service.

[0110] Here, the first target application type refers to type identification information pre-stored in the image codec and used to generate the first identification information for the hardware storage resource allocation request of the corresponding application.

[0111] In some embodiments, the first target application type pre-stored in the image codec may be one or more.

[0112] In this way, when the application type of the first application is the preset first target application type, the image encoder generates the first identification information for the second request corresponding to the first application through the first service.

[0113] Here, the first identification information is used to indicate that the hardware storage resource corresponding to the second request is not allowed to be passively recovered.

[0114] In some embodiments, when the image codec is MediaCodec, the first identification information may be implemented as a "moto-media-codec-reclaim-ban"=1 key-value pair added to the MediaFormat parameter in the MediaCodec.configure() function corresponding to the first application.

[0115] In some embodiments, the resource management method provided by the present application further includes the following steps S3024:

[0116] Step S3024: using the second service, 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 recovered.

[0117] Here, after the second service recognizes the first identification information in the second request, the second service adds the request identifier corresponding to the second request to a whitelist; wherein the whitelist indicates that the hardware storage resources corresponding to the request identifier therein are not allowed to be passively recovered.

[0118] In this way, when the hardware storage resources of the electronic device are insufficient, the second service queries the whitelist and excludes the hardware storage resources corresponding to the request identifier stored in the whitelist from the recyclable hardware storage resources. In this way, the second application corresponding to the second request can safely occupy the allocated hardware storage resources, improve the stability of the second application operation, and thus improve the user experience.

[0119] In some embodiments, the resource management method provided by the present application further includes the following steps S304 to S306:

[0120] 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.

[0121] Here, in response to the image encoding or decoding request of the second application, a corresponding hardware storage resource allocation request is generated for the second application using the first service, that is, a third request is generated.

[0122] The third request includes at least information about the amount of hardware storage resources required.

[0123] Step S305: In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources corresponding to the third request, recycling processing is performed on at least part of the hardware storage resources other than the hardware storage resources corresponding to the second request.

[0124] 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, because the second request has the first identification information, the second service regards the hardware storage resources corresponding to the second request as non-recyclable resources.

[0125] Step S306: Based on the remaining hardware storage resources after the recycling, use the second service to allocate hardware storage resources to the third request.

[0126] Here, after the second service performs resource recycling, based on the remaining hardware storage resources after recycling, the second service reallocates hardware storage resources for the third request.

[0127] In some embodiments, when the second service determines that the remaining hardware storage resources after recycling are still less than the amount of hardware storage resources corresponding to the third request, it may return to execute step S305 again, or return a prompt message of insufficient resources to the second application; when the second service determines that the remaining hardware storage resources after recycling are not less than the amount of hardware storage resources corresponding to the third request, the second service allocates corresponding hardware storage resources to the third request.

[0128] In some embodiments, before receiving the third request using the second service, that is, before the above step S304, the resource management method provided by the present application further includes the following steps S307 to S308:

[0129] Step S307: In response to the fourth request, generate the third request for the second application using the first service; the fourth request represents an image encoding or decoding request.

[0130] Here, the fourth request is an image encoding or decoding request generated by the second application.

[0131] 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.

[0132] Step S308, based on the second application, use the first service 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 for the third request except the hardware storage resources corresponding to the first identification information when the remaining hardware storage resources are insufficient.

[0133] 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 the hardware storage resources corresponding to the first identification information for the third request when the remaining hardware storage resources of the electronic device are insufficient.

[0134] In some embodiments, the application information of the second application may include application identification information, application type information, operating environment information and / or operating status information of the second application.

[0135] In this way, when 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 the hardware storage resources corresponding to the first identification information for the third request, thereby ensuring that the second application can obtain the required hardware storage resources when the second application is an application of higher importance.

[0136] In some embodiments, based on the second application, the second identification information is generated for the third request by using the first service, that is, the above step S308, can be implemented as at least one of the following steps S3081 to S3083:

[0137] Step S3081: In response to the configuration data of the second application including second target configuration data, using the first service to generate the second identification information for the third request.

[0138] 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 included in the second application, the first identification information is generated for the third request.

[0139] For example, a second target variable is set in the configuration data of each application, and second target configuration data is configured for the second target variable based on user requirements or the operating environment of the application.

[0140] Step S3082: In response to the application identifier of the second application being a preset second target application identifier, using the first service to generate the second identification information for the third request.

[0141] Here, the application identifier of the second application is information that can uniquely identify the second application on the electronic device.

[0142] The second target application identifier refers to application identifier information pre-stored in the image codec and used to generate second identifier information for a hardware storage resource allocation request of its corresponding application.

[0143] In some embodiments, the image codec may pre-store at least one second target application identifier.

[0144] In this way, when the application identifier of the second application is the preset second target application identifier, the image encoder generates second identification information for the third request corresponding to the second application through the first service.

[0145] Step S3083: In response to the application type of the second application being a preset second target application type, using the first service to generate the second identification information for the third request.

[0146] Here, the second target application type refers to type identification information pre-stored in the image codec and used to generate the second identification information for the hardware storage resource allocation request of the corresponding application.

[0147] In some embodiments, the second target application type pre-stored in the image codec may be one or more.

[0148] In this way, 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.

[0149] In some embodiments, when the image codec is MediaCodec, the second identification information may be implemented as a "moto-media-codec-reclaim-all"=1 key-value pair added to the MediaFormat parameter in the MediaCodec.configure() function corresponding to the second application.

[0150] 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, recycling processing is performed on at least part of the hardware storage resources other than the hardware storage resources corresponding to the second request, that is, the above step S305 can be implemented as the following steps S3051 to S3052:

[0151] 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, all allocated hardware storage resources other than the hardware storage resources corresponding to the second request are reclaimed using the second service.

[0152] Here, when 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 second identification information, the second service reclaims all allocated hardware storage resources except the hardware storage resources corresponding to the second request, that is, all allocated hardware storage resources are forcibly reclaimed except the hardware storage resources corresponding to the first identification information.

[0153] Step S3052: Based on the remaining hardware storage resources after the recycling, use the second service to allocate hardware storage resources to the third request.

[0154] Here, the second service reallocates hardware storage resources for the third request based on the remaining hardware storage resources after recycling.

[0155] When the remaining hardware storage resources are not less than the amount of hardware storage resources requested by the third request, corresponding hardware storage resources are allocated to the third request; when the remaining hardware storage resources are still less than the amount of hardware storage resources requested by the third request, a prompt message of insufficient resources is returned to the second application.

[0156] In the above embodiment, by generating second identification information for the third request corresponding to the second application, when the remaining hardware storage resources are insufficient, all hardware storage resources except the hardware storage resources corresponding to the first identification information can be allocated to the third request, thereby achieving the purpose of giving priority to meeting the resource requirements of important applications and improving the user experience.

[0157] In some embodiments, before using the second service to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request, that is, before the above step S3052, the resource management method further includes the following steps S3053 to S3055:

[0158] Step S3053: Determine 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.

[0159] Here, the fifth request is a request for which hardware storage resources have been allocated except for the second request, that is, the fifth request does not include the first identification information.

[0160] The priority information corresponding to the fifth request may be generated based on the application type, application running status, or other application information of the application corresponding to the fifth request.

[0161] For example, when the application type corresponding to the fifth request is a conference application, the priority of the fifth request is higher than the priority of an entertainment application; for another example, when the application state of the application corresponding to the fifth request is a foreground running application, the priority of the fifth request is higher than the priority of the request corresponding to the background application.

[0162] In some embodiments, the priority of the fifth request may also be determined based on the frequency and duration of use of the application corresponding to the fifth request by the user within a specified duration.

[0163] Step S3054: determining a specified number of sixth requests with lower priorities from the at least one fifth request based on the priority information;

[0164] Step S3055: Reclaim the hardware storage resources corresponding to each of the sixth requests using the second service.

[0165] Here, before using the second service to perform forced reclamation of 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 priority information corresponding to at least one fifth request for reclaimable hardware storage resources.

[0166] After recycling 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, continue to execute the above step S3052.

[0167] Next, combine Figure 4 Taking MediaCodec as an image codec as an example, an embodiment of allocating hardware storage resources using the resource management method provided by this application is described.

[0168] After the resource request 410 of the screen recording application is sent to the hardware storage resource manager 400, the hardware storage resource manager 400 determines whether the currently remaining hardware storage resources meet the resource amount requested by the resource request 410 of the screen recording application; if the resources are sufficient, the required hardware encoding and decoding resources are allocated to the resource request 410 of the screen recording application; if the resources are insufficient, the hardware storage resource manager 400 obtains the resource usage information of the currently used resources 420;

[0169] In the case of insufficient resources, the hardware storage resource manager 400 determines that the currently used resources 420 include: Internet software background use resources 421, Jianying background use resources 422, Douyin background use resources 423, and Kuaishou background use resources 424;

[0170] Afterwards, 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 interconnected software background use resource 421 has the first identification information, that is, the interconnected software background use resource 421 does not allow passive recovery. Therefore, the hardware storage resource manager 400 determines that the releasable resources 430 include: the background use resources 432 of Jianying, the background use resources 433 of Douyin, and the background use resources 434 of Kuaishou;

[0171] Afterwards, the hardware storage resource manager 400 determines to release the hardware storage resources corresponding to the Kuaishou application according to the priority corresponding to each resource in the releasable resources 430. Here, the priority of the resource request corresponding to the Jianying background use resource 431 is the second priority, the priority of the resource request corresponding to the Douyin background use resource 432 is the second priority, and the priority of the resource request corresponding to the Kuaishou background use resource 433 is the third priority. It can be seen that among the currently used resources 420, the priority of the resource request corresponding to the Kuaishou background use resource 433 is the lowest, so it is determined to release the Kuaishou background use resource 433;

[0172] Afterwards, the resource used by Kuaishou is released 440; the resource request 450 of Kuaishou is placed in the background, waiting for the reallocation of hardware storage resources;

[0173] After releasing the resources 440 used by the Kuaishou background, the hardware storage resource manager 400 re-determines whether the currently remaining hardware codec resources are sufficient; if the resources are sufficient, the hardware codec resources are allocated to the resource request 410 of the screen recording application; if the resources are insufficient, the resource requests with lower priority are re-determined in the releasable resources 430, and the corresponding resources are released.

[0174] In the above embodiment, since the resource allocation request corresponding to the interconnected software background usage resource 421 has the first identification information, the hardware storage resource manager 400 excludes the interconnected software background usage resource 421 from the releasable resources, making it a resource that is not allowed to be passively recovered, thereby enabling the application projection application based on the interconnected software to run stably and improve the user experience.

[0175] Next, combine Figure 5 Taking MediaCodec as an image codec as an example, another embodiment of allocating hardware storage resources using the resource management method provided by the present application is described.

[0176] like Figure 5 As shown, this embodiment includes the following steps S501 to S507:

[0177] Step S501, using MediaCodec to generate a resource allocation request for 8K video and corresponding second identification information; then, executing step S502;

[0178] Step S502, the hardware storage resource manager determines whether the remaining hardware storage resources are sufficient; if so, execute step S507; if not, execute step S503;

[0179] Here, the hardware storage resource manager determines whether the remaining hardware storage resource amount is not less than the resource amount corresponding to the resource allocation request for 8K video.

[0180] Step S503, determining recyclable hardware storage resources; then, executing step S504;

[0181] Here, the hardware storage resource manager determines the recyclable 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 interconnected software with first identification information), the hardware storage resources corresponding to the resource allocation request are determined as non-recyclable hardware storage resources.

[0182] Step S504, executing a specified number of resource recycling based on the priority of the resource allocation request corresponding to the recyclable hardware storage resource; then executing step S505;

[0183] Step S505, the hardware storage resource manager determines whether the remaining hardware storage resources are sufficient; if so, execute step S507; if not, execute step S506;

[0184] Step S506, reclaiming all recyclable hardware storage resources; then, executing step S507;

[0185] Step S507: Allocate hardware storage resources for the resource allocation request for 8K video based on the remaining hardware storage resources.

[0186] In the above embodiment, when the second identification information 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 identification information is set, determine the recyclable hardware storage resources from the allocated hardware storage resources; then, based on the priority corresponding to the recyclable hardware storage resources, perform a specified number of resource recycling on the recyclable hardware storage resources; if the remaining resources after performing the specified number of resource recycling are still insufficient, recycle all recyclable hardware storage resources. In this way, it is ensured that the 8K camera application can obtain the requested hardware storage resources, and it can also ensure that the hardware storage resources corresponding to the first identification information are not forcibly recycled, so that the corresponding application can run stably, that is, applications that are more important to the user or system operation stability can obtain hardware storage resources first, or stably occupy hardware storage resources, thereby improving the user experience.

[0187] Based on the above embodiments, an embodiment of the present application provides a resource management device, which includes the units included and the modules included in the units, which can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0188] Figure 6 A schematic diagram of the composition structure of a resource management device provided in this application, such as Figure 6 As shown, the resource management device 600 includes: a first service module 610 and a second service module 620, wherein:

[0189] The first service module 610 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 and 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 allow passive recovery;

[0190] 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.

[0191] In some embodiments, the first service module 610 is configured to perform at least one of the following:

[0192] In response to the configuration data of the first application including first target configuration data, generating first identification information for the second request using the first service;

[0193] In response to the application identifier of the first application being a preset first target application identifier, generating first identification information for the second request using the first service;

[0194] In response to the application type of the first application being a preset first target application type, generating first identification information for the second request using the first service;

[0195] The first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively recovered.

[0196] In some embodiments, the second service module 620 is further used to utilize 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 recovered.

[0197] In some embodiments, the second service module 620 is further configured to:

[0198] Receiving a third request using the second service; wherein the third request represents a hardware storage resource allocation request corresponding to the second application;

[0199] In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources corresponding to the third request, performing recycling processing on at least part of the hardware storage resources other than the hardware storage resources corresponding to the second request;

[0200] Based on the remaining hardware storage resources after the recycling, the second service is used to allocate hardware storage resources to the third request.

[0201] In some embodiments, the first service module 610 is further configured to:

[0202] In response to a fourth request, generating the third request for the second application using the first service; the fourth request represents an image encoding or decoding request;

[0203] 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 for the third request except the hardware storage resources corresponding to the first identification information when the remaining hardware storage resources are insufficient.

[0204] In some embodiments, the second service module 620 is further configured to perform at least one of the following:

[0205] In response to the configuration data of the second application including second target configuration data, generating the second identification information for the third request using the first service;

[0206] In response to the application identifier of the second application being a preset second target application identifier, using the first service to generate the second identification information for the third request;

[0207] In response to the application type of the second application being a preset second target application type, the second identification information is generated for the third request using the first service.

[0208] In some embodiments, the second service module 620 is used to:

[0209] In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, using the second service to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request;

[0210] Based on the remaining hardware storage resources after the recycling, the second service is used to allocate hardware storage resources to the third request.

[0211] In some embodiments, the second service module 620 is further configured to:

[0212] Determine 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;

[0213] determining, based on the priority information, a specified number of sixth requests having lower priorities from among the at least one fifth request;

[0214] The second service is used to reclaim the hardware storage resource corresponding to each of the sixth requests.

[0215] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0216] On the other hand, the present application also provides an electronic device, which is used to execute the above resource management method embodiments. Figure 7 As shown, the resource management device 700 includes a controller 710 and a memory 720; wherein,

[0217] The memory 710 is used to perform image encoding and / or decoding;

[0218] The controller 720 is used to:

[0219] 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 and decoding service; the second request represents a memory resource allocation request;

[0220] Based on the first application, using the first service 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 allow passive recovery;

[0221] Based on the second request, memory resources are allocated to the second request using a second service; the second service represents a memory resource management service.

[0222] It should be noted that the above device embodiments are similar to the description of the above method embodiments and have similar beneficial effects as the method embodiments. In some embodiments, the functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.

[0223] It should be noted that in the embodiment of the present application, if the above-mentioned resource management method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0224] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0225] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is executed in a resource management device, a processor in the resource management device executes some or all of the steps for implementing the above method.

[0226] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.

[0227] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. 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 description of the method embodiment of this application for understanding.

[0228] It should be noted that Figure 8 A schematic diagram of a hardware entity of a resource management device in an embodiment of the present application is shown in FIG. Figure 8 As shown, the hardware entity of the resource management device 800 includes: a processor 801, a communication interface 802 and a memory 803, wherein:

[0229] The processor 801 generally controls the overall operation of the resource management device 800 .

[0230] The communication interface 802 enables the resource management device to communicate with other terminals or servers through a network.

[0231] The memory 803 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or processed by the processor 801 and each module in the resource management device 800 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM). Data transmission can be performed between the processor 801, the communication interface 802, and the memory 803 through the bus 804.

[0232] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and 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 embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.

[0233] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0234] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0235] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0236] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0237] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0238] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function 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 present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0239] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A resource management method, comprising: In response to the first request, generating a second request 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 and decoding service; The second request represents a hardware storage resource allocation request; Based on the first application, using the first service 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 allow passive recovery; Based on the second request, allocating 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.

2. The method according to claim 1, wherein: The generating corresponding identification information for the second request by using the first service based on the first application includes at least one of the following: In response to the configuration data of the first application including first target configuration data, generating first identification information for the second request using the first service; In response to the application identifier of the first application being a preset first target application identifier, generating first identification information for the second request using the first service; In response to the application type of the first application being a preset first target application type, generating first identification information for the second request using the first service; The first identification information is used to indicate that the hardware storage resources corresponding to the second request are not allowed to be passively recovered.

3. The method according to claim 2, further comprising: Using the second service, adding 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 recovered.

4. The method according to claim 2, further comprising: Receiving a third request using the second service; wherein the third request represents a hardware storage resource allocation request corresponding to the second application; In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources corresponding to the third request, performing recycling processing on at least part of the 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 to the third request.

5. The method according to claim 4, further comprising: In response to the fourth request, generating the third request 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 for the third request except the hardware storage resources corresponding to the first identification information when the remaining hardware storage resources are insufficient.

6. The method according to claim 5, wherein: The generating second identification information for the third request by using the first service based on the second application includes at least one of the following: In response to the configuration data of the second application including second target configuration data, generating the second identification information 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, using the first service to generate the second identification information for the third request; In response to the application type of 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 remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, performing recycling processing on at least part of the hardware storage resources other than the hardware storage resources corresponding to the second request, including: In response to the remaining amount of hardware storage resources being less than the amount of hardware storage resources requested by the third request, using the second service 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 to the third request.

8. The method according to claim 7, wherein: Before using the second service to reclaim all allocated hardware storage resources other than the hardware storage resources corresponding to the second request, the method further includes: Determine 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; determining, based on the priority information, a specified number of sixth requests having lower priorities from among the at least one fifth request; The second service is used to reclaim the hardware storage resource corresponding to each of the sixth requests.

9. A resource management device, comprising: A first service module, configured to generate a second request for the first application in response to the first request; and generating 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 and decoding service; The second request represents a hardware storage resource allocation request; the identification information is used to indicate whether the hardware storage resource allocated for the second request allows passive recovery; A second service module, configured to allocate hardware storage resources to the second request; The hardware storage resources represent storage resources used to perform image encoding or decoding.

10. An electronic device, comprising: controller and memory; wherein, The memory is used to perform image encoding and / or decoding; The code controller is used for: In response to the first request, generating a second request 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 and decoding service; the second request represents a memory resource allocation request; Based on the first application, using the first service 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 allow passive recovery; Based on the second request, memory resources are allocated to the second request using a second service; the second service represents a memory resource management service.

Citation Information

Cited By

  • Resource management method and apparatus, and device

    WO2026045834A1