Task resource allocation method and device, equipment and storage medium

By matching task tags with resource pools through logical operations and using a resource pool allocation ratio mechanism, the problem of cumbersome resource configuration in the inference engine is solved, enabling precise allocation and efficient utilization of resources to meet the resource needs of different business scenarios.

CN122064465APending Publication Date: 2026-05-19GUANGDONG HUAZHIYUAN TECH CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG HUAZHIYUAN TECH CO LTD
Filing Date
2025-12-17
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing inference engines are cumbersome and inflexible in resource allocation, making it difficult to precisely control the resources used by algorithm tasks.

Method used

Resource pool matching is performed by matching the tags carried by the task with the matching rules of the resource pool. Logical operations between multiple tags are supported. Resources are allocated in the resource pool based on the task type and algorithm requirements. A mechanism of resource pool division ratio and public resource pool is adopted to achieve precise allocation of resources.

Benefits of technology

It simplifies and improves the accuracy of resource allocation, reduces maintenance costs, enhances resource utilization and system stability, and adapts to the resource allocation needs of diverse business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064465A_ABST
    Figure CN122064465A_ABST
Patent Text Reader

Abstract

The invention discloses a task resource allocation method and device, equipment and a storage medium. The task resource allocation method comprises the steps that in response to a task processing request, resource pool matching is conducted according to labels carried by a task and matching rules of all resource pools, and the matching rules are set based on the labels and support logical operation among the multiple labels; and according to the task type and the algorithm requirement of the task, allocating resources in a resource pool matched with the task to process the task. In this way, simplified allocation of algorithm task resources can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of task resource allocation, and in particular to a task resource allocation method, apparatus, device and storage medium. Background Technology

[0002] With the development of artificial intelligence technology across various industries, the demand for various business algorithms is emerging in an endless stream, requiring an efficient, flexible, and stable inference engine to run these algorithms. In actual business operations, how to accurately and flexibly control the resources used by each algorithm task has become a major challenge in the development of inference engines. Most existing inference engine designs only support configuring the amount of resources used by a task, and a few also support configuring the location of the resources used by the task. Directly specifying the amount and location of resources used by a task through configuration requires a lot of configuration, is cumbersome, difficult to maintain, and lacks flexibility. Summary of the Invention

[0003] This application mainly provides a task resource allocation method, apparatus, device, and storage medium to solve the problem of difficult resource optimization during the allocation of algorithm task resources.

[0004] To address the aforementioned technical problems, this application provides a task resource allocation method, comprising: responding to a task processing request, performing resource pool matching based on the tags carried by the task and the matching rules of each resource pool, wherein the matching rules are set based on the tags and the matching rules support logical operations between multiple tags; and allocating resources in the resource pool matching the task according to the task type and algorithm requirements of the task to process the task.

[0005] In some embodiments, before performing resource matching based on the tags carried by the task and the matching rules of each resource pool, the method further includes: allocating each unit of the resource to each resource pool according to the allocation ratio of each unit of the resource in each resource pool.

[0006] In some embodiments, after allocating the resources to each of the resource pools according to the allocation ratio, the method further includes: uniformly allocating the remaining unallocated resources to a common resource pool.

[0007] In some embodiments, allocating resources in the resource pool matching the task further includes: allocating resources from the public resource pool when the resource reserves of all resource pools matching the task do not meet the resource usage of the task.

[0008] In some embodiments, the step of matching resources based on the tags carried by the task and the matching rules of each resource pool includes: calculating the matching degree between the tags carried by the task and the matching rules of each resource pool; prioritizing each resource pool according to the matching degree; and selecting the resource pool that matches the task in priority order.

[0009] In some embodiments, selecting a resource pool that matches the task in priority order includes: calculating the resource usage of the task based on the algorithm plugin information of the algorithm specified by the task; and selecting the resource pool that meets the resource usage of the task in priority order as the resource pool that matches the task.

[0010] In some embodiments, allocating resources in a resource pool matching the task according to the task type and algorithm requirements includes: when the task type is a video analysis task, allocating resources that meet the algorithm requirements from the resource pool matching the task according to a preset resource usage; or, when the task type is an image analysis task, calculating the number of frames per second and the resource usage per frame of the image task, and dynamically allocating resources that meet the algorithm requirements from the resource pool matching the task every second.

