Cluster job scheduling method and device, equipment and storage medium

By constructing a job classification model and a priority scoring mechanism, the problems of job congestion and abnormal jobs in the cluster were solved, achieving efficient job allocation and resource management, and improving the operating efficiency of the cluster.

CN112965820BActive Publication Date: 2026-02-13CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110244373.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-05
Publication Date
2026-02-13
Estimated Expiration
2041-03-05

AI Technical Summary

Technical Problem

In existing technologies, management nodes cannot automatically identify abnormal jobs in the cluster, leading to job congestion and resource waste, and reducing the operating efficiency of the cluster.

Method used

By constructing a job classification model to analyze job information, determining priority scores, and assigning jobs to different queues based on priority scores, abnormal jobs can be identified and terminated, and their resources can be recovered.

Benefits of technology

It effectively avoids job queue congestion, handles abnormal jobs in a timely manner, and improves the cluster's operating efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112965820B_ABST
    Figure CN112965820B_ABST
Patent Text Reader

Abstract

The application provides a cluster job scheduling method, device and storage medium. The method comprises a job allocation process, after receiving a to-be-processed job, analyzing a priority score according to job information (including a job category, a job importance and a job data volume) of the to-be-processed job, and allocating the to-be-processed job by using a target job queue determined according to the priority score. The method further comprises a job recovery process, judging whether a running job meets an abnormal job condition according to a cumulative running time and a memory usage index of the running job, and if the running job meets the abnormal job condition, terminating the running job and recovering resources of the running job. According to the application, different job queues are divided according to priority scores of jobs, and jobs are allocated by using multiple job queues, so that a large number of jobs are avoided, and abnormal jobs are identified in time and their resources are recovered, so that more jobs can be run in a cluster, and the running efficiency of the cluster is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a cluster job scheduling method and device, equipment and storage medium. BACKGROUND

[0002] A computer cluster (hereinafter referred to as cluster) composed of a management node and multiple computing nodes is a commonly used job processing system at present. A user of the cluster can send a job to the management node, and then the management node distributes the received job to a computing node for running through a job queue. After the computing node finishes running, the management node feeds back the running result of the job to the user.

[0003] In the prior art, the management node only distributes jobs through one job queue, and cannot automatically identify abnormal jobs in the cluster. On the one hand, a large number of jobs are congested in the same job queue and cannot be distributed to the computing node for running in time. On the other hand, abnormal jobs in the cluster also consume a large amount of resources of the cluster, which reduces the amount of jobs that can be run in the cluster.

[0004] Therefore, when a large number of jobs need to be run, the running efficiency of the existing cluster is low. SUMMARY

[0005] In view of the problems existing in the prior art, the present application provides a cluster job scheduling method, device, equipment and storage medium to improve the efficiency of running jobs in the cluster.

[0006] The first aspect of the present application provides a cluster job scheduling method, comprising:

[0007] Job distribution process:

[0008] After receiving a to-be-processed job, obtaining job information of the to-be-processed job; wherein the job information comprises a job category, a job importance and a job data volume;

[0009] analyzing the job information of the to-be-processed job by using a pre-constructed job classification model to obtain a priority score of the to-be-processed job; wherein the job classification model is constructed by using job information of a plurality of jobs received in a preset historical time period;

[0010] determining a target job queue from a plurality of job queues according to the priority score of the to-be-processed job;

[0011] distributing the to-be-processed job to a computing node in a computer cluster through the target job queue, so that the computing node runs the to-be-processed job;

[0012] Job recycling process:

[0013] obtaining a cumulative running time and a memory usage index of a running job; wherein the running job refers to a job being run in the cluster;

[0014] determining whether the running job meets an abnormal job condition according to the cumulative running time and the memory usage index of the running job; wherein the abnormal job condition includes that the cumulative running time of the running job is greater than a time threshold of the running job, and the memory usage index of the running job is greater than a memory usage threshold;

[0015] if the running job meets the abnormal job condition, terminating the running job meeting the abnormal job condition, and reclaiming resources occupied by the running job meeting the abnormal job condition.

[0016] Optionally, the obtaining the job information of the to-be-processed job comprises:

[0017] reading a job category and a job importance degree carried by the to-be-processed job;

[0018] calculating a data amount of job data carried by the to-be-processed job to obtain a job data amount of the to-be-processed job.

[0019] Optionally, the determining a target job queue from a plurality of job queues according to the priority score of the to-be-processed job comprises:

