Resource scheduling method, electronic equipment and storage medium
Through the resource scheduling method of virtual grouping and resource configuration information, the scheduling trigger conditions are dynamically adjusted, the problems of resource waste and insufficient resources are solved, and the flexible scheduling of resources is realized to ensure the smooth completion of tasks.
Patent Information
- Application Number
- CN202510334112.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, when the number of tasks is greater than the number of resources, task priority control causes tasks in a certain link or process to squeeze resources, resulting in waste or insufficient resources, and the inability to effectively balance the problems of idle resources and insufficient resources.
The resource scheduling method of virtual grouping is adopted. By setting virtual grouping and resource configuration information, dynamically adjusting the scheduling trigger conditions, reasonably allocating resources in the resource pool, avoiding resource binding, and achieving flexible scheduling of resources.
It improves resource utilization efficiency, ensures the smooth completion of tasks, solves the problems of idle and insufficient resources, and improves the stability and flexibility of resource scheduling.
Smart Images

Figure CN120386622A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of resource scheduling, and particularly to a resource scheduling method, an electronic device, and a storage medium. Background Art
[0002] Resource scheduling refers to reasonably allocating limited resources such as material resources, financial resources, time, etc. according to the requirements and priorities of tasks to ensure that tasks can be completed efficiently. Currently, when the number of tasks is greater than the number of resources, the priority of tasks is usually used to control the priority processing order of tasks. However, this will cause a problem: when there are many tasks and high priorities in a certain link or process, it will occupy all the resources of other links or processes, resulting in other tasks never being processed or being delayed for a long time.
[0003] In related technologies, dedicated resources are set for tasks in a specific link or process, and the dedicated resources are bound to the tasks, so that the dedicated resources can only execute the tasks in the specific link or process, thereby ensuring that there are resources to process tasks in any case. This solution is called the "transport capacity group solution".
[0004] However, due to the burst nature of the tasks in the link or process corresponding to the transport capacity group, for example, sometimes the number of tasks is large, and sometimes there are no tasks. When there are no tasks, it is easy to cause waste of resources, and when there are tasks, there will be insufficient resources, and the problem of resource idleness and resource shortage cannot be effectively balanced. Summary of the Invention
[0005] Embodiments of this application provide a resource scheduling method, an electronic device, and a storage medium, which can effectively balance the problems of resource idleness and resource shortage, improve resource utilization efficiency, and ensure the smooth completion of tasks.
[0006] According to the first aspect of this application, a resource scheduling method is disclosed. The method includes:
[0007] When a scheduling trigger condition is met, obtain a virtual grouping set corresponding to a target service scenario; wherein, the virtual grouping set includes: at least two virtual groupings with resources, and the resources of each virtual grouping are allocated from a resource pool corresponding to the target service scenario according to the resource configuration information of the virtual grouping. The scheduling trigger condition includes one of the following: a virtual grouping releases idle resources, a set time interval is reached;
[0008] Based on the virtual grouping set, process the tasks in the task pool corresponding to the target service scenario.
[0009] According to the second aspect of this application, a resource scheduling device is disclosed. The device includes:
[0010] An acquisition module, configured to acquire a virtual packet set corresponding to a target service scenario when a scheduling trigger condition is satisfied; wherein, the virtual packet set includes: at least two virtual packets with resources, and the resources of each virtual packet are allocated from a resource pool corresponding to the target service scenario according to the resource configuration information of the virtual packet, and the scheduling trigger condition includes one of the following: a virtual packet releases idle resources, a set time interval is reached;
[0011] A processing module, configured to process tasks in a task pool corresponding to the target service scenario based on the virtual packet set.
[0012] According to a third aspect of the present application, an electronic device is disclosed, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the resource scheduling method as in the first aspect.
[0013] According to a fourth aspect of the present application, a computer-readable storage medium is disclosed, on which a computer program / instructions are stored, and when the computer program / instructions are executed by a processor, the resource scheduling method as in the first aspect is implemented.
[0014] According to a fifth aspect of the present application, a computer program product is disclosed, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the resource scheduling method as in the first aspect is implemented.
[0015] In an embodiment of the present application, when a scheduling trigger condition is satisfied, a virtual packet set corresponding to a target service scenario is acquired; wherein, the virtual packet set includes: at least two virtual packets with resources, and the resources of each virtual packet are allocated from a resource pool corresponding to the target service scenario according to the resource configuration information of the virtual packet, and the scheduling trigger condition includes one of the following: a virtual packet releases idle resources, a set time interval is reached; tasks in a task pool corresponding to the target service scenario are processed based on the virtual packet set.
[0016] As can be seen, in the embodiments of the present application, for the target business scenario, the concept of virtual grouping is proposed. It is not necessary to explicitly divide a certain resource into a certain group. The grouping only describes the resource requirements. On the one hand, since it is not necessary to bind a specific resource to a task, the situation where tasks cannot be processed due to the abnormality of a single resource in the transport capacity group solution is solved, and the stability of resource scheduling is improved. On the other hand, corresponding resource configuration information is set for each virtual group, and the limited resources in the resource pool are reasonably allocated through the resource configuration information to avoid resource waste. By setting the scheduling trigger conditions to control the resource scheduling process, the real-time performance and system overhead can be balanced. The resources in the resource pool are used to process the tasks in the task pool in groups, and the task scheduling is more flexible, avoiding resource shortage, realizing the elastic scheduling of resources, thus effectively balancing the problems of resource idleness and resource shortage, improving the resource utilization efficiency, and ensuring the smooth completion of tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of a resource scheduling method provided by an embodiment of the present application;
[0018] Figure 2 is a flowchart of an implementation manner of step 102 provided by an embodiment of the present application;
[0019] Figure 3 is an example diagram of a resource scheduling method provided by an embodiment of the present application;
[0020] Figure 4 is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present application;
[0021] Figure 5 is a block diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] It should be noted that, for the method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present application.
[0024] In recent years, important progress has been made in the research of technologies such as computer vision, deep learning, machine learning, image processing, and image recognition based on artificial intelligence. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies, and application systems for simulating and extending human intelligence. The discipline of artificial intelligence is a comprehensive discipline that involves many technical categories such as chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, and neural networks. As an important branch of artificial intelligence, computer vision specifically enables machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, object detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping, computational photography, robot navigation and positioning, etc. With the research and progress of artificial intelligence technology, this technology has been applied in many fields, such as security prevention, urban management, traffic management, building management, park management, face access, face attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile imaging, cloud services, smart home, wearable devices, driverless, autonomous driving, intelligent healthcare, face payment, face unlocking, fingerprint unlocking, human identity verification, smart screen, smart TV, cameras, mobile Internet, webcasting, beauty, makeup, medical beauty, intelligent temperature measurement, etc.
[0025] Next, with reference to the accompanying drawings, a resource scheduling method provided by an embodiment of the present application will be introduced.
[0026] Figure 1 is a flowchart of a resource scheduling method provided by an embodiment of the present application. As Figure 1 shown, the method may include the following steps: Step 101 and Step 102;
[0027] In Step 101, when the scheduling trigger condition is satisfied, obtain the virtual grouping set corresponding to the target service scenario; wherein, the virtual grouping set includes: at least two virtual groupings with resources, and the resources of each virtual grouping are allocated from the resource pool corresponding to the target service scenario according to the resource configuration information of the virtual grouping. The scheduling trigger condition includes one of the following: the virtual grouping releases idle resources, and a set time interval is reached.
[0028] The resource scheduling method provided by the embodiment of the present application can be applied to different resource scheduling systems according to different service scenarios to allocate resources for tasks in different service scenarios and ensure the smooth processing of tasks.
[0029] In the embodiments of the present application, in order to balance the real-time performance and system overhead of the resource scheduling system, a scheduling trigger condition is preset in advance. Considering that if the scheduling trigger condition is too frequent, it may lead to excessive system overhead, and if the scheduling trigger condition is too sparse, it may lead to low resource utilization. Therefore, the threshold of the scheduling trigger condition can be dynamically adjusted according to the characteristics of the business scenario.
[0030] In the embodiments of the present application, the scheduling trigger methods of the resource scheduling system can be divided into two types: one is idle resource trigger, and the other is timing trigger.
[0031] In the embodiments of the present application, for the idle resource trigger method, when a certain virtual group completes a task and releases resources, it means that there are idle resources in one or more virtual groups of the resource scheduling system. Using this idle resource can directly process the task without the task waiting for idle resources again, which can improve the scheduling efficiency and task processing speed.
[0032] In the embodiments of the present application, idle resources refer to resources that are not currently being used. Opposite to idle resources are occupied resources, which refer to resources that are currently being used.
[0033] In the embodiments of the present application, for the timing trigger method, the resource usage of each virtual group is checked every few seconds. Before the set time interval arrives, while the resource scheduling system is continuously accumulating tasks, the resources in the virtual groups of the resource scheduling system are also gradually being released, and the idle resources are gradually increasing. When the set time interval arrives, a batch of accumulated tasks and a batch of accumulated idle resources are calculated for matching. For example, if the task is a handling task and the resource is a handling robot, the matching degree is the distance between the handling task and the handling robot. The resources are allocated to the tasks according to the matching degree, which can improve the efficiency of resource scheduling.
[0034] In the embodiments of the present application, the target business scenario may include one of the following: robot operation scenario, manual operation scenario, cloud computing scenario, software development scenario, and fund allocation scenario.
[0035] In the embodiments of the present application, the robot operation scenario includes but is not limited to: the handling robot operation scenario in the logistics and warehousing field, the robot operation scenario in the industrial manufacturing field, the robot operation scenario in the medical and health field, the robot operation scenario in the agricultural field, the robot operation scenario in the construction and construction field, the robot operation scenario in the security and patrol field, etc. Among them, the handling robots include but are not limited to: pallet handling robots, bin handling robots, driverless trucks, etc.
[0036] In the embodiments of the present application, the manual operation scenarios include, but are not limited to: manual handling scenarios at service windows, manual operation scenarios in the construction and construction fields, manual operation scenarios in the logistics and warehousing fields, manual operation scenarios in the industrial manufacturing fields, manual operation scenarios in the medical and health fields, manual operation scenarios in the agricultural fields, manual operation scenarios in the security and patrol fields, etc. Among them, the service windows include, but are not limited to: service windows of banks, service windows of government affairs, service windows for ticket sales, service windows for payment, etc.
[0037] In the embodiments of the present application, the cloud computing scenarios include, but are not limited to: infrastructure service scenarios for providing virtualized computing resources, platform service scenarios for providing platforms for developing and deploying application programs, software service scenarios for providing cloud-based application services, big data service scenarios for providing large-scale data storage, processing, and analysis capabilities, edge computing scenarios, etc.
[0038] In the embodiments of the present application, the software development scenarios include, but are not limited to: software requirement analysis and planning scenarios, system design scenarios, coding and development scenarios, testing and quality assurance scenarios, continuous integration and continuous delivery scenarios, operation and maintenance and monitoring scenarios, etc.
[0039] In the embodiments of the present application, the fund allocation scenarios include, but are not limited to: fund allocation scenarios of venture capital companies, fund allocation scenarios of e-commerce platforms, fund allocation scenarios of sharing economy enterprises, etc.
[0040] In the embodiments of the present application, resources refer to substances and energies that can be utilized by humans to meet production and living needs within a certain time and space.
[0041] In the embodiments of the present application, resources may include one of the following: robots, humans, cloud computing resources, software development resources, and funds.
[0042] In the embodiments of the present application, a task refers to a specific work or activity that needs to be completed to achieve a specific goal.
[0043] In the embodiments of the present application, tasks can come from external systems outside the resource scheduling system and can be automatically generated. When coming from an external system, tasks can be imported in batches or added to the resource scheduling system dynamically one by one.
[0044] In the embodiments of the present application, depending on different business scenarios, the specific content referred to by resources is different, and the specific content referred to by tasks is also different. For example, when the business scenario is a robot operation scenario, the resource is a robot, and the task is the operation that the robot needs to perform. When the business scenario is a manual operation scenario, the resource is a person, and the task is the operation that needs to be performed manually. When the business scenario is a cloud computing scenario, the resource is cloud computing resources, and the task is usually some projects that require cloud computing resources. When the business scenario is a software development scenario, the resource is software development resources, and the task is usually some projects that require software development resources. When the business scenario is a fund allocation scenario, the resource is funds, and the task is usually some projects that require financial support.
[0045] It can be seen that in the embodiments of the present application, the provided resource scheduling method can be applied to resource scheduling systems in different business scenarios, with a relatively wide applicable scenario and high flexibility.
[0046] In the embodiments of the present application, considering that resource scheduling is usually closely related to business scenarios, and each business scenario has a resource pool. For example, for the handling robot operation scenario in the logistics and warehousing field, its resource pool contains many handling robots; for the manual handling scenario at the bank service window, its resource pool contains multiple bank service windows. Therefore, in order to improve the accuracy of resource scheduling, at least two virtual groups and the resource configuration information of each virtual group are set in advance according to the business scenario.
[0047] In the embodiments of the present application, the resource configuration information of different virtual groups can be the same or different. In addition, subsequently, the resource configuration information of each virtual group can be dynamically adjusted according to the number of tasks and the fluctuation of the processing time in the business scenario. For example, use a machine learning model to predict the peak and trough periods of tasks and adjust the resource configuration information in advance, or optimize the resource allocation ratio of virtual groups according to the historical processing time of tasks.
[0048] In the embodiments of the present application, when setting at least two virtual groups and the resource configuration information of each virtual group according to the target business scenario, one virtual group can correspond to a business type of the target business scenario, and the resource configuration information can be determined according to the business type; wherein, the resource configuration information may include: the maximum concurrency number and the minimum standby number. The maximum concurrency number is used to represent the maximum number of tasks that the virtual group can process simultaneously at the same time, and the minimum standby number is used to represent the minimum number of resources that the virtual group needs to maintain. The maximum concurrency number is greater than or equal to the minimum standby number, and the sum of the maximum concurrency numbers of all virtual groups is less than or equal to the total number of resources in the resource pool.
[0049] In the embodiments of the present application, considering that a business scenario is usually composed of multiple business types. For example, for the operation scenario of a handling robot in the logistics and warehousing field, it usually includes 3 business types: outbound, inbound, and inventory management. Another example is the manual handling scenario at a bank service window, which usually includes 3 business types: general business, VIP business, and wealth management and credit business. Therefore, in order to improve the processing efficiency of tasks of different business types, a virtual group is set to correspond to one business type of the target business scenario. Also considering that for the same business scenario, the number of tasks and the time-consuming for task processing of different business types are different. Therefore, in order to further improve the processing efficiency of tasks by different virtual groups, the resource configuration information of the virtual groups is set according to the business types of the target business scenario.
[0050] Exemplarily, when the business scenario is the manual handling scenario at a bank service window, the resource is the service window of the bank. There are 7 service windows in total in this bank. Considering the main business types of the bank, 3 virtual groups can be set, corresponding to general business, VIP business, and wealth management and credit business respectively. The resource configuration information of the virtual group corresponding to general business is: maximum concurrency = 3, minimum standby number = 3; the resource configuration information of the virtual group corresponding to VIP business is: maximum concurrency = 2, minimum standby number = 1; the resource configuration information corresponding to wealth management and credit business is: maximum concurrency = 2, minimum standby number = 1.
[0051] Exemplarily, when the business scenario is the operation scenario of a handling robot in the logistics and warehousing field, the resource is the robot. There are 10 handling robots in total in this warehouse. Considering the main business types in the logistics and warehousing scenario, 3 virtual groups can be set, corresponding to outbound operation, inbound operation, and inventory management operation respectively. The resource configuration information of the virtual group corresponding to outbound operation is: maximum concurrency = 5, minimum standby number = 4; the resource configuration information of the virtual group corresponding to inbound operation is: maximum concurrency = 4, minimum standby number = 3; the resource configuration information of the virtual group corresponding to inventory management operation is: maximum concurrency = 1, minimum standby number = 1.
[0052] It can be seen that in the embodiments of the present application, different numbers of virtual groups and the resource configuration information of each virtual group can be set in a refined manner according to different business scenarios, making the grouping result and resource allocation result more suitable for the business types of the business scenario, thereby improving the efficiency of resource scheduling.
[0053] In the embodiments of the present application, the maximum concurrency in the resource configuration information of a virtual group is used to represent the maximum number of tasks that the virtual group can handle simultaneously at the same time, reflecting the processing capacity and load limit of the virtual group. It can limit the overuse of resources, prevent a single task from occupying too many resources, ensure that other tasks can also be fairly processed, and avoid service interruption caused by resource exhaustion. The minimum standby number in the resource configuration information of the virtual group is used to represent the minimum number of available resources that the virtual group needs to maintain. By reserving a certain number of resources, when a certain virtual group suddenly adds several new tasks after a period of no tasks, the resource scheduling system can immediately allocate the reserved resources to these new tasks to ensure a quick response when the tasks suddenly increase, avoid resource shortage, and avoid the cold start problem of waiting for available resources for a long time. It realizes the elastic scheduling of resources, can gradually release the restricted resources as the tasks decrease, and gradually occupy exclusive resources as the tasks increase, thereby effectively balancing the problems of resource idleness and resource shortage, improving resource utilization efficiency, and ensuring the smooth completion of tasks.
[0054] In the embodiments of the present application, different virtual groups are set according to the business types of business scenarios, and the maximum concurrency and the minimum standby number are combined and set as the resource configuration information of the virtual group, which can more effectively adjust the elasticity of the resource scheduling system to adapt to different numbers of tasks. In addition, during the task processing, the maximum concurrency and the minimum standby number of each virtual group can be dynamically adjusted according to the task situation. For example, if a certain virtual group has more tasks, more resources can be allocated to it; if a certain virtual group has fewer tasks, some of its resources can be released back to the resource pool for other virtual groups to use, to ensure that the virtual group can stably process when the number of tasks is large and can save resources when the number of tasks is small.
[0055] In the embodiments of the present application, according to the resource configuration information of each virtual group, the resources in the resource pool are respectively allocated to each virtual group. It should be noted that during the above resource allocation process, the resources in the resource pool are randomly allocated to the virtual groups, and a specific resource does not need to be bound to a certain task, avoiding the situation where a task cannot be processed due to the abnormality of a single resource in the transport capacity group scheme, and improving the stability of resource scheduling.
[0056] In step 102, based on the virtual group set, the tasks in the task pool corresponding to the target business scenario are processed.
[0057] In the embodiments of the present application, the resources in each virtual group can be scheduled in units of groups to process the tasks in the task pool corresponding to the target business scenario.
[0058] In the embodiments of the present application, when processing tasks through resource grouping, the following advantages exist: Similar resources can be centrally managed, reducing the switching cost and improving the task execution speed; Resources can be reasonably allocated to avoid waste and ensure the efficient use of resources; After grouping, management is more convenient, reducing complexity and facilitating monitoring and adjustment; The grouping structure facilitates the addition of new resources or tasks, making the system more scalable; Resource isolation reduces the scope of impact of failures and improves system stability; After resource grouping, task scheduling is more flexible and can be dynamically adjusted according to requirements; The grouping structure simplifies maintenance, and problem location and repair are faster; Resources can be allocated according to task priorities to ensure that critical tasks are completed first. It can be seen that resource grouping can improve efficiency, optimize utilization, simplify management, enhance collaboration, reduce costs, and improve the scalability and stability of the resource scheduling system.
[0059] In the embodiments of the present application, considering that there are usually tasks of multiple business types in a business scenario, to improve the task processing efficiency, tasks of the same business type can be placed in the same virtual group for processing. At this time, for tasks with a clear business type, a grouping identifier can be assigned to the task to indicate which virtual group the task belongs to, while for tasks with an unclear business type, the grouping identifier can be temporarily not assigned. Correspondingly, the tasks in the task pool can include: tasks carrying a grouping identifier and / or tasks not carrying a grouping identifier; wherein, the grouping identifier is used to indicate the virtual group to which the task belongs, and the grouping identifier is generated based on the business type of the target business scenario.
[0060] Exemplarily, the business scenario is the manual handling scenario at a bank service window, and the resource is the service window of the bank. Three virtual groups are set, namely: the virtual group corresponding to bank general business, the virtual group corresponding to bank VIP business, and the virtual group corresponding to bank wealth management and credit business. When a user enters the bank to handle general business, the user will first get a general business number at the number dispenser, and this general business number is the grouping identifier of the task.
[0061] In some embodiments, for the tasks in the task pool carrying a grouping identifier, as Figure 2 shown, step 102 may include the following steps: step 1021, step 1022, and step 1023;
[0062] In step 1021, for any virtual group in the virtual group set, according to the grouping identifier of each task in the task pool, determine whether there are tasks to be processed in the virtual group.
[0063] In the embodiments of the present application, since the grouping identifier carried by the task can directly indicate the virtual group to which the task belongs, according to the grouping identifier of each task in the task pool, the tasks to be processed corresponding to each virtual group can be determined.
[0064] In step 1022, when there are tasks to be processed in the virtual group, obtain idle resources from this virtual group or other virtual groups outside this virtual group, and allocate the idle resources to the tasks to be processed, so as to process the tasks to be processed through the idle resources.
[0065] In the embodiments of the present application, when there are tasks to be processed in the virtual group, the maximum concurrency and the minimum standby number in the resource configuration information of the virtual group can be used to determine whether to obtain idle resources from within this virtual group or from other virtual groups outside this virtual group, making the resource scheduling more reasonable. Accordingly, the above step 1022 may include the following steps: step 10221 and step 10222;
[0066] In step 10221, when there are tasks to be processed in the virtual group and the number of tasks being processed within the group reaches the maximum concurrency, wait for this virtual group to release idle resources, and allocate the idle resources released by this virtual group to the tasks to be processed.
[0067] In the embodiments of the present application, if a virtual group has tasks to be processed and the number of tasks being processed within the group reaches the maximum concurrency, it means that the number of tasks currently processed by this virtual group has reached the processing limit. To avoid overuse of resources, it is possible to wait for the release of the occupied resources within this virtual group. When a resource is released, the resource is considered an idle resource and is allocated to the tasks to be processed to achieve the processing of the tasks to be processed.
[0068] In step 10222, when there are tasks to be processed in the virtual group and the number of tasks being processed within the group does not reach the maximum concurrency, determine whether there are idle resources within this virtual group. If there are idle resources within this virtual group, allocate the idle resources within this virtual group to the tasks to be processed. If there are no idle resources within this virtual group, obtain idle resources from other virtual groups and allocate the idle resources obtained from other virtual groups to the tasks to be processed.
[0069] In the embodiments of the present application, if a virtual group has tasks to be processed and the number of tasks being processed within the group does not reach the maximum concurrency, it means that the number of tasks currently processed by this virtual group does not reach the processing limit. To avoid the cold start problem caused by insufficient resources, it is possible to further determine whether there are idle resources within this virtual group. If there are idle resources, directly allocate them to the tasks to be processed to achieve the rapid processing of the tasks to be processed; if there are no idle resources, schedule idle resources from other virtual groups and allocate them to the tasks to be processed to achieve the rapid processing of the tasks to be processed.
[0070] In the embodiments of the present application, to ensure the resource scheduling efficiency, when scheduling idle resources from other virtual groups, two perspectives can be considered: one is from the perspective of the tasks to be processed, and the other is from the perspective of other virtual groups.
[0071] From the perspective of the tasks to be processed, preferably, when the processing time of the tasks to be processed is lower than the second threshold, low-frequency virtual groups other than the present virtual group in the virtual group set are determined.
[0072] In the embodiments of the present application, when the processing time of the tasks to be processed is relatively low, considering scheduling idle resources from other virtual groups and processing the tasks to be processed with the idle resources, since the processing time of the tasks to be processed is relatively low, the idle resources will not be occupied for too long. After the tasks to be processed are completed, the idle resources can be quickly returned to the virtual group to which they originally belonged.
[0073] From the perspective of other virtual groups, preferably, low-frequency virtual groups other than the present virtual group in the virtual group set are determined; idle resources are obtained from the low-frequency virtual groups; wherein, the low-frequency virtual group refers to a virtual group with a task processing frequency lower than the first threshold.
[0074] In the embodiments of the present application, when there are virtual groups that are often idle in other virtual groups, considering scheduling idle resources from the virtual groups that are often idle and processing the tasks to be processed with the idle resources, since the task processing frequency of the virtual groups that are often idle is low, it generally will not affect their processing of tasks. After the tasks to be processed are completed, the idle resources can be returned to the virtual groups that are often idle.
[0075] It can be seen that in the embodiments of the present application, for virtual groups that are often idle, in order to prevent waste of the production capacity of the reserved resources, if the virtual groups have a high tolerance for cold start, when the resource scheduling system determines that the virtual groups have no tasks to be processed currently, the reserved resources of the virtual groups can be used to execute other tasks with the lowest regression time cost (low task duration and low in-transit duration loss), so that after new tasks arrive, the resources can be returned to the present virtual group at the fastest speed, improving the resource utilization efficiency.
[0076] In step 1023, when the virtual group has no tasks to be processed and the number of resources in the group is less than the minimum standby number, idle resources are added to the virtual group.
[0077] In the embodiments of the present application, if a virtual group has no tasks to be processed and the number of standby resources in the virtual group is lower than the lower limit of the standby quantity, it indicates that the currently available resources in the virtual group are scarce. To avoid suddenly adding several new tasks to the virtual group after a period of no tasks, idle resources can be added to the virtual group so that the resource scheduling system can immediately allocate the reserved resources to these new tasks, avoiding the cold start problem of waiting for available resources for a long time.
[0078] In the embodiments of the present application, within each virtual group, if there are multiple tasks carrying the group identifier, they can be sorted according to any mainstream sorting method, such as creation time, priority, etc.
[0079] In the embodiments of the present application, for the tasks in the task pool that do not carry the group identifier, after all the tasks carrying the group identifier in the task pool are processed, the idle resources in each virtual group are allocated to the tasks in the task pool that do not carry the group identifier in the order of task execution priority, so as to process the tasks that do not carry the group identifier through the idle resources, thereby realizing the processing of all the tasks in the task pool.
[0080] In the embodiments of the present application, first, each task carrying the group identifier is processed in units of virtual groups. After all the tasks carrying the group identifier are processed, the idle resources in each virtual group are centrally scheduled to process all the tasks that do not carry the group identifier, which can improve the processing efficiency.
[0081] It can be seen that in the embodiments of the present application, for the service scenarios of multiple service types, by setting virtual groups and resource configuration information, the resources in the resource pool of the service scenario can be reasonably allocated to each virtual group. The elastic scheduling of the grouped resources can gradually release the restricted resources as the tasks decrease and gradually occupy the resources as the tasks increase. Through the elastic resource allocation scheme, the dilemma of resource waste and resource shortage is solved.
[0082] To facilitate the overall understanding of the resource scheduling method provided by the embodiments of the present application, finally, an example is given in combination with Figure 3 the example diagram shown, as Figure 3 shown, it may include the following steps: Step 300, Step 301, Step 302, Step 303, Step 304, Step 305, Step 306, Step 307, Step 308, Step 309, Step 310, Step 311, and Step 312.
[0083] In Step 300, it is detected that the scheduling trigger condition is satisfied.
[0084] In step 301, loop through each virtual group and determine whether there is a task to be assigned to this virtual group; if so, execute step 302, otherwise execute step 303.
[0085] In step 302, determine whether the number of tasks being processed by this virtual group has reached the maximum concurrency; if so, execute step 304, otherwise execute step 305.
[0086] In step 303, determine whether the number of resources of this virtual group is less than the minimum standby number; if so, do nothing, otherwise execute step 306;
[0087] In step 304, wait for this virtual group to release idle resources, and allocate the idle resources released by this virtual group to the task to be processed, so as to process the task to be processed through the idle resources.
[0088] In step 305, determine whether there is idle resource within this virtual group; if so, execute step 307, otherwise execute step 308;
[0089] In step 306, add idle resources to this virtual group, and then execute step 309.
[0090] In step 307, obtain idle resources from within this virtual group, allocate the idle resources to the task to be processed, so as to process the task to be processed through the idle resources, and then execute step 309.
[0091] In step 308, obtain idle resources from other virtual groups, allocate the idle resources to the task to be processed, so as to process the task to be processed through the idle resources, and then execute step 309.
[0092] In step 309, determine whether all tasks to be processed carrying group identifiers have been processed; if so, execute step 310, otherwise return to execute step 301.
[0093] In step 310, determine whether there are tasks to be processed without carrying group identifiers; if so, execute step 311, otherwise execute step 312;
[0094] In step 311, allocate the idle resources of each virtual group to the tasks to be processed without carrying group identifiers, so as to process each task to be processed without carrying group identifiers through the idle resources, and then execute step 312.
[0095] In step 312, end the resource scheduling.
[0096] As can be seen from the above embodiments, in this embodiment, when the scheduling trigger condition is met, a virtual packet set corresponding to the target service scenario is obtained; wherein, the virtual packet set includes: at least two virtual packets with resources, and the resources of each virtual packet are allocated from the resource pool corresponding to the target service scenario according to the resource configuration information of the virtual packet. The scheduling trigger condition includes one of the following: a virtual packet releases idle resources, or a set time interval is reached; based on the virtual packet set, the tasks in the task pool corresponding to the target service scenario are processed.
[0097] As can be seen, in the embodiments of the present application, for the target service scenario, the concept of virtual packets is proposed. It is not necessary to explicitly divide a certain resource into a certain packet. The packet only describes the resource requirements. On the one hand, since it is not necessary to bind a specific resource to a task, the situation where a task cannot be processed due to an exception of a single resource in the transport capacity group solution is solved, and the stability of resource scheduling is improved; on the other hand, corresponding resource configuration information is set for each virtual packet, and the limited resources in the resource pool are reasonably allocated through the resource configuration information to avoid resource waste. By setting the scheduling trigger condition to control the resource scheduling process, the real-time performance and system overhead can be balanced. The resources in the resource pool are grouped to process the tasks in the task pool, and the task scheduling is more flexible, avoiding resource shortage, realizing elastic scheduling of resources, thus effectively balancing the problems of resource idleness and resource shortage, improving resource utilization efficiency, and ensuring the smooth completion of tasks.
[0098] Figure 4 It is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present application. As Figure 4 shown, the resource scheduling device 400 may include: an acquisition module 401 and a processing module 402;
[0099] The acquisition module 401 is configured to obtain a virtual packet set corresponding to the target service scenario when the scheduling trigger condition is met; wherein, the virtual packet set includes: at least two virtual packets with resources, and the resources of each virtual packet are allocated from the resource pool corresponding to the target service scenario according to the resource configuration information of the virtual packet. The scheduling trigger condition includes one of the following: a virtual packet releases idle resources, or a set time interval is reached;
[0100] The processing module 402 is configured to process the tasks in the task pool corresponding to the target service scenario based on the virtual packet set.
[0101] As can be seen from the above embodiments, in this embodiment, when the scheduling trigger condition is met, a virtual packet set corresponding to the target service scenario is obtained; wherein, the virtual packet set includes: at least two virtual packets with resources, and the resources of each virtual packet are allocated from the resource pool corresponding to the target service scenario according to the resource configuration information of the virtual packet. The scheduling trigger condition includes one of the following: the virtual packet releases idle resources, and a set time interval is reached; based on the virtual packet set, the tasks in the task pool corresponding to the target service scenario are processed.
[0102] It can be seen that in the embodiments of the present application, for the target service scenario, the concept of virtual packets is proposed. It is not necessary to explicitly divide a certain resource into a certain packet. The packet only describes the resource requirements. On the one hand, since it is not necessary to bind a specific resource to a task, the situation where tasks cannot be processed due to the abnormality of a single resource in the transport capacity group solution is solved, and the stability of resource scheduling is improved; on the other hand, corresponding resource configuration information is set for each virtual packet, and the limited resources in the resource pool are reasonably allocated through the resource configuration information to avoid resource waste. By setting the scheduling trigger condition to control the resource scheduling process, the real-time performance and system overhead can be balanced. The resources in the resource pool are used as a group to process the tasks in the task pool, and the task scheduling is more flexible, avoiding resource shortage, realizing elastic scheduling of resources, effectively balancing the problems of resource idleness and resource shortage, improving resource utilization efficiency, and ensuring the smooth completion of tasks.
[0103] Optionally, as an embodiment, a virtual packet corresponds to a service type of the target service scenario, and the resource configuration information is determined according to the service type;
[0104] The resource configuration information may include: the maximum concurrency and the minimum standby number. The maximum concurrency is used to represent the maximum number of tasks that the virtual packet can process simultaneously at the same time, and the minimum standby number is used to represent the minimum number of resources that the virtual packet needs to maintain. The maximum concurrency is greater than or equal to the minimum standby number, and the sum of the maximum concurrencies of all virtual packets is less than or equal to the total number of resources in the resource pool.
[0105] Optionally, as an embodiment, the tasks in the task pool may include: tasks carrying a packet identifier and / or tasks not carrying a packet identifier; wherein, the packet identifier is used to indicate the virtual packet to which the task belongs, and the packet identifier is generated based on the service type of the target service scenario.
[0106] Optionally, as an embodiment, the processing module 402 may include:
[0107] A determination sub-module, configured to, for any virtual packet in the virtual packet set, determine whether there is a pending task for the virtual packet according to the packet identifier of each task in the task pool;
[0108] A first processing sub-module, configured to, when there is a pending task for the virtual packet, obtain idle resources from the virtual packet itself or other virtual packets outside the virtual packet, allocate the idle resources to the pending task, so as to process the pending task through the idle resources;
[0109] An allocation sub-module, configured to, when there is no pending task for the virtual packet and the number of resources within the group is less than the minimum standby number, add idle resources to the virtual packet.
[0110] Optionally, as an embodiment, the first processing sub-module may include:
[0111] A first allocation unit, configured to, when there is a pending task for the virtual packet and the number of tasks being processed within the group reaches the maximum concurrency number, wait for the virtual packet to release idle resources, and allocate the released idle resources of the virtual packet to the pending task;
[0112] A second allocation unit, configured to, when there is a pending task for the virtual packet and the number of tasks being processed within the group does not reach the maximum concurrency number, determine whether there are idle resources within the virtual packet. If there are idle resources within the virtual packet, allocate the idle resources within the virtual packet to the pending task. If there are no idle resources within the virtual packet, obtain idle resources from other virtual packets, and allocate the obtained idle resources from other virtual packets to the pending task.
[0113] Optionally, as an embodiment, the second allocation unit may include:
[0114] A determination subunit, configured to determine low-frequency virtual packets in the virtual packet set except the virtual packet itself; wherein, the low-frequency virtual packet refers to a virtual packet with a task processing frequency lower than a first threshold;
[0115] An obtaining subunit, configured to obtain idle resources from the low-frequency virtual packets.
[0116] Optionally, as an embodiment, the determination subunit is specifically configured to:
[0117] When the processing time of the pending task is lower than a second threshold, determine low-frequency virtual packets in the virtual packet set except the virtual packet itself.
[0118] Optionally, as an embodiment, the processing module 402 may further include
[0119] A second processing sub-module, configured to, for tasks in the task pool that do not carry a grouping identifier, after all tasks in the task pool that carry a grouping identifier are processed, allocate idle resources within each virtual grouping to the tasks in the task pool that do not carry a grouping identifier in sequence according to the priority order of task execution, so as to process the tasks that do not carry a grouping identifier through the idle resources.
[0120] Optionally, as an embodiment, the target service scenario may include one of the following: robot operation scenario, cloud computing scenario, software development scenario, and fund allocation scenario.
[0121] Optionally, as an embodiment, the resources may include one of the following: robots, cloud computing resources, software development resources, and funds.
[0122] Any step and the specific operation in any step in the embodiments of the resource scheduling method provided in the embodiments of the present application can be completed by the corresponding module in the resource scheduling device. The process of the corresponding operations completed by each module in the resource scheduling device refers to the process of the corresponding operations described in the embodiments of the resource scheduling method.
[0123] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the related parts, refer to the partial description of the method embodiments.
[0124] Figure 5 is a structural block diagram of an electronic device provided in the embodiments of the present application, as Figure 5 shown. The electronic device includes a processing component 522, which further includes one or more processors, and memory resources represented by a memory 532 for storing instructions executable by the processing component 522, such as application programs. The application programs stored in the memory 532 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the above-mentioned resource scheduling method.
[0125] The electronic device may further include a power supply component 526 configured to perform power management of the electronic device, a wired or wireless network interface 550 configured to connect the electronic device to a network, and an input / output (I / O) interface 558. The electronic device may operate based on an operating system stored in the memory 532, for example, Windows ServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
[0126] According to still another embodiment provided by the present application, the present application further provides a computer-readable storage medium, on which a computer program / instructions are stored, and when the computer program / instructions are executed by a processor, the steps in the resource scheduling method described in any one of the above embodiments are implemented.
[0127] According to still another embodiment provided by the present application, the present application further provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps in the resource scheduling method described in any one of the above embodiments are implemented.
[0128] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0129] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0130] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the specified function in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0131] These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the specified function in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0132] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0133] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.
[0134] The above has introduced in detail a resource scheduling method, an electronic device and a storage medium provided by the present application. Specific examples are used in this text to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A resource scheduling method, characterized in that, The method includes: When the scheduling trigger condition is met, obtaining a virtual packet set corresponding to the target service scenario; wherein, the virtual packet set includes: at least two virtual packets with resources, and the resources of each virtual packet are allocated from the resource pool corresponding to the target service scenario according to the resource configuration information of the virtual packet, and the scheduling trigger condition includes one of the following: the virtual packet releases idle resources, and a set time interval is reached; Based on the virtual packet set, processing the tasks in the task pool corresponding to the target service scenario.
2. The method according to claim 1, wherein One virtual packet corresponds to one service type of the target service scenario, and the resource configuration information is determined according to the service type; The resource configuration information includes: the maximum concurrency number and the minimum standby number. The maximum concurrency number is used to represent the maximum number of tasks that a virtual packet can process simultaneously at the same time, and the minimum standby number is used to represent the minimum number of resources that a virtual packet needs to maintain. The maximum concurrency number is greater than or equal to the minimum standby number, and the sum of the maximum concurrency numbers of all virtual packets is less than or equal to the total number of resources in the resource pool.
3. The method according to claim 2, characterized in that, The tasks in the task pool include: tasks carrying a packet identifier and / or tasks not carrying a packet identifier; wherein, the packet identifier is used to indicate the virtual packet to which the task belongs, and the packet identifier is generated based on the service type of the target service scenario.
4. The method according to claim 3, wherein For the tasks carrying a packet identifier in the task pool, the processing the tasks in the task pool corresponding to the target service scenario based on the virtual packet set includes: For any virtual packet in the virtual packet set, determining whether there is a task to be processed for the virtual packet according to the packet identifier of each task in the task pool; When there is a task to be processed for the virtual packet, obtaining idle resources from this virtual packet or other virtual packets outside this virtual packet, and allocating the idle resources to the task to be processed, so as to process the task to be processed through the idle resources; When there is no task to be processed for the virtual packet and the number of resources in the group is less than the minimum standby number, adding idle resources to the virtual packet.
5. The method according to claim 4, characterized in that, The obtaining idle resources from this virtual packet or other virtual packets outside this virtual packet and allocating the idle resources to the task to be processed when there is a task to be processed for the virtual packet includes: When there is a task to be processed for the virtual packet and the number of tasks being processed in the group reaches the maximum concurrency number, waiting for this virtual packet to release idle resources, and allocating the idle resources released by this virtual packet to the task to be processed; When there is a task to be processed in the virtual group and the number of tasks being processed within the group has not reached the maximum concurrency, determine whether there is idle resource within this virtual group. If there is idle resource within this virtual group, allocate the idle resource within this virtual group to the task to be processed. If there is no idle resource within this virtual group, obtain idle resource from other virtual groups and allocate the idle resource obtained from other virtual groups to the task to be processed.
6. The method according to claim 5, wherein The obtaining idle resource from other virtual groups includes: Determine the low-frequency virtual groups in the virtual group set except this virtual group; wherein, the low-frequency virtual group refers to a virtual group with a task processing frequency lower than the first threshold; Obtain idle resource from the low-frequency virtual groups.
7. The method according to claim 6, wherein The determining the low-frequency virtual groups in the virtual group set except this virtual group includes: When the processing time of the task to be processed is lower than the second threshold, determine the low-frequency virtual groups in the virtual group set except this virtual group.
8. The method according to claim 3, characterized in that, The method further includes: For the tasks in the task pool without a group identifier, after all the tasks with a group identifier in the task pool are processed, allocate the idle resources in each virtual group to the tasks without a group identifier in the task pool in the order of task execution priority, so as to process the tasks without a group identifier with the idle resources.
9. The method according to any one of claims 1-8, characterized in that, The target service scenario includes one of the following: robot operation scenario, cloud computing scenario, software development scenario, and fund allocation scenario.
10. The method according to claim 9, wherein The resource includes one of the following: robot, cloud computing resource, software development resource, and fund.
11. An electronic device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the resource scheduling method according to any one of claims 1-10.
12. A computer-readable storage medium having computer programs / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, the resource scheduling method according to any one of claims 1-10 is implemented.
13. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the resource scheduling method according to any one of claims 1-10 is implemented.