[0011] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a task resource allocation device, comprising: a resource pool matching module, configured to, in response to a task processing request, perform resource matching based on the tags carried by the task and the matching rules of each resource pool, wherein the matching rules are set based on the tags and the matching rules support logical operations between multiple tags; and a resource allocation module, configured to allocate resources in the resource pool matching the task according to the task type and algorithm requirements of the task, so as to process the task.

[0012] This application also provides a computer device, the computer device comprising: a memory and at least one processor, the memory storing instructions; the at least one processor calling the instructions in the memory to cause the computer device to perform the task resource allocation method as described above.

[0013] This application also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the task resource allocation method described above.

[0014] The beneficial effects of this application are as follows: Unlike existing technologies, this application discloses a task resource allocation method, apparatus, device, and storage medium. By responding to task processing requests, resource pools are matched according to the tags carried by the task and the matching rules of each resource pool. The matching rules are based on tag settings and support logical operations between multiple tags. This replaces the cumbersome operation of specifying the quantity and location of resources for each task individually in existing technologies. Resource matching logic is managed in batches through tag rules, reducing configuration workload and maintenance costs. It supports the design of rules for logical operators, which can precisely limit which tasks can use specific resource pools, achieving targeted resource allocation. Resources are allocated from the resource pools matching the task based on the task type and algorithm requirements to process the task, allocating resources on demand and avoiding resource oversupply caused by fixed allocation. First, suitable resource pools are quickly matched using tags combined with logical rules, and then resources are precisely allocated based on task type and algorithm requirements, resolving the contradiction between cumbersome configuration and imprecise resource control in existing technologies. This achieves a comprehensive effect of simplified configuration, efficient resource utilization, and stable system expansion, completely covering the shortcomings of existing technologies. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 This is a flowchart illustrating an embodiment of the task resource allocation method provided in this application; Figure 2 Is it like this? Figure 1 The flowchart of step 100 of the method shown is a schematic diagram of an embodiment. Figure 3 Is it like this? Figure 2 The flowchart of step 130 of the method shown is a schematic diagram of an embodiment; Figure 4 This is a schematic diagram of an embodiment of the task resource allocation device provided in this application; Figure 5 This is a schematic diagram of the structure of a computer device according to an embodiment of this application. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0017] The terms "first," "second," and "third" used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0018] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0019] See Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the task resource allocation method provided in this application. The task resource allocation method includes the following steps: 100: In response to a task processing request, resource pool matching is performed based on the tags carried by the task and the matching rules of each resource pool. The matching rules are set based on the tags and support logical operations between multiple tags.

[0020] In response to a task processing request, the system first obtains the tags carried by the task, and then compares these tags with the preset matching rules of each resource pool. Each matching rule contains at least one tag and supports logical operations between multiple tags to determine whether the task tags meet the rule conditions, thereby filtering out suitable resource pools and providing a basis for subsequent resource allocation. If a task matches multiple resource pools, the selection is based on the matching degree priority. For example, the matching degree can be set to the number of conditions met under the rule; if resources are insufficient, the matching will automatically be downgraded.

[0021] The tags are labels carried by the task to identify its attributes or type, such as "video analysis", "real-time processing", "low latency", etc. Each task can carry multiple tags.

[0022] The matching rules are predefined expressions from the resource pool, consisting of labels, logical operators such as "AND &", "OR |", "NOT!", and parentheses, used to determine whether a task is eligible to use the resources in the resource pool.

[0023] For example, "tag A & !tag B" means that a task must carry tag A but not tag B to match the resource pool; "tag C | tag D" means that a task carrying either tag C or tag D will match the resource pool; "(tag E & tag F) | !tag G" means that a task carrying tags E and F, or not carrying tag G, will match the resource pool; "tag H & (tag I | tag J)" means that a task carrying tag H, and either tag I or tag J, will match the resource pool.

[0024] By matching tags between resource pools and tasks, the cumbersome operation of "specifying resources for each task" in existing technologies is replaced. Resource matching logic is managed in batches through logical operation rules, reducing configuration workload and maintenance costs. At the same time, logical operation rules can precisely limit the scope of matching tasks, enabling targeted resource allocation.

[0025] Tasks can be matched with multiple resource pools, selected according to matching priority, and automatically downgraded to match when resources are insufficient, avoiding task blocking caused by bottlenecks in a single resource pool; combinational logic operations support diverse task attribute matching requirements and can meet resource allocation requirements under different business scenarios.

