Job tracking method, device, computer equipment and storage medium

By obtaining and parsing job basic information in the job scheduling system, determining process identifiers to obtain process information, the problem of restricted job monitoring in the existing technology is solved, complete information tracking and data support for jobs is realized, and job scheduling is optimized. .

CN113535514BActive Publication Date: 2024-11-15DAWNING INT INFORMATION IND CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202110753248.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-02
Publication Date
2024-11-15
Estimated Expiration
2041-07-02

AI Technical Summary

Technical Problem

In the prior art, if the comment attribute parameter is not added in the submission job commands and scripts, the complete information of the job cannot be obtained, resulting in limited job monitoring.

Method used

By obtaining the basic information of the target job in the job scheduling system, input it into the preset analysis algorithm, determining the process identity, and obtaining process information based on the process identity, outputting it to the database, realizing complete information monitoring and tracking of the job.

Benefits of technology

It realizes monitoring of the process details of the job, provides data support, optimizes job scheduling, and improves information effectiveness and data mining and analysis capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535514B_ABST
    Figure CN113535514B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for job tracking. The method includes: a job scheduling system obtains basic information of a target job in the job scheduling system, inputs the basic information of the target job into a preset parsing algorithm, determines a process identifier corresponding to the target job, determines the process information corresponding to the target job based on the process identifier, and outputs the basic information of the target job and the process information of the target job to a database. In this method, the job scheduling system can determine the process identifier corresponding to the job based on the basic information of the job obtained and according to a preset parsing algorithm, thereby determining the detailed information of the process corresponding to the job based on the process identifier, achieving the purpose of monitoring and tracking the detailed information of the process of the job in the job scheduling system, and further performing data mining and analysis based on the basic information and process information of the job, to provide data support for optimizing job scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a job tracking method, apparatus, computer equipment and storage medium. Background Art

[0002] As an open source, fault-tolerant, and highly scalable cluster job scheduling system, SLURM can implement job scheduling for computer devices and can also monitor jobs. Specifically, the prior art implements job monitoring based on the job's application name and process information by marking specified field attributes, such as comment attributes, in the command and script for submitting a job, obtaining the application name of the job in the running state through the SLURMscontrol show job command carrying the field attributes, and obtaining the process information corresponding to the job in the running state through the linux command carrying the field attributes.

[0003] However, if the comment attribute parameter is not added to the command and script for submitting a job, the above-mentioned prior art will not be able to obtain complete information about the job, and job monitoring will be limited. Summary of the invention

[0004] Based on this, it is necessary to provide a job tracking method, device, computer equipment and storage medium that can monitor and track complete job information in response to the above technical problems.

[0005] In a first aspect, a job tracking method is provided, which is applied to a job scheduling system, and the method comprises:

[0006] Obtain basic information of the target job in the job scheduling system;

[0007] Inputting basic information of the target job into a preset parsing algorithm, determining a process identifier corresponding to the target job, and determining process information corresponding to the target job based on the process identifier;

[0008] The basic information of the target job and the process information of the target job are output to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

[0009] In this embodiment, the job scheduling system can determine the process identifier corresponding to the job based on the acquired basic information of the job and according to a preset parsing algorithm, thereby determining the detailed information of the process corresponding to the job based on the process identifier, thereby achieving the purpose of monitoring and tracking the detailed process information of the job in the job scheduling system, and outputting the obtained basic information and process information of the job to the database. Further data mining and analysis can be performed based on the basic information and process information of the job to provide data support for optimizing job scheduling.

[0010] In one of the optional embodiments, obtaining basic information of a target job in a job scheduling system includes:

[0011] According to the preset sampling frequency, basic information of the first job in the job scheduling system whose job status is running at the current sampling time is obtained;

[0012] Obtain basic information of a second job whose job status is running at the last sampling time in the job scheduling system;

[0013] The basic information of the target job is determined according to the basic information of the first job and the basic information of the second job.

[0014] In this embodiment, the job scheduling system calls the management node to determine the basic information of the newly added job based on the information obtained at the current sampling time and the information obtained at the previous sampling time. This method can simply and effectively determine the target job and improve the effectiveness of the basic information of the job.

[0015] In one optional embodiment, determining basic information of the target job according to basic information of the first job and basic information of the second job includes:

[0016] Determine a difference set between the first job and the second job according to the basic information of the first job and the basic information of the second job;

[0017] The job in the difference set is determined as the target job, and the basic information of the target job is determined.

[0018] In this embodiment, the job scheduling system determines the basic information of the newly added job, i.e., the basic information of the target job, based on the difference between the basic information of the first job and the basic information of the second job. This method can simply and effectively determine the target job, thereby improving the effectiveness of the basic information of the job.

[0019] In one of the optional embodiments, the basic information of the target job is input into a preset parsing algorithm to determine the process identifier corresponding to the target job, and based on the process identifier, the process information corresponding to the target job is determined, including:

[0020] Input the basic information of the target job into the recursive function of the parsing algorithm to determine the process ID of the target job;