[0020] determining a score interval to which the priority score of the to-be-processed job belongs;

[0021] determining, as the target job queue, a job queue corresponding to the score interval to which the priority score of the to-be-processed job belongs from the plurality of job queues; wherein each of the job queues is previously provided with a corresponding score interval.

[0022] Optionally, the terminating the running job meeting the abnormal job condition and reclaiming resources occupied by the running job meeting the abnormal job condition comprises:

[0023] determining a computing node to which the running job meeting the abnormal job condition belongs as a target computing node;

[0024] sending a job termination command to the target computing node, so that the target computing node closes a thread for running the running job meeting the abnormal job condition, and the target computing node deletes data of the running job meeting the abnormal job condition.

[0025] The second aspect of the application provides a cluster job scheduling device, comprising:

[0026] The first obtaining unit is configured to obtain job information of the to-be-processed job after receiving the to-be-processed job, wherein the job information comprises a job category, a job importance level and a job data volume;

[0027] The analysis unit is configured to analyze the job information of the to-be-processed job by using a pre-constructed job classification model to obtain a priority score of the to-be-processed job, wherein the job classification model is constructed by using job information of a plurality of jobs received in a preset historical time period;

[0028] The determination unit is configured to determine a target job queue from a plurality of job queues according to the priority score of the to-be-processed job.

[0029] The allocation unit is configured to allocate the to-be-processed job to a computing node in a computer cluster through the target job queue, so that the computing node runs the to-be-processed job.

[0030] The second obtaining unit is configured to obtain cumulative running time and memory usage indicators of a running job, wherein the running job refers to a job that is running in the cluster.

[0031] The judgment unit is configured to judge whether the running job meets an abnormal job condition according to the cumulative running time and the memory usage indicators of the running job, wherein the abnormal job condition comprises that the cumulative running time of the running job is greater than a time threshold value of the running job, and the memory usage indicator of the running job is greater than a memory usage threshold value.

[0032] The recycling unit is configured to terminate the running job that meets the abnormal job condition and recycle resources occupied by the running job that meets the abnormal job condition, if the running job meets the abnormal job condition.

[0033] Optionally, when the first obtaining unit obtains the job information of the to-be-processed job, the first obtaining unit is specifically configured to:

[0034] read a job category and a job importance level carried by the to-be-processed job;

[0035] calculate a data volume of job data carried by the to-be-processed job to obtain a job data volume of the to-be-processed job.

[0036] Optionally, when the determination unit determines a target job queue from a plurality of job queues according to the priority score of the to-be-processed job, the determination unit is specifically configured to:

[0037] determine a score interval to which the priority score of the to-be-processed job belongs;

[0038] The job queue corresponding to the score interval to which the priority score of the to-be-processed job belongs in the plurality of job queues is determined as a target job queue; each of the job queues is previously provided with a corresponding score interval.

[0039] Optionally, when the recycling unit terminates the running job that meets the abnormal job condition and recycles the resource occupied by the running job that meets the abnormal job condition, the method is specifically used for:

[0040] The computing node to which the running job that meets the abnormal job condition belongs is determined as a target computing node.

[0041] A job termination command is sent to the target computing node, so that the target computing node closes the thread for running the running job that meets the abnormal job condition, and the target computing node deletes the data of the running job that meets the abnormal job condition.

[0042] The third aspect of the application provides a computer storage medium for storing a computer program, when the computer program is executed, specifically for implementing the cluster job scheduling method provided in any one of the first aspect of the application.

[0043] The fourth aspect of the application provides an electronic device, comprising a memory and a processor.

[0044] The memory is used for storing a computer program.

[0045] The processor is used for executing the computer program, and specifically for implementing the cluster job scheduling method provided in any one of the first aspect of the application.

[0046] The application provides a cluster job scheduling method, device, equipment and storage medium, the method comprises: a job allocation process, after receiving a to-be-processed job, the priority score is analyzed according to the job information (including job category, job importance and job data volume) of the to-be-processed job, and the to-be-processed job is allocated by using the target job queue determined according to the priority score; a job recycling process: whether the running job meets the abnormal job condition is judged according to the cumulative running time and memory usage index of the running job; if the running job meets the abnormal job condition, the running job is terminated, and the resource of the running job is recycled. The scheme divides different job queues according to the priority score of the job, allocates jobs by using a plurality of job queues, avoids a large number of job congestion, identifies abnormal jobs in time and recycles the resources of the abnormal jobs, so that more jobs can be run in the cluster, and the running efficiency of the cluster is improved. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only aim at the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative effort based on the provided drawings.

