Job task exception processing method and device, equipment and medium
By obtaining and identifying the operation log of the job task, determining the target exception source and executing the corresponding exception handling script, the problem of low efficiency in manual debugging of exception status is solved, and efficient and accurate job task exception handling is achieved.
Patent Information
- Application Number
- CN202411789291.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, manual debugging of abnormal state jobs is less efficient, and it is difficult to effectively deal with abnormal operation of job tasks in computer systems.
By obtaining the run log of the job task, identifying the job information in the log, determining the target exception source, and obtaining the exception handling script, executing the script to handle exceptions.
This method can perform different exception handling methods for different target exception sources, refine job task exception handling operations, and significantly improve the efficiency and accuracy of job task exception handling.
Smart Images

Figure CN119621404A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and medium for handling abnormal operation tasks. Background Art
[0002] With the rapid development of science and technology, various computer systems are increasingly used in all aspects of people's lives. However, during the execution of various tasks in the computer system, operational anomalies may occur, requiring maintenance of the tasks.
[0003] Currently, the operation status of job tasks is monitored manually and abnormal operation status is manually maintained.
[0004] However, manual debugging of abnormal status jobs is inefficient. Summary of the Invention
[0005] The present invention provides a method, device, equipment and medium for handling abnormal operation tasks, so as to improve the accuracy of handling abnormal operation tasks.
[0006] In a first aspect, an embodiment of the present invention provides a method for handling job exceptions, the method comprising:
[0007] Get the running log corresponding to the job task;
[0008] Identify the operation log corresponding to the job task and obtain the job information corresponding to the job task;
[0009] Determine the target exception source corresponding to the task based on the task information corresponding to the task;
[0010] Obtain the exception handling script corresponding to the target exception source and execute the exception handling script to perform exception handling on the job task.
[0011] In a second aspect, an embodiment of the present invention further provides a device for handling abnormal tasks, the device comprising:
[0012] The log acquisition module is used to obtain the running log corresponding to the job task;
[0013] The log identification module is used to identify the operation log corresponding to the job task and obtain the job information corresponding to the job task;
[0014] The abnormality source determination module is used to determine the target abnormality source corresponding to the operation task based on the operation information corresponding to the operation task;
[0015] The job maintenance module is used to obtain the exception handling script corresponding to the target exception source and execute the exception handling script to perform exception handling on the job task.
[0016] In a third aspect, an embodiment of the present invention further provides a device for handling abnormal tasks, the device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the method for handling job exceptions according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the job task exception handling method according to any embodiment of the present invention when executed.
[0021] The technical solution of the embodiment of the present invention obtains the operation log corresponding to the job task; identifies the operation log corresponding to the job task to obtain the job information corresponding to the job task; determines the target exception source corresponding to the job task based on the job information corresponding to the job task; obtains the exception handling script corresponding to the target exception source, executes the exception handling script to perform exception handling on the job task, and executes different exception handling methods for different target exception sources, thereby refining the job task exception handling operation and improving the efficiency of job task exception handling.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 This is a flowchart of a method for handling job exceptions provided in accordance with an embodiment of the present invention;
[0025] Figure 2 This is a flowchart of a method for handling job exceptions provided in accordance with an embodiment of the present invention;
[0026] Figure 3This is a structural diagram of a device for handling abnormal tasks according to an embodiment of the present invention;
[0027] Figure 4 The present invention is a schematic diagram of a device for handling abnormal tasks according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] In the technical solutions of the embodiments of the present invention, the acquisition, storage and application of operation logs, etc. are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0031] The information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0032] Example 1
[0033] Figure 1 This is a flowchart of a method for handling a task exception provided in Example 1 of the present invention. This embodiment of the present invention is applicable to situations where a task exception is handled. This method can be performed by a task exception handling device, which can be implemented in the form of hardware and / or software.
[0034] See also Figure 1 The method for handling job task exceptions shown includes:
[0035] S101: Obtain the operation log corresponding to the job task.
[0036] A job task is a piece of work submitted by a user to the system. It is the work a user requests the computer to perform during a transaction or computation. A job consists of a series of ordered steps, and its completion process includes four phases: job submission, job acceptance, job execution, and job completion. A run log is a detailed file that records the execution of a job task, including information about the job's lifecycle, system messages, and application output. By viewing the job log, you can obtain detailed information about the job's execution process, including its start and end times. This helps improve the analysis and optimization of job performance. Furthermore, the job log helps track the progress of the job and promptly identify and resolve issues that arise during the execution of the job. To obtain the corresponding run log for a job task, you can preset a log storage directory and query the files in the preset storage directory using a query algorithm. You can also obtain the run log by running command statements.
[0037] S102: Identify the operation log corresponding to the job task and obtain the job information corresponding to the job task.
[0038] The job information may be descriptive information about the running status of the job task.
[0039] Specifically, by identifying the operation log corresponding to the job task, at least one job attribute corresponding to the job task and the job attribute value corresponding to each of the job attributes can be obtained. Job information corresponding to the job task is determined based on each of the job attributes and the job attribute value. The job information corresponding to different job tasks can be the same. Different operation conditions of the same job task may correspond to different job information.
[0040] S103: Determine the target abnormality source corresponding to the operation task according to the operation information corresponding to the operation task.
[0041] The target exception source can be used to describe the cause of the job information exception.
[0042] Specifically, there is a one-to-one correspondence between job tasks and job information. If a job task encounters an operational anomaly during execution, the target anomaly source corresponding to the job task is determined based on the anomaly information in the corresponding operation log. If no operational anomaly occurs during execution and the corresponding operation log contains no anomaly information, the job task is determined to have no target anomaly source.
[0043] S104: Obtain an exception handling script corresponding to the target exception source, and execute the exception handling script to perform exception handling on the job task.
[0044] A script can be an executable file written in a specific descriptive language according to a certain format. Scripts are typically stored in text format and contain a series of actions that control computer operations. Scripting languages are called dynamic languages because they are interpreted or compiled when they are called, rather than compiled at compile time like binary programs. Scripts have a wide range of uses, including web design, automated tasks, and system management. The scripting language can be Java. An exception handling script can be a script that maintains job exceptions corresponding to the target exception source.
[0045] Specifically, each target exception source corresponds to an exception handling script. Based on the type of target exception source, the exception handling script corresponding to the target exception source is obtained. By executing the exception handling script, the job task is maintained to ensure the normal operation of the job task. The exception handling script corresponding to the target exception source can be obtained using methods including, but not limited to, sequential search algorithms, binary search algorithms, hash search algorithms, block search algorithms, or tree table search algorithms, etc., which are not limited in this embodiment of the present invention.
[0046] The technical solution of the embodiment of the present invention obtains the operation log corresponding to the job task; identifies the operation log corresponding to the job task to obtain the job information corresponding to the job task; determines the target exception source corresponding to the job task based on the job information corresponding to the job task; obtains the exception handling script corresponding to the target exception source, executes the exception handling script to perform exception handling on the job task, and executes different exception handling methods for different target exception sources, thereby refining the job task exception handling operation and improving the efficiency of job task exception handling.
[0047] Example 2
[0048] Figure 2 This is a flow chart of a method for handling abnormal tasks in a second embodiment of the present invention. Based on the above embodiments, this embodiment of the present invention optimizes and improves the operation of handling abnormal tasks.
[0049] Furthermore, "obtain the exception handling script corresponding to the target exception source, execute the exception handling script, and perform exception handling on the job task" is refined into "obtain the exception handling script corresponding to the target exception source, and the exception handling script includes: skipping the execution script or re-executing the script; if the target exception source is the first exception source, executing the skip execution script; if the target exception source is the second exception source, executing the re-execution script" to improve the operation of job task exception handling.
[0050] It should be noted that for parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.
[0051] See also Figure 2 The method for handling job task exceptions shown includes:
[0052] S201: Obtain the operation log corresponding to the job task.
[0053] S202: Identify the operation log corresponding to the job task and obtain the job information corresponding to the job task.
[0054] S203: Determine the target abnormality source corresponding to the operation task according to the operation information corresponding to the operation task.
[0055] S204: Obtain an exception handling script corresponding to the target exception source. The exception handling script includes: skipping the execution script or re-executing the script.
[0056] The skip execution script may be a script that handles exceptions by temporarily skipping the current task and not executing the task. The re-execution script may be a script that handles exceptions by re-executing the current task.
[0057] Specifically, obtain the exception handling script corresponding to the target exception source. The exception handling methods corresponding to each target exception source can be divided into two categories, one is skipping execution, and the other is re-execution. For example, the skipping execution script means that if there is abnormal data in the running log of the current job task, the current job task will be suspended first, and the next job task to be executed corresponding to the current job task will be executed. When executing the job task to be executed, the data file required for exception handling is obtained for the current job task. After the execution of the job task to be executed is completed, the current job task will be executed. The re-execution script means that if there is abnormal data in the running log of the current job task, the data resources corresponding to the current job task will be re-obtained, and the current job task will be re-executed. If it is difficult to perform exception maintenance in a short time during the job task exception handling, the skipping execution script will be called, otherwise the re-execution script will be called.
[0058] S205: If the target exception source is the first exception source, skip executing the script.
[0059] The first abnormal source may be of the same type as the target abnormal source.
[0060] Specifically, if the target exception source belongs to the first exception source type, indicating that data resource acquisition is unavailable within a short period of time, the script is skipped. For example, the first exception source could be a parent task exception or memory overflow. Through distributed job management, the current task is skipped and the next pending task is executed. The data resources required by the current task are acquired. After the pending task is completed and the data resource preparation is complete, the current task is resumed.
[0061] S206: If the target exception source is the second exception source, re-execute the script.
[0062] The second abnormal source may be of the same type as the target abnormal source.
[0063] Specifically, if the target exception source belongs to the second exception source type, the re-execution script is executed. For example, the second exception source can be an empty line in a file or a connection timeout. The second exception source is that the current job task can re-acquire the required data resources in a short time, and the current job task is re-executed after the required data resources are acquired.
[0064] The embodiment of the present invention obtains the exception handling script corresponding to the target exception source, and the exception handling script includes: skipping the execution script or re-executing the script; if the target exception source is the first exception source, executing the skipping execution script; if the target exception source is the second exception source, executing the re-executing script, performing different operations for different target exception sources, refining the job task exception handling method, and improving the accuracy of handling exceptions corresponding to the target exception source.
[0065] Optionally, if the first exception source is a parent task exception or a memory overflow, the execution script is skipped, including: if the target exception source is a parent task exception, the execution order of the job tasks is obtained, at least one parent task corresponding to the job task is queried, at least one long-unexecuted task corresponding to each parent task is obtained, and each long-unexecuted task is executed; if the target exception source is a memory overflow, at least one first execution task and a second execution task corresponding to the job task are obtained, each first execution task is terminated, the second execution task is driven to run, the initial version file corresponding to each first execution task is obtained, and after the second execution task is completed, each first execution task is driven to re-execute according to the task driving module.
[0066] Among them, the "parent task exception" can be used to describe the abnormal operation of a task that has a dependency on the current task. The "long-term unexecuted task" can be used to describe a task that has not been executed for a long time. The "memory overflow" can be used to describe the situation where memory space overflows during the operation of a task. The "initial version file" can be used to describe the data resources required to execute the current task. The "task driver module" can be used to describe the program that drives the execution of the task.
[0067] Specifically, if the target exception source is a parent task exception, the execution order of the job task is obtained, at least one parent task corresponding to the job task is queried, the operation information corresponding to each parent task is detected, and at least one long-unexecuted task is found in each parent task. Each long-unexecuted task is executed, and when each long-unexecuted task is completed, the current job task is executed. If the target exception source is a memory overflow, at least one first execution task and a second execution task corresponding to the job task are obtained. The second execution task is the task that should be executed after the first execution task is completed. Terminate each first execution task and drive the second execution task to run. During the execution of the second execution task, the initial version file corresponding to each first execution task is obtained. After the second execution task is completed, according to the task driving module, drive each first execution task to re-execute according to the initial version file.
[0068] If the target exception source is a parent task exception, the execution order of the job task is obtained, at least one parent task corresponding to the job task is queried, at least one long-unexecuted task corresponding to each parent task is obtained, and each long-unexecuted task is executed; if the target exception source is a memory overflow, at least one first execution task and second execution task corresponding to the job task is obtained, each first execution task is terminated, the second execution task is driven to run, and the initial version file corresponding to each first execution task is obtained. After the second execution task is completed, each first execution task is driven to re-execute according to the task driving module. By executing the remaining job tasks first, time is provided for the current job task to obtain resources, which saves job time and improves exception handling efficiency.
[0069] Optionally, if the second exception source is a blank line in a file or a connection timeout, a re-execution script is executed, including: if the target exception source is a blank line in a file, obtaining at least one blank line of data corresponding to the job task, deleting each blank line of data, and re-executing the job task. If the target exception source is a connection timeout, obtaining a preset connection count threshold and the connection count corresponding to the job task, comparing the connection count corresponding to the job task with the preset connection count threshold, if the connection count corresponding to the job task is greater than the preset connection count threshold, generating an alarm message, sending the alarm message to the operation and maintenance personnel, and if the connection count corresponding to the job task is less than or equal to the preset connection count threshold, reconnecting the task.
[0070] The file blank line can be used to describe the presence of blank lines in the job execution file. The connection timeout can be used to describe the timeout of the current job task connection. The preset connection count threshold can be a preset value for the number of connections to the data transmission interface for the current job task.
[0071] Specifically, if the target exception source is a blank line in a file, then obtain at least one blank line of data corresponding to the job task, delete each blank line of data in the job task, rerun the file with the blank line data deleted, and execute the job task. If the target exception source is a connection timeout, obtain the preset connection count threshold and the connection count corresponding to the job task, compare the connection count corresponding to the job task with the preset connection count threshold. If the connection count corresponding to the job task is greater than the preset connection count threshold, indicating that the job task has failed to connect after multiple connections, an alarm message is generated and sent to the operation and maintenance personnel so that the operation and maintenance personnel can perform maintenance. If the connection count corresponding to the job task is less than or equal to the preset connection count threshold, indicating that there may be an accidental connection failure, which may be due to network delays and other problems, the task connection is then re-performed.
[0072] If the target exception source is a blank line in the file, at least one blank line of data corresponding to the job task is obtained, each blank line of data is deleted, and the job task is re-executed. If the target exception source is a connection timeout, the preset connection count threshold and the connection count corresponding to the job task are obtained, and the connection count corresponding to the job task is compared with the preset connection count threshold. If the connection count corresponding to the job task is greater than the preset connection count threshold, an alarm message is generated and sent to the operation and maintenance personnel. If the connection count corresponding to the job task is less than or equal to the preset connection count threshold, the task connection is re-performed, and the data resource can be re-processed. By judging the exception handling operation corresponding to the job task through multi-dimensional data, the accuracy of job task exception handling is improved.
[0073] Optionally, based on the job information corresponding to the job task, determine the target exception source corresponding to the job task, including: determining the exception type based on the job status and job prompt information in the job information corresponding to the job task; adding the identifier of the target exception source corresponding to the exception type to the job task based on the exception type; obtaining the exception handling script corresponding to the target exception source, including: querying the exception handling script corresponding to the target exception source based on the identifier of the target exception source.
[0074] The job status can be used to describe the running status of the job task. The job prompt information can be used to describe the abnormal prompt information during the running of the job task. The exception type can be the type of exception that occurred in the job task.
[0075] Specifically, if the job is in normal state and there is no other abnormal information, the corresponding log will be marked as "normal operation" and marked as 0; if the job is in response state and it prompts that the file under the xxx path (absolute path) under the xxxx.xxxx.xxxx.xxxx (ip) server does not exist, then its corresponding log will be marked as "no response to the file" and marked as 1; if the job is in timeout state and there is a prompt that the parent task is not completed, it will be marked as "timeout and the previous item is not executed" and marked as 2; if the job is in timeout state and there is no other prompt state, it will be marked as "only timeout" and marked as 3; if the job is in interruption state and there is a stack in the log information If a memory overflow prompt is displayed, it is identified as "heap memory overflow interruption" and marked as 4; if the job is in an interrupted state and there is a prompt in the log information that the information directory does not exist, it is identified as "directory does not exist interruption" and marked as 5; if the job is in an interrupted state and there is a blank line in the information file in the log information, it is identified as "file blank line interruption" and marked as 6; if the job is in an interrupted state and there is a database connection timeout in the log information, it is identified as "database connection timeout interruption" and marked as 7; if the job is in an interrupted state and there is a main logic error prompt in the log information, it is identified as "main logic abnormal interruption" and marked as 8. Different exception handling scripts are queried according to different identifiers. The query method can be a depth-first traversal algorithm or a breadth-first algorithm, etc., which is not limited by the embodiment of the present invention.
[0076] The exception type is determined based on the job status and job prompt information in the job information corresponding to the job task; based on the exception type, the identifier of the target exception source corresponding to the exception type is added to the job task; based on the identifier of the target exception source, the exception handling script corresponding to the target exception source is queried, and different operations are performed for different target exception source identifiers, thereby fine-graining the exception handling operations and improving the accuracy of exception handling.
[0077] Optionally, based on the job information corresponding to the job task, the target abnormality source corresponding to the job task is determined, including: determining the job status and job prompt information corresponding to the job task based on the job information corresponding to the job task; generating sentence vector feature data based on the job status and job prompt information corresponding to the job task; inputting the sentence vector feature data into the abnormality source identification model to obtain the target abnormality source corresponding to the job task.
[0078] The sentence vector feature data may be a language representation model, which refers to adding the word vectors corresponding to the job status and job prompt information in the sentence in the run log as data representing the entire sentence.
[0079] Specifically, the job information corresponding to the job task can be identified to determine the job status and job prompt information corresponding to the job task. For example, if the job status is normal, there may be no job prompt information; if the job status is response status, the job prompt information may be that the file under the xxx path (absolute path) under the xxxx.xxxx.xxxx.xxxx (ip) server does not exist; if the job is in timeout status, the job prompt information may be that the parent task is not completed; if the job status is timeout status, there may be no other job prompt information; if the job status is interrupted, the job prompt information may be that there is a heap memory overflow in the log information; if the job status is interrupted, the job prompt information may be that there is an information directory that does not exist in the log information; if the job status is interrupted, the job prompt information may be that there is a blank line in the information file in the log information; if the job status is interrupted, the job prompt information may be that there is a database connection timeout in the log information; if the job status is interrupted, the job prompt information may be that there is a main logic error in the log information. Sentence vector feature data is generated based on the job status and job prompt information corresponding to the job task; the sentence vector feature data is input into the abnormal source identification model to obtain the target abnormal source corresponding to the job task. The anomaly source identification model can be obtained by training the InferSent model. In the InferSent model, U represents the sentence vector, and V represents the identifier, such as "normal operation" or "no response to file arrival." In this model, a bidirectional LSTM network based on the attention mechanism can be used as the sentence vector encoder. hi represents the hidden state representation, Ai represents the attention weight, and Uw is the learned query vector. The final sentence representation U is obtained by combining the attention weight and the bidirectional hidden state. Three different methods can be used to extract the correlation between the two: directly combining the vectors concatenate(U,V); element-by-element multiplication U*V; and the absolute value of the element-by-element difference |UV|. At the fully connected layer, two fully connected layers are used for the final classification calculation, and a 9-category softmax function is also connected to make a multi-class prediction for the final result.
[0080] By determining the job status and job prompt information corresponding to the job task based on the job information corresponding to the job task; generating sentence vector feature data based on the job status and job prompt information corresponding to the job task; inputting the sentence vector feature data into the abnormal source identification model to obtain the target abnormal source corresponding to the job task, and generating a sentence vector based on the job status and job prompt information corresponding to the job task, the abnormal source identification model can identify the target abnormal source based on the characteristics of the sentence vector, thereby improving the accuracy of abnormal handling of job tasks.
[0081] Optionally, the abnormality source identification model is obtained by the following steps: obtaining at least one job information and a job abnormality source corresponding to each job information; inputting each job information and the job abnormality source corresponding to each job information into the job abnormality identification model for processing to obtain a job detection source corresponding to each job information; training the job abnormality identification model according to the job abnormality source of each job information and the job detection source of each job information to obtain an abnormality source identification model.
[0082] The job abnormality source may be the cause of the job abnormality corresponding to the job information. The job detection source may be the cause of the job abnormality identified by the abnormality recognition model based on the job information.
[0083] Specifically, at least one piece of operation information and the corresponding operation anomaly source are obtained, and each piece of operation information and the corresponding operation anomaly source are input into the operation anomaly identification model for processing to obtain the operation detection source corresponding to each piece of operation information. The operation anomaly identification model is trained based on the operation anomaly source and the operation detection source of each piece of operation information until training conditions are met, thereby obtaining an anomaly source identification model. The training termination condition may be that the accuracy of the anomaly source identification model on the validation set is greater than a preset accuracy threshold, for example, the accuracy threshold may be 95%. Furthermore, the training termination condition may also be that the difference is minimized or converged, or the number of training times is greater than or equal to a preset threshold.
[0084] By obtaining at least one job information and the job abnormality source corresponding to each job information; inputting each job information and the job abnormality source corresponding to each job information into the job abnormality recognition model for processing, the job detection source corresponding to each job information is obtained; according to the job abnormality source of each job information and the job detection source of each job information, the job abnormality recognition model is trained to obtain an abnormality source recognition model. The abnormality source recognition model can be pre-trained to improve the accuracy of abnormality source recognition.
[0085] Example 3
[0086] Figure 3 This is a schematic diagram of the structure of a device for handling exceptions in a task, provided in Example 3 of the present invention. This embodiment of the present invention is applicable to situations where exceptions to task are handled. The device can execute a method for handling exceptions in a task, and the device can be implemented in the form of hardware and / or software.
[0087] See also Figure 3 The operation task exception handling device shown includes: a log acquisition module 301, a log identification module 302, an exception source determination module 303 and an operation maintenance module 304, wherein:
[0088] The log acquisition module 301 is used to obtain the operation log corresponding to the job task;
[0089] The log identification module 302 is used to identify the operation log corresponding to the job task and obtain the job information corresponding to the job task;
[0090] The abnormality source determination module 303 is used to determine the target abnormality source corresponding to the operation task based on the operation information corresponding to the operation task;
[0091] The job maintenance module 304 is used to obtain the exception handling script corresponding to the target exception source and execute the exception handling script to perform exception handling on the job task.
[0092] The technical solution of the embodiment of the present invention obtains the operation log corresponding to the job task; identifies the operation log corresponding to the job task to obtain the job information corresponding to the job task; determines the target exception source corresponding to the job task based on the job information corresponding to the job task; obtains the exception handling script corresponding to the target exception source, executes the exception handling script to perform exception handling on the job task, and executes different exception handling methods for different target exception sources, thereby refining the job task exception handling operation and improving the efficiency of job task exception handling.
[0093] Optionally, the job maintenance module 304 includes:
[0094] A script acquisition unit is used to obtain an exception handling script corresponding to a target exception source. The exception handling script includes: skipping the execution of the script or re-executing the script;
[0095] A first execution unit, configured to skip executing the script if the target exception source is the first exception source;
[0096] The second execution unit is configured to execute a re-execution script if the target exception source is the second exception source.
[0097] Optionally, the first execution unit is specifically configured to:
[0098] If the target exception source is a parent task exception, obtain the execution order of the job tasks, query to obtain at least one parent task corresponding to the job task, obtain at least one long-unexecuted task corresponding to each parent task, and execute each long-unexecuted task;
[0099] If the target exception source is memory overflow, obtain at least one first execution task and second execution task corresponding to the job task, terminate each first execution task, drive the second execution task to run, obtain the initial version file corresponding to each first execution task, and after the second execution task is completed, drive each first execution task to re-execute according to the task driving module.
[0100] Optionally, the second execution unit is specifically configured to:
[0101] If the target exception source is a blank line in the file, obtain at least one blank line of data corresponding to the job task, delete each blank line of data, and re-execute the job task.
[0102] If the target exception source is connection timeout, the preset connection count threshold and the connection count corresponding to the job task are obtained, and the connection count corresponding to the job task is compared with the preset connection count threshold. If the connection count corresponding to the job task is greater than the preset connection count threshold, an alarm message is generated and sent to the operation and maintenance personnel. If the connection count corresponding to the job task is less than or equal to the preset connection count threshold, the task connection is re-performed.
[0103] Optionally, the abnormality source determination module 303 is specifically configured to:
[0104] Determine the exception type based on the job status and job prompt information in the job information corresponding to the job task;
[0105] According to the exception type, add the target exception source identifier corresponding to the exception type to the job task;
[0106] The job maintenance module 304 is specifically used to:
[0107] According to the identifier of the target exception source, query the exception handling script corresponding to the target exception source.
[0108] Optionally, the abnormality source determination module 303 includes:
[0109] An information determination unit, configured to determine a job status and job prompt information corresponding to the job task based on job information corresponding to the job task;
[0110] A sentence vector generation unit, configured to generate sentence vector feature data based on the job status and job prompt information corresponding to the job task;
[0111] The target source identification unit is used to input the sentence vector feature data into the abnormal source identification model to obtain the target abnormal source corresponding to the job task.
[0112] Optionally, an abnormal source identification model is obtained by the following steps:
[0113] Obtain at least one piece of job information and a job exception source corresponding to each piece of job information;
[0114] Input each operation information and the operation abnormality source corresponding to each operation information into the operation abnormality identification model for processing to obtain the operation detection source corresponding to each operation information;
[0115] According to the operation abnormality source of each operation information and the operation detection source of each operation information, the operation abnormality recognition model is trained to obtain the abnormality source recognition model.
[0116] The operation task exception handling device provided in the embodiment of the present invention can execute the operation task exception handling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the operation task exception handling method.
[0117] Example 4
[0118] Figure 4 A schematic structural diagram of a job task exception handling device 400 that can be used to implement an embodiment of the present invention is shown.
[0119] like Figure 4 As shown, the operation task exception handling device 400 includes at least one processor 401 and a memory connected to the at least one processor 401, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 401 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 to the random access memory (RAM) 403. Various programs and data required for the operation task exception handling device 400 can also be stored in the RAM 403. The processor 401, ROM 402 and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0120] Multiple components in the job task exception handling device 400 are connected to an I / O interface 405, including an input unit 406, such as a keyboard and mouse; an output unit 407, such as various types of displays and speakers; a storage unit 408, such as a magnetic disk and optical disk; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the job task exception handling device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0121] Processor 401 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processor, controller, microcontroller, etc. Processor 501 executes the various methods and processes described above, such as the method for handling job task exceptions.
[0122] In some embodiments, the job task exception handling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed onto the job task exception handling device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the processor 401, one or more steps of the job task exception handling method described above may be performed. Alternatively, in other embodiments, the processor 401 may be configured to execute the job task exception handling method in any other appropriate manner (e.g., by means of firmware).
[0123] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a task exception handling device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the task exception handling device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0128] A computing system may include clients and servers. The clients and servers are generally remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS (Virtual Private Server) services.
[0129] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0130] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for handling abnormal tasks, characterized in that: The method comprises: Get the running log corresponding to the job task; Identify the operation log corresponding to the job task to obtain the job information corresponding to the job task; Determine the target abnormality source corresponding to the operation task according to the operation information corresponding to the operation task; Obtain an exception handling script corresponding to the target exception source, and execute the exception handling script to perform exception handling on the job task.
2. The method according to claim 1, characterized in that The obtaining the exception handling script corresponding to the target exception source and executing the exception handling script to perform exception handling on the job task includes: Obtaining an exception handling script corresponding to the target exception source, wherein the exception handling script includes: skipping execution of the script or re-executing the script; If the target exception source is the first exception source, executing the skip execution script; If the target exception source is the second exception source, the re-execution script is executed.
3. The method according to claim 2, characterized in that If the first exception source is a parent task exception or a memory overflow, executing the skip execution script includes: If the target exception source is a parent task exception, the execution order of the job task is obtained, at least one parent task corresponding to the job task is obtained through query, at least one long-term unexecuted task corresponding to each parent task is obtained, and each long-term unexecuted task is executed; If the target exception source is a memory overflow, obtain at least one first execution task and a second execution task corresponding to the job task, terminate each of the first execution tasks, drive the second execution tasks to run, obtain the initial version file corresponding to each of the first execution tasks, and after the second execution tasks are completed, drive each of the first execution tasks to be re-executed according to the task driving module.
4. The method according to claim 1, characterized in that: If the second exception source is a blank line in the file or a connection timeout, executing the re-execution script includes: If the target exception source is a blank line in a file, at least one blank line of data corresponding to the job task is obtained, each blank line of data is deleted, and the job task is re-executed. If the target abnormality source is a connection timeout, obtain a preset connection number threshold and the connection number corresponding to the job task, compare the connection number corresponding to the job task with the preset connection number threshold, and if the connection number corresponding to the job task is greater than the preset connection number threshold, generate an alarm message, and send the alarm message to the operation and maintenance personnel; if the connection number corresponding to the job task is less than or equal to the preset connection number threshold, reconnect the task.
5. The method according to claim 1, characterized in that The determining, according to the job information corresponding to the job task, a target abnormality source corresponding to the job task includes: Determine the abnormality type according to the job status and job prompt information in the job information corresponding to the job task; According to the exception type, adding an identifier of a target exception source corresponding to the exception type to the job task; The obtaining of the exception handling script corresponding to the target exception source includes: According to the identifier of the target exception source, query the exception handling script corresponding to the target exception source.
6. The method according to claim 1, characterized in that The determining, according to the job information corresponding to the job task, a target abnormality source corresponding to the job task includes: Determine the job status and job prompt information corresponding to the job task according to the job information corresponding to the job task; Generate sentence vector feature data according to the job status and job prompt information corresponding to the job task; The sentence vector feature data is input into an abnormal source identification model to obtain a target abnormal source corresponding to the job task.
7. The method according to claim 6, characterized in that The abnormal source identification model is obtained by the following steps: Obtain at least one piece of operation information and a job exception source corresponding to each piece of operation information; Input each of the operation information and the operation abnormality source corresponding to each of the operation information into the operation abnormality identification model for processing, so as to obtain the operation detection source corresponding to each of the operation information; The operation abnormality identification model is trained according to the operation abnormality source of each operation information and the operation detection source of each operation information to obtain the abnormality source identification model.
8. A device for handling abnormal operation tasks, characterized in that: The device comprises: The log acquisition module is used to obtain the operation log corresponding to the job task; A log identification module, used to identify the operation log corresponding to the job task and obtain the job information corresponding to the job task; An abnormality source determination module, used to determine a target abnormality source corresponding to the operation task according to the operation information corresponding to the operation task; The job maintenance module is used to obtain the exception handling script corresponding to the target exception source and execute the exception handling script to perform exception handling on the job task.
9. A device for handling abnormal operation tasks, characterized in that: The operation task exception processing device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the job task exception handling method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for handling job exceptions according to any one of claims 1 to 7 when executed.