[0021] The process information of the target job is determined according to the process ID of the target job and the preset field model.

[0022] In this embodiment, the job scheduling system calls the computing node to determine the process identifier corresponding to the target job based on the basic information of the target job, and then determines the detailed information of the process corresponding to the target job based on the process identifier, thereby realizing information tracking of the process corresponding to the job.

[0023] In one of the optional embodiments, outputting the basic information of the target job and the process information of the target job to a database includes:

[0024] Write the basic information and process information of the target job into the specified file according to the preset writing format;

[0025] Parse the specified file according to the preset parsing frequency to obtain the first parsing result of the target job;

[0026] Output the first parsing result of the target job to the database.

[0027] In this embodiment, after obtaining the process information of the target job, the management node writes the basic information and process information of the target job into a specified file and parses the specified file, which is equivalent to performing a validity check on the specified file, further ensuring the validity of the target job information output to the database.

[0028] In one of the optional embodiments, the basic information and process information of the target job are written into a specified file according to a preset writing format, including:

[0029] Check whether the process information of the target job is empty;

[0030] If the process information of the target job is not empty, writing the basic information and process information of the target job into the first designated file according to a preset writing format;

[0031] If the process information of the target job is empty, the basic information of the target job is written into the second designated file in the designated directory according to the writing format; wherein, in the process of parsing the designated file, the priority of the first designated file is higher than that of the second designated file.

[0032] In this embodiment, the management node detects whether the target job process information is empty, thereby generating corresponding first and second designated files. In the subsequent parsing of the designated files, the first designated file is processed first, thereby improving the efficiency of parsing the designated files.

[0033] In one of the optional embodiments, parsing a specified file according to a preset parsing frequency to obtain a first parsing result of a target job includes:

[0034] Scan the process information of the target job in the specified file line by line according to the preset parsing frequency;

[0035] Determine whether the process information corresponding to the current row contains a preset value; the preset value is a field in a preset application name configuration file of the job in the job scheduling system;

[0036] If the preset value is not included, the process information of the current line is discarded;

[0037] If the preset value is included, the process information of the current row is determined as the first parsing result.

[0038] In this embodiment, the management node detects whether each line of data in the specified file contains a preset value, thereby ensuring the validity of each line of data in the specified file and improving the efficiency of parsing the specified file.

[0039] In one of the optional embodiments, the method further comprises:

[0040] If there are multiple consecutive lines of process information that do not contain the preset value, the value of the preset column of the multiple consecutive lines of process information is obtained, and the value of the preset column is determined as the first parsing result.

[0041] In one of the optional embodiments, before parsing the designated file according to the preset parsing frequency to obtain the first parsing result of the target job, the method further includes:

[0042] Determine whether the writing of the specified file is completed according to the timestamp of the specified file and the current timestamp of the job scheduling system;

[0043] If the difference between the timestamp of the designated file and the current timestamp is greater than a preset time threshold, a step of parsing the designated file according to a preset parsing frequency to obtain a first parsing result of the target job is performed.

[0044] In this embodiment, the management node determines the writing status of the specified file based on the difference between the timestamp of the specified file and the current timestamp, ensuring that the step of parsing the specified file is executed after the writing of the specified file is completed, thereby ensuring the integrity of the data in the specified file and improving the efficiency of parsing the specified file.

[0045] In a second aspect, a job scheduling system is provided, the system comprising a management node and a computing node;

[0046] Call the management node to obtain basic information of the target job in the job scheduling system;

[0047] Call the computing node, input the basic information of the target job into the preset parsing algorithm, determine the process ID corresponding to the target job, and determine the process information corresponding to the target job based on the process ID;

[0048] The management node is called to output the basic information of the target job and the process information of the target job to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

[0049] In a third aspect, a work tracking device is provided, the device comprising:

[0050] An acquisition module is used to obtain basic information of a target job in the job scheduling system;

[0051] The parsing module is used to parse the target job according to the basic information of the target job and a preset parsing algorithm to determine the process information of the target job;

[0052] The output module is used to output the basic information of the target job and the process information of the target job to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

[0053] In a fourth aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the job tracking methods described in the first aspect when executing the computer program.

[0054] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the job tracking method described in any one of the first aspects is implemented.

[0055] In the above-mentioned job tracking method, device, computer equipment and storage medium, the job scheduling system obtains the basic information of the target job in the job scheduling system, inputs the basic information of the target job into a preset parsing algorithm, determines the process identifier corresponding to the target job, determines the process information corresponding to the target job based on the process identifier, and outputs the basic information of the target job and the process information of the target job to a database. In this method, the job scheduling system can determine the process identifier corresponding to the job based on the basic information of the acquired job according to a preset parsing algorithm, thereby determining the detailed information of the process corresponding to the job based on the process identifier, achieving the purpose of monitoring and tracking the detailed information of the process of the job in the job scheduling system, outputting the obtained basic information and process information of the job to a database, and can perform further data mining and analysis based on the basic information and process information of the job, providing data support for optimizing job scheduling. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of the structure of a job scheduling system in one embodiment;

