CN113568733A - Resource allocation method, device, electronic equipment and storage medium - Google Patents

Resource allocation method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113568733A
CN113568733A CN202010354568.9A CN202010354568A CN113568733A CN 113568733 A CN113568733 A CN 113568733A CN 202010354568 A CN202010354568 A CN 202010354568A CN 113568733 A CN113568733 A CN 113568733A
Authority
CN
China
Prior art keywords
size
resource
interest
processed
current region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010354568.9A
Other languages
Chinese (zh)
Inventor
张海斌
蔡媛
樊鸿飞
汪贤
成超
鲁方波
熊宝玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010354568.9A priority Critical patent/CN113568733A/en
Publication of CN113568733A publication Critical patent/CN113568733A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]

Abstract

The resource allocation method, the resource allocation device, the electronic equipment and the storage medium provided by the embodiment of the application relate to the technical field of data processing, the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource are obtained, the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource are compared, and under the condition that the size of the resource required by the current region of interest to be processed is not larger than the size of the currently allocated resource, the currently allocated resource is used as the allocation resource of the current region of interest to be processed, so that the allocation resource does not need to be recalculated for each region of interest, the time for allocating the resource is shortened, the resource allocation efficiency is improved, and meanwhile, the resource utilization rate is also improved by utilizing the allocated resource.

Description

