Resource allocation method, device, electronic device and storage medium

By comparing and adjusting resource sizes, the problem of low resource allocation efficiency caused by changes in the size of the area of ​​interest is solved, and efficient resource allocation and utilization is achieved.

CN113568733BActive Publication Date: 2024-10-01BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202010354568.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-29
Publication Date
2024-10-01
Estimated Expiration
2040-04-29

AI Technical Summary

Technical Problem

In video processing, changes in the size of the region of interest lead to inefficient resource allocation and require frequent reallocation of video memory resources.

Method used

By comparing the size of the resources required for the current area of ​​interest to be processed with the size of the allocated resources, if it is not greater than the allocated resources, the allocated resources will be used directly; if it is greater, the preset step size will be increased based on the allocated resources. Or preset multiples to ensure sufficient resource usage.

Benefits of technology

It reduces the time of resource allocation, improves the efficiency and utilization of resource allocation, and avoids frequent resource reallocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113568733B_ABST
    Figure CN113568733B_ABST
Patent Text Reader

Abstract

The resource allocation method, device, electronic device and storage medium provided in the embodiments of the present application relate to the field of data processing technology. By obtaining the size of resources required by the current region of interest to be processed and the size of currently allocated resources, the size of resources required by the current region of interest to be processed and the size of currently allocated resources are compared. When the size of resources required by the current region of interest to be processed is not greater than the size of currently allocated resources, the currently allocated resources are used as the allocated resources of the current region of interest to be processed, so that there is no need to recalculate the allocated resources for each region of interest, which shortens the time for allocating resources, improves the efficiency of resource allocation, and also improves the utilization rate of resources by utilizing the allocated resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a resource allocation method, device, electronic device and storage medium. Background Art

[0002] In computer vision and image processing, ROI (Region of Interest) is a region to be processed in the image being processed, which is outlined in the form of a box, circle, ellipse or irregular polygon. ROI is the focus of image analysis or processing.

[0003] When allocating resources to the region of interest, for example, allocating video memory resources to the region of interest, the solution in the related art will allocate resources according to the size of the region of interest. When the next frame of the picture is processed after the current frame is processed, the size of the region of interest will be recalculated. If the size of the region of interest of the next frame is different from that of the previous frame, the video memory resources will be reallocated. However, during video processing, the region of interest of each frame will have more or less differences in the number of pixels as the detection target moves, so the size of the region of interest of each frame is different. Because the size of the region of interest is different, the resources are reallocated, resulting in low resource allocation efficiency. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a resource allocation method, device, electronic device and storage medium to solve the problem of low resource allocation efficiency in related technologies and improve the efficiency of resource allocation.

[0005] The specific technical solutions are as follows:

[0006] In a first aspect, an embodiment of the present application provides a resource allocation method, the method comprising:

[0007] Obtain the size of resources required for the current area of ​​interest to be processed and the size of currently allocated resources;

[0008] Comparing the size of resources required by the current region of interest to be processed with the size of the currently allocated resources;

[0009] In a case where the size of the resources required by the current region of interest to be processed is not greater than the size of the currently allocated resources, the currently allocated resources are used as the allocated resources of the current region of interest to be processed.

[0010] Optionally, after the step of comparing the size of the resources required by the current to-be-processed region of interest with the size of the currently allocated resources, the method further includes:

[0011] In the case that the size of the resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, adding a specified number of resources of a preset step size on the basis of the currently allocated resources to obtain updated allocated resources, wherein the size of the resources required by the current region of interest to be processed is not greater than the updated allocated resources;

[0012] The updated allocated resources are used as the allocated resources of the current region of interest to be processed.

[0013] Optionally, after the step of comparing the size of the resources required by the current to-be-processed region of interest with the size of the currently allocated resources, the method further includes:

[0014] In the case where the size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, the size of the target allocated resources for the current region of interest to be processed is determined according to a preset multiple of a preset step size and the size of the resources required by the current region of interest to be processed, the size of the target allocated resources for the current region of interest to be processed is equal to the preset multiple multiplied by the preset step size, and the size of the resources required by the current region of interest to be processed is not greater than the size of the target allocated resources for the current region of interest to be processed.

[0015] Optionally, the method comprises:

[0016] Get the size of the resources needed for the initial region of interest;

[0017] Dividing the size of the resources required by the initial region of interest by a preset step size to obtain a quotient value;

[0018] Rounding up the quotient to obtain a target multiple;

[0019] The target multiple is multiplied by the preset step length, and the product of the target multiple and the preset step length is used as the size of the initial resource allocation of the region of interest.

[0020] In a second aspect, an embodiment of the present application provides a resource allocation device, the device comprising:

[0021] The acquisition module is used to obtain the size of resources required by the current area of ​​interest to be processed and the size of currently allocated resources;

[0022] A comparison module, used for comparing the size of resources required by the current region of interest to be processed with the size of the currently allocated resources;

[0023] The first processing module is used to use the currently allocated resources as the allocated resources of the currently processed region of interest when the size of the resources required by the currently processed region of interest is not greater than the size of the currently allocated resources.

[0024] Optionally, the device further includes a second processing module, wherein the second processing module is specifically configured to:

[0025] In the case that the size of the resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, adding a specified number of resources of a preset step size on the basis of the currently allocated resources to obtain updated allocated resources, wherein the size of the resources required by the current region of interest to be processed is not greater than the updated allocated resources;

[0026] The updated allocated resources are used as the allocated resources of the current region of interest to be processed.

[0027] Optionally, the device further includes a third processing module, and the third processing module is specifically configured to:

[0028] In the case where the size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, the size of the target allocated resources for the current region of interest to be processed is determined according to a preset multiple of a preset step size and the size of the resources required by the current region of interest to be processed, the size of the target allocated resources for the current region of interest to be processed is equal to the preset multiple multiplied by the preset step size, and the size of the resources required by the current region of interest to be processed is not greater than the size of the target allocated resources for the current region of interest to be processed.

[0029] Optionally, the device comprises:

[0030] An acquisition module is used to acquire the size of resources required for the initial area of ​​interest;

[0031] A first calculation module, used for dividing the size of the resources required by the initial region of interest by a preset step size to obtain a quotient;

[0032] A second calculation module is used to round up the quotient to obtain a target multiple;

[0033] The fourth processing module is used to multiply the target multiple by the preset step length, and use the product of the target multiple and the preset step length as the size of the initial resource allocation of the region of interest.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0035] Memory, used to store computer programs;

[0036] The processor is used to implement the resource allocation method described in any one of the above-mentioned first aspects when executing the program stored in the memory.

[0037] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, any of the resource allocation methods described in any of the first aspect above is implemented.

[0038] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any resource allocation method described in the first aspect.

[0039] The resource allocation method, device, electronic device, storage medium and computer program product containing instructions provided in the embodiments of the present application obtain the size of resources required for the current region of interest to be processed and the size of currently allocated resources, compare the size of resources required for the current region of interest to be processed and the size of currently allocated resources, and when the size of resources required for the current region of interest to be processed is not greater than the size of currently allocated resources, use the currently allocated resources as the allocated resources for the current region of interest to be processed, so that there is no need to recalculate the allocated resources for each region of interest, shortens the time for allocating resources, improves the efficiency of resource allocation, and also improves resource utilization by utilizing the allocated resources.

[0040] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 A schematic diagram of a resource allocation method according to an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a resource allocation device according to an embodiment of the present application;

[0044] Figure 3 A schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] The embodiments of the present application disclose a resource allocation method, an apparatus, an electronic device, a storage medium, and a computer program product including instructions, which are described below respectively.

[0047] The present application embodiment provides a resource allocation method, see Figure 1 , Figure 1 A schematic diagram of a resource allocation method according to an embodiment of the present application includes the following steps:

[0048] Step 110: Obtain the size of resources required by the current region of interest to be processed and the size of currently allocated resources.

[0049] The resource allocation method in the embodiment of the present application can be implemented by an electronic device. Specifically, the electronic device is a server.

[0050] The size of resources required for the current region of interest to be processed can be directly the size of the current region of interest to be processed, or it can be calculated according to the size of the current region of interest to be processed according to a preset operation algorithm, wherein the size of resources required for the current region of interest to be processed is not less than the size of the current region of interest to be processed. The size of the current region of interest to be processed is calculated according to a preset method, and the above-mentioned preset method can be a deep learning method, or a traditional MATLAB (Matrix Laboratory) method, wherein the size of the current region of interest to be processed according to the preset method can refer to the calculation method of the size of the region of interest in the existing / related technology, which will not be repeated here. Obtain the size of resources required for the current region of interest to be processed and the size of the currently allocated resources. Among them, the above-mentioned resources can be video memory resources, or memory resources, etc.

[0051] Step 120: compare the size of the resources required by the current region of interest to be processed with the size of the currently allocated resources.

[0052] According to the size of the resources required by the current region of interest to be processed and the size of the currently allocated resources, the size of the resources required by the current region of interest to be processed and the size of the currently allocated resources are compared.

[0053] Step 130: When the size of the resources required by the current region of interest to be processed is not greater than the size of the currently allocated resources, the currently allocated resources are used as the allocated resources of the current region of interest to be processed.

[0054] In the case where the size of the resources required for the current region of interest to be processed is not greater than the size of the currently allocated resources, for example, the size of the resources required for the current region of interest to be processed is 249, and the size of the currently allocated resources is 256, the currently allocated resources are used as the allocated resources for the current region of interest to be processed, and there is no need to reallocate resources. For example, a video includes multiple picture frames, and the regions of interest in each frame are inconsistent. In order to process the regions of interest in each frame, it is necessary to allocate video memory resources to the regions of interest, so as to process each region of interest. The size of the allocated video memory resources is obtained, that is, A. When the size of the resources required for the current region of interest to be processed is not greater than A, the allocated video memory resources are used to process the current region of interest to be processed, so that there is no need to reallocate resources for each region of interest, thereby shortening the time for allocating resources and improving the efficiency of resource allocation. At the same time, by using the allocated resources, the resource utilization rate is also improved.

[0055] By obtaining the size of resources required by the current region of interest to be processed and the size of currently allocated resources, and comparing the size of resources required by the current region of interest to be processed and the size of currently allocated resources, when the size of resources required by the current region of interest to be processed is not greater than the size of currently allocated resources, the currently allocated resources are used as the allocated resources for the current region of interest to be processed, so that there is no need to recalculate the allocated resources for each region of interest, which shortens the time for allocating resources, improves the efficiency of resource allocation, and also improves the utilization rate of resources by utilizing the allocated resources.

[0056] In a possible implementation manner, after the step of comparing the size of the resources required by the current region of interest to be processed with the size of the currently allocated resources, the method further includes:

[0057] Step 1: when the size of the resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, a specified number of resources with a preset step size are added to the currently allocated resources to obtain updated allocated resources, wherein the size of the resources required by the current region of interest to be processed is not greater than the updated allocated resources;

[0058] Step 2: Using the updated allocated resources as the allocated resources of the current region of interest to be processed.

[0059] In the case that the size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, a specified number of resources with a preset step size are added on the basis of the currently allocated resources, wherein the specified number may be an integer, to obtain updated allocated resources. For example, the size of the currently allocated resources is 256, and the size of resources required by the current region of interest to be processed is 280. The size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources. Then, on the basis of 256, a specified number of resources with a preset step size are added. For example, if the preset step size is 32, a resource with a preset step size is added to obtain updated allocated resources of 256+32=288, so that the size of resources required by the current region of interest to be processed 280 is not greater than the updated allocated resources 288, and then the updated allocated resources are used as the allocated resources of the current region of interest to be processed.

[0060] By comparing the size of resources required by the above-mentioned current area of ​​interest to be processed with the size of the above-mentioned currently allocated resources, it is determined whether it is necessary to reallocate resources. When the size of resources required by the above-mentioned current area of ​​interest to be processed is greater than the size of the above-mentioned currently allocated resources, on the basis of the above-mentioned currently allocated resources, a specified number of resources with a preset step size are added to obtain updated allocated resources, thereby shortening the time for allocating resources and improving the efficiency of resource allocation. At the same time, by utilizing the allocated resources, the utilization rate of resources is also improved. At the same time, by allocating resources according to the preset step size, standardized resource allocation can be performed.

[0061] In a possible implementation manner, after the step of comparing the size of the resources required by the current region of interest to be processed with the size of the currently allocated resources, the method further includes:

[0062] In the case that the size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, the size of the target allocated resources for the current region of interest to be processed is determined according to a preset multiple of a preset step size and the size of the resources required by the current region of interest to be processed, the size of the target allocated resources for the current region of interest to be processed is equal to the preset multiple multiplied by the preset step size, and the size of the resources required by the current region of interest to be processed is not greater than the size of the target allocated resources for the current region of interest to be processed.

[0063] When the size of resources required by the current region of interest to be processed is greater than the size of currently allocated resources, the size of target allocated resources for the current region of interest to be processed is determined according to the preset multiples of the preset step size and the size of resources required by the current region of interest to be processed. For example, the size of currently allocated resources is 256, the size of resources required by the current region of interest to be processed is 280, and the preset step size is 32. Then 280 / 32=8.75, 8.75 is rounded up to get 9, 9 is multiplied by 32 to get 288, 288 is used as the size of target allocated resources for the current region of interest to be processed, resources are reallocated to the current region of interest to be processed, and resources are allocated to the region of interest to be processed according to the preset multiples of the preset step size, so as to reduce the situation of excess resources in the region of interest to be processed, avoid waste of resources, and improve resource utilization. At the same time, allocating resources according to the preset step size can perform standardized resource allocation.

[0064] When resources are allocated for the first time, in a possible implementation manner, the method includes:

[0065] Get the size of the resources needed for the initial region of interest;

[0066] Divide the size of the resources required by the initial region of interest by the preset step size to obtain a quotient value;

[0067] Round the above quotient upwards to obtain the target multiple;

[0068] The target multiple is multiplied by the preset step length, and the product of the target multiple and the preset step length is used as the size of the resources allocated to the initial region of interest.

[0069] When allocating resources for the first time, obtain the size of resources required for the initial region of interest. For example, if the size of resources required for the initial region of interest is 249, divide the size of resources required for the initial region of interest by the preset step size. For example, the preset step size is 32, and the quotient is 7.78. Round 7.78 up to 8, which is the target multiple. Multiply 8 by the preset step size 32, which is equal to 256. 256 is the size of resources allocated to the initial region of interest. Allocating resources according to the preset step size can perform standardized resource allocation.

[0070] When performing the second resource allocation, the size of the resources required for the second region of interest is obtained. For example, the size of the resources required for the second region of interest is 230, and the size of the resources required for the second region of interest is less than the size of 256 of the resources allocated to the initial region of interest. In this case, the resources allocated to the initial region of interest are used as the allocated resources for the second region of interest, that is, there is no need to reallocate them, and the allocated resources of the initial region of interest are directly used to process the second region of interest.