[0048] Figure 1 A flow chart of a job allocation process in the cluster job scheduling method provided by the embodiments of the present application;

[0049] Figure 2 A schematic diagram of a job allocation process in the cluster job scheduling method provided by the embodiments of the present application;

[0050] Figure 3 A flow chart of a job recovery process in the cluster job scheduling method provided by the embodiments of the present application;

[0051] Figure 4 A schematic diagram of a user recovery management process in the cluster job scheduling method provided by the embodiments of the present application;

[0052] Figure 5 A schematic diagram of a background administrator recovery management process in the cluster job scheduling method provided by the embodiments of the present application;

[0053] Figure 6 A structural schematic diagram of a cluster job scheduling device provided by the embodiments of the present application;

[0054] Figure 7 A structural schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort belong to the scope of protection of the present application.

[0056] The cluster job scheduling method provided by the present application can be applied to a statistical analysis system (SAS) cluster for example. The SAS cluster generally has multiple computing nodes and a management node. A user can provide a to-be-processed job to the management node, and then the management node sends the to-be-processed job to the computing nodes for running, so as to obtain the running result of the to-be-processed job.

[0057] SAS is a modular, integrated, large-scale application software system. Since its development began at the SAS Software Institute in 1976, SAS has been widely used across various fields, including in the big data intelligence platforms of banks, due to its powerful analytical and computational capabilities. For bank SAS systems, as business and data volumes increase, and the number and scale of SAS users grow, the requirements for SAS clusters in processing analysis scripts also rise. Based on the characteristics of SAS cluster deployment, a single management node distributes jobs to multiple data nodes for computation. Because the R&D environment involves many experimental jobs, abnormal and inefficient jobs are unavoidable. On the one hand, abnormal jobs consume significant computing resources; even if a job consumes a large amount of memory and CPU during execution, it will not be forcibly stopped but will remain running, consuming memory to the point that the entire cluster becomes unusable. On the other hand, management nodes typically send jobs to compute nodes through job queues. The generation of a large number of inefficient jobs can cause the number of jobs stored in the job queue to exceed the queue's capacity, resulting in queue congestion. This prevents jobs on the management node from being distributed to compute nodes, ultimately leading to cluster paralysis. When these problems occur, the system cannot automatically stop jobs, requiring manual cleanup and recycling at the system level. Furthermore, the business units submitting jobs cannot completely stop or recycle their submissions, and the system's memory space cannot be automatically released. To resolve cluster queue congestion, control individual jobs, and fundamentally ensure the stable operation of the cluster, a set of tools and methods is urgently needed to efficiently distribute and control jobs.

[0058] Taking the SAS cluster, one of the R&D platforms of a bank's big data intelligence platform, as an example, it has 25 nodes and more than 3,000 users. The cluster has one management node and one compute node, handling the daily R&D and computation script execution needs of various data R&D departments across the bank. With such high usage, a failure would significantly impact numerous jobs and users. Therefore, there is an urgent need for a tool that can efficiently resolve situations involving a large number of jobs and job congestion, and prevent abnormal jobs from continuously consuming memory.

[0059] This application provides a cluster job scheduling method, which mainly includes two processes: job allocation and job recycling. The job allocation process is used to allocate the pending jobs provided by the user to the computing nodes in the cluster for execution after receiving the pending jobs. The job recycling process is used to detect abnormal jobs in a timely manner and terminate abnormal jobs while the computing nodes are running.

[0060] The job allocation process can be performed by a queue automatic generation tool, and the job recycling process can be performed by a job control tool. Through the job allocation process, the application can avoid the situation of job queue congestion, and ensure that the number of jobs in each job queue does not exceed the specified upper limit. Through the job recycling process, the application can terminate the abnormal jobs running in the cluster in time and recycle the corresponding resources, so as to avoid affecting the running of other normal jobs.

[0061] The scheduling method provided by any embodiment of the application can be executed in SAS 9.4M6 software, Linux Oracle7.4, and RedHat6.5, or can be executed in other software, and is not limited to the above software and versions.

[0062] Please refer to Figure 1 , and in combination with Figure 2 , the job allocation process in the scheduling method of the application can specifically include the following steps:

[0063] S101, after receiving a to-be-processed job, obtaining job information of the to-be-processed job.

[0064] The job information includes a job category, a job importance level, and a job data volume.