[0026] Optionally, the process may include the following steps prior to step 100: Based on the allocation ratio of each unit of resource in each resource pool, each unit of resource is allocated to each resource pool respectively.

[0027] When resources to be allocated are available, the allocation ratio is first set according to the current resource allocation status of each resource pool. Then, the resources to be allocated are allocated to the corresponding resource pools according to this ratio. The allocation ratio can be set manually or automatically.

[0028] The resource types include, but are not limited to, computing power, video memory, and encoding / decoding in the inference engine.

[0029] For example, given existing resource pools X and Y, and a total of 0.5 cards of video memory resources to be allocated, if the allocation ratio is set to 60% for X and 40% for Y, then 0.3 cards of video memory resources will be allocated to resource pool X, and 0.2 cards of video memory resources will be allocated to resource pool Y.

[0030] Resources are divided according to the set allocation ratio to ensure that the usage rules and priorities of the resource pools remain unchanged, avoiding the tedious operation of reconfiguration; newly added resources are allocated to each resource pool according to the set allocation strategy to avoid idleness, ensure efficient use of resources, and maintain the stability and accuracy of the resource pool strategy.

[0031] Optionally, the remaining unallocated resources can be uniformly allocated to a public resource pool.

[0032] For example, given existing resource pools A, B, and a public pool, if a total of 1 GPU card is to be allocated, the allocation ratio is set according to the existing allocation: A accounts for 40% of the GPU card's resources, and B accounts for 30% of the GPU card's resources. This means that 0.4 GPU card's computing power will be allocated to A, 0.3 GPU card's computing power will be allocated to B, and the remaining 0.3 GPU card's computing power will be allocated to the public resource pool.

[0033] For the mixed resources to be partitioned, there are currently 0.8 units of computing power and 0.6 units of video memory to be partitioned. If resource pool M is allocated 50% of the computing power + 40% of the video memory, and N is allocated 30% of the computing power + 30% of the video memory, and the remaining 20% ​​of the computing power + 30% of the video memory is not assigned a resource pool, then after partitioning, the computing power portion will receive 0.4 units for M, 0.24 units for N, and 0.16 units for the shared pool; the video memory portion will receive 0.24 units for M, 0.18 units for N, and 0.18 units for the shared pool.

[0034] Optionally, the allocation ratio of new resources in each resource pool can be calculated using a proportional allocation calculator.

[0035] Clearly define the types of new resources, such as computing power, video memory, and encoding / decoding resources. Only calculate the proportion of resources of the same type. The allocation proportions of different types of resources are handled separately. For example, the proportion of computing power resources does not affect the allocation of video memory resources.

[0036] Collect the total allocated resources and the resource quantity of each pool under this resource type. For explicit resource pools, count the resource quantity of this type in all user-specified resource pools; for public resource pools, count the resource quantity that is not explicitly allocated.

[0037] For example, if the new resource is computing power, and the current explicit pool A has 3 cards, pool B has 5 cards, and the public pool has 2 cards, then the total resource T = 3 + 5 + 2 = 10 cards.

[0038] For each resource pool, calculate its proportion within that type of resource, and proportionally calculate the allocation amount of newly added resources. Write the allocation results to the resource management database and synchronize them in real time to the task scheduling module, ensuring that subsequent tasks can immediately utilize the newly added resources.

[0039] The proportions of different resource types are calculated independently to avoid interference between different resource types; no need for administrators to manually adjust the quotas of each resource pool: when adding new resources, they are automatically allocated according to the existing proportions, avoiding the tedious operation of reconfiguring all pools when adding new resources in traditional solutions, and reducing manual intervention; new resources are allocated based on the actual usage ratio of the current resource pool to ensure that resources are tilted towards high-demand pools.

[0040] Optionally, when a new node is detected, the new node can be automatically registered with etcd.

[0041] If a new graphics card is added to the node, the resources registered on etcd will be updated when the service restarts to complete the addition of the new graphics card.

[0042] Optionally, periodic scanning can be performed using a new resource detection unit to identify the type, total amount, and node ID of the new resources.