[0071] When performing the second resource allocation, the size of the resources required for the second region of interest is obtained. For example, if the size of the resources required for the second region of interest is 270, then the size of the resources required for the second region of interest is greater than the size of the resources allocated to the initial region of interest, 256. Then, based on the resources 256 allocated to the initial region of interest, a resource with a preset step size of 32 is added to obtain 256+32=288 updated resources. The updated resources are used to process the second region of interest, and resources are allocated according to the preset step size, so that the resource allocation can be standardized. Among them, for the same group of regions of interest, for example, for processing the regions of interest in the same video, the preset step size can be fixed, and for different groups of regions of interest, the preset step size can be set as needed. The setting of the preset step size can be set according to actual needs.

[0072] When resources are allocated for the first time, in a possible implementation manner, the method includes:

[0073] Get the size of the resources needed for the initial region of interest;

[0074] The size of the resources required by the initial region of interest is used as the size of the resources allocated to the initial region of interest.

[0075] When resources are allocated for the first time, the size of resources required by the initial region of interest is obtained. For example, if the size of resources required by the initial region of interest is 249, then 249 is the size of resources allocated to the initial region of interest. In this way, when resources are allocated for the first time, resources are directly allocated to the initial region of interest according to the size of resources required by the initial region of interest, without the need for calculation, thereby reducing the amount of calculation.

[0076] The present application embodiment provides a resource allocation device, see Figure 2 , Figure 2 A schematic diagram of a resource allocation device according to an embodiment of the present application includes:

[0077] The acquisition module 210 is used to obtain the size of resources required by the current region of interest to be processed and the size of currently allocated resources;

[0078] A comparison module 220, configured to compare the size of the resources required by the current region of interest to be processed with the size of the currently allocated resources;

[0079] The first processing module 230 is configured to use the currently allocated resources as allocated resources for the currently processed region of interest if the size of the resources required for the currently processed region of interest is not greater than the size of the currently allocated resources.

[0080] In a possible implementation manner, the device further includes a second processing module, and the second processing module is specifically configured to:

[0081] In the case that the size of the resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, adding a specified number of resources of a preset step size on the basis of the currently allocated resources to obtain updated allocated resources, wherein the size of the resources required by the current region of interest to be processed is not greater than the updated allocated resources;

[0082] The updated allocated resources are used as the allocated resources of the current region of interest to be processed.

[0083] In a possible implementation manner, the apparatus further includes a third processing module, and the third processing module is specifically configured to:

[0084] In the case that the size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, the size of the target allocated resources for the current region of interest to be processed is determined according to a preset multiple of a preset step size and the size of the resources required by the current region of interest to be processed, the size of the target allocated resources for the current region of interest to be processed is equal to the preset multiple multiplied by the preset step size, and the size of the resources required by the current region of interest to be processed is not greater than the size of the target allocated resources for the current region of interest to be processed.

[0085] In a possible implementation, the above device includes:

[0086] An acquisition module is used to acquire the size of resources required for the initial area of ​​interest;

[0087] A first calculation module is used to divide the size of the resources required by the initial region of interest by a preset step size to obtain a quotient;

[0088] The second calculation module is used to round up the quotient to obtain a target multiple;

[0089] The fourth processing module is used to multiply the target multiple by the preset step length, and use the product of the target multiple and the preset step length as the size of the resources allocated to the initial region of interest.

[0090] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0091] The present application also provides an electronic device, see Figure 3 , Figure 3A schematic diagram of an electronic device according to an embodiment of the present application, comprising: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340, and the memory 330 is used to store computer programs;

[0092] The processor 310 is used to execute the computer program stored in the memory 330 to implement the following steps:

[0093] Obtain the size of resources required for the current area of ​​interest to be processed and the size of currently allocated resources;

[0094] Compare the size of the resources required by the current region of interest to be processed with the size of the currently allocated resources;

[0095] In the case that the size of the resources required by the current region of interest to be processed is not greater than the size of the currently allocated resources, the currently allocated resources are used as the allocated resources of the current region of interest to be processed.

[0096] Optionally, when the processor 310 is used to execute the program stored in the memory 330, it can also implement any of the above-mentioned resource allocation methods.

[0097] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0098] The communication interface is used for communication between the above electronic device and other devices.