[0065] The job category and the job importance level can be set by a user who submits the to-be-processed job, and are sent to the management node together with the to-be-processed job. The job data volume refers to the total amount of job data contained in the to-be-processed job. For example, if the to-be-processed job contains 20MB of data to be processed, the job data volume is 20MB.

[0066] In the application, a job can specifically include two parts of a job script and job data. The job script is equivalent to a data processing program that can be run. After receiving a job, the computing node can run the job script in the job, so as to process the job data based on the job script, and finally obtain the running result of the job.

[0067] Therefore, step S101 can specifically include:

[0068] After receiving the to-be-processed job, reading the job category and the job importance level carried by the to-be-processed job and set by the user;

[0069] Calculating the data volume of the job data carried by the to-be-processed job to obtain the job data volume of the to-be-processed job.

[0070] In the embodiments of the present application, the job category of the to-be-processed job can be represented by a job category code carried by the to-be-processed job. When uploading the to-be-processed job, the user can select one of the plurality of preset job category codes according to business needs or technical needs and configure the to-be-processed job with the selected job category code.

[0071] S102, analyzing the job information of the to-be-processed job by using the job classification model to obtain a priority score of the to-be-processed job.

[0072] The job classification model is constructed by using the job information of a plurality of jobs received in a preset historical time period.

[0073] Specifically, the job information of the plurality of jobs received in the preset historical time period can be learned by using a multi-classification machine learning algorithm, and then the above-mentioned job classification model can be constructed.

[0074] A specific construction method can be that a plurality of jobs processed and completed in a preset historical time period are obtained, such as the job information of a plurality of jobs received in the last month and the processing time of the jobs. Then, a priority score is determined for each of the jobs according to the processing time. Specifically, the priority score can be negatively correlated with the processing time, that is, the longer the processing time of a job, the lower the priority score set for the job.

[0075] After the priority score is set for the above-mentioned processed jobs, all the processed jobs with the set priority scores are used as a job set, and the multi-classification machine learning algorithm is used to classify the job set according to different job information, so as to split the job set into a plurality of subsets. The multi-classification machine learning algorithm will adaptively determine a set of classification standards according to the job information and the priority score of the processed jobs in the classification process. For example, jobs with a job category of one, a high job importance, and a job data volume between 10 MB and 20 MB are divided into a first subset, jobs with a job category of two, a low job importance, and a job data volume between 100 MB and 150 MB are divided into a second subset, and so on. Finally, the obtained set of classification standards and the subsets constitute the job classification model in step S102.

[0076] Based on the above-mentioned job classification model, step S102 can be that after obtaining the job information of the to-be-processed job, the job information of the to-be-processed job is analyzed according to the classification standards in the job classification model, so as to determine to which subset in the job classification model the to-be-processed job specifically belongs.

[0077] After determining the subset to which the to-be-processed job belongs in the job classification model, an arithmetic mean of the priority scores of all processed jobs in the subset can be calculated, and the result of the calculation is determined as the priority score of the to-be-processed job.

[0078] For example, it is determined that the subset to which the to-be-processed job belongs contains processed jobs 1 to 10, and the corresponding priority scores are S1 to S10, respectively. The priority score Sc of the to-be-processed job can be determined as follows:

[0079]

[0080] Further, after obtaining the priority score of the to-be-processed job by using the job classification model, the priority score can be appropriately adjusted according to the current job quantity.

[0081] The current job quantity refers to the number of jobs currently running in the entire cluster.

[0082] The specific adjustment manner can be that, first, the upper limit of the job quantity of the cluster, that is, the maximum number of jobs that can be simultaneously run in the cluster, can be determined by analyzing the total amount of resources of the cluster. For example, if the cluster can simultaneously run 1000 jobs at most, the upper limit of the job quantity is 1000. Then, according to the upper limit of the job quantity, a plurality of job quantity intervals between 0 and the upper limit of the job quantity are divided, and an adjustment coefficient is configured for each job quantity interval. Among them, the adjustment coefficient of the job quantity interval close to 50% of the upper limit of the job quantity is set to 1. On this basis, the adjustment coefficient of the job quantity interval below 50% of the upper limit of the job quantity is greater than 1, and the adjustment coefficient of the job quantity interval above 50% of the upper limit of the job quantity is less than 1.