[0043] Administrators preset scan parameters through the inference engine's configuration interface. Specifically, the scan frequency is configured from 5 to 60 seconds to balance real-time performance and system overhead. The detection scope specifies the types of resources to be monitored, such as computing power / GPUs, video memory, and encoding / decoding units, and the target nodes include all server nodes or specific cluster nodes. Node identification rules define how node IDs are generated, such as server IP address, hostname, or custom cluster node number.

[0044] The system timer starts the scanning task at a preset frequency and sends resource query commands to each target node through a distributed scheduling framework.

[0045] The computing power resource detection program calls GPU driver APIs, such as NVIDIA CUDA's cudaGetDeviceCount, or CPU management tools like lscpu, to enumerate the number, model, and computing power level of the current node's GPUs / CPUs, with single GPU computing power counted as 1 unit. The video memory resource detection program obtains the total video memory of a single card through the GPU or system memory; the codec resource detection program calls the hardware codec library to identify supported codec formats and performance indicators; and the node ID extraction program reads the node's IP address or hostname as a unique identifier.

[0046] The scan results are compared with the historical resource list stored in the resource management database. Specifically, the unique identifier of the resource, such as the UUID of the GPU or the serial number of the CPU, is used to determine whether there are any new items. If a resource is not recorded in the historical list, it is marked as a new resource, and its type, total quantity, and node ID are extracted.

[0047] The newly scanned metadata, including its type, total quantity, and node ID, is written to the distributed resource management database. Simultaneously, the resource status cache table in memory is updated to ensure the scheduling module can query it in real time. After detection, the system sends a notification to the new resource allocation program, initiating the process of allocating new resources according to the existing resource pool ratio.

[0048] Furthermore, the newly added resource detection unit adopts a dynamic adjustable mechanism, which automatically shortens the scanning interval during peak business periods and extends the scanning interval during off-peak periods.

[0049] A globally unique ID is generated by combining the node IP and rack location to ensure conflict-free identification of cross-cluster resources.

[0050] Optionally, a master-slave replication database architecture is used to store resource metadata to ensure data reliability; optionally, the memory cache table adopts a "write penetration" strategy to ensure the real-time query performance of the scheduling module; optionally, newly added resource records include timestamps to support subsequent auditing and backtracking.

[0051] New resources can be quickly integrated into the existing resource pool system within the scanning cycle, maintaining consistency with the original allocation strategy and avoiding resource idleness. The periodic scanning mechanism further enhances flexibility and efficiency through automated and real-time resource detection, better meeting the inference engine's needs for dynamic resource management.

[0052] Further, see Figure 2 Step 100 also includes the following steps: 110: Calculate the matching degree between the tags carried by the task and the matching rules of each resource pool.

[0053] Calculate the matching degree between the tags carried by the task and the matching rules of each resource pool. The matching degree can be calculated by the number of conditions that the task tag must simultaneously meet in the resource pool matching rules. For example, the rule "tag A & ! tag B" requires two conditions to be met simultaneously, so the matching degree is 2.

[0054] 120: Prioritize each resource pool based on its matching degree.

[0055] Priority sorting ranks resource pools from highest to lowest matching degree; the higher the matching degree, the higher the priority. The public resource pool has the lowest matching degree and the lowest priority.

[0056] 130: Select resource pools that match the task in priority order.

[0057] The system selects matching resource pools in order of priority, prioritizing high-priority pools, selecting low-priority pools in turn when resources are insufficient, and finally using the common pool as a backup.

[0058] For example, consider a task tagged with: video, real-time, and high priority. The resource pool rules and matching criteria are as follows: Resource Pool X: Rule "Video & Real-time" → Matching Degree 2 (Meets 2 conditions) Resource pool Y: Rule "Video | High priority" → Match degree 1 (meets 1 condition) Public resource pool: If the rule is empty → the matching degree is 0, then for this task, the priority order of the resource pool is: X>Y>public pool.

[0059] During the selection process, first try resource pool X. If X has enough remaining resources, then use X. If X is insufficient, then try Y. If Y is still insufficient, finally use the common pool.

[0060] Prioritize resource pools with high matching rates to ensure resources are allocated to the most suitable tasks and reduce resource waste. When resources are insufficient, automatically degrade to lower priority pools to prevent tasks from being blocked by a single resource pool bottleneck and improve system fault tolerance.