[0099] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0100] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0101] In an embodiment of the present application, a storage medium is further provided, in which instructions are stored. When the storage medium is executed on a computer, the computer executes any of the resource allocation methods in the above embodiments.

[0102] In an embodiment of the present application, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer executes any of the resource allocation methods in the above embodiments.

[0103] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0104] It should be noted that, in this article, the technical features in each optional solution can be combined to form a solution as long as there is no contradiction, and these solutions are all within the scope disclosed in this application. Relational terms such as first and second, etc. are only used to distinguish an entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the above-mentioned elements.

[0105] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, electronic device, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0106] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the protection scope of the present application.

Claims

1. A resource allocation method, characterized in that: The method comprises: Obtain the size of resources required for the current area of ​​interest to be processed and the size of currently allocated resources; Comparing the size of resources required by the current region of interest to be processed with the size of the currently allocated resources; In a case where the size of the resources required by the current region of interest to be processed is not greater than the size of the currently allocated resources, using the currently allocated resources as the allocated resources of the current region of interest to be processed; In the case where the size of resources required by the current region of interest to be processed is greater than the size of the currently allocated resources, the size of the target allocated resources for the current region of interest to be processed is determined according to a preset multiple of a preset step size and the size of the resources required by the current region of interest to be processed, the size of the target allocated resources for the current region of interest to be processed is equal to the preset multiple multiplied by the preset step size, and the size of the resources required by the current region of interest to be processed is not greater than the size of the target allocated resources for the current region of interest to be processed.

2. The method according to claim 1, characterized in that The method comprises: Get the size of the resources needed for the initial region of interest; Dividing the size of the resources required by the initial region of interest by a preset step size to obtain a quotient value; Rounding up the quotient to obtain a target multiple; The target multiple is multiplied by the preset step length, and the product of the target multiple and the preset step length is used as the size of the initial resource allocation of the region of interest.

3. A resource allocation device, characterized in that: The device comprises: The acquisition module is used to obtain the size of resources required by the current area of ​​interest to be processed and the size of currently allocated resources; A comparison module, used for comparing the size of resources required by the current region of interest to be processed with the size of the currently allocated resources; A first processing module, configured to use the currently allocated resources as allocated resources for the currently processed region of interest when the size of the resources required for the currently processed region of interest is not greater than the size of the currently allocated resources; The third processing module is used to determine the size of the target allocated resources of the current region of interest to be processed according to a preset multiple of a preset step and the size of the resources required by the current region of interest to be processed, when the size of the resources required by the current region of interest to be processed is larger than the size of the currently allocated resources. The size of the target allocated resources of the current region of interest to be processed is equal to the preset multiple multiplied by the preset step, and the size of the resources required by the current region of interest to be processed is not larger than the size of the target allocated resources of the current region of interest to be processed.

4. The device according to claim 3, characterized in that The device comprises: An acquisition module is used to acquire the size of resources required for the initial area of ​​interest; A first calculation module, used for dividing the size of the resources required by the initial region of interest by a preset step size to obtain a quotient; A second calculation module is used to round up the quotient to obtain a target multiple; The fourth processing module is used to multiply the target multiple by the preset step length, and use the product of the target multiple and the preset step length as the size of the initial resource allocation of the region of interest.

5. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein: The processor, communication interface, and memory communicate with each other via a communication bus; Memory, used to store computer programs; A processor, configured to implement the resource allocation method according to any one of claims 1 to 2 when executing a program stored in a memory.

6. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the resource allocation method according to any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • Real-time picture-in-picture generating method based on field programmable gate array (FPGA) and device thereof

    CN103095997A

  • Cache management method for transparent-computing-oriented intelligent terminal

    CN105468541A

  • Resource management method, resource management device and resource management equipment of cloud computing cluster

    CN108874502A

  • Image processing method, apparatus, image pickup apparatus, and storage medium

    CN109034136A

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN110070083A