[0057] Figure 2 A flowchart of a method for tracking a job in one embodiment;

[0058] Figure 3 A flowchart of a method for tracking a job in one embodiment;

[0059] Figure 4 A flowchart of a method for tracking a job in one embodiment;

[0060] Figure 5 A flowchart of a method for tracking a job in one embodiment;

[0061] Figure 6 A flowchart of a method for tracking a job in one embodiment;

[0062] Figure 7 A flowchart of a method for tracking a job in one embodiment;

[0063] Figure 8 A flowchart of a method for tracking a job in one embodiment;

[0064] Fig. 9 A flowchart of a method for tracking a job in one embodiment;

[0065] Fig.10 A flowchart of a method for tracking a job in one embodiment;

[0066] Fig.11 is a structural block diagram of a job tracking device in one embodiment;

[0067] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0069] The job tracking method provided in this application can be applied to Figure 1In the job scheduling system shown. The job scheduling system may be a SLURM job scheduling system; the job scheduling system includes three parts: a management node, a computing node, and a database. Optionally, the monitor_job.sh script for obtaining newly added jobs may be deployed on the management node to achieve the purpose of calling the management node to obtain the basic information of the job in the job scheduling system; optionally, the analysis_job.sh script for analyzing the job may be deployed on the computing node to achieve the purpose of calling the computing node to obtain the process identifier corresponding to the job according to the basic information of the job and the preset parsing algorithm, thereby obtaining the process information based on the process identifier; optionally, the program for storing the job information may be deployed on the management node to achieve the purpose of calling the management node to output the basic information and process information of the job to the database. In addition, optionally, scheduled tasks, script directories, log file directories, etc. may be configured on the management node, and the script directory may be configured on the computing node.

[0070] The following will explain in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems through embodiments and in combination with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that the present application Figure 2-Figure 10 The job tracking method provided in the embodiment is executed by a job scheduling system or a job tracking device, which can be part or all of the job scheduling system through software, hardware, or a combination of software and hardware. In the following method embodiments, the execution subject is taken as an example of the job scheduling system.

[0071] In one embodiment, Figure 2 As shown, a job tracking method is provided, which involves a job scheduling system obtaining basic information of a target job in the job scheduling system, inputting the basic information of the target job into a preset parsing algorithm, determining a process identifier corresponding to the target job, determining the process information corresponding to the target job based on the process identifier, and outputting the basic information of the target job and the process information of the target job to a database, including the following steps:

[0072] S201. Obtain basic information of a target job in a job scheduling system.

[0073] The target job refers to the newly added job at the current sampling time; the basic information refers to the job ID, job status, and server node information that executes the job. The job status includes running status, waiting status, and completion status.

[0074] In this embodiment, the job scheduling system can obtain basic information of the job according to the preset sampling frequency. For example, the job scheduling system calls the management node to obtain the basic information of all jobs at the current sampling time, and then determines the basic information of the newly added job at the current sampling time according to the preset new search rules as the basic information of the target job. Optionally, the management node can determine whether the job is a newly added job at the current sampling time according to the execution time of the job and the current sampling time; the management node can also determine the newly added job at the current sampling time according to the job information at the historical sampling time and the job information at the current sampling time, which is not limited in this embodiment.

[0075] S202: Input basic information of the target job into a preset parsing algorithm, determine a process identifier corresponding to the target job, and determine process information corresponding to the target job based on the process identifier.

[0076] In this embodiment, the job scheduling system can call the computing node to execute step 202. The preset parsing algorithm can be deployed in the computing node. The computing node determines the job ID of each target job based on the basic information of the target job, and inputs the job ID as an input parameter into the parsing algorithm to obtain a process identifier corresponding to the job ID. For example, the process identifier can be a process ID. After obtaining the process ID, the computing node can obtain detailed information about the process corresponding to the process ID from a preset database based on the process ID; or, the computing node can also match the detailed information of the process corresponding to the process ID based on the process ID and a preset field model, that is, determine the process information corresponding to the target job, which is not limited in this embodiment.

[0077] S203, outputting the basic information of the target job and the process information of the target job to a database; the basic information and the process information of the target job in the database can be displayed in a display interface of the job scheduling system.

[0078] The job scheduling system may call the management node to execute an operation of outputting basic information and process information of the target job to the database.

[0079] In this embodiment, after determining the process information corresponding to each target job, the computing node can pass the process information corresponding to each target job to the management node, and the management node can directly store the process information and basic information corresponding to each target job in the database; optionally, in order to ensure the validity of the process information of the target job, the management node can also perform validity detection on the process information of the target job, for example, write the process information of the job into a specified file, detect whether the data in the file is empty, and if it is not empty, output the process information to the database. This embodiment does not limit this.