Resource allocation method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a resource allocation method and apparatus, an electronic device, and a storage medium.
Background
The ROI (Region of Interest) is a Region to be processed, which is delineated by a square frame, a circle, an ellipse, or an irregular polygon from a processed image in computer vision and image processing, and is a key point of Interest in image analysis or processing.
According to the scheme in the related art, when resources are allocated to the region of interest, for example, video memory resources are allocated to the region of interest, the allocation is performed according to the size of the region of interest, when the next frame of picture is processed after the frame of picture is processed, the size of the region of interest is recalculated, and if the size of the region of interest of the next frame of picture is different from the size of the region of interest of the previous frame, the allocation of the video memory resources is performed again. However, during video processing, the interesting regions of each frame may have a difference in the number of pixels along with the movement of the detection target, so the interesting regions of each frame are different in size, and the resources are reallocated due to the difference in the sizes of the interesting regions, so that the resource allocation efficiency is low.
Disclosure of Invention
An object of the embodiments of the present application is to provide a resource allocation method, a resource allocation device, an electronic device, and a storage medium, so as to solve the problem of low resource allocation efficiency in the related art and improve the efficiency of resource allocation.
The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a resource allocation method, where the method includes:
acquiring the size of resources required by a current region of interest to be processed and the size of currently allocated resources;
comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource;
and under the condition that the size of the resource required by the current region of interest to be processed is not larger than the size of the currently allocated resource, taking the currently allocated resource as the allocation resource of the current region of interest to be processed.
Optionally, after the step of comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource, the method further includes:
under the condition that 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, increasing a specified number of resources with preset step length 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 larger than the updated allocated resources;
and taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
Optionally, after the step of comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource, the method further includes:
and under the condition that the size of the resource required by the current region of interest to be processed is larger than the size of the currently allocated resource, determining the size of the resource allocated to the current region of interest to be processed according to a preset multiple of a preset step length and the size of the resource required by the current region of interest to be processed, wherein the size of the resource allocated to the current region of interest to be processed is equal to the preset multiple multiplied by the preset step length, and the size of the resource required by the current region of interest to be processed is not larger than the size of the resource allocated to the current region of interest to be processed.
Optionally, the method includes:
acquiring the size of resources required by an initial region of interest;
dividing the size of the resource required by the initial region of interest by a preset step length to obtain a quotient value;
rounding the quotient upwards to obtain a target multiple;
and multiplying the target multiple by the preset step length, and taking the product of the target multiple and the preset step length as the size of the initial interested area allocated resources.
In a second aspect, an embodiment of the present application provides a resource allocation apparatus, where the apparatus includes:
the acquisition module is used for acquiring the size of the resources required by the current region of interest to be processed and the size of the currently allocated resources;
the comparison module is used for comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource;
and the first processing module is used for taking the currently allocated resources as the allocation resources of the current region of interest to be processed under the condition that the size of the resources required by the current region of interest to be processed is not larger than the size of the currently allocated resources.
Optionally, the apparatus further includes a second processing module, where the second processing module is specifically configured to:
under the condition that 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, increasing a specified number of resources with preset step length 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 larger than the updated allocated resources;
and taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
Optionally, the apparatus further includes a third processing module, where the third processing module is specifically configured to:
and under the condition that the size of the resource required by the current region of interest to be processed is larger than the size of the currently allocated resource, determining the size of the resource allocated to the current region of interest to be processed according to a preset multiple of a preset step length and the size of the resource required by the current region of interest to be processed, wherein the size of the resource allocated to the current region of interest to be processed is equal to the preset multiple multiplied by the preset step length, and the size of the resource required by the current region of interest to be processed is not larger than the size of the resource allocated to the current region of interest to be processed.
Optionally, the apparatus includes:
the acquisition module is used for acquiring the size of resources required by the initial region of interest;
the first calculation module is used for dividing the size of the resource required by the initial region of interest by a preset step length to obtain a quotient value;
the second calculation module is used for rounding the quotient upwards to obtain a target multiple;
and the fourth processing module is used for multiplying the target multiple by the preset step length and taking the product of the target multiple and the preset step length as the size of the resource allocated to the initial region of interest.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the resource allocation method according to any one of the first aspect described above when executing a program stored in a memory.
In a fourth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored in the storage medium, and the computer program, when executed by a processor, implements any of the resource allocation methods described in any of the above first aspects.
In a fifth aspect, embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the resource allocation method according to any one of the above first aspects.
According to the resource allocation method, the resource allocation device, the electronic device, the storage medium and the computer program product containing the instructions, the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource are obtained, the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource are compared, and under the condition that the size of the resource required by the current region of interest to be processed is not larger than the size of the currently allocated resource, the currently allocated resource is used as the allocation resource of the current region of interest to be processed, so that each region of interest is not required to recalculate the allocation resource, the time for allocating the resource is shortened, the resource allocation efficiency is improved, and meanwhile, the resource utilization rate is also improved by utilizing the allocated resource.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a resource allocation method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a resource allocation apparatus according to an embodiment of the present application;
fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiments of the present application disclose a resource allocation method, a resource allocation apparatus, an electronic device, a storage medium, and a computer program product containing instructions, which are described below.
An embodiment of the present application provides a resource allocation method, referring to fig. 1, where fig. 1 is a schematic diagram of the resource allocation method in the embodiment of the present application, and includes the following steps:
step 110, obtaining the size of the resource needed by the current interesting area to be processed and the size of the currently allocated resource.
The resource allocation method of the embodiment of the application can be implemented by an electronic device, and specifically, the server electronic device is a server.
The size of the resource required by the current region of interest to be processed can be directly the size of the current region of interest to be processed, or 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 the resource required by the current region of interest to be processed is not smaller 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, where the preset method may be a deep learning method or a conventional MATLAB (Matrix Laboratory) method, and the calculation of the size of the current region of interest to be processed according to the preset method may refer to a calculation method of the size of the region of interest in the existing/related art, and is not described herein again. And acquiring the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource. The resources may be video memory resources, or the like.
And step 120, comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource.
And comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource according to the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource.
Step 130, taking the currently allocated resource as the allocated resource of the current region of interest to be processed, when the size of the resource required by the current region of interest to be processed is not larger than the size of the currently allocated resource.
When the size of the resource needed by the current region of interest to be processed is not greater than the size of the currently allocated resource, for example, the size of the resource needed by the current region of interest to be processed is 249, and the size of the currently allocated resource is 256, the currently allocated resource is used as the allocation resource of the current region of interest to be processed, and there is no need to allocate the resource again. For example, the video includes a plurality of picture frames, regions of interest in each frame of picture are inconsistent, and to process the regions of interest in each frame of picture, a video memory resource needs to be allocated to the regions of interest, so as to process each region of interest. The size of the allocated video memory resource is obtained, namely A, when the size of the resource required by the current region of interest to be processed is not larger than A, the allocated video memory resource is used for processing the current region of interest to be processed, so that the resource does not need to be reallocated to each region of interest, the time for allocating the resource is shortened, the resource allocation efficiency is improved, and meanwhile, the resource utilization rate is also improved by using the allocated resource.
The method comprises the steps of obtaining the size of resources required by a current region of interest to be processed and the size of currently allocated resources, comparing the size of the resources required by the current region of interest to be processed with the size of the currently allocated resources, and taking the currently allocated resources as the allocated resources of the current region of interest to be processed under the condition that the size of the resources required by the current region of interest to be processed is not larger than the size of the currently allocated resources, so that the resources do not need to be recalculated in each region of interest, the time for allocating the resources is shortened, the efficiency of resource allocation is improved, and meanwhile, the utilization rate of the resources is also improved by utilizing the allocated resources.
In a possible implementation manner, after the step of comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource, the method further includes:
step one, under the condition that the size of the resource required by the current interesting area to be processed is larger than the size of the currently allocated resource, on the basis of the currently allocated resource, increasing a specified number of resources with preset step length to obtain an updated allocated resource, wherein the size of the resource required by the current interesting area to be processed is not larger than the updated allocated resource;
and step two, taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
If the size of the resource needed by the current roi is larger than the size of the currently allocated resource, a specified number of resources with a preset step size is added based on the currently allocated resource, where the specified number may be an integer, to obtain an updated allocated resource, for example, the size of the currently allocated resource is 256, the size of the current roi is 280, the size of the current roi needed resource is larger than the size of the currently allocated resource, then the specified number of resources with the preset step size is added based on 256, for example, the preset step size is 32, a preset step size is added to obtain an updated allocated resource of 256+32 ═ 288, so that the size of the current roi 280 is not larger than the updated allocated resource 288, and then taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
Comparing the size of the resource needed by the current interesting area to be processed with the size of the currently allocated resource, judging whether the resource needs to be reallocated, when the size of the resource needed by the current interesting area to be processed is larger than the size of the currently allocated resource, increasing a specified number of resources with preset step length on the basis of the currently allocated resource to obtain updated allocated resource, thereby shortening the time for allocating the resource, improving the efficiency of resource allocation, simultaneously improving the utilization rate of the resource by utilizing the allocated resource, and allocating the resource according to the preset step length, thereby being capable of performing standardized resource allocation.
In a possible implementation manner, after the step of comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource, the method further includes:
and under the condition that the size of the resource required by the current region of interest to be processed is larger than the size of the currently allocated resource, determining the size of the resource allocated to the target of the current region of interest to be processed according to a preset multiple of a preset step length and the size of the resource required by the current region of interest to be processed, wherein the size of the resource allocated to the target of the current region of interest to be processed is equal to the preset multiple multiplied by the preset step length, and the size of the resource required by the current region of interest to be processed is not larger than the size of the resource allocated to the target of the current region of interest to be processed.
When the size of the resource needed by the current roi is larger than the size of the currently allocated resource, determining the size of the resource allocated to the current roi target according to a preset multiple of a preset step and the size of the resource needed by the current roi, for example, the size of the currently allocated resource is 256, the size of the resource needed by the current roi is 280, the preset step is 32, 280/32 is 8.75, 8.75 is rounded up to 9, 9 is multiplied by 32 to be equal to 288, 288 is taken as the size of the resource allocated to the current roi target, the resource is reallocated to the current roi, the resource is allocated to the roi according to the preset multiple of the preset step, so as to reduce the situation that the resource of the roi is excessive, the resource waste is avoided, the resource utilization rate is improved, and meanwhile, the resources are distributed according to the preset step length, so that the resource distribution can be carried out in a standardized manner.
When resource allocation is performed for the first time, in one possible embodiment, the method includes:
acquiring the size of resources required by an initial region of interest;
dividing the size of the resource required by the initial region of interest by a preset step length to obtain a quotient value;
rounding the quotient upwards to obtain a target multiple;
and multiplying the target multiple by the preset step length, and taking the product of the target multiple and the preset step length as the size of the initial interested area allocation resource.
When resource allocation is performed for the first time, the size of the resource required by the initial region of interest is obtained, for example, the size of the resource required by the initial region of interest is 249, the size of the resource required by the initial region of interest is divided by a preset step length, for example, the preset step length is 32, the quotient is 7.78, 7.78 is rounded up to obtain 8, 8 is a target multiple, 8 is multiplied by the preset step length 32 to be equal to 256, 256 is the size of the resource allocated to the initial region of interest, and resource allocation can be performed according to the preset step length, so that normalized resource allocation can be performed.
When the second resource allocation is performed, the size of the resource required by the second region of interest is obtained, for example, the size of the resource required by the second region of interest is 230, and the size of the resource required by the second region of interest is smaller than the size 256 of the resource allocated to the initial region of interest, and the resource allocated to the initial region of interest is used as the allocated resource of the second region of interest, that is, the second region of interest is processed by directly using the allocated resource of the initial region of interest without reallocation.
When the second resource allocation is performed, the size of the resource needed by the second roi is obtained, for example, the size of the resource needed by the second roi is 270, and the size of the resource needed by the second roi is larger than the size 256 of the resource allocated by the initial roi, then on the basis of the resource 256 allocated to the initial roi, a resource with a preset step size of 32 is added, so as to obtain an updated resource with 256+ 32-288, the updated resource is used to process the second roi, and the resource is allocated according to the preset step size, so that the resource allocation can be performed in a normalized manner. For the same group of interested regions, for example, the interested regions in the same video are processed, the preset step length may be fixed, and for different groups of interested regions, the preset step length may be set as required. The preset step length can be set according to actual needs.
When resource allocation is performed for the first time, in one possible embodiment, the method includes:
acquiring the size of resources required by an initial region of interest;
and taking the size of the resource required by the initial region of interest as the size of the resource allocated by the initial region of interest.
When resource allocation is performed for the first time, the size of the resource required by the initial region of interest is obtained, for example, if the size of the resource required by the initial region of interest is 249, the 249 allocates the size of the resource to the initial region of interest. Therefore, when the resource allocation is carried out for the first time, the resource is directly allocated to the initial region of interest according to the size of the resource required by the initial region of interest, calculation is not needed, and the calculation amount is reduced.
An embodiment of the present application provides a resource allocation apparatus, referring to fig. 2, where fig. 2 is a schematic diagram of the resource allocation apparatus according to the embodiment of the present application, including:
the acquisition module 210 is configured to acquire the size of the resource required by the current region of interest to be processed and the size of the currently allocated resource;
a comparing module 220, configured to compare the size of the resource needed by the current region of interest to be processed with the size of the currently allocated resource;
the first processing module 230 is configured to, when the size of the resource required by the current region of interest to be processed is not greater than the size of the currently allocated resource, use the currently allocated resource as an allocation resource of the current region of interest to be processed.
In a possible implementation manner, the apparatus further includes a second processing module, where the second processing module is specifically configured to:
under the condition that 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, increasing a specified number of resources with preset step length 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 larger than the updated allocated resources;
and taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
In a possible implementation manner, the apparatus further includes a third processing module, where the third processing module is specifically configured to:
and under the condition that the size of the resource required by the current region of interest to be processed is larger than the size of the currently allocated resource, determining the size of the resource allocated to the target of the current region of interest to be processed according to a preset multiple of a preset step length and the size of the resource required by the current region of interest to be processed, wherein the size of the resource allocated to the target of the current region of interest to be processed is equal to the preset multiple multiplied by the preset step length, and the size of the resource required by the current region of interest to be processed is not larger than the size of the resource allocated to the target of the current region of interest to be processed.
In one possible embodiment, the above apparatus comprises:
the acquisition module is used for acquiring the size of resources required by the initial region of interest;
the first calculation module is used for dividing the size of the resource required by the initial region of interest by a preset step length to obtain a quotient value;
the second calculation module is used for rounding the quotient upwards to obtain a target multiple;
and the fourth processing module is configured to multiply the target multiple by the preset step size, and use the product of the target multiple and the preset step size as the size of the initial roi allocation resource.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present application further provides an electronic device, referring to fig. 3, where fig. 3 is a schematic diagram of the electronic device according to the embodiment of the present application, and the electronic device includes: the system comprises 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 are communicated with each other through the communication bus 340, and the memory 330 is used for storing computer programs;
the processor 310 is configured to implement the following steps when executing the computer program stored in the memory 330:
acquiring the size of resources required by a current region of interest to be processed and the size of currently allocated resources;
comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource;
and under the condition that the size of the resource required by the current region of interest to be processed is not larger than the size of the currently allocated resource, taking the currently allocated resource as the allocation resource of the current region of interest to be processed.
Optionally, the processor 310, when configured to execute the program stored in the memory 330, may also implement any of the resource allocation methods described above.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
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 memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In an embodiment of the present application, there is also provided a storage medium having instructions stored therein, which when executed on a computer, cause the computer to perform any of the above-described resource allocation methods in the above-described embodiments.
In an embodiment of the present application, there is also provided a computer program product containing instructions, which when run on a computer, cause the computer to perform any of the above-mentioned resource allocation methods in the above-mentioned embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be noted that, in this document, the technical features in the various alternatives can be combined to form the scheme as long as the technical features are not contradictory, and the scheme is within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the same element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the electronic device, and the storage medium, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A method for resource allocation, the method comprising:
acquiring the size of resources required by a current region of interest to be processed and the size of currently allocated resources;
comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource;
and under the condition that the size of the resource required by the current region of interest to be processed is not larger than the size of the currently allocated resource, taking the currently allocated resource as the allocation resource of the current region of interest to be processed.
2. The method according to claim 1, wherein after the step of comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource, the method further comprises:
under the condition that 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, increasing a specified number of resources with preset step length 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 larger than the updated allocated resources;
and taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
3. The method according to claim 1, wherein after the step of comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource, the method further comprises:
and under the condition that the size of the resource required by the current region of interest to be processed is larger than the size of the currently allocated resource, determining the size of the resource allocated to the current region of interest to be processed according to a preset multiple of a preset step length and the size of the resource required by the current region of interest to be processed, wherein the size of the resource allocated to the current region of interest to be processed is equal to the preset multiple multiplied by the preset step length, and the size of the resource required by the current region of interest to be processed is not larger than the size of the resource allocated to the current region of interest to be processed.
4. A method according to any of claims 1-3, characterized in that the method comprises:
acquiring the size of resources required by an initial region of interest;
dividing the size of the resource required by the initial region of interest by a preset step length to obtain a quotient value;
rounding the quotient upwards to obtain a target multiple;
and multiplying the target multiple by the preset step length, and taking the product of the target multiple and the preset step length as the size of the initial interested area allocated resources.
5. An apparatus for resource allocation, the apparatus comprising:
the acquisition module is used for acquiring the size of the resources required by the current region of interest to be processed and the size of the currently allocated resources;
the comparison module is used for comparing the size of the resource required by the current region of interest to be processed with the size of the currently allocated resource;
and the first processing module is used for taking the currently allocated resources as the allocation resources of the current region of interest to be processed under the condition that the size of the resources required by the current region of interest to be processed is not larger than the size of the currently allocated resources.
6. The apparatus according to claim 5, further comprising a second processing module, the second processing module being specifically configured to:
under the condition that 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, increasing a specified number of resources with preset step length 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 larger than the updated allocated resources;
and taking the updated allocation resource as the allocation resource of the current region of interest to be processed.
7. The apparatus according to claim 5, further comprising a third processing module, the third processing module being specifically configured to:
and under the condition that the size of the resource required by the current region of interest to be processed is larger than the size of the currently allocated resource, determining the size of the resource allocated to the current region of interest to be processed according to a preset multiple of a preset step length and the size of the resource required by the current region of interest to be processed, wherein the size of the resource allocated to the current region of interest to be processed is equal to the preset multiple multiplied by the preset step length, and the size of the resource required by the current region of interest to be processed is not larger than the size of the resource allocated to the current region of interest to be processed.
8. The apparatus according to any one of claims 5-7, wherein the apparatus comprises:
the acquisition module is used for acquiring the size of resources required by the initial region of interest;
the first calculation module is used for dividing the size of the resource required by the initial region of interest by a preset step length to obtain a quotient value;
the second calculation module is used for rounding the quotient upwards to obtain a target multiple;
and the fourth processing module is used for multiplying the target multiple by the preset step length and taking the product of the target multiple and the preset step length as the size of the resource allocated to the initial region of interest.
9. An electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein,
the processor, the communication interface and the memory complete mutual communication through a communication bus;
a memory for storing a computer program;
a processor for implementing the resource allocation method of any one of claims 1 to 4 when executing a program stored in the memory.
10. A storage medium, in which a computer program is stored, which, when executed by a processor, implements the resource allocation method of any one of claims 1 to 4.
CN202010354568.9A 2020-04-29 2020-04-29 Resource allocation method, device, electronic equipment and storage medium Pending CN113568733A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010354568.9A CN113568733A (en) 2020-04-29 2020-04-29 Resource allocation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010354568.9A CN113568733A (en) 2020-04-29 2020-04-29 Resource allocation method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113568733A true CN113568733A (en) 2021-10-29