[0083] In this way, in the adjustment, the job quantity interval to which the current job quantity belongs can be determined, and then the priority score of the to-be-processed job determined in step S102 is multiplied by the adjustment coefficient corresponding to the job quantity interval to which it belongs, so as to obtain the adjusted priority score of the to-be-processed job.

[0084] S103, determining a target job queue from the plurality of job queues according to the priority score of the to-be-processed job.

[0085] Step S103 can specifically include:

[0086] determining the score interval to which the priority score of the to-be-processed job belongs;

[0087] determining, as the target job queue, the job queue corresponding to the score interval to which the priority score of the to-be-processed job belongs from the plurality of job queues; wherein each job queue is previously provided with a corresponding score interval.

[0088] It should be noted that the number of the plurality of job queues in step S103 can be fixed or dynamically adjusted according to the current job amount. When the number of the job queues can be dynamically adjusted, the corresponding score interval of each job queue can also be adjusted accordingly.

[0089] The specific adjustment manner can be to increase the number of job queues when the current job amount is large, and to reduce the number of job queues when the current job amount is small.

[0090] Further, the upper limit of the number of jobs that each job queue can carry can be set according to the height of the corresponding score interval. Generally, the higher the corresponding score interval, the lower the upper limit of the number of jobs that the corresponding job queue can carry can be set. For example, the job queue 1 corresponds to the score interval 70 to 100, and the job queue 3 corresponds to the score interval 40 to 60. The job queue 1 can be set to a smaller upper limit of the number of jobs that can be carried, and the job queue 2 can be set to a larger upper limit of the number of jobs that can be carried.

[0091] S104, distributing the to-be-processed jobs to the computing nodes in the computer cluster through the target job queue, so that the computing nodes run the to-be-processed jobs.

[0092] In step S104, the to-be-processed jobs can be written into the corresponding target job queue. The jobs in each job queue will be sent to any computing node in the cluster in turn according to the writing order. After receiving the to-be-processed jobs, the computing node will run the to-be-processed jobs, so as to obtain the running results of the to-be-processed jobs.

[0093] Optionally, if the priority score of the to-be-processed job is too low, for example, the priority score belongs to the lowest score interval, such as the score interval 1 to 30, a resource limitation tag can be added to the to-be-processed job when the to-be-processed job is written into the target job queue, so as to limit the resources allocated to the to-be-processed job when the computing node runs the to-be-processed job, so as to avoid affecting the running of other jobs with higher priority scores.

[0094] Further, a sending priority can be set for each job queue. The job queue corresponding to a higher score interval has a high sending priority, and the job queue corresponding to a lower score interval has a low sending priority. When jobs of multiple job queues need to be sent to the computing node, the management node will preferentially send the jobs of the job queue with a higher sending priority. In this way, the jobs with a higher priority score (generally important or urgent jobs) can be preferentially sent through the job queue with a high sending priority. For ordinary jobs with a lower priority score, the jobs can be sent through the job queue with a low sending priority later. In this way, important jobs can have a high priority, and the efficiency can be improved.

[0095] Meanwhile, the scheme sets multiple job queues, and according to the priority scores of different jobs, the jobs are distributed to different job queues, so as to avoid a large number of jobs received in a short time from being crowded in the same job queue, and prevent too many jobs in the job queue from being unable to be sent.

[0096] Please refer to Figure 3 The job recovery process in the scheduling method provided by the application can include the following steps:

[0097] S301, obtaining cumulative running time and memory usage index of a running job.

[0098] The running job refers to a job that is running in the cluster.

[0099] S302, judging whether the running job meets abnormal job conditions.

[0100] The abnormal job conditions include that the cumulative running time of the running job is greater than a time threshold of the running job, and the memory usage index of the running job is greater than a memory usage threshold.

[0101] Therefore, step S302 is to judge whether the running job meets the abnormal job conditions according to the cumulative running time and the memory usage index of the running job.

[0102] It should be noted that when there are multiple running jobs in the cluster, whether each running job meets the abnormal job conditions will be judged in step S302.

[0103] When there is a running job that meets the abnormal job conditions, step S303 is performed, and when there is no running job that meets the abnormal job conditions, i.e., each running job in the cluster does not meet the abnormal job conditions, step S301 is returned to be performed.

[0104] In the abnormal job conditions described in step S302, the time threshold of the running job can be specifically set according to the estimated running time of each running job. For example, if the estimated running time of a running job is 30 minutes, the time threshold of this running job can be obtained by increasing the estimated running time by 20%, i.e., 36 minutes.

[0105] The memory usage index can be the memory size occupied by the running job, or the growth rate of the occupied memory of the running job.

[0106] That is, for a running job, the above abnormal job conditions can be specifically:

[0107] The accumulated running time is greater than 1.2 times of the predicted running time of the job, i.e., exceeds the predicted running time, and the exceeding part is greater than 20% of the predicted running time, and the memory space occupied by the job is greater than the memory usage threshold, such as greater than 100 MB.

[0108] Also can be:

[0109] The accumulated running time is greater than 1.2 times of the predicted running time of the job, i.e., exceeds the predicted running time, and the exceeding part is greater than 20% of the predicted running time, and the memory space occupied by the job is greater than the memory usage threshold, such as greater than 100 MB.

[0110] S303, terminate the running job that meets the abnormal job condition, and recover the resource occupied by the running job that meets the abnormal job condition.

[0111] The specific execution process of step S303 can include:

[0112] Determine the computing node to which the running job that meets the abnormal job condition belongs as a target computing node;

[0113] Send a job termination command to the target computing node, so that the target computing node closes the thread for running the running job that meets the abnormal job condition, and the target computing node deletes the data of the running job that meets the abnormal job condition.

[0114] As shown in the job recovery process Figure 3 , it can be considered that the automatic job recovery management is automatically executed by the job control tool provided in the present application.

[0115] The job control tool provided in the present application can also support manual job recovery by users and background administrators, that is, users can realize user job recovery management through the job control tool, and the background administrators of the cluster can also realize background administrator job recovery management through the job control tool.

[0116] The process of user job recovery management is as shown in Figure 4 , after uploading the job, the user can open a graphical interface for job recovery management in the Enterprise Guide (EG) client, i.e., the EG client as shown in Figure 4 , and the graphical interface displays each running job in the cluster, and the user can click the end button corresponding to any running job, and then the EG client can send a job termination command to the management node of the cluster, i.e., the management node as shown in Figure 4The SAS server shown) sends a recovery request of the corresponding running job, and the management node terminates the running of the running job selected by the user and recovers the resources occupied by the running job after receiving the recovery request.

[0117] The flow of the background administrator job recovery management is shown in Figure 5 The background administrator can access the Web monitoring page of the cluster system, thereby checking the running of each running job in the cluster on the monitoring page, and when the background administrator finds an abnormal job, the abnormal job is selected and the end button of the abnormal job is clicked, thereby sending a recovery request of the selected job to the management node (i.e. Figure 5 The SAS server shown) of the cluster through the monitoring page, so that the management node terminates the running of the job and recovers the corresponding resources.

[0118] By detecting whether the running job meets the abnormal job condition, the running of the running job meeting the abnormal job condition is terminated in time and the resources thereof are recovered, so that the application can solve the situation that the abnormal job cannot be recovered automatically and continuously consumes and occupies the memory, thereby causing the service to be unavailable, and greatly reduces the risk of system instability.

[0119] With reference to the scheduling method of the cluster job provided in the embodiments of the application, the embodiments of the application further provide a scheduling device of a cluster job, which can specifically include the following units: Figure 6

[0120] The first obtaining unit 601 is configured to obtain job information of the to-be-processed job after receiving the to-be-processed job.

[0121] The job information includes a job category, a job importance degree and a job data volume.

[0122] The analysis unit 602 is configured to analyze the job information of the to-be-processed job by using a pre-constructed job classification model to obtain a priority score of the to-be-processed job.

[0123] The job classification model is constructed by using job information of a plurality of jobs received in a preset historical time period.

[0124] The determination unit 603 is configured to determine a target job queue from a plurality of job queues according to the priority score of the to-be-processed job.

[0125] The allocation unit 604 is configured to allocate the to-be-processed job to a computing node in a computer cluster through the target job queue, so that the computing node runs the to-be-processed job.

[0126] The second obtaining unit 605 is configured to obtain a cumulative running time and a memory usage index of the running job.

[0127] ​The running job refers to a job that is running in the cluster.

[0128] The judging unit 606 is configured to judge whether the running job meets the abnormal job condition according to the cumulative running time of the running job and the memory usage index of the running job.

[0129] The abnormal job condition includes that the cumulative running time of the running job is greater than a time threshold of the running job, and the memory usage index of the running job is greater than a memory usage threshold.

[0130] The recycling unit 607 is configured to terminate the running job that meets the abnormal job condition, and recycle resources occupied by the running job that meets the abnormal job condition, if the running job meets the abnormal job condition.

[0131] Optionally, when the first obtaining unit 601 obtains the job information of the to-be-processed job, the first obtaining unit 601 is specifically configured to:

[0132] read the job category and the job importance degree carried by the to-be-processed job;

[0133] calculate the data amount of the job data carried by the to-be-processed job to obtain the job data amount of the to-be-processed job.

[0134] Optionally, when the determining unit 603 determines a target job queue from the plurality of job queues according to the priority score of the to-be-processed job, the determining unit 603 is specifically configured to:

[0135] determine the score interval to which the priority score of the to-be-processed job belongs;

[0136] determine, as the target job queue, a job queue corresponding to the score interval to which the priority score of the to-be-processed job belongs, from the plurality of job queues, wherein each job queue is previously set with a corresponding score interval.

[0137] Optionally, when the recycling unit 607 terminates the running job that meets the abnormal job condition, and recycles resources occupied by the running job that meets the abnormal job condition, the recycling unit 607 is specifically configured to:

[0138] determine, as a target computing node, a computing node to which the running job that meets the abnormal job condition belongs;

[0139] send a job termination command to the target computing node, so that the target computing node closes a thread used for running the running job that meets the abnormal job condition, and so that the target computing node deletes data of the running job that meets the abnormal job condition.

[0140] The cluster job scheduling device provided in the embodiments of the present application can refer to the related steps in the cluster job scheduling method provided in the embodiments of the present application for the specific working principle, which will not be described here again.

[0141] The application provides a cluster job scheduling device, wherein an analysis unit 602 analyzes a priority score according to job information (including a job category, a job importance and a job data volume) of a to-be-processed job after receiving the to-be-processed job, and a distribution unit 604 distributes the to-be-processed job by using a target job queue determined according to the priority score, a judgment unit 606 judges whether a running job meets an abnormal job condition according to a cumulative running time and a memory usage index of the running job, and a recovery unit 607 terminates the running job and recovers resources of the running job if the running job meets the abnormal job condition. According to the application, different job queues are divided according to the priority score of the job, and the jobs are distributed by using the multiple job queues, so that the application can avoid a large number of job congestion, identify the abnormal job in time and recover the resources of the abnormal job, so that more jobs can be run in the cluster, and the running efficiency of the cluster is improved.

[0142] The application further provides a computer storage medium for storing a computer program, and the stored computer program is executed to specifically implement the cluster job scheduling method provided in any of the embodiments of the application.

[0143] The application further provides an electronic device, as shown in the accompanying drawings. Figure 7 The electronic device includes a memory 701 and a processor 702.

[0144] The memory 701 is configured to store a computer program.

[0145] The processor 702 is configured to execute the computer program, and specifically implement the cluster job scheduling method provided in any of the embodiments of the application.

[0146] Finally, it should be noted that the relative terms such as first and second, and the like are used herein only to differentiate one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between such entities or operations. Moreover, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not expressly listed, or other elements inherent in such process, method, article or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0147] It should be noted that the terms "first", "second", and the like mentioned in the present application are only used to distinguish different devices, modules or units, and do not limit the functions performed by these devices, modules or units.

[0148] Those skilled in the art could make or employ the present application without undue experimentation having regard to the detailed description herein. Various modifications can be made to the embodiments described herein, and the generic principles illustrated herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for scheduling clustered jobs, characterized in that, The method, applied to a statistical analysis system cluster, includes: Job assignment process: Upon receiving a pending job, the job information of the pending job is obtained; wherein, the job information includes job category, job importance and job data volume; The process involves analyzing the job information of the pending jobs using a pre-built job classification model to obtain a priority score for the pending jobs. This includes: analyzing the job information of the pending jobs according to the classification criteria in the job classification model to determine which subset of the job belongs to; and after determining the subset to which the pending job belongs, calculating the arithmetic mean of the priority scores of all processed jobs in the subset, and using the result as the priority score for the pending job. The job classification model is constructed using job information from multiple jobs received within a preset historical time period. Based on the priority scores of the jobs to be processed, a target job queue is determined from multiple job queues; The pending jobs are allocated to computing nodes in the computer cluster through the target job queue, so that the computing nodes can run the pending jobs. Job recovery process: Obtain the cumulative runtime and memory usage metrics of running jobs; wherein, the running jobs refer to jobs currently running in the cluster; The abnormal job conditions are determined based on the cumulative running time and memory usage metrics of the running job. The abnormal job conditions include the cumulative running time of the running job being greater than the time threshold of the running job, and the memory usage metrics of the running job being greater than the memory usage threshold. If the running job meets the abnormal job conditions, the running job that meets the abnormal job conditions is terminated, and the resources occupied by the running job that meets the abnormal job conditions are reclaimed.