[0080] In the above-mentioned job tracking method, the job scheduling system obtains the basic information of the target job in the job scheduling system, inputs the basic information of the target job into a preset parsing algorithm, determines the process identifier corresponding to the target job, determines the process information corresponding to the target job based on the process identifier, and outputs the basic information of the target job and the process information of the target job to a database. In this method, the job scheduling system can determine the process identifier corresponding to the job based on the obtained basic information of the job according to a preset parsing algorithm, thereby determining the detailed information of the process corresponding to the job based on the process identifier, achieving the purpose of monitoring and tracking the detailed information of the process of the job in the job scheduling system, outputting the obtained basic information and process information of the job to a database, and further data mining and analysis can be performed based on the basic information and process information of the job to provide data support for optimizing job scheduling.

[0081] The job scheduling system can determine the basic information of the current newly added job based on the basic information of the historical jobs. The job scheduling system can call the management node to execute Figure 3 , Figure 4 The steps involved in the embodiment. In one embodiment, as Figure 3 As shown, the basic information of the target job in the job scheduling system is obtained, including:

[0082] S301. According to a preset sampling frequency, basic information of a first job whose job status is a running status at a current sampling time in a job scheduling system is obtained.

[0083] The preset sampling frequency can be set to 60s / time; the job scheduling system can configure a timed task in the management node, that is, the management node obtains the basic information of the job in the job scheduling system according to the preset sampling frequency. Optionally, in order to further improve the effectiveness of obtaining the information of the job, the management node can obtain the basic information of the job according to the running status of the job, for example, the management node only obtains the basic information of the job when the current job status is the running status.

[0084] In this embodiment, the management node can call the job monitoring script monitor_job.sh script to determine whether there is a running job. If there is, call the crawling job script analysis_job.sh script to obtain the basic information of the running job at the current sampling time as the basic information of the first job. Optionally, the management node can write the basic information of the first job into the cur.jobs file.

[0085] S302: Obtain basic information of a second job whose job status is running at the last sampling time in the job scheduling system.

[0086] In this embodiment, the job scheduling system can call the management node to obtain the basic information of the job obtained at the last sampling moment from the historical information database. The basic information of the job obtained at the last sampling moment is the basic information of the job in the running state obtained by the management node at the last sampling moment, which is used as the basic information of the second job. Optionally, the basic information of the job obtained at each sampling moment can be written into a corresponding file, and the management node can also obtain the basic information of the job at the last sampling moment from the pre.jobs file that records the basic information of the job at the last sampling moment.

[0087] S303: Determine basic information of the target job according to basic information of the first job and basic information of the second job.

[0088] The job scheduling system calls the management node to determine the basic information of the target job. The management node can determine the intersection of the basic information of the first job and the basic information of the second job based on the basic information of the first job, and determine the information of the remaining jobs as the basic information of the target job. Alternatively, the management node can directly determine the difference between the basic information of the first job and the basic information of the second job, and determine the difference as the basic information of the target job.

[0089] Among them, Figure 4 As shown, according to the basic information of the first job and the basic information of the second job, the basic information of the target job is determined, including:

[0090] S401: Determine a difference set between the first job and the second job according to basic information of the first job and basic information of the second job.

[0091] In this embodiment, for example, the management node determines the difference set based on the cur.jobs file corresponding to the basic information of the first job and the pre.jobs file corresponding to the basic information of the second job, and can overwrite the content of the cur.jobs file with the content of the pre.jobs file to determine the difference set between the first job and the second job.

[0092] S402: Determine the job in the difference set as the target job, and determine basic information of the target job.

[0093] In this embodiment, the management node determines the job in the difference set as the target job, and determines the basic information of the job in the difference set as the basic information of the target job, that is, the target job is a job newly added at the current sampling time, which is not limited in this embodiment.

[0094] In this embodiment, the job scheduling system calls the management node to determine the basic information of the newly added job based on the information obtained at the current sampling time and the information obtained at the previous sampling time. This method can simply and effectively determine the target job and improve the effectiveness of the basic information of the job.

[0095] The job scheduling system can call the computing nodes to execute Figure 5 The steps involved in the embodiment, in one embodiment, are as follows: Figure 5 As shown, the basic information of the target job is input into a preset parsing algorithm to determine the process identifier corresponding to the target job, and based on the process identifier, the process information corresponding to the target job is determined, including:

[0096] S501: Input the basic information of the target job into the recursive function of the parsing algorithm to determine the process identifier of the target job.

[0097] The process identifier may be a process ID. In this embodiment, after the management node determines the basic information of the target job, the management node may pass the basic information of the target job to the computing node. After receiving the basic information of the target job, the computing node uses the job ID in the basic information of the target job as an input parameter, inputs it into the recursive function of the preset parsing algorithm, obtains the number of processes related to the target job, and determines the process ID corresponding to the target job. The job scheduling system may deploy the parsing script analysis_job.sh script in the computing node, and the parsing script includes the parsing algorithm.

[0098] S502: Determine the process information of the target job according to the process identifier of the target job and a preset field model.

