Resource allocation method, device and electronic equipment
By setting up resource scheduling queues and preempting resource queues in the resource management platform, and dynamically allocating resources according to business direction and task tags, the problems of low resource utilization and poor stability in the existing technology are solved, and efficient allocation and stability of resources are achieved promote.
Patent Information
- Application Number
- CN202411216490.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-02
AI Technical Summary
The existing resource management platform has problems of low resource utilization and poor stability in task resource allocation in multiple business directions, mainly due to the limitations of machine grouping, which cannot be efficiently allocated resources.
By setting up resource scheduling queues corresponding to the business direction and shared resource preemption queues, allocating resources according to task tags, using resource allocation quotas and preemption resource quotas to achieve reasonable allocation and differentiated allocation of resources, dynamically adjusting resource allocation quotas to improve resource utilization rate .
It improves the overall utilization rate of resources and the stability of resource allocation, ensuring that resources are allocated reasonably and handles resource requirements for different tasks when the total resource is limited.
Smart Images

Figure CN118760525B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource management, and in particular to a resource allocation method, device and electronic device. Background Art
[0002] The importance of allocating resources to tasks corresponding to multiple business directions is self-evident. This is not only related to the smooth progress of enterprise projects, but also directly affects the enterprise's operational efficiency, cost control and long-term competitiveness. Reasonable and high-utilization allocation of resources can provide guarantees for the smooth progress of projects and enhance risk management capabilities.
[0003] At present, resource management platforms generally use the conventional NodeSelector method to allocate resources for tasks corresponding to multiple business directions. That is, in the early stage of resource allocation, the machines in the resource management platform are grouped, and the tasks corresponding to each business direction can only use the resources managed by a specific machine group to ensure resource exclusivity. Due to the limitations of this machine grouping, the overall resource utilization is reduced, thereby reducing the stability of resource allocation for tasks. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a resource allocation method, device and electronic device, by setting a resource scheduling queue corresponding to the business direction and a preemptive resource queue shared by each business direction, to allocate resources in the resource allocation quota under the resource scheduling queue for platform tasks under multiple business directions, so that the platform tasks under the business direction use the exclusive resources allocated by the resource scheduling queue, and use the preemptive resource queue to allocate preemptible resources, according to the resource demand of the business direction where the exclusive task is located, adjust the resource allocation quota occupied by multiple business directions to process the exclusive task, thereby realizing reasonable allocation of resources and differentiated allocation of different tasks under the condition of limited total resources, improving the overall resource utilization, and thereby improving the stability of resource allocation for tasks.
[0005] The embodiment of the present application provides a resource allocation method, which is applied to a resource management platform. The method includes:
[0006] Based on multiple preset business directions, respectively set resource scheduling queues corresponding to the business directions and preempted resource queues shared by the business directions, and respectively set corresponding resource allocation amounts and preempted resource quotas for the resource scheduling queues and preempted resource queues;
[0007] According to the task labels corresponding to each platform task under the multiple business directions, the platform task is allocated to the resource scheduling queue or the preempted resource queue, and resources are allocated to the platform task based on the resource allocation amount or the preempted resource quota.
[0008] Further, the corresponding resource allocation quota is set for the resource scheduling queue through the following steps:
[0009] Determine resource guarantee quotas corresponding to the multiple business directions based on historical platform task information corresponding to the multiple business directions respectively;
[0010] Based on the total amount of computing resources, determine the total amount of resource quotas corresponding to the multiple business directions;
[0011] Based on the resource guarantee quota and the total resource quota, a corresponding resource allocation quota is set for the resource scheduling queue corresponding to each service direction.
[0012] Further, the allocating the platform task to the resource scheduling queue or the preempted resource queue according to the task label corresponding to each platform task under the multiple business directions, and allocating resources to the platform task based on the resource allocation amount or the preempted resource quota, including:
[0013] For a platform task including a preemptible task in a task tag, the platform task is allocated to the preemptible resource queue, and the preemptible resource is allocated to the platform task based on the preemptible resource quota;
[0014] For a platform task whose task tag includes an exclusive task, the platform task is allocated to a corresponding resource scheduling queue, and exclusive resources are allocated to the platform task based on the resource allocation quota.
[0015] Further, the following steps are performed to allocate preemptible resources to the platform task based on the preemptible resource quota, including:
[0016] Determining whether the preempted resource quota meets the preemption requirements corresponding to the platform tasks including the preemptible tasks in the task tags;
[0017] If not, the preemption level corresponding to the platform task is determined based on the task score corresponding to the platform task;
[0018] According to the preemption order corresponding to the preemption level, the preemptible resources are sequentially allocated to the platform task based on the preemption resource quota.
[0019] Further, the following steps are performed to allocate preemptible resources to the platform task based on the preemptible resource quota, including:
[0020] Determining whether the preempted resource quota meets the preemption requirements corresponding to the platform tasks including the preemptible tasks in the task tags;
[0021] If not, the preemption level corresponding to each platform task under the business direction is determined based on the business score corresponding to the business direction of the task;
[0022] According to the preemption order corresponding to the preemption level, the preemptible resources are sequentially allocated to the platform task based on the preemption resource quota.
[0023] Furthermore, for a platform task whose task tag includes an exclusive task, allocating the platform task to a corresponding resource scheduling queue, and allocating exclusive resources to the platform task based on the resource allocation quota, includes:
[0024] For a platform task whose task tag includes an exclusive task, the platform task is assigned to a corresponding resource scheduling queue, and in response to an external signal indicating a scheduling requirement corresponding to a business direction where the platform task is located, a scheduling mechanism corresponding to the resource scheduling queue where the platform task is located is determined;
[0025] When the scheduling mechanism is a queue management mechanism, based on the resource allocation quota, the resource scheduling queue is used to allocate exclusive resources to the platform task in a first-in-first-out scheduling manner;
[0026] When the scheduling mechanism is a priority mechanism, based on the resource allocation quota and the service priority corresponding to the platform task, the resource scheduling queue is used to allocate exclusive resources to the platform task in a preset priority order.
[0027] Furthermore, for a platform task whose task tag includes an exclusive task, allocating the platform task to a corresponding resource scheduling queue, and allocating exclusive resources to the platform task based on the resource allocation quota, further includes:
[0028] Determine the resource demand corresponding to the business direction of the platform task in the current task cycle, and determine whether the resource demand is less than or equal to the resource allocation quota;
[0029] If the resource demand is less than or equal to the resource allocation quota, determining a first borrowing quota corresponding to the first business direction according to the corresponding resource demand growth trend of the first business direction, and applying to the second business direction to borrow the first borrowing quota;
[0030] Based on the first borrowing amount, the resource allocation amount corresponding to the second business direction is dynamically adjusted to the resource allocation amount corresponding to the first business direction, so as to increase the resource allocation amount corresponding to the first business direction.
[0031] Further, the determining of the resource demand corresponding to the business direction of the platform task in the current task cycle and judging whether the resource demand is less than or equal to the resource allocation quota also includes:
[0032] If the resource demand is greater than the resource allocation quota, determining a second borrowing quota corresponding to the first business direction according to the resource demand corresponding to the exclusive task in the first business direction, and applying to the second business direction to borrow the second borrowing quota;
[0033] Based on the second borrowing amount, dynamically adjusting the resource allocation amount corresponding to the second business direction to the resource allocation amount corresponding to the first business direction, so as to increase the resource allocation amount corresponding to the first business direction;
[0034] The exclusive task is processed based on resources corresponding to the increased resource allocation quota of the first business direction.
[0035] The embodiment of the present application further provides a resource allocation device, the allocation device comprising:
[0036] A queue setting module, for setting resource scheduling queues corresponding to the business directions and preempted resource queues shared by the business directions based on a plurality of preset business directions, and setting corresponding resource allocation amounts and preempted resource quotas for the resource scheduling queues and preempted resource queues;
[0037] The resource allocation module is used to allocate the platform task to the resource scheduling queue or the preempted resource queue according to the task label corresponding to each platform task under the multiple business directions, and allocate resources to the platform task based on the resource allocation amount or the preempted resource quota.
[0038] An embodiment of the present application also provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the resource allocation method as described above are performed.
[0039] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource allocation method as described above are executed.
[0040] The resource allocation method, device and electronic device provided in the embodiments of the present application, the allocation method is applied to a resource management platform, including: based on multiple preset business directions, respectively setting a resource scheduling queue corresponding to the business direction and a preemptive resource queue shared by each business direction, and setting corresponding resource allocation amounts and preemptive resource quotas for the resource scheduling queue and the preemptive resource queue, respectively; according to the task label corresponding to each platform task under the multiple business directions, allocating the platform task to the resource scheduling queue or the preemptive resource queue, and allocating resources to the platform task based on the resource allocation amount or the preemptive resource quota.
[0041] Compared with the prior art method of grouping machines in the resource management platform in the early stage of resource allocation, and ensuring that tasks corresponding to each business direction can only use resources managed by a specific machine group to ensure resource exclusivity, by setting a resource scheduling queue corresponding to the business direction and a preemptive resource queue shared by each business direction, resources in the resource allocation quota under the resource scheduling queue are allocated to platform tasks under multiple business directions, so that platform tasks under the business direction use the exclusive resources allocated by the resource scheduling queue, and use the preemptive resource queue to allocate preemptible resources. According to the resource demand of the business direction where the exclusive task is located, the resource allocation quotas occupied by multiple business directions are adjusted to handle the exclusive task, thereby realizing reasonable allocation of resources and differentiated allocation of different tasks under the condition of limited total resources, improving the overall resource utilization rate, and further improving the stability of resource allocation for tasks.
[0042] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flowchart of a resource allocation method provided in an embodiment of the present application;
[0045] Figure 2 A schematic diagram of a resource scheduling queue and a resource preemption queue provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of a platform task borrowing resources provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the structure of a resource allocation device provided in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0050] Research has found that, at present, resource management platforms generally use the conventional NodeSelector method to allocate resources for tasks corresponding to multiple business directions. That is, in the early stage of resource allocation, the machines in the resource management platform are grouped, and the tasks corresponding to each business direction can only use the resources managed by a specific machine group to ensure resource exclusivity. Due to the limitations of this machine grouping, the overall resource utilization is reduced, thereby reducing the stability of resource allocation for tasks.
[0051] In response to at least one of the above-mentioned problems, an embodiment of the present application provides a resource allocation method, which allocates resources in the resource allocation quota under the resource scheduling queue to platform tasks under multiple business directions by setting a resource scheduling queue corresponding to the business direction and a preemptive resource queue shared by each business direction, so that the platform tasks under the business direction use the exclusive resources allocated by the resource scheduling queue, and use the preemptive resource queue to allocate preemptible resources. According to the amount of resources occupied by the exclusive tasks, the resource allocation quotas occupied by multiple business directions are adjusted to process the exclusive tasks, thereby realizing reasonable allocation of resources and differentiated allocation of different tasks under the condition of limited total resources, improving the overall resource utilization, and thereby improving the stability of resource allocation to tasks.
[0052] See also Figure 1 , Figure 1A flowchart of a resource allocation method provided in an embodiment of the present application. It is generally used in a resource management platform. In an embodiment of the present application, the resource management platform is used to manage target objects. For example, the resource management platform manages target objects by distinguishing the requirements of different tasks such as experiments, model training, and online large model calculations on target objects. Here, the target objects may include but are not limited to the user's storage resources and the user's computing resources.
[0053] For example, the resource management platform can be an experimental platform. Before revising a product in the experimental platform, before updating a business requirement, or before patching a vulnerability, it is necessary to conduct corresponding experiments to verify whether the solution is feasible, stable and reliable, whether the performance is improved, etc. Therefore, the resource management platform is needed to manage the above-mentioned target objects.
[0054] In addition, the resource management platform is also used in the scenario of large model training, where large model training refers to the task of training various large models and massive data learning. In addition, the resource management platform is also used in various large models that need computing power to support request tasks when facing user requests, so as to output results within a limited time.
[0055] like Figure 1 As shown, the allocation method of the exemplary embodiment of the present application specifically includes:
[0056] Step S101: based on a plurality of preset business directions, respectively set resource scheduling queues corresponding to the business directions and preempted resource queues shared by the business directions, and respectively set corresponding resource allocation amounts and preempted resource quotas for the resource scheduling queues and preempted resource queues.
[0057] In the embodiment of the present application, the business direction includes the specific content and objects of the work or activities that need to be completed in the resource management platform.
[0058] As an example, the business direction can be divided into TOB business direction and TOC business direction according to the user groups that the resource management platform is facing. Here, TOB business direction refers to the business direction facing corporate customers; TOC business direction refers to the business direction facing individual consumers;
[0059] As another example, based on the user needs that the resource management platform serves, the business direction can be divided into a text model business direction, a voice model business direction, an image and / or video model business direction, etc.
[0060] In the embodiment of the present application, the resource scheduling queue is a scheduling queue exclusively for each business direction. The platform tasks under a business direction can be scheduled in the allocated resource scheduling queue and consume resources in the resource allocation quota allocated by the queue.
[0061] The preemptible queue is a public and preemptible queue outside the resource scheduling queue. The preemptible queue can not only improve resource utilization, but also ensure that high-priority platform tasks are given priority in resource allocation for processing. The preemptible queue can cope with sudden platform tasks. The preemptible queue is an independent queue. Platform tasks under any business direction can be submitted and processed in the preemptible queue, and resources can be preempted.
[0062] Regarding the step of respectively setting a resource scheduling queue corresponding to a plurality of preset business directions and a preemptive resource queue shared by each business direction based on the preset multiple business directions, in specific implementation:
[0063] First, the amount of resources required for each business direction when processing tasks can be determined for the multiple business directions preset by the resource management platform.
[0064] Then, based on the amount of resources corresponding to each business direction, a resource scheduling queue for the amount of resources for each business direction when processing platform tasks is determined.
[0065] Finally, while setting the resource scheduling queue corresponding to the business direction, an independent preemptive resource queue shared by each business direction can be set. Here, the reason for setting a common independent preemptive resource queue for each business direction is that there are sudden platform tasks that need to preempt resources in each business direction. At this time, the preemptive resource queue can provide preemptible resources for sudden platform tasks that need to preempt resources.
[0066] In an exemplary embodiment, it is assumed that the multiple business directions preset by the resource management platform include business direction A, business direction B, business direction C and business direction D. According to the amount of resources required for processing tasks corresponding to business direction A, business direction B, business direction C and business direction D, resource scheduling queues for business direction A, business direction B, business direction C and business direction D are set respectively. Then, after setting the resource scheduling queues for business direction A, business direction B, business direction C and business direction D, an independent preemptive resource queue E is set to preempt resource allocation for sudden tasks that require preemptive resources in business direction A, business direction B, business direction C and business direction D.
[0067] After respectively setting the resource scheduling queue corresponding to the service direction and the preempted resource queue shared by each service direction, corresponding resource allocation amounts and preempted resource quotas may be respectively set for the resource scheduling queue and the preempted resource queue.
[0068] Here, the resource scheduling queue corresponds to the resource allocation quota, which limits the range of resources consumed by platform tasks under the business direction in the resource scheduling queue; the preemptive resource queue corresponds to the preemptive resource quota, which limits the range of resources that can be preempted in the resource management platform.
[0069] Regarding the step of setting the corresponding resource allocation quota for the resource scheduling queue, as an example, the following steps may be included:
[0070] Step S1011: Determine resource guarantee quotas corresponding to the multiple business directions based on historical platform task information corresponding to the multiple business directions respectively.
[0071] In the embodiment of the present application, each of the multiple business directions corresponds to multiple platform tasks.
[0072] In this step, during the specific implementation, first, the historical platform task information corresponding to each of the multiple business directions is obtained; then, the business requirements, setting standards, business information and other contents corresponding to each business direction are determined by analyzing each historical platform task information; finally, based on the above contents, the resource guarantee amount corresponding to each of the multiple business directions is determined.
[0073] In the embodiment of the present application, the resource guarantee quota is the quota corresponding to the guarantee resource, wherein the guarantee resource is the resource under the resource guarantee quota corresponding to each business direction, and this part of the resources cannot be preempted by the platform tasks of other business directions. Here, resources less than the resource guarantee quota are not preemptible and cannot be borrowed; resources greater than the resource guarantee quota and less than the resource allocation quota are borrowable but not preemptible.
[0074] For example, assuming that the multiple business directions include business direction F and business direction G, according to the historical platform task information corresponding to business direction F and business direction G, for example, the amount of resources required by business direction F in the previous cycle to process tasks is too high, and the resource guarantee amount corresponding to business direction F is determined to be 10 computing power; for another example, the amount of resources required by business direction G in the previous cycle to process tasks is average, and the resource guarantee amount corresponding to business direction G is determined to be 5 computing power. Here, it should be understood that the amount of computing power can be determined according to actual conditions, and this application does not make any limitation here.
[0075] Step S1012: Based on the total amount of computing resources, determine the total amount of resource quotas corresponding to the multiple business directions.
[0076] In an embodiment of the present application, the total amount of computing resources in the resource management platform also limits the resource upper limit corresponding to the resource scheduling queue. Here, when determining the total amount of resource quotas corresponding to multiple business directions, the minimum value between the total amount corresponding to all Quota resources and the total amount of computing resources in the resource management platform needs to be determined as the upper limit of the available resources of the resource scheduling queue.
[0077] In this step, during the specific implementation, first, determine the total amount of computing resources corresponding to the resource management platform; then, determine the total amount of resource allocation quotas allocated in the current resource management platform; finally, subtract the total amount of computing resources from the total amount of allocated resource allocation quotas, and determine the determined difference as the total amount of resource quotas corresponding to multiple business directions.
[0078] For example, assuming that the multiple business directions include business direction H and business direction I, the total amount of computing resources corresponding to the resource management platform is 20 computing power, and the total amount of resource quotas corresponding to business direction H and business direction I is determined to be 20 computing power. Here, it should be understood that the amount of the above computing power can be determined according to actual conditions, and this application does not make any limitation here.
[0079] Step S1013: Based on the resource guarantee quota and the total resource quota, a corresponding resource allocation quota is set for the resource scheduling queue corresponding to each service direction.
[0080] In an embodiment of the present application, the resource allocation quota is the quota corresponding to the Quota resource, wherein the total resource quota is always greater than or equal to the resource guarantee quota. Here, the Quota resource is the upper limit of the available resources of the resource scheduling queue.
[0081] In this step, during specific implementation, the set resource allocation quota is determined within a quota range that is greater than or equal to the resource guarantee quota and less than the total resource quota, and the corresponding resource allocation quota is set for the resource scheduling queue corresponding to each business direction.
[0082] For example, assuming that the resource guarantee quota of business direction J is 5 computing power, and the total resource quota of multiple business directions is set to 50 computing power, that is, the resource allocation quota corresponding to the resource scheduling queue corresponding to business direction J is determined in the interval [5 computing power, 50 computing power]. Here, it should be understood that the amount of the above computing power can be determined according to actual conditions, and this application does not make any limitation here.
[0083] Through the above method, each business direction uses the resource guarantee quota as the resource lower limit, but the sum of the resource allocation quotas allocated to all business directions cannot be equal to the total amount of computing resources. At this time, the total amount of resource quotas needs to be set to a quota that is smaller than the total amount of computing resources to avoid the effect of not preempting resource quotas when allocating preemptive resource queues.
[0084] Furthermore, for platform tasks whose corresponding task labels under business directions are preemptible tasks, a preemptive resource queue is set to provide preemptive resources for platform tasks that need to preempt resources under multiple business directions; wherein the preemptive resource queue corresponds to the preemptive resource quota.
[0085] Figure 2 A schematic diagram of a resource scheduling queue and a resource preemption queue provided in an embodiment of the present application.
[0086] like Figure 2 As shown in , for example, assuming that there are platform tasks under three business directions, namely 3D tasks, speech tasks and dialogue tasks, a corresponding resource scheduling queue is assigned to each platform task, and each resource scheduling queue corresponds to a resource allocation quota. For example, resource scheduling queue 1 is assigned to the 3D task, resource scheduling queue 2 is assigned to the speech task, and resource scheduling queue 3 is assigned to the dialogue task. The dotted line in the figure shows the resource guarantee quota (guarentee); in addition, an independent preemptible resource queue 1 (preemptible) is set outside the resource scheduling queue.
[0087] Return to reference Figure 1 In step S102, according to the task labels corresponding to each platform task under the multiple business directions, the platform task is assigned to the resource scheduling queue or the preempted resource queue, and resources are allocated to the platform task based on the resource allocation amount or the preempted resource quota.
[0088] In an embodiment of the present application, the task labels corresponding to each platform task are divided according to whether the task needs to preempt resources, and the task labels include preemptible tasks and exclusive tasks; among which, preemptible tasks refer to platform tasks that need to preempt resources for processing, and exclusive tasks refer to platform tasks other than preemptive tasks. The platform tasks perform task processing based on the resources under the resource allocation quota corresponding to the resource scheduling queue.
[0089] In one embodiment of the present application, when step S102 is specifically implemented, when the task tags are of different types, the platform tasks corresponding to the different task tags are allocated to the resource scheduling queue or the preempted resource queue according to the different task tags, and resources are allocated to the platform tasks corresponding to the different task tags based on the corresponding resource allocation amount and the preempted resource quota:
[0090] As an example, for a platform task whose task tag includes a preemptible task, in the specific implementation, first, the platform task is assigned to an independently set preemptive resource queue; then, according to the priority of multiple platform tasks simultaneously assigned to the preemptive resource queue at this time, preemptible resources are allocated to the platform task based on the preemptive resource quota.
[0091] In one implementation of the present application, in a specific implementation, the step of using the preemptible resource quota to allocate preemptible resources to the platform task in the above example may include:
[0092] Step S10211: Determine whether the preempted resource quota meets the preemption requirement corresponding to the platform task of the preemptible task included in the task tag.
[0093] In this step, the preemptive resource quota in the preemptive resource queue is compared with the preemptive requirements corresponding to the preemptible tasks under multiple business directions, and according to the comparison result, it is determined whether the preemptive resource quota meets the preemptive requirements corresponding to the platform tasks of the preemptible tasks included in the task label.
[0094] Step S10212: If not satisfied, determine the preemption level corresponding to the platform task based on the task score corresponding to the platform task.
[0095] In this step, if the preempted resource quota does not meet the preemption requirements corresponding to the platform tasks of the preemptible tasks included in the task label, it is necessary to determine the preemption level corresponding to the platform task by comparing the task scores of the platform tasks, so as to further determine the allocation task object of the resources in the preempted resource quota.
[0096] Here, task resources are preempted according to the preemption level corresponding to the task score to ensure that business directions with high preemption levels are given priority in allocating resources for processing; in addition, platform tasks that occupy more resources and / or have higher preemption levels are given priority in preempting resources. At this time, platform tasks that have been submitted to the preemption resource queue and allocated preemptible resources may be interrupted (preempted) at any time.
[0097] For example, when there are 10 units of computing power resources, 3 platform tasks are each allocated 2 units of computing power, and 4 units of computing power are left as preemptible resource quotas. The first platform task requires 2 units of preemptible resources, the second platform task requires 3 units of preemptible resources, and the third platform task requires 2 units of preemptible resources. At this time, since the preemptible resource quota does not meet the preemption demand, it is necessary to compare the preemption levels of the three platform tasks and prioritize the allocation of preemptible resources under the preemptible resource quota to the platform tasks with higher preemption levels, so as to improve resource utilization while ensuring timely processing of high-priority tasks.
[0098] Further, if the conditions are met, the preemptible resources under the preemptible resource quota are directly allocated to the platform tasks of the preemptible tasks included in the task tags based on the preemptible resource quota.
[0099] Optionally, in an optional implementation, the preemption level corresponding to each platform task under the business direction may be determined based on the business score corresponding to the business direction of the task, specifically including:
[0100] If not, the preemption level corresponding to each platform task under the business direction is determined based on the business score corresponding to the business direction of the task.
[0101] In this step, if the resources under the preemptible resource quota do not meet the preemption requirements corresponding to the business direction of the platform task of the preemptible task included in the task label, it is necessary to determine the preemption level corresponding to the business direction of the platform task by comparing the business scores of the business direction of the platform task, so as to further determine the allocation task object of the resources in the preemptible resource quota.
[0102] Step S10213: allocating preemptible resources to the platform task in sequence according to the preemption order corresponding to the preemption level and based on the preemption resource quota.
[0103] In this step, the preemption order corresponding to the preemption level is determined according to the standard that each platform task under the business direction with a higher preemption level is preempted first; then, based on the preemption resource quota, preemptible resources are allocated to the platform task according to the preemption order.
[0104] For example, when there are preemptive services K, L and M that need to preempt preemptible resources in the preemptive resource queue at the same time, at this time, the preemption level is determined to be the highest for preemptive service K, the middle for preemptive service L, and the lowest for preemptive service M. Therefore, the preemption order is determined as: first (preemptive service K), second (preemptive service L), third (preemptive service M).
[0105] In an optional embodiment, when each platform task under a certain business direction cannot be scheduled normally, the eviction logic will be triggered to preempt resources in the preemptive resource queue and interrupt the business direction with a lower preemption level. That is, when cluster resources are tight (for example, the remaining resources are lower than the warning threshold or there is a machine queue waiting for scheduling (Pending)), the tasks are evicted by giving priority to recovering the preemptible resources occupied by the platform tasks with a lower preemption level in the preemptive resource queue. If the resources are still tight after recovery, it means that the cluster resources are insufficient. At this time, it is necessary to expand the cluster resources or adjust the size of the machine pool through the cluster autoscaler.
[0106] As another example, for a platform task whose task tag includes an exclusive task, the platform task is allocated to a corresponding resource scheduling queue, and based on the resource allocation quota, exclusive resources under the resource allocation quota are allocated to the platform task.
[0107] Here, the scheduling mechanism corresponding to the resource scheduling queue where the platform task is located includes but is not limited to a queue management mechanism and a priority mechanism.
[0108] In one embodiment of the present application, in a specific implementation, for a platform task whose task tag includes an exclusive task in the above another example, the platform task is allocated to a corresponding resource scheduling queue, and the step of using the resource allocation quota to allocate exclusive resources to the platform task may include:
[0109] Step S10221: for a platform task whose task tag includes an exclusive task, the platform task is assigned to a corresponding resource scheduling queue, and in response to an external signal indicating a scheduling requirement corresponding to the business direction of the platform task, a scheduling mechanism corresponding to the resource scheduling queue where the platform task is located is determined.
[0110] In this step, during the specific implementation, first, each platform task under multiple business directions is allocated to a resource scheduling queue; then, an external signal indicating the scheduling requirements corresponding to each platform task is received from the user; finally, in response to the received external signal, the scheduling mechanism corresponding to the resource scheduling queue indicated in the external signal is determined according to the determined scheduling requirements.
[0111] For example, assuming that the scheduling requirement corresponding to each platform task under multiple business directions is sequential scheduling, the scheduling mechanism corresponding to the resource scheduling queue is the queue management mechanism; assuming that the scheduling requirement corresponding to each platform task under multiple business directions is priority scheduling, the scheduling mechanism corresponding to the resource scheduling queue is the priority mechanism.
[0112] Step S10222: When the scheduling mechanism is a queue management mechanism, based on the resource allocation quota, the resource scheduling queue is used to allocate exclusive resources to the platform task in a first-in-first-out scheduling manner.
[0113] In this step, when the scheduling mechanism corresponding to the resource scheduling queue indicated in the external signal is the queue management mechanism, the resource scheduling queue is used to allocate resources to the platform tasks that arrive first according to the order in which the platform tasks in the resource scheduling queue arrive, and then to the platform tasks that arrive later.
[0114] Step S10223: When the scheduling mechanism is a priority mechanism, based on the resource allocation quota and the service priority corresponding to the platform task, the resource scheduling queue is used to allocate exclusive resources to the platform task in a preset priority order.
[0115] In this step, when the scheduling mechanism corresponding to the resource scheduling queue indicated in the external signal is a priority mechanism, first, the business priority corresponding to each platform task is determined; then, in the resource scheduling queue, resources are allocated to the corresponding platform tasks according to the priority order preset for the business priority using the resource allocation quota corresponding to the resource scheduling queue.
[0116] For example, assuming that the platform tasks include reasoning platform tasks, training platform tasks, and cleaning platform tasks, the preset priority order is that reasoning platform tasks are greater than training platform tasks, which are greater than cleaning platform tasks.
[0117] In one embodiment of the present application, in a specific implementation, for the platform task whose task tag includes an exclusive task, the platform task is allocated to the corresponding resource scheduling queue, and exclusive resources are allocated to the platform task based on the resource allocation quota, and further includes:
[0118] Step S10224: determine the resource demand corresponding to the business direction of the platform task in the current task cycle, and determine whether the resource demand is less than or equal to the resource allocation quota.
[0119] In the embodiment of the present application, the resource demand refers to the sum of the resources required for a business direction to process tasks in the current task cycle and the resource occupancy of the business direction in the current task cycle.
[0120] In this step, during the specific implementation, first, for the business direction of the platform task whose task label is an exclusive task, the resource demand corresponding to the business direction of the platform task in the current task cycle is determined according to the amount of resources required for the processing tasks of the platform task in the current task cycle, and the amount of resources occupied by the platform task in the current task cycle; then, the determined multiple resource demands are compared with the corresponding resource allocation quotas respectively; finally, based on the comparison result, it is determined whether the resource demand is less than or equal to the resource allocation quota.
[0121] In the embodiment of the present application, the resource occupancy corresponding to the business direction is the resources occupied and consumed by the platform tasks under the business direction in the current task cycle.
[0122] Step S10225: If the resource demand is less than or equal to the resource allocation quota, determine the first borrowing quota corresponding to the first business direction according to the resource demand growth trend corresponding to the first business direction, and apply to the second business direction to borrow the first borrowing quota.
[0123] In an embodiment of the present application, based on the growth and fluctuation trend of resource demand corresponding to the first business direction in the current task cycle, the business direction that is or is about to be in the peak period of the task is determined as the first business direction; and the business direction that is or is about to be in the trough period of the task is determined as the second business direction.
[0124] Here, the resource allocation quota corresponding to the borrowed quota refers to the quota within the resource allocation quota allocated to each business direction; among them, the resource quota that exceeds the resource guarantee quota and is not occupied is non-preemptible resource quota.
[0125] In this step, when the resource demand is less than or equal to the resource allocation quota, first, for the first business direction that is in or about to be in the task peak period in the current task cycle, the resource demand growth trend of the first business direction is analyzed and determined; then, based on the resource demand growth trend, the first borrowing quota corresponding to the first business direction that is in or about to be in the task peak period is determined; finally, the first business direction sends a request for borrowing the first borrowing quota to the platform task under the second business direction that is in or about to be in the task trough period.
[0126] Step S10226: Based on the first borrowing amount, dynamically adjust the resource allocation amount corresponding to the second business direction to the resource allocation amount corresponding to the first business direction to increase the resource allocation amount corresponding to the first business direction.
[0127] In this step, if the second business direction that is in or is about to be in a task trough period agrees to borrow, in response to the signal of consent to borrow sent by the second business direction, based on the first borrowing amount corresponding to the first business direction that is in or is about to be in a task peak period, the resource allocation amount corresponding to the second business direction that is in or is about to be in a task trough period is dynamically adjusted to the resource allocation amount corresponding to the first business direction, so that the first business direction increases the corresponding resource allocation amount.
[0128] Optionally, in addition to the allocation method described in the above steps when the resource demand is less than or equal to the resource allocation quota, steps S10227 to S10229 are also included. Specifically, steps S10227 to S10229 are used to illustrate the allocation method when the resource demand is greater than the resource allocation quota, so as to achieve the effect of allocating resources according to the resource demand situation of the first business direction.
[0129] Figure 3 A schematic diagram of a borrowed resource allocation quota provided in an embodiment of the present application.
[0130] like Figure 3 As shown in , the total resources of the queue are the resources within the resource allocation quota, the resources within the resource guarantee quota include resident resources and dynamic resources, and the resources within the loanable resource time are the resources under the resource allocation quota.
[0131] For example, for Figure 3 During the task peak period in the current task cycle shown in , a first business direction that is in or about to be in the task peak period is selected from multiple business directions, and a borrowing amount is determined based on the resource demand and the resource allocation amount of the first business direction. The resource allocation amount of the second business direction that is in the task trough period is borrowed from the resource allocation amount of the first business direction to ensure efficient use of resources.
[0132] Step S10227: If the resource demand is greater than the resource allocation quota, determine the second borrowing quota corresponding to the first business direction according to the resource demand corresponding to the exclusive task in the first business direction, and apply to the second business direction to borrow the second borrowing quota.
[0133] In this step, when the resource demand is greater than the resource allocation quota, first, for the first business direction that is in the task peak period in the current task cycle, the resource demand of the specific task corresponding to the exclusive task under the first business direction is analyzed and determined; then, based on the resource demand, the second borrowing quota corresponding to the first business direction that is in the task peak period is determined; finally, the first business direction sends a request for borrowing the second borrowing quota to the second business direction in the task trough period.
[0134] Step S10228: Based on the second borrowing amount, dynamically adjust the resource allocation amount corresponding to the second business direction to the resource allocation amount corresponding to the first business direction to increase the resource allocation amount corresponding to the first business direction.
[0135] In this step, if the second business direction in the task trough period agrees to borrow the second borrowing quota, in response to the signal of consent to borrowing sent by the second business direction, based on the second borrowing quota corresponding to the first business direction in the task peak period, the resource allocation quota corresponding to the second business direction in the task trough period is dynamically adjusted to the resource allocation quota corresponding to the first business direction, so that the resource allocation quota corresponding to the first business direction is increased.
[0136] Step S10229: Process the exclusive task based on the increased resource allocation quota of the first business direction.
[0137] In this step, based on the resource allocation quota after the second borrowing quota is increased for the first business direction, the resources under the resource allocation quota are used to process the exclusive tasks of the first business direction during the task peak period, so as to solve the problem of resource demand for exclusive task processing of the first business direction when the initially allocated resource allocation quota is full.
[0138] The resource allocation method provided in the embodiment of the present application allocates resources in the resource allocation quota under the resource scheduling queue to platform tasks under multiple business directions by setting a resource scheduling queue corresponding to the business direction and a preemptive resource queue shared by each business direction, so that the platform tasks under the business direction use the exclusive resources allocated by the resource scheduling queue, and use the preemptive resource queue to allocate preemptible resources. According to the resource demand of the business direction where the exclusive task is located, the resource allocation quota occupied by multiple business directions is dynamically adjusted to handle the exclusive task of the first business direction at the peak of the task, thereby realizing reasonable allocation of resources and differentiated allocation of different tasks under the condition of limited total resources, improving the overall resource utilization, and thereby improving the stability of resource allocation for tasks.
[0139] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a resource allocation device provided in an embodiment of the present application. Figure 4 As shown in FIG. , the distribution device 400 comprises:
[0140] The queue setting module 410 is used to set a resource scheduling queue corresponding to the business direction and a preempted resource queue shared by each business direction based on a plurality of preset business directions, and set corresponding resource allocation amounts and preempted resource quotas for the resource scheduling queue and the preempted resource queue respectively;
[0141] The resource allocation module 420 is used to allocate the platform task to the resource scheduling queue or the preempted resource queue according to the task label corresponding to each platform task under the multiple business directions, and allocate resources to the platform task based on the resource allocation amount or the preempted resource quota.
[0142] Further, when the queue setting module 410 sets the corresponding resource allocation quota for the resource scheduling queue, the queue setting module 410 is used to:
[0143] Determine resource guarantee quotas corresponding to the multiple business directions based on historical platform task information corresponding to the multiple business directions respectively;
[0144] Based on the total amount of computing resources, determine the total amount of resource quotas corresponding to the multiple business directions;
[0145] Based on the resource guarantee quota and the total resource quota, a corresponding resource allocation quota is set for the resource scheduling queue corresponding to each service direction.
[0146] Further, when the resource allocation module 420 is used to allocate the platform task to the resource scheduling queue or the preempted resource queue according to the task label corresponding to each platform task under the multiple business directions, and allocate resources to the platform task based on the resource allocation amount or the preempted resource quota, the resource allocation module 420 is used to:
[0147] For a platform task including a preemptible task in a task tag, the platform task is allocated to the preemptible resource queue, and the preemptible resource is allocated to the platform task based on the preemptible resource quota;
[0148] For a platform task whose task tag includes an exclusive task, the platform task is allocated to a corresponding resource scheduling queue, and exclusive resources are allocated to the platform task based on the resource allocation quota.
[0149] Further, when the resource allocation module 420 is used to allocate preemptible resources to the platform task based on the preempted resource quota, the resource allocation module 420 is used to:
[0150] Determining whether the preempted resource quota meets the preemption requirements corresponding to the platform tasks including the preemptible tasks in the task tags;
[0151] If not, the preemption level corresponding to the platform task is determined based on the task score corresponding to the platform task;
[0152] According to the preemption order corresponding to the preemption level, the preemptible resources are sequentially allocated to the platform task using the preemption resource quota.
[0153] Furthermore, when the resource allocation module 420 is used to allocate preemptible resources to the platform task using the preemptive resource quota, the resource allocation module 420 is also used to:
[0154] Determining whether the preempted resource quota meets the preemption requirements corresponding to the platform tasks including the preemptible tasks in the task tags;
[0155] If not, the preemption level corresponding to each platform task under the business direction is determined based on the business score corresponding to the business direction of the task;
[0156] According to the preemption order corresponding to the preemption level, the preemptible resources are sequentially allocated to the platform task based on the preemption resource quota.
[0157] Furthermore, when the resource allocation module 420 is used to allocate a platform task whose task tag includes an exclusive task to a corresponding resource scheduling queue and allocate an exclusive resource to the platform task based on the resource allocation quota, the resource allocation module 420 is used to:
[0158] For a platform task whose task tag includes an exclusive task, the platform task is assigned to a corresponding resource scheduling queue, and in response to an external signal indicating a scheduling requirement corresponding to a business direction where the platform task is located, a scheduling mechanism corresponding to the resource scheduling queue where the platform task is located is determined;
[0159] When the scheduling mechanism is a queue management mechanism, based on the resource allocation quota, the resource scheduling queue is used to allocate exclusive resources to the platform task in a first-in-first-out scheduling manner;
[0160] When the scheduling mechanism is a priority mechanism, based on the resource allocation quota and the service priority corresponding to the platform task, the resource scheduling queue is used to allocate exclusive resources to the platform task in a preset priority order.
[0161] Furthermore, when the resource allocation module 420 is used to allocate a platform task whose task tag includes an exclusive task to a corresponding resource scheduling queue and allocate an exclusive resource to the platform task based on the resource allocation quota, the resource allocation module 420 is used to:
[0162] Determine the resource demand corresponding to the business direction of the platform task in the current task cycle, and determine whether the resource demand is less than or equal to the resource allocation quota;
[0163] If the resource demand is less than or equal to the resource allocation quota, determining a first borrowing quota corresponding to the first business direction according to the corresponding resource demand growth trend of the first business direction, and applying to the second business direction to borrow the first borrowing quota;
[0164] Based on the first borrowing amount, the resource allocation amount corresponding to the second business direction is dynamically adjusted to the resource allocation amount corresponding to the first business direction, so as to increase the resource allocation amount corresponding to the first business direction.
[0165] Furthermore, when the resource allocation module 420 is used to determine the resource demand corresponding to the business direction of the platform task in the current task cycle and to determine whether the resource demand is less than or equal to the resource allocation quota, the resource allocation module 420 is also used to:
[0166] If the resource demand is greater than the resource allocation quota, determining a second borrowing quota corresponding to the first business direction according to the resource demand corresponding to the exclusive task in the first business direction, and applying to the second business direction to borrow the second borrowing quota;
[0167] Based on the second borrowing amount, dynamically adjusting the resource allocation amount corresponding to the second business direction to the resource allocation amount corresponding to the first business direction, so as to increase the resource allocation amount corresponding to the first business direction;
[0168] The exclusive task is processed based on resources corresponding to the increased resource allocation quota of the first business direction.
[0169] The resource allocation device provided in the embodiment of the present application allocates resources in the resource allocation quota under the resource scheduling queue to platform tasks under multiple business directions by setting a resource scheduling queue corresponding to the business direction and a preemptive resource queue shared by each business direction, so that the platform tasks under the business direction use the exclusive resources allocated by the resource scheduling queue, and use the preemptive resource queue to allocate preemptible resources. According to the resource demand of the business direction where the exclusive task is located, the resource allocation quota occupied by multiple business directions is adjusted to process the exclusive task, thereby realizing reasonable allocation of resources and differentiated allocation of different tasks under the condition of limited total resources, improving the overall resource utilization, and further improving the stability of resource allocation for tasks.
[0170] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0171] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 The specific implementation of the steps of the resource allocation method in the illustrated method embodiment can be found in the method embodiment, which will not be described in detail here.
[0172] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The specific implementation of the steps of the resource allocation method in the illustrated method embodiment can be found in the method embodiment, which will not be described in detail here.
[0173] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0174] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0176] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0177] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0178] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A resource allocation method, characterized in that: Applied to the resource management platform, the allocation method includes: Based on multiple preset business directions, resource scheduling queues corresponding to the business directions and preemptive resource queues shared by the business directions are respectively set, and corresponding resource allocation quotas and preemptive resource quotas are respectively set for the resource scheduling queues and the preemptive resource queues; wherein the resource scheduling queue is a scheduling queue exclusively for each business direction, and a platform task under a business direction can be scheduled in the allocated resource scheduling queue and consume resources in the resource allocation quota allocated by the queue; the preemptive resource queue is a public and preemptible queue outside the resource scheduling queue, and platform tasks under any business direction can be submitted and processed in the preemptive resource queue, and resources can be preempted; According to the task labels corresponding to each platform task under the multiple business directions, the platform task is allocated to the resource scheduling queue or the preempted resource queue, and resources are allocated to the platform task based on the resource allocation amount or the preempted resource quota.
2. The method according to claim 1, characterized in that Set the corresponding resource allocation quota for the resource scheduling queue by following the steps below: Determine resource guarantee quotas corresponding to the multiple business directions based on historical platform task information corresponding to the multiple business directions respectively; Based on the total amount of computing resources, determine the total amount of resource quotas corresponding to the multiple business directions; Based on the resource guarantee quota and the total resource quota, a corresponding resource allocation quota is set for the resource scheduling queue corresponding to each service direction.
3. The method according to claim 1, characterized in that The allocating the platform task to the resource scheduling queue or the preempted resource queue according to the task label corresponding to each platform task under the multiple business directions, and allocating resources to the platform task based on the resource allocation amount or the preempted resource quota, includes: For a platform task including a preemptible task in a task tag, the platform task is allocated to the preemptible resource queue, and the preemptible resource is allocated to the platform task based on the preemptible resource quota; For a platform task whose task tag includes an exclusive task, the platform task is allocated to a corresponding resource scheduling queue, and exclusive resources are allocated to the platform task based on the resource allocation quota.
4. The method according to claim 3, characterized in that The following steps are used to allocate preemptible resources to the platform task based on the preemptible resource quota, including: Determining whether the preempted resource quota meets the preemption requirements corresponding to the platform tasks including the preemptible tasks in the task tags; If not, the preemption level corresponding to the platform task is determined based on the task score corresponding to the platform task; According to the preemption order corresponding to the preemption level, the preemptible resources are sequentially allocated to the platform task based on the preemption resource quota.
5. The method according to claim 3, characterized in that: The following steps are used to allocate preemptible resources to the platform task based on the preemptible resource quota, including: Determining whether the preempted resource quota meets the preemption requirements corresponding to the platform tasks including the preemptible tasks in the task tags; If not, the preemption level corresponding to each platform task under the business direction is determined based on the business score corresponding to the business direction of the task; According to the preemption order corresponding to the preemption level, the preemptible resources are sequentially allocated to the platform task based on the preemption resource quota.
6. The method according to claim 3, characterized in that The step of allocating, for a platform task whose task tag includes an exclusive task, the platform task to a corresponding resource scheduling queue, and allocating exclusive resources to the platform task based on the resource allocation quota includes: For a platform task whose task tag includes an exclusive task, the platform task is assigned to a corresponding resource scheduling queue, and in response to an external signal indicating a scheduling requirement corresponding to a business direction where the platform task is located, a scheduling mechanism corresponding to the resource scheduling queue where the platform task is located is determined; When the scheduling mechanism is a queue management mechanism, based on the resource allocation quota, the resource scheduling queue is used to allocate exclusive resources to the platform task in a first-in-first-out scheduling manner; When the scheduling mechanism is a priority mechanism, based on the resource allocation quota and the service priority corresponding to the platform task, the resource scheduling queue is used to allocate exclusive resources to the platform task in a preset priority order.
7. The method according to claim 3, characterized in that The step of allocating the platform task whose task tag includes an exclusive task to a corresponding resource scheduling queue and allocating exclusive resources to the platform task based on the resource allocation quota further includes: Determine the resource demand corresponding to the business direction of the platform task in the current task cycle, and determine whether the resource demand is less than or equal to the resource allocation quota; If the resource demand is less than or equal to the resource allocation quota, determining a first borrowing quota corresponding to the first business direction according to the resource demand growth trend corresponding to the first business direction, and applying to the second business direction to borrow the first borrowing quota; Based on the first borrowing amount, the resource allocation amount corresponding to the second business direction is dynamically adjusted to the resource allocation amount corresponding to the first business direction, so as to increase the resource allocation amount corresponding to the first business direction.
8. The method according to claim 7, characterized in that The determining of the resource demand corresponding to the business direction of the platform task in the current task cycle and judging whether the resource demand is less than or equal to the resource allocation quota also includes: If the resource demand is greater than the resource allocation quota, determining a second borrowing quota corresponding to the first business direction according to the resource demand corresponding to the exclusive task in the first business direction, and applying to the second business direction to borrow the second borrowing quota; Based on the second borrowing amount, dynamically adjusting the resource allocation amount corresponding to the second business direction to the resource allocation amount corresponding to the first business direction, so as to increase the resource allocation amount corresponding to the first business direction; The exclusive task is processed based on resources corresponding to the increased resource allocation quota of the first business direction.
9. A resource allocation device, characterized in that: The dispensing device comprises: A queue setting module is used to set resource scheduling queues corresponding to the business directions and preemptive resource queues shared by the business directions based on multiple preset business directions, and set corresponding resource allocation quotas and preemptive resource quotas for the resource scheduling queues and preemptive resource queues; wherein the resource scheduling queue is a scheduling queue exclusively for each business direction, and a platform task under a business direction can be scheduled in the allocated resource scheduling queue and consume resources in the resource allocation quota allocated by the queue; the preemptive resource queue is a public and preemptible queue outside the resource scheduling queue, and platform tasks under any business direction can be submitted and processed in the preemptive resource queue, and preempt resources; The resource allocation module is used to allocate the platform task to the resource scheduling queue or the preempted resource queue according to the task label corresponding to each platform task under the multiple business directions, and allocate resources to the platform task based on the resource allocation amount or the preempted resource quota.
10. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the resource allocation method as described in any one of claims 1 to 8.