2. The scheduling method according to claim 1, characterized in that, Obtaining the job information of the job to be processed includes: Read the job category and job importance of the job to be processed; Calculate the amount of job data carried by the job to be processed to obtain the amount of job data of the job to be processed.

3. The scheduling method according to claim 1, characterized in that, The step of determining a target job queue from multiple job queues based on the priority scores of the jobs to be processed includes: Determine the score range to which the priority score of the task to be processed belongs; The task queue that corresponds to the score range of the priority score of the task to be processed is determined as the target task queue; wherein, each task queue is pre-set with a corresponding score range.

4. The scheduling method according to claim 1, characterized in that, The termination of running jobs that meet the abnormal operation conditions and the recovery of resources occupied by running jobs that meet the abnormal operation conditions include: The computing node to which the running job that meets the above abnormal operation conditions belongs is determined as the target computing node; A job termination command is sent to the target computing node, causing the target computing node to shut down the threads used to run jobs that meet the abnormal job conditions, and to delete the data of the running jobs that meet the abnormal job conditions.

5. A scheduling device for cluster operations, characterized in that, The device is applied to a statistical analysis system cluster and includes: The first obtaining unit is configured to obtain job information of the job to be processed after receiving the job to be processed; wherein, the job information includes job category, job importance and job data volume; The analysis unit is used to analyze the job information of the job to be processed using a pre-built job classification model to obtain the priority score of the job to be processed. This includes: analyzing the job information of the job to be processed according to the classification criteria in the job classification model, determining which subset of the job to be processed belongs to in the job classification model, and after determining the subset to which the job to be processed belongs in the job classification model, calculating the arithmetic mean of the priority scores of all processed jobs in the subset, and determining the calculation result as the priority score of the job to be processed; wherein, the job classification model is constructed using job information from multiple jobs received within a preset historical time period; The determining unit is used to determine a target job queue from multiple job queues based on the priority score of the jobs to be processed. The allocation unit is used to allocate the pending job to the computing nodes in the computer cluster through the target job queue, so that the computing nodes can run the pending job. The second acquisition unit is used to acquire the cumulative running time and memory usage metrics of running jobs; wherein, the running jobs refer to jobs currently running in the cluster; The judgment unit is used to determine whether the running job meets the abnormal job conditions based on the cumulative running time and memory usage index of the running job; wherein, the abnormal job conditions include that the cumulative running time of the running job is greater than the time threshold of the running job, and the memory usage index of the running job is greater than the memory usage threshold. The recycling unit is used to terminate the running job that meets the abnormal job conditions and reclaim the resources occupied by the running job that meets the abnormal job conditions if the running job meets the abnormal job conditions.

6. The scheduling device according to claim 5, characterized in that, When the first obtaining unit obtains the job information of the job to be processed, it is specifically used for: Read the job category and job importance of the job to be processed; Calculate the amount of job data carried by the job to be processed to obtain the amount of job data of the job to be processed.

7. The scheduling device according to claim 5, characterized in that, When the determining unit identifies a target job queue from multiple job queues based on the priority scores of the jobs to be processed, it is specifically used for: Determine the score range to which the priority score of the task to be processed belongs; The task queue that corresponds to the score range of the priority score of the task to be processed is determined as the target task queue; wherein, each task queue is pre-set with a corresponding score range.

8. The scheduling device according to claim 5, characterized in that, When the recycling unit terminates the running operation that meets the abnormal operation conditions and reclaims the resources occupied by the running operation that meets the abnormal operation conditions, it is specifically used for: The computing node to which the running job that meets the above abnormal operation conditions belongs is determined as the target computing node; A job termination command is sent to the target computing node, causing the target computing node to shut down the threads used to run jobs that meet the abnormal job conditions, and to delete the data of the running jobs that meet the abnormal job conditions.

9. A computer storage medium, characterized in that, Used to store computer programs, which, when executed, are specifically used to implement the cluster job scheduling method as described in any one of claims 1 to 4.

10. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is used to execute the computer program, specifically to implement the cluster job scheduling method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Job scheduling method and apparatus

    CN105718316A

  • Task scheduling processing method, device and system

    CN107291547A