Family

ID=78158463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010354568.9A Pending CN113568733A (en) 2020-04-29 2020-04-29 Resource allocation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113568733A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023097996A1 (en) * 2021-11-30 2023-06-08 上海商汤智能科技有限公司 Target analysis method and apparatus, computer device, storage medium, computer program, and computer program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023097996A1 (en) * 2021-11-30 2023-06-08 上海商汤智能科技有限公司 Target analysis method and apparatus, computer device, storage medium, computer program, and computer program product

Similar Documents

Publication Publication Date Title
US10509772B1 (en) Efficient locking of large data collections
CN106874100B (en) Computing resource allocation method and device
CN111104825A (en) Face registry updating method, device, equipment and medium
CN111597040A (en) Resource allocation method, device, storage medium and electronic equipment
CN111091572A (en) Image processing method and device, electronic equipment and storage medium
CN104008016A (en) Information processing apparatus, resource control method, and program
CN107784195A (en) Data processing method and device
CN113568733A (en) Resource allocation method, device, electronic equipment and storage medium
CN107844593B (en) Video data distribution method and device in distributed computing platform
CN108845860B (en) Method and device for managing quota and electronic equipment
CN110619597A (en) Semitransparent watermark removing method and device, electronic equipment and storage medium
CN110110260B (en) Page rendering method and device and electronic equipment
CN113467924A (en) Resource allocation method, device, server and computer readable storage medium
CN113495786B (en) Image convolution processing method and electronic equipment
CN111625358B (en) Resource allocation method and device, electronic equipment and storage medium
CN109271538A (en) A kind of picture storage method and relevant device
CN113238852B (en) Task allocation method and device, electronic equipment and storage medium
CN115174495B (en) Resource allocation method based on parallel routing and related equipment
CN109377177B (en) Flow processing method, device, equipment and computer readable storage medium
CN111754487B (en) Black frame region cutting method and device and electronic equipment
CN112579281B (en) Resource allocation method, device, electronic equipment and storage medium
CN110991543B (en) Image region of interest clustering method and device, computing device and storage medium
CN115760541A (en) Graphics processor resource management method and device, electronic equipment and readable medium
CN114580805A (en) Resource allocation method, device, readable medium and electronic equipment
CN113989249A (en) Method and device for detecting signs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination