Resource scheduling method, device, computer equipment and storage medium
Through the automatic migration and scheduling of the three-layer virtual queue model, the problem of computing queue unavailability caused by exceptions in big data computing is solved, and automatic disaster recovery across computer rooms is achieved and resource utilization is improved.
Patent Information
- Application Number
- CN202211065521.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-09-01
AI Technical Summary
In big data computing scenarios, network abnormalities or equipment abnormalities cause the computing queue to be unavailable, making it impossible to achieve automatic disaster recovery across computer rooms and affecting computing services.
Adopt a three-layer virtual queue model (queue namespace queue, logical computer room queue, physical cluster queue) to automatically determine and migrate target jobs to normal logical computer room queues, ensuring that jobs use available computing resources within the queue namespace range, and realizing cross-computer room automation Disaster recovery.
It improves resource utilization and reliability of computing services, avoids delays caused by manual scheduling, and achieves automatic disaster recovery capabilities in abnormal situations.
Smart Images

Figure CN115309592B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource scheduling method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of Internet technology, more and more fields have begun to use big data for calculation and analysis to provide decision support for data-based operations.
[0003] In big data computing scenarios, some computing tasks with large data volumes require computing queues with sufficient resources to meet computing needs. However, in practice, network anomalies or device anomalies often occur, and abnormal computing queues cannot be used, which can easily lead to computing tasks not being able to proceed normally. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a resource scheduling method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a resource scheduling method, including:
[0006] receiving a job request, wherein the job request is used to request execution of a target job;
[0007] In response to the job request, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is used to allocate the corresponding first logical computer room queue to the target job; wherein each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue;
[0008] In response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, based on the job type of the target job, determining a second logical computer room queue under the queue namespace queue for executing the target job;
[0009] The target job is executed by using computing resources in the physical cluster queue associated with the second logical computer room queue.
[0010] In an optional implementation manner, after receiving the job request, the method further includes:
[0011] In response to the first logical computer room queue not being associated with a physical cluster queue having a target computing resource, creating a first physical cluster queue under the first logical computer room queue; the target computing resource is used to execute the target job;
[0012] Establishing an association relationship between the first physical cluster queue and a second physical cluster queue having the target computing resource; the second physical cluster queue is a physical cluster queue in other logical computer room queues;
[0013] In the first physical cluster queue, the target computing resource of the second physical cluster queue is scheduled to execute the target job based on the association relationship.
[0014] In an optional implementation manner, executing the target job by using computing resources in a physical cluster queue associated with the second logical computer room queue includes:
[0015] In response to the fact that the number of computing resources corresponding to the third physical cluster queue associated with the second logical computer room queue currently executing the target job is less than the number of computing resources required by the target job, a fourth physical cluster queue is determined based on the number of computing resources respectively corresponding to each physical cluster queue associated with the second logical computer room queue;
[0016] The target job is executed using computing resources in the fourth physical cluster queue; or the fourth physical cluster queue is merged with the third physical cluster queue to obtain a fifth physical cluster queue, and the target job is executed using computing resources in the fifth physical cluster queue.
[0017] In an optional implementation, the method of allocating a corresponding first logical computer room queue to the target job based on the job type of the target job and utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model includes:
[0018] Based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate a candidate logical computer room queue with computing resources to the target job, as well as computing resource configuration information corresponding to each of the candidate logical computer room queues;
[0019] Based on the computing resource configuration information corresponding to the candidate logical computer room queues, a first logical computer room queue whose computing resource configuration information meets a preset condition is screened from the candidate logical computer room queues.
[0020] In an optional implementation manner, the job request includes the amount of computing resources required to execute the target job;
[0021] The step of allocating a candidate logical computer room queue having computing resources to the target job includes:
[0022] Based on the number of computing resources, allocating a queue namespace queue for executing the target job that matches the number of computing resources to the target job;
[0023] Based on the job type of the target job, a candidate logical computer room queue having computing resources for executing the target job is selected from the queue namespace queue.
[0024] In an optional implementation, the method of allocating a corresponding first logical computer room queue to the target job based on the job type of the target job and utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model includes:
[0025] Based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is used to allocate candidate logical computer room queues with computing resources for executing the target job, and the number of physical cluster queues associated with each candidate logical computer room queue for the target job;
[0026] A candidate logical computer room queue whose number of associated physical cluster queues meets a set threshold is determined as a first logical computer room queue for executing the target job.
[0027] In an optional implementation manner, the job request includes user identity information;
[0028] The method of allocating a corresponding first logical computer room queue to the target job based on the job type of the target job and utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model includes:
[0029] Verifying the user's authority based on the user's identity information;
[0030] In response to the user authority verification being passed, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate the corresponding first logical computer room queue to the target job.
[0031] In an optional implementation manner, after the response to at least one of the cluster queues associated with the first logical computer room queue being abnormal, the method further includes:
[0032] Receiving a job scheduling request; the job scheduling request includes identification information of a queue to be scheduled;
[0033] Based on the queue identification information, determining a target queue for executing the target job;
[0034] Based on the computing resources configured in the target queue, the target job is executed using the computing resources corresponding to the target queue.
[0035] In an optional implementation manner, determining a target queue for executing the target job based on the queue identification information includes:
[0036] In the case where the queue identification information includes queue namespace queue identification information, determining a target queue namespace queue corresponding to the queue namespace queue identification information; determining any physical cluster queue in any logical computer room queue associated with the target queue namespace queue as a target queue for executing the target job;
[0037] In the case where the queue identification information includes queue namespace queue identification information and logical computer room queue identification information, determine the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue corresponding to the queue namespace queue identification information; determine the target physical cluster queue in the target logical computer room queue as the target queue for executing the target job; the target physical cluster queue is a physical cluster queue with user authority;
[0038] In the case where the queue identification information includes queue namespace queue identification information, logical computer room queue identification information, and physical cluster queue identification information, determine the target queue namespace queue corresponding to the queue namespace queue identification information, and the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue, and the target physical cluster queue corresponding to the physical cluster queue identification information; determine the target physical cluster queue as the target queue for executing the target job.
[0039] In a second aspect, an embodiment of the present disclosure further provides a resource scheduling device, including:
[0040] A first receiving module, used for receiving a job request, wherein the job request is used for requesting execution of a target job;
[0041] An allocation module, configured to respond to the job request, and based on the job type of the target job, allocate a corresponding first logical computer room queue to the target job by utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model; wherein each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue;
[0042] A first determination module is configured to determine, in response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, a second logical computer room queue under the queue namespace queue for executing the target job based on the job type of the target job;
[0043] The first execution module is used to execute the target job by using the computing resources in the physical cluster queue associated with the second logical computer room queue.
[0044] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer 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 above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0045] In a fourth aspect, an embodiment of the present disclosure 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 above-mentioned first aspect, or any possible implementation of the first aspect are executed.
[0046] The resource scheduling method provided by the embodiment of the present disclosure uses virtual queues in three dimensions, namely, a queue namespace queue, a logical computer room queue, and a physical cluster queue. When an exception occurs in at least one physical cluster queue under the first logical computer room queue that is currently executing the target job, the second logical computer room queue for executing the target job can be automatically determined, so that the target job can be automatically migrated from the first logical computer room queue where the exception occurs to the normal second logical computer room queue within the scope of the queue namespace queue, so that it has the ability of automatic disaster recovery across computer rooms; and the target job can use the computing resources in each virtual computer room queue within the scope of the queue namespace queue, which improves resource utilization compared with the solution in which the target job can only use the computing resources in the specified computing queue.
[0047] In order to make the above-mentioned objectives, features and advantages of the present disclosure 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
[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0049] Figure 1 A flow chart of a resource scheduling method provided by an embodiment of the present disclosure is shown;
[0050] Figure 2 A schematic diagram of the hierarchical structure of a three-layer virtual queue model provided by an embodiment of the present disclosure is shown;
[0051] Figure 3 A schematic diagram of user authority levels corresponding to a three-layer virtual queue model provided in an embodiment of the present disclosure is shown;
[0052] Figure 4 A schematic diagram of the hierarchical structure of another three-layer virtual queue model provided by an embodiment of the present disclosure is shown;
[0053] Figure 5 A flow chart of a resource scheduling device provided by an embodiment of the present disclosure is shown;
[0054] Figure 6 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally 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 disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0056] In big data scenarios, computing tasks are usually scheduled to a specified computing cluster, or to a computing cluster with the most computing resources. When network or device anomalies occur, the abnormal computing queue cannot be used, and users need to manually schedule computing tasks to a normal computing cluster. The above method cannot achieve automatic disaster recovery across computer rooms, which seriously affects computing services.
[0057] Based on this, the present disclosure provides a resource scheduling method, which uses virtual queues in three dimensions, namely, queue namespace queues, logical computer room queues, and physical cluster queues. When an exception occurs in at least one physical cluster queue under the first logical computer room queue that is currently executing the target job, the second logical computer room queue for executing the target job can be automatically determined, so that the target job can be automatically migrated from the first logical computer room queue where the exception occurs to the normal second logical computer room queue within the scope of the queue namespace queue, so that it has the ability of automatic disaster recovery across computer rooms; and the target job can use the computing resources in each virtual computer room queue within the scope of the queue namespace queue, which improves resource utilization compared with the solution in which the target job can only use the computing resources in the specified computing queue.
[0058] The defects existing in the above schemes and the proposed solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0059] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0060] To facilitate understanding of this embodiment, a resource scheduling method disclosed in the embodiment of the present disclosure is first introduced in detail. The executor of the resource scheduling method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities.
[0061] The resource scheduling method provided in the embodiments of the present disclosure is mainly applicable to big data scenarios, such as machine learning, data statistical analysis and the like.
[0062] See also Figure 1 FIG. 1 is a flowchart of a resource scheduling method provided by an embodiment of the present disclosure, wherein the method includes S101 to S104, wherein:
[0063] S101: receiving a job request, where the job request is used to request execution of a target job.
[0064] In an embodiment of the present disclosure, the received job request may be a request submitted by a user for executing a target job. The target job included in the job request may include at least one. The multiple target jobs included in the job request may be multiple target jobs of a certain user; or multiple target jobs of multiple users, for example, multiple target jobs of each member of a team consisting of multiple members.
[0065] S102: In response to the job request, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to assign a corresponding first logical computer room queue to the target job; wherein each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue.
[0066] In the embodiment of the present disclosure, the computing resources used to execute the job can be set to a three-layer virtual queue model including three layers of virtual queues, and the three-layer virtual queues can include queue namespace queues, logical computer room queues, and physical cluster queues. Figure 2 In the hierarchical structure diagram of a three-layer virtual queue model shown, there is a relationship of inclusion and being included between the upper layer virtual queue and the lower layer virtual queue. Specifically, a queue namespace queue (or a regional Region virtual queue) may correspond to multiple logical computer room queues (or a data center DataCenter), and each logical computer room queue may correspond to at least one physical cluster queue (or a cluster Cluster). That is, each queue namespace queue may be a collection of multiple logical computer room queues, and each logical computer room queue may be a collection of at least one physical cluster queue. Each layer of virtual queue may be set with corresponding queue identification information, such as a queue name. Exemplarily, the queue namespace queue identification information corresponding to the queue namespace queue may be represented by queue_namespace; the logical computer room queue identification information corresponding to the logical computer room queue may be represented by data_ceneter; and the cluster queue identification information corresponding to the physical cluster queue may be represented by queue_name. Among them, the queue namespace queue identification information may be a unique identifier set to distinguish different regional virtual queues.
[0067] In a specific implementation, each logical computer room queue may be configured with computing resources, storage resources, job data, etc. for executing jobs. Among them, computing resources may include, for example, a central processing unit (CPU), etc.; storage resources may include, for example, memory. Job data may refer to data that the execution of a target job depends on.
[0068] The queue namespace queue can manage the multiple logical computer room queues it contains through the corresponding cross-computer room routing. For example, the cross-computer room routing can migrate the jobs in the logical computer room queue 1 under the same queue namespace queue to the logical computer room queue 2; it can also read the job data stored in the logical computer room queue 2 to execute the jobs in the logical computer room queue 1, etc.
[0069] Different target jobs may correspond to different job types. Under different job types, the job data required for executing the target jobs may be different.
[0070] The logical computer room queue can determine the correlation between the job type of the target job and the job data stored in the logical computer room queue through the configured computer room routing, that is, different logical computer room queues can process target jobs of different job types.
[0071] The physical cluster queue can adjust the number of computing resources and / or storage resources between various physical cluster queues in the same logical computer room queue through the configured cluster routing.
[0072] In order to ensure that the target job can be executed smoothly when an abnormality occurs in the logical computer room queue, the job data required for the same target job can be stored in multiple logical computer room queues. In one embodiment, in the process of determining the first logical computer room queue for executing the target job, the hierarchical relationship between the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model can be used to allocate candidate logical computer room queues with computing resources and computing resource configuration information corresponding to each candidate logical computer room queue according to the job type of the target job.
[0073] Here, according to the job type of the target job, the storage path corresponding to the action data required by the target job can be analyzed at the computing engine layer, and then the application programming interface (API) provided by the storage system can be called to obtain the distribution of the job data. According to the distribution of the job data and the hierarchical relationship of the virtual queues in the three-layer virtual queue model, the candidate logical computer room queues configured with computing resources for executing the target job and the computing resource configuration information corresponding to each candidate logical computer room queue can be determined. The computing resource configuration information here may include information such as the size of the job data and the number of configurations.
[0074] Based on the computing resource configuration information corresponding to the candidate logical computer room queues, a first logical computer room queue whose computing resource configuration information meets a preset condition can be screened from the candidate logical computer room queues.
[0075] Here, the preset condition may refer to that the configuration quantity of the operation data is greater than or equal to a set threshold. In a specific implementation, the candidate logical computer room queues whose configuration quantity of the operation data is greater than or equal to the set threshold may be screened as the first logical computer room queue.
[0076] In order to ensure the utilization rate of computing resources, in one embodiment, the job request may include the number of computing resources required to execute the target job. The number of computing resources here may include the number of computing resources and / or storage resources. In the process of allocating a queue namespace queue for executing the target job to the target job, a queue namespace queue for executing the target job that matches the number of computing resources may be allocated to the target job based on the number of computing resources.
[0077] In a specific implementation, a user may apply for queue namespace queue identification information from a resource management platform, and the resource management platform may allocate a queue namespace queue corresponding to the number of computing resources required for a target job to the user. The queue namespace queue allocated to the user may execute each target job submitted by the user. That is, each target job submitted by the user may share all computing resources in the queue namespace queue.
[0078] After determining the queue namespace queue for executing the target job, a candidate logical computer room queue having computing resources for executing the target job may be selected from the queue namespace queue based on the job type of the target job.
[0079] In a specific implementation, the more physical cluster queues are set in the logical computer room queue, the more computing resources are in the logical computer room queue, and the faster the target job is executed. Therefore, in one embodiment, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model can be used to allocate candidate logical computer room queues with computing resources for executing the target job, as well as the number of physical cluster queues set under each candidate logical computer room queue. Then, the candidate logical computer room queue whose number of associated physical cluster queues meets the set threshold is determined as the first logical computer room queue for executing the target job.
[0080] Here, the determined candidate logical room queues may include logical room queues configured with job data for executing the target job. Then, according to the number of physical cluster queues associated with each candidate logical room queue, a candidate logical room queue whose number of physical cluster queues meets a set threshold is selected as the first logical room queue.
[0081] As mentioned above, a target job may include multiple target jobs of multiple users. Figure 3In the user authority hierarchy diagram corresponding to a three-layer virtual queue model shown, different users may have different permissions to use virtual queues. In order to manage the permissions of each user, a corresponding resource record (RR) may be set for each queue namespace queue, which describes the user permissions of each logical computer room queue under the queue namespace queue, virtual queue attribute information (such as virtual queue identification information), etc. Each queue namespace queue, the logical computer room queue under the queue namespace queue, and the physical cluster queue under each logical computer room queue can be constructed in the form of a tree queue structure. Each parent node can have all the permissions of the child node and can use all the computing resources of the child node.
[0082] In one embodiment, the job request may include the user's identity information. In the process of allocating the corresponding first logical computer room queue to the target job, the user's user authority may be verified based on the user's identity information. In response to the user's user authority verification being passed, based on the job type of the target job and the user's authority, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate the first logical computer room queue that matches the user's authority to the target job.
[0083] For users with approved user permissions, the first logical computer room queue that matches the user permissions can be used to execute the corresponding target job. For example, if the user permissions are permissions for the logical computer room queue, the user can use the computing resources corresponding to each physical cluster queue in the first logical computer room queue. For example, if the user permissions are permissions for the physical cluster queue, the user can use the computing resources corresponding to the target physical cluster queue in the first logical computer room queue.
[0084] S103: In response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, based on the job type of the target job, determine a second logical computer room queue under the queue namespace queue for executing the target job.
[0085] Here, at least one physical cluster queue under the first logical computer room queue has an abnormality, including but not limited to network abnormality, hardware failure, etc. When the number of physical cluster queues with abnormalities in the first logical computer room queue is less than the total number of physical cluster queues in the first logical computer room queue, in one implementation, the target job in the physical cluster queue with abnormalities in the first logical computer room queue can be migrated to other physical cluster queues in the first logical computer room queue that have not experienced abnormalities. For example, Figure 4As shown, when an exception occurs in physical cluster queue A in the logical computer room queue, the target job in physical cluster queue A can be migrated to physical cluster queue B in the logical computer room queue. That is, when an exception occurs in at least one physical cluster queue under the first logical computer room queue, the second logical computer room queue determined based on the job type of the target job can be the same logical computer room queue as the first logical computer room queue. In one embodiment, the target job in the physical cluster queue in which the exception occurs in the first logical computer room queue can also be migrated to other second logical computer room queues in which the exception does not occur. The second logical computer room queue can be a logical computer room queue different from the first logical computer room queue.
[0086] When the number of abnormal physical cluster queues in the first logical computer room queue is the total number of physical cluster queues in the first logical computer room queue, the target job in the abnormal physical cluster queue in the first logical computer room queue can be migrated to other second logical computer room queues where no abnormality occurs. At this time, the second logical computer room queue can be a logical computer room queue different from the first logical computer room queue.
[0087] S104: Execute the target job by using computing resources in the physical cluster queue associated with the second logical computer room queue.
[0088] In an embodiment of the present disclosure, during the process of executing the target job in the second logical computer room queue, an imbalance in computing resources in the virtual queue may occur. In one implementation, in response to the number of computing resources corresponding to the third physical cluster queue under the second logical computer room queue currently executing the target job being less than the number of computing resources required for the target job, a fourth physical cluster queue is determined based on the numbers of computing resources corresponding to each physical cluster queue under the second logical computer room queue.
[0089] Here, if the number of computing resources corresponding to the third physical cluster queue under the second logical computer room queue currently executing the target job is less than the number of computing resources required for the target job, the third physical cluster queue may not be able to execute the target job in a timely manner. In this case, a fourth physical cluster queue whose number of computing resources meets the preset conditions can be determined based on the number of computing resources corresponding to each physical cluster queue under the second logical computer room queue. The preset condition here may refer to the number of computing resources being greater than or equal to a set threshold. Then, the computing resources in the fourth physical cluster queue are used to execute the target job.
[0090] Alternatively, the fourth physical cluster queue is merged with the third physical cluster queue to obtain a fifth physical cluster queue. Here, the number of computing resources of the fourth physical cluster queue is mainly merged with the number of computing resources of the third physical cluster queue, and the number of computing resources of the fifth physical cluster queue can be the sum of the number of computing resources of the fourth physical cluster queue and the number of computing resources of the third physical cluster queue. The target job is executed using the number of computing resources of the fifth physical cluster queue.
[0091] Through the above implementation, the computing resources between the physical cluster queues can be balanced, so that the computing resources of the physical cluster queues can be fully utilized and resource fragmentation can be prevented.
[0092] In an embodiment of the present disclosure, there may be a situation where a physical cluster queue with target computing resources is not configured under a determined first logical computer room queue. In order to reduce cross-computer room communication, in one implementation, after receiving a job request, in response to the fact that a physical cluster queue with target computing resources is not associated under a first logical computer room queue for executing a target job under a determined queue namespace queue, a first physical cluster queue is created under the first logical computer room queue.
[0093] Here, the target computing resources can be used to execute the target job. The first physical cluster queue created is also a physical cluster queue that is not associated with the target computing resources. The target computing resources here can specifically refer to job data. In order to reduce cross-computer room communication, an association relationship can be established between the first physical cluster queue and the second physical cluster queue with the target computing resources. Among them, the second physical cluster queue is a physical cluster queue in other logical computer room queues. By establishing an association relationship between the first physical cluster queue and the second physical cluster queue with the target computing resources, the first physical cluster queue can schedule the target computing resources of the second physical cluster queue based on the association relationship, and then use the target computing resources of the second physical cluster queue to execute the target job.
[0094] During the above implementation process, by responding to an exception in at least one physical cluster queue under the first logical computer room queue, based on the job type of the target job, the second logical computer room queue under the queue namespace queue for executing the target job can be automatically determined, thereby improving the efficiency of cross-computer room scheduling.
[0095] In the embodiment of the present disclosure, after an exception occurs in the first logical computer room queue, in addition to automatically determining the second logical computer room queue for executing the target job, a job scheduling request can also be received. The job scheduling request can include the queue identification information to be scheduled. The queue identification information to be scheduled can be the queue identification information specified by the user.
[0096] Based on the queue identification information, a target queue for executing the target job can be determined. Then, based on the computing resources configured in the target queue, the computing resources corresponding to the target queue are used to execute the target job.
[0097] Here, as mentioned above, each layer of virtual queue can be set with corresponding queue identification information. Among them, the queue namespace queue identification information can be uniquely determined queue identification information. The logical room queue identification information and the physical cluster queue identification information can support the wildcard "*".
[0098] When the queue identification information includes queue namespace queue identification information, the target queue namespace queue corresponding to the queue namespace queue identification information can be determined, and any physical cluster queue in any logical computer room queue under the target queue namespace queue is determined as the target queue for executing the target job.
[0099] For example, if the queue namespace queue identification information is ns1.*.*, it can be determined that any physical cluster queue in any logical computer room queue under the target queue namespace queue "ns1" corresponding to the queue namespace queue identification information is the target queue for executing the target job.
[0100] When the queue identification information includes queue namespace queue identification information and logical computer room queue identification information, determine the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue corresponding to the queue namespace queue identification information; determine the target physical cluster queue in the target logical computer room queue as the target queue for executing the target job; the target physical cluster queue is a physical cluster queue with user permissions.
[0101] For example, if the queue namespace queue identification information is ns1.dc1.*, it can be determined that the target queue namespace queue corresponding to the queue namespace queue identification information is "ns1" and the target physical cluster queue in the logical computer room queue dc1 is the target queue for executing the target job.
[0102] In the case where the queue identification information includes queue namespace queue identification information, logical computer room queue identification information, and physical cluster queue identification information, determine the target queue namespace queue corresponding to the queue namespace queue identification information, and the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue, and the target physical cluster queue corresponding to the cluster queue identification information; determine the target physical cluster queue as the target queue for executing the target job.
[0103] For example, if the queue namespace queue identification information is ns1.dc1.queueA, it can be determined that the logical computer room queue under the target queue namespace queue "ns1" corresponding to the queue namespace queue identification information is dc1, and the target physical cluster queue with the physical cluster queue queueA is the target queue for executing the target job.
[0104] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0105] Based on the same inventive concept, the embodiment of the present disclosure also provides a job execution device corresponding to the resource scheduling method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned resource scheduling method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0106] Reference Figure 5 FIG. 1 is a schematic diagram of the architecture of a job execution device provided by an embodiment of the present disclosure, wherein the device includes:
[0107] A first receiving module 501 is used to receive a job request, where the job request is used to request execution of a target job;
[0108] The allocation module 502 is used to respond to the job request and allocate the corresponding first logical computer room queue to the target job based on the job type of the target job by using the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model; wherein each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue;
[0109] A first determination module 503 is configured to determine, in response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, a second logical computer room queue under the queue namespace queue for executing the target job based on the job type of the target job;
[0110] The first execution module 504 is used to execute the target job by using the computing resources in the physical cluster queue associated with the second logical computer room queue.
[0111] In an optional implementation manner, after receiving the job request, the device further includes:
[0112] A creation module, configured to create a first physical cluster queue under the first logical computer room queue in response to the first logical computer room queue not being associated with a physical cluster queue having a target computing resource; the target computing resource is used to execute the target job;
[0113] An establishing module, used to establish an association relationship between the first physical cluster queue and a second physical cluster queue having the target computing resource; the second physical cluster queue is a physical cluster queue in other logical computer room queues;
[0114] The scheduling module is configured to schedule, in the first physical cluster queue, the target computing resource of the second physical cluster queue to execute the target job based on the association relationship.
[0115] In an optional implementation manner, the first execution module 504 is specifically configured to:
[0116] In response to the fact that the number of computing resources corresponding to the third physical cluster queue associated with the second logical computer room queue currently executing the target job is less than the number of computing resources required by the target job, a fourth physical cluster queue is determined based on the number of computing resources respectively corresponding to each physical cluster queue associated with the second logical computer room queue;
[0117] The target job is executed using computing resources in the fourth physical cluster queue; or the fourth physical cluster queue is merged with the third physical cluster queue to obtain a fifth physical cluster queue, and the target job is executed using computing resources in the fifth physical cluster queue.
[0118] In an optional implementation manner, the allocation module 502 is specifically configured to:
[0119] Based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate a candidate logical computer room queue with computing resources to the target job, as well as computing resource configuration information corresponding to each of the candidate logical computer room queues;
[0120] Based on the computing resource configuration information corresponding to the candidate logical computer room queues, a first logical computer room queue whose computing resource configuration information meets a preset condition is screened from the candidate logical computer room queues.
[0121] In an optional implementation manner, the job request includes the amount of computing resources required to execute the target job;
[0122] The allocation module 502 is specifically configured to:
[0123] Based on the number of computing resources, allocating a queue namespace queue for executing the target job that matches the number of computing resources to the target job;
[0124] Based on the job type of the target job, a candidate logical computer room queue having computing resources for executing the target job is selected from the queue namespace queue.
[0125] In an optional implementation manner, the allocation module 502 is specifically configured to:
[0126] Based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is used to allocate candidate logical computer room queues with computing resources for executing the target job, and the number of physical cluster queues associated with each candidate logical computer room queue for the target job;
[0127] A candidate logical computer room queue whose number of associated physical cluster queues meets a set threshold is determined as a first logical computer room queue for executing the target job.
[0128] In an optional implementation manner, the job request includes user identity information;
[0129] The allocation module 502 is specifically configured to:
[0130] Verifying the user's authority based on the user's identity information;
[0131] In response to the user authority verification being passed, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate the corresponding first logical computer room queue to the target job.
[0132] In an optional implementation manner, after the response to at least one of the cluster queues associated with the first logical computer room queue being abnormal, the device further includes:
[0133] A second receiving module is used to receive a job scheduling request; the job scheduling request includes the identification information of the queue to be scheduled;
[0134] A second determining module, configured to determine a target queue for executing the target job based on the queue identification information;
[0135] The second execution module is used to execute the target job based on the computing resources configured in the target queue and using the computing resources corresponding to the target queue.
[0136] In an optional implementation manner, the second determining module is specifically configured to:
[0137] In the case where the queue identification information includes queue namespace queue identification information, determining a target queue namespace queue corresponding to the queue namespace queue identification information; determining any physical cluster queue in any logical computer room queue associated with the target queue namespace queue as a target queue for executing the target job;
[0138] In the case where the queue identification information includes queue namespace queue identification information and logical computer room queue identification information, determine the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue corresponding to the queue namespace queue identification information; determine the target physical cluster queue in the target logical computer room queue as the target queue for executing the target job; the target physical cluster queue is a physical cluster queue with user authority;
[0139] In the case where the queue identification information includes queue namespace queue identification information, logical computer room queue identification information, and physical cluster queue identification information, determine the target queue namespace queue corresponding to the queue namespace queue identification information, and the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue, and the target physical cluster queue corresponding to the physical cluster queue identification information; determine the target physical cluster queue as the target queue for executing the target job.
[0140] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0141] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 6 As shown, it is a schematic diagram of the structure of a computer device 600 provided in an embodiment of the present disclosure, including a processor 601, a memory 602, and a bus 603. Among them, the memory 602 is used to store execution instructions, including a memory 6021 and an external memory 6022; the memory 6021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 601, and the data exchanged with the external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the memory 6021. When the computer device 600 is running, the processor 601 communicates with the memory 602 through the bus 603, so that the processor 601 executes the following instructions:
[0142] receiving a job request, wherein the job request is used to request execution of a target job;
[0143] In response to the job request, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is used to allocate the corresponding first logical computer room queue to the target job; wherein each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue;
[0144] In response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, based on the job type of the target job, determining a second logical computer room queue under the queue namespace queue for executing the target job;
[0145] The target job is executed by using computing resources in the physical cluster queue associated with the second logical computer room queue.
[0146] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the resource scheduling method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0147] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the resource scheduling method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0148] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0149] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method 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 the device or unit can be electrical, mechanical or other forms.
[0150] 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.
[0151] In addition, each functional unit in each embodiment of the present disclosure 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.
[0152] 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 disclosure, 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, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0153] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described 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-described embodiments within the technical scope disclosed in the present disclosure, 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 disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A resource scheduling method, It is characterized in that include: The computing resources used to execute the job are set to a three-layer virtual queue model including three-layer virtual queues, wherein the three-layer virtual queues include a queue namespace queue, a logical computer room queue, and a physical cluster queue, each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue; receiving a job request, wherein the job request is used to request execution of a target job; In response to the job request, based on the job type of the target job, the hierarchical relationship between the three layers of virtual queues in the three-layer virtual queue model is used to allocate a corresponding first logical computer room queue to the target job; In response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, based on the job type of the target job, determining a second logical computer room queue under the queue namespace queue for executing the target job; The target job is executed by using computing resources in the physical cluster queue associated with the second logical computer room queue.
2. The method according to claim 1, It is characterized in that After receiving the job request, the method further includes: In response to the first logical computer room queue not being associated with a physical cluster queue having a target computing resource, creating a first physical cluster queue under the first logical computer room queue; the target computing resource is used to execute the target job; Establishing an association relationship between the first physical cluster queue and a second physical cluster queue having the target computing resource; the second physical cluster queue is a physical cluster queue in other logical computer room queues; In the first physical cluster queue, the target computing resource of the second physical cluster queue is scheduled to execute the target job based on the association relationship.
3. The method according to claim 1, It is characterized in that The using computing resources in the physical cluster queue associated with the second logical computer room queue to execute the target job includes: In response to the fact that the number of computing resources corresponding to the third physical cluster queue associated with the second logical computer room queue currently executing the target job is less than the number of computing resources required by the target job, a fourth physical cluster queue is determined based on the number of computing resources respectively corresponding to each physical cluster queue associated with the second logical computer room queue; The target job is executed using computing resources in the fourth physical cluster queue; or the fourth physical cluster queue is merged with the third physical cluster queue to obtain a fifth physical cluster queue, and the target job is executed using computing resources in the fifth physical cluster queue.
4. The method according to claim 1, It is characterized in that The method of allocating a corresponding first logical computer room queue to the target job based on the job type of the target job and utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model includes: Based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate a candidate logical computer room queue with computing resources to the target job, as well as computing resource configuration information corresponding to each of the candidate logical computer room queues; Based on the computing resource configuration information corresponding to the candidate logical computer room queues, a first logical computer room queue whose computing resource configuration information meets a preset condition is screened from the candidate logical computer room queues.
5. The method according to claim 4, It is characterized in that The job request includes the amount of computing resources required to execute the target job; The step of allocating a candidate logical computer room queue having computing resources to the target job includes: Based on the number of computing resources, allocating a queue namespace queue for executing the target job that matches the number of computing resources to the target job; Based on the job type of the target job, a candidate logical computer room queue having computing resources for executing the target job is selected from the queue namespace queue.
6. The method according to claim 1, It is characterized in that The method of allocating a corresponding first logical computer room queue to the target job based on the job type of the target job and utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model includes: Based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is used to allocate candidate logical computer room queues with computing resources for executing the target job, and the number of physical cluster queues associated with each candidate logical computer room queue for the target job; A candidate logical computer room queue whose number of associated physical cluster queues meets a set threshold is determined as a first logical computer room queue for executing the target job.
7. The method according to claim 1, It is characterized in that The job request includes the user's identity information; The method of allocating a corresponding first logical computer room queue to the target job based on the job type of the target job and utilizing the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model includes: Verifying the user's authority based on the user's identity information; In response to the user authority verification being passed, based on the job type of the target job, the hierarchical relationship among the queue namespace queue, the logical computer room queue, and the physical cluster queue in the three-layer virtual queue model is utilized to allocate the corresponding first logical computer room queue to the target job.
8. The method according to claim 1, It is characterized in that After the response to at least one of the cluster queues associated with the first logical computer room queue being abnormal, the method further includes: Receiving a job scheduling request; the job scheduling request includes identification information of a queue to be scheduled; Based on the queue identification information, determining a target queue for executing the target job; Based on the computing resources configured in the target queue, the target job is executed using the computing resources corresponding to the target queue.
9. The method according to claim 8, It is characterized in that The step of determining a target queue for executing the target job based on the queue identification information includes: In the case where the queue identification information includes queue namespace queue identification information, determining a target queue namespace queue corresponding to the queue namespace queue identification information; determining any physical cluster queue in any logical computer room queue associated with the target queue namespace queue as a target queue for executing the target job; In the case where the queue identification information includes queue namespace queue identification information and logical computer room queue identification information, determine the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue corresponding to the queue namespace queue identification information; determine the target physical cluster queue in the target logical computer room queue as the target queue for executing the target job; the target physical cluster queue is a physical cluster queue with user authority; In the case where the queue identification information includes queue namespace queue identification information, logical computer room queue identification information, and physical cluster queue identification information, determine the target queue namespace queue corresponding to the queue namespace queue identification information, and the target logical computer room queue corresponding to the logical computer room queue identification information under the target queue namespace queue, and the target physical cluster queue corresponding to the physical cluster queue identification information; determine the target physical cluster queue as the target queue for executing the target job.
10. A resource scheduling device, It is characterized in that include: A model setting module, configured to set the computing resources used to execute the job to a three-layer virtual queue model including three-layer virtual queues, wherein the three-layer virtual queues include queue namespace queues, logical computer room queues, and physical cluster queues, each of the queue namespace queues is associated with a plurality of the logical computer room queues, and each of the logical computer room queues is associated with at least one physical cluster queue; A first receiving module, used for receiving a job request, wherein the job request is used for requesting execution of a target job; an allocation module, configured to respond to the job request and allocate a corresponding first logical computer room queue to the target job based on the job type of the target job and by utilizing the hierarchical relationship between the three layers of virtual queues in the three-layer virtual queue model; A first determination module is configured to determine, in response to an exception occurring in at least one of the physical cluster queues associated with the first logical computer room queue, a second logical computer room queue under the queue namespace queue for executing the target job based on the job type of the target job; The first execution module is used to execute the target job by using the computing resources in the physical cluster queue associated with the second logical computer room queue.
11. A computer device, It is 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 computer 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 scheduling method as described in any one of claims 1 to 9 are performed.
12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource scheduling method according to any one of claims 1 to 9 are executed.