[0099] The process identifier of the target job may be a process ID. In this embodiment, the computing node may match the detailed information of the process corresponding to the process ID from a preset field model according to the process identifier of the target job to determine the process information corresponding to the target job. Alternatively, the computing node may also call the Linux command ps-ef according to the process identifier of the target job to obtain the detailed information of the process corresponding to the target job. Optionally, after obtaining the process information of the target job, the computing node may also pass the process information to the management node, which is not limited in this embodiment.

[0100] In this embodiment, the job scheduling system calls the computing node to determine the process identifier corresponding to the target job based on the basic information of the target job, and then determines the detailed information of the process corresponding to the target job based on the process identifier, thereby realizing information tracking of the process corresponding to the job.

[0101] After obtaining the process information of the job, the job scheduling system can output the process information and basic information of the job to the database. The job scheduling system can call the management node to execute Figure 6 , Figure 7 , Figure 8 , Fig. 9 The steps involved in the embodiment. In one embodiment, as Figure 6 As shown, the basic information of the target job and the process information of the target job are output to the database, including:

[0102] S601. Write the basic information and process information of the target job into a designated file according to a preset writing format.

[0103] In this embodiment, after receiving the process information of the target job transmitted by the computing node, the management node writes the basic information and process information of the target job into the specified file under the instruction directory according to the preset writing format. Optionally, the management node can write the basic information and process information of the target job into the specified file under the instruction directory based on the monitor_job.sh script. For example, the preset writing format can be job id: timestamp: hostname.

[0104] To further improve the effectiveness of writing information in the specified file, optionally, in one embodiment, Figure 7 As shown, according to the preset writing format, the basic information and process information of the target job are written to the specified file, including:

[0105] S701: Check whether the process information of the target job is empty.

[0106] In this embodiment, the management node determines whether the process information of each target job is empty according to the process information of the target job returned by the computing node, wherein the management node may call the monitor_job.sh script to detect whether the process information of the target job is empty.

[0107] S702: If the process information of the target job is not empty, write the basic information and process information of the target job into a first designated file according to a preset writing format.

[0108] In this embodiment, if the management node determines that the process information of the target job is not empty, the basic information and process information of the target job are written into the first designated file in the designated directory according to the above-mentioned preset writing format. For example, the first designated file may be the / process / prcess_result / id:timestamp:hostname file.

[0109] S703: If the process information of the target job is empty, write the basic information of the target job into a second designated file in the designated directory according to the writing format.

[0110] In the process of parsing the designated files, the priority of the first designated file is higher than that of the second designated file.

[0111] In this embodiment, when the management node determines that the process information of the target job is empty, the job ID in the basic information of the target job can be directly written into the second designated file in the designated directory. The second designated file can be / prcess / prcocess_no_result / id:timestamp:hostname.

[0112] Optionally, after the management node writes the job ID with empty process information into the / prcess / prcocess_no_result / id:timestamp:hostname file, the management node can read the file, call the retry script retry_analysis_job.sh corresponding to the retry analysis algorithm, parse the job again, and save the parsing result into the / process / prcess_result / id:timestamp:hostname file. Optionally, after determining that the process information of the job in the / prcess / prcocess_no_result / id:timestamp:hostname file is output to the / process / prcess_result / id:timestamp:hostname file through retry parsing, the management node can delete the / prcess / prcocess_no_result / id:timestamp:hostname file.

[0113] S602: Parse the designated file according to a preset parsing frequency to obtain a first parsing result of the target job.

[0114] The program reads the result file regularly and stores it in the database: The program reads the result of the Linux script regularly. The file naming format under this directory is: job id: timestamp: hostname. The file under this directory is read regularly and then the data is stored in the database.

[0115] In this embodiment, the management node periodically parses the designated files in the designated directory according to the preset parsing frequency. Optionally, if the designated directory includes a first designated file and a second designated file, the parsing is performed in the order of priority of the first designated file and the second designated file. That is, the management node parses the first designated file first, and parses the second designated file after parsing the first designated file. The parsing process of the management node is to read the data in the first designated file / the second designated file line by line, perform corresponding processing according to the read data, and then obtain the parsing results of the first designated file and the parsing results of the second designated file respectively.

[0116] Optional, such as Figure 8 As shown, the management node parses the specified file according to the preset parsing frequency to obtain the first parsing result of the target job, including:

[0117] S801. Scan the process information of the target job in the specified file line by line according to a preset parsing frequency.

[0118] In this embodiment, the management node processes each line of data in the specified file cyclically according to a preset parsing frequency. Optionally, the management node may insert each line of data into a specified collection.

[0119] S802. Determine whether the process information corresponding to the current row contains a preset value; the preset value is a field in a preset application name configuration file of the job in the job scheduling system.

[0120] In this embodiment, the management node determines whether each row of data contains a preset value. Optionally, the management node can scan each row of data to determine whether the cmd column of each row of data contains a field in the application name configuration file. If not, execute step 803; if contained, execute step 804.

[0121] S803: If the preset value is not included, the process information of the current row is discarded.

[0122] In this embodiment, if the management node determines that the data in this row does not contain the preset value, the data in this row is discarded.