[0061] There's no need to manually specify task resource pools; the system automatically calculates matching scores and sorts them for selection, replacing the traditional, cumbersome resource configuration and reducing maintenance costs. This process, by combining matching scores and priorities, achieves a balance between accuracy and flexibility in resource allocation, resolving the contradiction between cumbersome configuration and imprecise resource control in traditional solutions.

[0062] Further, see Figure 3 Step 130 also includes the following steps: 131: Calculate the resource usage of the task based on the algorithm plugin information of the algorithm specified in the task.

[0063] After the algorithm is specified for the task, the system obtains the corresponding algorithm plugin information and calculates the resource usage required for task execution based on the detection frame rate and corresponding resource usage in the plugin information.

[0064] Among them, the algorithm plugin information is the detection frame rate and corresponding resource usage declared by the algorithm plugin in the description file, which is the basis for calculating the resource usage of the task.

[0065] The resource usage of a task is calculated based on the information from the algorithm plugin. The amount of resources required to execute a task is divided into fixed usage for video tasks and dynamic usage for image tasks.

[0066] 132: Select resource pools that meet the resource requirements of the task in order of priority, and use them as the resource pools that match the task.

[0067] After prioritizing the resource pools according to the previously calculated matching degree, the system checks the remaining resources of each resource pool in order of priority to see if they meet the resource requirements of the task. The system prioritizes resource pools with higher priority and sufficient remaining resources as the matching pools for the task; if a high-priority pool is insufficient, it checks lower-priority pools in turn, and finally uses the common resource pool as a fallback.

[0068] Resource usage is calculated using algorithm plugin information to ensure that resource usage matches the actual needs of the algorithm, avoiding resource surplus or shortage and improving task execution efficiency. It supports differentiated resource calculation and allocation for different task types, adapting to diverse business scenarios and enhancing system scalability.

[0069] After allocating resources to each resource pool according to the preset ratio, the remaining unallocated resources are then uniformly allocated to the public resource pool.

[0070] After allocating resources to each resource pool according to a preset ratio, the total resource amount of each resource card (such as computing power, video memory, or encoding / decoding) is recorded as 1. After allocating resources to each explicitly defined resource pool according to a preset ratio, the remaining proportion of resources on the card that have not been allocated by the explicit resource pool is counted. The remaining proportion of resources on each card is then uniformly allocated to the implicit public resource pool built into the inference engine to ensure that the total resources of each card are equal to 1.

[0071] For example, suppose a GPU card has a preset allocation ratio of 0.4 for resource pool A and 0.3 for resource pool B. The remaining ratio is 0.3 (1-0.4-0.3), and this remaining 0.3 will be uniformly allocated to the public resource pool.

[0072] By uniformly allocating remaining resources to the public pool, the total resources of each card are guaranteed to be strictly equal to 1, which complies with the resource allocation rules and avoids resource allocation conflicts or waste. As an implicit pool, the public resource pool can receive all resources that are not explicitly allocated. When the remaining resources in the explicit resource pool matched by a task are insufficient, resources can be allocated from the public pool to ensure the normal execution of the task. There is no need to explicitly configure the resource ratio of the public resource pool; remaining resources are automatically filled into the public pool, reducing the workload of manual configuration and lowering maintenance costs. It allows some resources to be reserved in the public pool to adapt to the backup needs of different tasks, improve the stability of the system in dealing with resource shortage scenarios, and maintain a balance between the accuracy and flexibility of resource allocation.

[0073] 200: Based on the task type and algorithm requirements, allocate resources from the resource pool that matches the task to process the task.

[0074] Based on the tags carried by the task, match resource pools that meet the resource pool rules and sort them from high to low matching degree; calculate the resource usage required by the task based on the task type and algorithm requirements; select the pool with remaining resources that meet the task usage from the matched resource pools according to the matching degree priority, and allocate resources to process the task.

[0075] The task type refers to the business category to which the task belongs, such as video analysis task, image analysis task, etc.

[0076] Algorithm requirements are the resource usage requirements for the algorithm specified in the task. They are determined by the detection frame rate and corresponding resource usage declared by the algorithm plugin in the description file, and are the core basis for calculating the task's resource usage.