[0123] S804: If the preset value is included, the process information of the current row is determined as the first parsing result.

[0124] In this embodiment, the management node includes a preset value in determining the process information of the current row. Optionally, the management node can obtain the application type corresponding to the current job based on the process information, and determine the application type, basic information, process information and other data of the job as the first analysis result.

[0125] In another case, in one embodiment, the method further includes:

[0126] If there are multiple consecutive lines of process information that do not contain the preset value, the value of the preset column of the multiple consecutive lines of process information is obtained, and the value of the preset column is determined as the first parsing result.

[0127] In this embodiment, during the process of parsing the specified file, the management stage determines that there are several consecutive lines of process information that do not contain the preset value. At this time, the management node obtains the value of the preset column, that is, the management node obtains the attribute value of the specified column, and determines the attribute value as the first parsing result; or, the management node can also obtain the data before the first space in the cmd column of the last line, and use the data as the first parsing result.

[0128] S603: Output the first parsing result of the target job to a database.

[0129] In this embodiment, the management node stores the first parsing result of the target job obtained by parsing in a database. Optionally, the job scheduling system can perform data analysis on the target job based on the first parsing result of the target job in the database, and display the first parsing result, analysis result and other data of the target job in the display interface of the job scheduling system. This embodiment does not limit this.

[0130] In this embodiment, after the management node obtains the process information of the target job, it detects whether the process information of the target job is empty while outputting the process information and basic information of the target job to the database, and writes the corresponding information into the corresponding designated file according to the detection result, thereby performing a validity check on the process information of the target job, thereby further ensuring the validity of the target job information output to the database.

[0131] In order to ensure the integrity of the specified file, in one embodiment, Fig. 9 As shown, before parsing the specified file according to the preset parsing frequency to obtain the first parsing result of the target job, it also includes:

[0132] S901. Determine whether writing of a specified file is complete according to a timestamp of the specified file and a current timestamp of a job scheduling system.

[0133] In this embodiment, the management node compares the time difference between the timestamp of the specified file and the current timestamp of the job scheduling system. If the timestamp of the specified file is less than the current timestamp of the job scheduling system, it means that the writing action of the specified file may have been completed; if the timestamp of the specified file is equal to the current timestamp of the job scheduling system, it means that the writing action of the specified file may have been completed, or the specified file may have been in the writing process.

[0134] S902: If the difference between the timestamp of the designated file and the current timestamp is greater than a preset time threshold, a step of parsing the designated file according to a preset parsing frequency to obtain a first parsing result of the target job is performed.

[0135] in,

[0136] In this embodiment, in order to further ensure that the writing of the specified file is completed, the management node can calculate the difference between the timestamp of the specified file and the current timestamp. When the difference is greater than the preset time threshold, that is, when the timestamp of the specified file stays for a period of time, it can be determined that the writing of the specified file is completed. At this time, the specified file is parsed according to the preset parsing frequency to ensure the integrity of the data in the specified file.

[0137] In this embodiment, the management node determines the writing status of the specified file based on the difference between the timestamp of the specified file and the current timestamp, ensuring that the step of parsing the specified file is executed after the writing of the specified file is completed, thereby ensuring the integrity of the data in the specified file and improving the efficiency of parsing the specified file.

[0138] In order to better illustrate the above method, Fig.10 As shown, this embodiment provides a job tracking method, which specifically includes:

[0139] S101, according to a preset sampling frequency, obtaining basic information of a first job whose job status is a running status at a current sampling time in a job scheduling system;

[0140] S102, obtaining basic information of a second job whose job status is running at the last sampling time in the job scheduling system;

[0141] S103, determining a difference set between the first job and the second job according to the basic information of the first job and the basic information of the second job;

[0142] S104, determining the job in the difference set as the target job, and determining basic information of the target job;

[0143] S105, inputting the basic information of the target job into the recursive function of the parsing algorithm to determine the process identifier of the target job;

[0144] S106, determining the process information of the target job according to the process identifier of the target job and a preset field model;

[0145] S107, detecting whether the process information of the target job is empty;

[0146] S108, if the process information of the target job is not empty, writing the basic information and process information of the target job into the first designated file according to a preset writing format;

[0147] S109, if the process information of the target job is empty, writing the basic information of the target job into a second designated file in the designated directory according to the writing format;

[0148] S110, determining whether the writing of the specified file is complete according to the timestamp of the specified file and the current timestamp of the job scheduling system;

[0149] S111, if the difference between the timestamp of the specified file and the current timestamp is greater than a preset time threshold, scanning the process information of the target job in the specified file line by line according to a preset parsing frequency;

[0150] S112, determining whether the process information corresponding to the current row contains a preset value; the preset value is a field in a preset application name configuration file of the job in the job scheduling system;

[0151] S113, if the preset value is not included, discard the process information of the current row;

[0152] S114: If the preset value is included, the process information of the current row is determined as the first parsing result;

[0153] S115. If there are multiple consecutive lines of process information that do not contain the preset value, obtain the value of the preset column of the multiple consecutive lines of process information, and determine the value of the preset column as the first parsing result;

[0154] S116: Output the first parsing result of the target job to the database.

[0155] In this embodiment, in this method, the job scheduling system can determine the process identifier corresponding to the job based on the acquired basic information of the job and according to a preset parsing algorithm, thereby determining the detailed information of the process corresponding to the job based on the process identifier, thereby achieving the purpose of monitoring and tracking the process details of the job in the job scheduling system, and outputting the obtained basic information and process information of the job to a database, and further data mining and analysis can be performed based on the basic information and process information of the job to provide data support for optimizing job scheduling.

[0156] The implementation principle and technical effect of the job tracking method provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0157] It should be understood that although Figure 2-10 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-10At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0158] In one embodiment, Fig.11 As shown, a work tracking device is provided:

[0159] Acquisition module 01, used to acquire basic information of target job in job scheduling system;

[0160] The parsing module 02 is used to parse the target job according to the basic information of the target job and a preset parsing algorithm to determine the process information of the target job;

[0161] The output module 03 is used to output the basic information of the target job and the process information of the target job to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

[0162] In one of the optional embodiments, the acquisition module 01 is used to obtain the basic information of the first job whose job status is running at the current sampling time in the job scheduling system according to a preset sampling frequency; obtain the basic information of the second job whose job status is running at the previous sampling time in the job scheduling system; and determine the basic information of the target job based on the basic information of the first job and the basic information of the second job.

[0163] In one optional embodiment, the acquisition module 01 is used to determine a difference set between the first job and the second job according to basic information of the first job and basic information of the second job; determine the job in the difference set as the target job, and determine basic information of the target job.

[0164] In one of the optional embodiments, the parsing module 02 is used to input the basic information of the target job into the recursive function of the parsing algorithm to determine the process identifier of the target job; and determine the process information of the target job based on the process identifier of the target job and a preset field model.

[0165] In one of the optional embodiments, the output module 03 is used to write the basic information and process information of the target job into a specified file according to a preset writing format; parse the specified file according to a preset parsing frequency to obtain a first parsing result of the target job; and output the first parsing result of the target job to a database.

[0166] In one of the optional embodiments, the output module 03 is used to detect whether the process information of the target job is empty; if the process information of the target job is not empty, the basic information and process information of the target job are written into the first designated file according to a preset writing format; if the process information of the target job is empty, the basic information of the target job is written into the second designated file in the designated directory according to the writing format; wherein, in the process of parsing the designated file, the priority of the first designated file is greater than that of the second designated file.

[0167] In one of the optional embodiments, the output module 03 is used to scan the process information of the target job in the specified file line by line according to a preset parsing frequency; determine whether the process information corresponding to the current line contains a preset value; the preset value is a field in the preset application name configuration file of the job in the job scheduling system; if the preset value is not contained, the process information of the current line is discarded; if the preset value is contained, the process information of the current line is determined as the first parsing result.

[0168] In one of the optional embodiments, the output module 03 is further used to obtain the value of a preset column of the multiple consecutive lines of process information if there are multiple consecutive lines of process information that do not contain the preset value, and determine the value of the preset column as the first parsing result.

[0169] In one of the optional embodiments, the output module 03 is also used to determine whether the writing of the specified file is completed based on the timestamp of the specified file and the current timestamp of the job scheduling system; if the difference between the timestamp of the specified file and the current timestamp is greater than a preset time threshold, the step of parsing the specified file according to the preset parsing frequency to obtain the first parsing result of the target job is executed.

[0170] For the specific definition of the operation tracking device, please refer to the definition of the operation tracking method above, which will not be repeated here. Each module in the above-mentioned operation tracking device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0171] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.12As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a job tracking method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0172] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0173] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0174] Obtain basic information of target jobs in the job scheduling system;

[0175] Inputting basic information of the target job into a preset parsing algorithm, determining a process identifier corresponding to the target job, and determining process information corresponding to the target job based on the process identifier;

[0176] The basic information of the target job and the process information of the target job are output to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

[0177] The implementation principle and technical effect of the computer device provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0178] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0179] Obtain basic information of the target job in the job scheduling system;

[0180] Inputting basic information of the target job into a preset parsing algorithm, determining a process identifier corresponding to the target job, and determining process information corresponding to the target job based on the process identifier;

[0181] The basic information of the target job and the process information of the target job are output to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

[0182] The computer-readable storage medium provided in the above embodiment has similar implementation principles and technical effects as those of the above method embodiment, and will not be described in detail here.