[0077] Resource usage is calculated based on task type and algorithm requirements to ensure that resource allocation is highly consistent with the actual needs of the task, avoiding resource surplus or shortage; resources are allocated first to the matching resource pool to reduce resource waste and improve overall resource utilization; by combining task type and algorithm requirements, a balance between accuracy and flexibility in resource allocation is achieved, solving the problems of cumbersome configuration and imprecise resource control in existing technologies.

[0078] Optionally, when the task type is a video analysis task, resources that meet the algorithm requirements are allocated from the resource pool that matches the task according to the preset resource usage.

[0079] When the task type is video analysis, the system matches resource pools that meet the resource pool rules based on the tags carried by the task, and sorts them from high to low matching degree; it determines the total amount of resources required by the task based on the preset resource usage of the algorithm plugin or the resource usage declared in the algorithm plugin description file; it selects the pool with remaining resources that meet the usage from the resource pools that match the task in priority order, and allocates resources that meet the algorithm requirements.

[0080] Optionally, video analytics tasks use a fixed deduction method, directly deducting the task's resource usage; Video analytics tasks employ a fixed deduction method to ensure a stable supply of resources; resources are allocated according to algorithm requirements to avoid resource surplus or shortage and reduce waste.

[0081] Optionally, when the task type is an image analysis task, the number of frames per second and the resource usage per frame of the image task are calculated, and resources that meet the algorithm requirements are dynamically allocated from the resource pool that matches the task every second.

[0082] When the task type is image analysis, the system matches resource pools that meet the resource pool rules based on the tags carried by the task, and sorts them from high to low according to the matching degree; it calculates the number of frames per second for the image task, or the detection frame rate and resource usage per frame declared by the algorithm plugin, and converts the resource usage declared by the algorithm plugin into the resource usage corresponding to each frame; and it dynamically allocates resources that meet the algorithm requirements from the resource pool that matches the task every second.

[0083] Optionally, the image analysis task adopts a dynamic deduction method, deducting the resource usage of one frame from the remaining resource quota of the resource pool every second.

[0084] The image analysis task adopts a dynamic deduction method to adapt to frame-level resource changes. Dynamic deduction further optimizes the resource usage of the image task and improves the overall utilization rate.

[0085] It supports differentiated resource allocation for diverse task types to adapt to complex business scenarios; the public resource pool backup mechanism ensures the stability of task execution and avoids task blocking due to insufficient resources.

[0086] By employing differentiated resource allocation strategies, both precise resource control and system flexibility are achieved, solving the problems of cumbersome configuration and low resource utilization in existing technologies.

[0087] Optionally, allocating resources in the resource pool that matches the task further includes: allocating resources from a common resource pool when the resource reserves of all resource pools that match the task are insufficient to meet the resource usage of the task.

[0088] If the resources in all matching resource pools are insufficient to meet the resource requirements of the task, the inference engine's built-in public resource pool will be activated, and resources will be allocated from the public resource pool to the task to support its processing.

[0089] By allocating resources through a public resource pool as a safety net, tasks are prevented from being blocked or failing due to insufficient matching resources, ensuring that tasks can be processed normally. There is no need to manually configure safety net resource strategies for tasks; the system automatically activates the public resource pool, replacing the traditional cumbersome emergency configuration operations and reducing maintenance costs. As an implicit resource pool, the public resource pool does not interfere with the planning of the explicit resource pool, while providing flexible emergency resource support to adapt to diverse task resource needs. The public resource pool integrates unallocated surplus resources, transforming idle resources into usable emergency resources and improving overall resource utilization.

[0090] The public resource pool mechanism not only ensures the accuracy of resource allocation but also addresses emergency resource shortages, thereby enhancing the system's stability and flexibility.

[0091] The task resource allocation method in the embodiments of the present invention has been described above. The task resource allocation device in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the task resource allocation device provided in this application. The task resource allocation device includes: The resource pool matching module 410 is used to respond to task processing requests and perform resource matching based on the tags carried by the task and the matching rules of each resource pool. The matching rules are set based on tags and support logical operations between multiple tags.

[0092] The resource allocation module 420 is used to allocate resources from a resource pool that matches the task to process the task, based on the task type and algorithm requirements.

[0093] above Figure 4 The task resource allocation device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The computer device in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0094] Figure 5 This is a schematic diagram of a computer device 500 provided in an embodiment of the present invention. The computer device 500 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 may be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the computer device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the computer device 500.