[0183] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for tracking a job, characterized in that: Applied in a job scheduling system, the method comprises: The management node in the job scheduling system obtains basic information of the target job in the job scheduling system; the basic information includes job ID, job status, and server node information for executing the job; The computing node in the job scheduling system inputs the basic information of the target job into a preset parsing algorithm, determines the process identifier corresponding to the target job, and determines the process information corresponding to the target job based on the process identifier; The management node in the job scheduling system detects whether the process information of the target job is empty; If the process information of the target job is not empty, writing the basic information and process information of the target job into the first designated file according to a preset writing format; If the process information of the target job is empty, writing the basic information of the target job into a second designated file in a designated directory according to the writing format; wherein, in the process of parsing the designated file, the priority of the first designated file is higher than that of the second designated file; Parsing the designated file according to a preset parsing frequency to obtain a first parsing result of the target job; The first parsing result of the target job is output to a database; basic information and process information of the target job in the database are displayed in a display interface of the job scheduling system.

2. The method according to claim 1, characterized in that The obtaining of basic information of the target job in the job scheduling system includes: According to a preset sampling frequency, basic information of a first job in the job scheduling system whose job status is a running state at a current sampling time is obtained; Obtain basic information of a second job whose job status is running at the last sampling time in the job scheduling system; The basic information of the target job is determined according to the basic information of the first job and the basic information of the second job.

3. The method according to claim 2, characterized in that The determining the basic information of the target job according to the basic information of the first job and the basic information of the second job includes: Determine a difference set between the first job and the second job according to the basic information of the first job and the basic information of the second job; The job in the difference set is determined as the target job, and basic information of the target job is determined.

4. The method according to claim 1, characterized in that: The step of inputting the basic information of the target job into a preset parsing algorithm, determining a process identifier corresponding to the target job, and determining the process information corresponding to the target job based on the process identifier includes: Inputting the basic information of the target job into the recursive function of the parsing algorithm to determine the process identifier of the target job; The process information of the target job is determined according to the process identifier of the target job and a preset field model.

5. The method according to claim 1, characterized in that: The step of parsing the designated file according to a preset parsing frequency to obtain a first parsing result of the target job includes: Scanning the process information of the target job in the specified file line by line according to a preset parsing frequency; Determine whether the process information corresponding to the current row contains a preset value; the preset value is a field in a preset application name configuration file of the job in the job scheduling system; If the preset value is not included, the process information of the current row is discarded; If the preset value is included, the process information of the current row is determined as the first parsing result.

6. The method according to claim 5, characterized in that The method further comprises: If there are multiple consecutive lines of process information that do not contain the preset value, the value of the preset column of the multiple consecutive lines of process information is obtained, and the value of the preset column is determined as the first parsing result.

7. The method according to claim 1, characterized in that Before parsing the designated file according to the preset parsing frequency to obtain the first parsing result of the target job, the method further includes: Determining whether the writing of the designated file is completed according to the timestamp of the designated file and the current timestamp of the job scheduling system; the writing format of the designated file includes timestamp information; If the difference between the timestamp of the designated file and the current timestamp is greater than a preset time threshold, the step of parsing the designated file according to the preset parsing frequency to obtain the first parsing result of the target job is performed.

8. A job scheduling system, characterized in that: The system includes a management node and a computing node; Calling the management node to obtain basic information of the target job in the job scheduling system; the basic information includes job ID, job status, and server node information for executing the job; Calling the computing node, inputting the basic information of the target job into a preset parsing algorithm, determining a process identifier corresponding to the target job, and determining the process information corresponding to the target job based on the process identifier; Calling the management node to detect whether the process information of the target job is empty; if the process information of the target job is not empty, writing the basic information and process information of the target job into a first designated file according to a preset writing format; If the process information of the target job is empty, the basic information of the target job is written into the second designated file in the designated directory according to the writing format; wherein, in the process of parsing the designated file, the priority of the first designated file is greater than that of the second designated file; according to the preset parsing frequency, the designated file is parsed to obtain a first parsing result of the target job; the first parsing result of the target job is output to the database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

9. A work tracking device, characterized in that: The device comprises: An acquisition module is used to call a management node in a job scheduling system to acquire basic information of a target job in the job scheduling system; the basic information includes a job ID, a job status, and information of a server node executing the job; The parsing module is used to call the computing node in the job scheduling system to parse the target job according to the basic information of the target job and a preset parsing algorithm, and determine the process information of the target job; An output module is used to call the management node in the job scheduling system to detect whether the process information of the target job is empty; if the process information of the target job is not empty, the basic information and process information of the target job are written into a first designated file according to a preset writing format; if the process information of the target job is empty, the basic information of the target job is written into a second designated file in a designated directory according to the writing format; wherein, in the process of parsing the designated file, the priority of the first designated file is greater than that of the second designated file; according to a preset parsing frequency, the designated file is parsed to obtain a first parsing result of the target job; the first parsing result of the target job is output to a database; the basic information and process information of the target job in the database can be displayed in the display interface of the job scheduling system.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • System and method of cloud computing application automatic deployment

    CN103092698A

  • Method for viewing and operating application graphical interface in job dispatching software

    CN103677840A

  • Method and device for monitoring application execution performance and high-performance computing system

    CN106354616A

  • Method and apparatus for monitoring real-time computation

    CN106371968A

  • Data query method and apparatus

    CN108268476A