[0095] Computer device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 5 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0096] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing computer-readable instructions, which, when executed by the processor, cause the processor to perform the steps of the task resource allocation method in the above embodiments.

[0097] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the task resource allocation method.

[0098] Unlike existing technologies, this application employs a partitioning mechanism combining explicit and public resource pools. It allocates computing power, video memory, encoding / decoding resources, and other resources to multiple explicit resource pools according to a preset ratio. Unallocated resources are uniformly assigned to a public resource pool built into the inference engine, limiting the overall resource usage for specific task types and precisely controlling task execution on designated nodes and computing cards. This avoids the cumbersome configuration of traditional solutions and maintains the accuracy and flexibility of resource allocation. Matching rules composed of tags and logical operators are defined for each resource pool. Tasks match resource pools using tags, selecting pools from highest to lowest matching degree. This achieves precise matching between tasks and resource pools, prioritizing the allocation of pools with high matching degrees, improving the rationality of resource allocation, reducing manual configuration, and enhancing system flexibility. This application also provides a differentiated resource deduction method based on task type, adapting to different resource requirements for tasks such as videos or images, meeting the resource usage requirements of algorithm plugins, and improving the accuracy of resource usage. When all explicit resource pools matching a task are insufficient, resources are allocated from the public resource pool to ensure that the task can still be executed when the explicit resource pool is insufficient, thus avoiding task blocking. At the same time, idle resources are integrated to improve the overall resource utilization rate.

[0099] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the storage medium embodiments and computer device embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0100] This application can be used in a wide range of general-purpose or specialized in-vehicle computing system environments or configurations. Examples include: personal computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, network PCs, minicomputers, and distributed computing environments including any of the above systems or devices.

[0101] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative; multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed.

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

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

[0104] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for allocating task resources, characterized in that, include: In response to a task processing request, resource pool matching is performed based on the tags carried by the task and the matching rules of each resource pool. The matching rules are set based on the tags and support logical operations between multiple tags. Based on the task type and algorithm requirements, resources are allocated from the resource pool that matches the task to process the task.

2. The task resource allocation method according to claim 1, characterized in that, Before performing resource matching based on the tags carried by the task and the matching rules of each resource pool, the method further includes: Based on the allocation ratio of each unit of the resource in each resource pool, each unit of the resource is allocated to each resource pool respectively.

3. The task resource allocation method according to claim 2, characterized in that, After allocating the resources to the respective resource pools according to the allocation ratio, the method further includes: The remaining unallocated resources will be uniformly allocated to the public resource pool.

4. The task resource allocation method according to claim 3, characterized in that, The allocation of resources from the resource pool matching the task further includes: When the resource reserves of all resource pools matching the task are insufficient to meet the resource requirements of the task, resources are allocated from the public resource pool.

5. The task resource allocation method according to claim 1, characterized in that, The resource matching based on the tags carried by the task and the matching rules of each resource pool includes: Calculate the matching degree between the tags carried by the task and the matching rules of each resource pool; The resource pools are prioritized according to the matching degree. Resource pools that match the task will be selected in order of priority.

6. The task resource allocation method according to claim 5, characterized in that, The step of selecting the resource pool that matches the task according to priority includes: Calculate the resource usage of the task based on the algorithm plugin information of the algorithm specified for the task. The resource pool that meets the resource usage of the task is selected according to priority order and used as the resource pool that matches the task.

7. The task resource allocation method according to claim 1, characterized in that, The step of allocating resources from a resource pool matching the task based on the task type and algorithm requirements includes: When the task type is a video analysis task, resources that meet the algorithm requirements are allocated from the resource pool that matches the task according to the preset resource usage. Alternatively, when the task type is an image analysis task, the number of frames per second and the resource usage per frame of the image task are calculated, and resources that meet the algorithm requirements are dynamically allocated from the resource pool matching the task every second.

8. A task resource allocation device, characterized in that, include: The resource pool matching module is used to respond to a task processing request by matching resources according to the tags carried by the task and the matching rules of each resource pool. The matching rules are set based on the tags and support logical operations between multiple tags. The resource allocation module is used to allocate resources from a resource pool that matches the task according to the task type and algorithm requirements of the task, so as to process the task.

9. A computer device, characterized in that, The computer device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the computer device to perform the task resource allocation method as described in any one of claims 1-7.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the task resource allocation method as described in any one of claims 1-7.