Timing task management method and device, equipment, storage medium and product
By monitoring the entire process of scheduled tasks, it solves the shortcomings of the existing technology of only monitoring task execution, enables timely discovery and processing of abnormalities in complex multi-dependent task scenarios, and avoids business losses.
Patent Information
- Application Number
- CN202410140757.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2024-10-18
AI Technical Summary
The management of scheduled tasks in the existing technology only monitors abnormal exits after task execution, and cannot handle unmonitored exceptions in complex multi-dependent task scenarios in a timely manner, resulting in business losses.
Adopt a full-process monitoring method, including monitoring before, during and after the scheduled task is executed. By obtaining and analyzing the normal distribution results of the time difference, determine the monitoring period and determine whether the task start and completion times are within the expected range. , and issue an alarm when it exceeds the range.
It realizes the full-process monitoring of scheduled tasks, detects and handles task execution exceptions in a timely manner, and avoids business losses caused by unmonitored exceptions.
Smart Images

Figure CN118796597A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the field of computer technology, and in particular to a method, apparatus, device, storage medium, and computer program product for managing scheduled tasks. Background Art
[0002] With the development of computer technologies such as big data, the management of business systems has become more sophisticated. Scheduled tasks, as a data processing method, often appear in the management process of various business systems. When scheduled tasks are executed abnormally, it will have a negative impact on various online business systems.
[0003] In the related technology, when managing scheduled tasks, monitoring and abnormal alarm are performed during the execution of a single task, specifically, only monitoring whether the task after scheduled execution has abnormal exit. As a result, in complex multi-dependent task scenarios, the business system cannot handle unmonitored abnormalities in a timely manner, resulting in business losses. Summary of the invention
[0004] The present application provides a scheduled task management method, device, equipment, storage medium and product; the scheduled task management method provided in the present application realizes the full process monitoring of the scheduled task, including monitoring of three stages: before the scheduled task is executed, during the scheduled task execution and after the scheduled task execution.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] A method for managing a scheduled task, the method comprising:
[0007] Before executing a scheduled task among multi-dependent tasks, monitoring the scheduled task based on a first time period, the first time period indicating the time period to which the actual start time of the scheduled task should belong;
[0008] During the execution of the scheduled task, the scheduled task is monitored based on a second time period, the second time period indicating the time period to which the actual completion time of the scheduled task should belong;
[0009] After the scheduled task is executed, the execution result of the scheduled task is verified.
[0010] In the above scheme, the method further comprises:
[0011] Acquire a first time difference of the scheduled task, where the first time difference indicates a difference between a historical actual start time of the scheduled task and a historical planned start time;
[0012] According to the first time difference, obtaining a first normal distribution result of a plurality of first time differences corresponding to the scheduled task at a plurality of historical times;
[0013] The first time period is determined according to a first parameter and a second parameter in the first normal distribution result, wherein the first parameter indicates an average value of the plurality of first time difference values, and the second parameter indicates a standard deviation of the plurality of first time difference values.
[0014] In the above scheme, the method further includes:
[0015] Obtaining a second time difference of the scheduled task, where the second time difference indicates a difference between a historical actual completion time of the scheduled task and a historical actual start time;
[0016] According to the second time difference, a second normal distribution result of a plurality of second time differences corresponding to the scheduled task at a plurality of historical times is obtained;
[0017] The second time period is determined according to a third parameter and a fourth parameter in the second normal distribution result, wherein the third parameter indicates an average value of the plurality of second time difference values, and the fourth parameter indicates a standard deviation of the plurality of second time difference values.
[0018] In the above solution, before the scheduled task in the multi-dependent tasks is executed, the scheduled task is monitored based on the first time period, including:
[0019] Obtaining the actual start time of the scheduled task;
[0020] Monitor whether the actual start time is within the first time period to obtain a first monitoring result.
[0021] In the above scheme, the method further includes:
[0022] When the first monitoring result indicates that the actual start time is not within the first time period, a first alarm message is output, where the first alarm message is used to issue an abnormal alarm before the scheduled task is executed.
[0023] In the above solution, during the execution of the scheduled task, monitoring the scheduled task based on the second time period includes:
[0024] Obtaining the actual completion time of the scheduled task;
[0025] Monitor whether the actual completion time is within the second time period to obtain a second monitoring result.
[0026] In the above scheme, the method further includes:
[0027] When the second monitoring result indicates that the actual completion time is not within the second time period, second alarm information is output, and the second alarm information is used to issue an abnormal alarm during the execution of the scheduled task.
[0028] In the above solution, after the scheduled task is executed, verifying the execution result of the scheduled task includes:
[0029] Performing a first verification operation on the execution result of the scheduled task to obtain a first indicator result;
[0030] Performing a second verification operation on the execution result of the scheduled task to obtain a second indicator result;
[0031] Determining a verification score of the execution result according to the first indicator result and the second indicator result;
[0032] It is determined whether the verification score is less than a first threshold value to obtain a third monitoring result.
[0033] In the above scheme, the method further includes:
[0034] When the third monitoring result indicates that the verification score is less than the first threshold, a third alarm information is output, where the third alarm information is used to issue an abnormal alarm after the scheduled task is executed.
[0035] In the above solution, before the scheduled task in the multi-dependent task is executed, the method further includes:
[0036] Get the scheduled start time of the scheduled task;
[0037] The planned start time is updated based on the first time difference configuration.
[0038] The embodiment of the present application further provides a management device for a scheduled task, the management device for a scheduled task comprising:
[0039] A processing unit, configured to monitor a scheduled task among multiple dependent tasks before the scheduled task is executed based on a first time period, wherein the first time period indicates a time period to which an actual start time of the scheduled task should belong;
[0040] The processing unit is further configured to monitor the scheduled task based on a second time period during the execution of the scheduled task, wherein the second time period indicates the time period to which the actual completion time of the scheduled task should belong;
[0041] The processing unit is further used to verify the execution result of the scheduled task after the scheduled task is executed.
[0042] The embodiment of the present application also provides a scheduled task management device, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein:
[0043] The processor is used to execute the steps of the above-mentioned scheduled task management method when running the computer program.
[0044] An embodiment of the present application also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned scheduled task management method are implemented.
[0045] An embodiment of the present application also provides a computer program product, including a computer program, which can be executed by a processor of an electronic device to complete the steps of managing the above-mentioned scheduled tasks.
[0046] The embodiment of the present application provides a method, device, equipment, storage medium and product for managing scheduled tasks, wherein the method includes: before the execution of a scheduled task in a multi-dependent task, monitoring the scheduled task based on a first time period, the first time period indicating the time period to which the actual start time of the scheduled task should belong; during the execution of the scheduled task, monitoring the scheduled task based on a second time period, the second time period indicating the time period to which the actual completion time of the scheduled task should belong; after the execution of the scheduled task, verifying the execution result of the scheduled task; in the execution process of multi-dependent scheduled tasks, the present application takes corresponding monitoring measures in the three stages corresponding to before, during and after the execution of the task according to the timeline of the task execution, so as to realize the full-process monitoring of the scheduled task. The problem that only monitoring whether the task after the scheduled execution has abnormal exit in the related technology makes it impossible for the business system to handle the unmonitored abnormalities in a timely manner in a complex multi-dependent task scenario, resulting in business losses. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of a method for managing scheduled tasks according to an embodiment of the present application;
[0048] Figure 2 This is a flow chart of a full-process monitoring method for scheduled multi-dependent tasks according to an embodiment of the present application;
[0049] Figure 3 A schematic diagram of a full-process monitoring system for scheduled multi-dependent tasks according to an embodiment of the present application;
[0050] Figure 4 This is a flowchart of a timed task scheduling method in a simple scenario in an embodiment of the present application;
[0051] Figure 5 This is a schematic diagram of the workflow of a scheduled task in a simple scenario in an embodiment of the present application;
[0052] Figure 6 This is a workflow diagram of a timed task in a complex scenario in an embodiment of the present application;
[0053] Figure 7 This is a flow chart of a scheduled task data analysis method according to an embodiment of the present application;
[0054] Figure 8 A schematic diagram of a scheduled task data analysis module according to an embodiment of the present application;
[0055] Fig. 9 This is an architecture diagram of data verification of a task execution result in an embodiment of the present application;
[0056] Fig.10 A schematic diagram of the structure of a scheduled task management device according to an embodiment of the present application;
[0057] Fig.11 A schematic diagram of the structure of a scheduled task management device according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0059] In multi-dependent tasks, the on-time execution of scheduled tasks depends on the on-time execution of upstream tasks, and the correct execution of scheduled tasks depends on the correct execution of upstream tasks. If the execution time of upstream tasks is too long, there will be too many scheduled tasks waiting to be executed. When a large number of scheduled tasks are in a waiting state at the same time, it will cause a large number of thread calls, resulting in the occupation and waste of system threads and other resources; if the upstream task has been executed, but the upstream task execution time is too long, network problems, less data volume, execution program errors and other abnormalities cause the scheduled task to start too late, it will cause the task to not start execution in time.
[0060] In the related art, the scheduled task is not monitored before it is executed, and only whether an abnormal exit occurs after the scheduled task is executed. As a result, even if the task starts too late, it cannot be monitored and an error cannot be reported in time. It does not take into account that in complex multi-dependency scenarios, scheduled tasks need to rely on multiple upstream tasks, and the execution time of upstream tasks is uncertain, resulting in the scheduled task not being executed as expected. For example, when a scheduled task for data cleaning is set to clean user behavior data at 8:00 every day, since the data cleaning task depends on the upstream data transmission task, when the upstream data transmission task fails to complete the data transmission due to network and other problems, the data cleaning task will remain in the execution waiting state to wait for the completion of the data transmission task. During this period, since there is no monitoring before the task is executed, when a transmission problem similar to the above occurs before the task is executed, causing the data cleaning task to be executed too late, it cannot be monitored and an alarm cannot be issued in time.
[0061] Based on this, this application provides a method for managing scheduled tasks. Figure 1 As shown, the method comprises the following steps:
[0062] Step 101: Before a scheduled task among multiple dependent tasks is executed, the scheduled task is monitored based on a first time period.
[0063] In actual application, the first time period indicates the time period to which the actual start time of the scheduled task should belong.
[0064] In actual application, a multi-dependent task refers to a time in which the execution start of a downstream scheduled task in a workflow depends on the execution end of multiple upstream scheduled tasks, which can also be called a scheduled multi-dependent task. Before the execution of a scheduled task in a multi-dependent task, it is determined whether the actual start time of the scheduled task is within the time period indicated by the first time period, so as to monitor the scheduled task before execution.
[0065] Step 102: During the execution of the scheduled task, the scheduled task is monitored based on the second time period.
[0066] Wherein, in actual application, the second time period indicates the time period to which the actual completion time of the scheduled task should belong;
[0067] In actual application, after the scheduled task in the multi-dependent task starts to execute, during the task execution, it is determined whether the actual completion time of the scheduled task is within the time period indicated by the second time period, so as to monitor the execution of the scheduled task.
[0068] Step 103: After the scheduled task is executed, the execution result of the scheduled task is verified.
[0069] In actual application, in complex multi-dependent scheduled task execution scenarios, it often happens that the execution status of some scheduled tasks is successful, but the results of the overall workflow after execution do not meet the expected data. For example, user portraits need to count the portrait indicator data of each user in each dimension based on offline behavior data. If some upstream offline data transmission exceptions occur, but the overall user portrait calculation task execution status is a successful execution status, although the execution status is successful, the execution result of the task in this case does not meet expectations. This application obtains the execution result of the scheduled task in a timely manner after the execution of the scheduled task in a multi-dependent task is completed, and determines whether the execution result of the scheduled task meets expectations, so as to monitor the execution result of the scheduled task. This is to avoid the inability to monitor abnormal situations in a timely manner when the program execution is normal, but the execution result does not meet expectations.
[0070] The embodiment of the present application provides a method for managing scheduled tasks, the method comprising: before the execution of a scheduled task in a multi-dependent task, monitoring the scheduled task based on a first time period, the first time period indicating the time period to which the actual start time of the scheduled task should belong; during the execution of the scheduled task, monitoring the scheduled task based on a second time period, the second time period indicating the time period to which the actual completion time of the scheduled task should belong; after the execution of the scheduled task, verifying the execution result of the scheduled task; in the execution process of the multi-dependent scheduled task, the present application takes corresponding monitoring measures in the three stages corresponding to before the task execution, during the task execution, and after the task execution, according to the timeline of the task execution, to achieve full-process monitoring of the scheduled task. The method solves the problem that only monitoring whether the task after the scheduled execution has abnormal exit in the related art makes it impossible for the business system to handle the unmonitored abnormalities in a timely manner in a complex multi-dependent task scenario, resulting in business losses.
[0071] In one embodiment, determining the first time period in step 101 includes:
[0072] Obtaining a first time difference of a scheduled task, where the first time difference indicates a difference between a historical actual start time of the scheduled task and a historical planned start time;
[0073] According to the first time difference, a first normal distribution result of a plurality of first time difference values corresponding to the scheduled task at a plurality of historical times is obtained;
[0074] The first time period is determined according to a first parameter and a second parameter in the first normal distribution result, wherein the first parameter indicates an average value of a plurality of first time difference values, and the second parameter indicates a standard deviation of the plurality of first time difference values.
[0075] In actual application, the historical actual start time and the historical planned start time of the scheduled task are obtained, and the first time difference is obtained based on the difference between the historical actual start time of the scheduled task and the historical planned start time. Further, multiple first time differences corresponding to the scheduled task at multiple historical times are obtained, and the corresponding first time difference sequence is obtained. Data processing is performed on the first time difference sequence to obtain the corresponding first normal distribution result.
[0076] In practical application, in one case, the first time difference sequence is Z-standardized, and the processed data conforms to the standard normal distribution with a mean of 0 and a standard deviation of 1, and the above-mentioned first normal distribution result is obtained:
[0077]
[0078] Among them, x1 is the first time difference of the scheduled task at each historical time, in seconds;
[0079] μ1 is the average value corresponding to the first time difference sequence, in seconds;
[0080] σ1 is the standard deviation corresponding to the first time difference sequence, in seconds;
[0081] Z1 is the Z score of the observations at each historical time corresponding to the first time difference sequence, which is used to compare different features at the same scale.
[0082] In practical application, according to the average value of multiple first time differences and the standard deviation of multiple first time differences in the first normal distribution result, the 3sigma rule is used to obtain the distribution in (μ 1 -3σ 1 ,μ 2 +3σ 1 ) to obtain the upper and lower limits of the first time difference. Since the planned start time of the scheduled task is a preset fixed value, the upper and lower limits of the actual start time of the scheduled task can be calculated according to the definition of the first difference, thereby obtaining the first time period to which the actual start time of the scheduled task should belong. It can be understood that the scheduled task should start executing when the time corresponding to the minimum value of the first time period is reached, and the latest actual start execution time should not exceed the time corresponding to the maximum value of the first time period, so as to ensure that the actual start time of the scheduled task is within the expected time period. In this way, the upper and lower limit thresholds of the actual start time are calculated using a statistical analysis method, thereby obtaining the first time period, and using the first time period as a benchmark to determine whether the actual start time meets expectations, and obtain a first monitoring result, thereby realizing pre-task execution monitoring of multi-dependent scheduled tasks.
[0083] In one embodiment, determining the second time period in step 102 includes:
[0084] Obtain a second time difference value of the scheduled task, where the second time difference value indicates a difference between a historical actual completion time of the scheduled task and a historical actual start time;
[0085] According to the second time difference, a second normal distribution result of a plurality of second time differences corresponding to the scheduled task at a plurality of historical times is obtained;
[0086] The second time period is determined according to a third parameter and a fourth parameter in the second normal distribution result, the third parameter indicates an average value of the plurality of second time difference values, and the fourth parameter indicates a standard deviation of the plurality of second time difference values.
[0087] In actual application, the historical actual start time and the historical actual completion time of the scheduled task are obtained, and a second time difference is obtained based on the difference between the historical actual completion time of the scheduled task and the historical actual start time. Further, multiple second time differences corresponding to the scheduled task at multiple historical times are obtained to obtain the corresponding second time difference sequence. Data processing is performed on the second time difference sequence to obtain the corresponding second normal distribution result.
[0088] In practical application, in one case, the second time difference sequence is Z-standardized, and the processed data conforms to the standard normal distribution with a mean of 0 and a standard deviation of 1, and the above second normal distribution result is obtained:
[0089]
[0090] Among them, x2 is the second time difference of the scheduled task at each historical time, in seconds;
[0091] μ2 is the average value corresponding to the second time difference sequence, in seconds;
[0092] σ2 is the standard deviation corresponding to the second time difference sequence, in seconds;
[0093] Z2 is the Z score of the observations at each historical time corresponding to the second time difference sequence, which is used for comparison between different features at the same scale.
[0094] In actual application, according to the average value of multiple second time difference values and the standard deviation of multiple second time difference values in the second normal distribution result, the 3sigma rule is used to obtain the distribution in (μ 2 -3σ 2 ,μ 2 +3Z 2 ) to obtain the upper and lower limits of the data of the scheduled task, and then obtain the upper and lower limits of the second time difference. Since the planned start time of the scheduled task is a preset fixed value, the upper and lower limits of the actual end time of the scheduled task can be deduced according to the definitions of the first difference and the second difference, thereby obtaining the second time period to which the actual end time of the scheduled task should belong. It can be understood that the scheduled task should end execution when the time corresponding to the minimum value of the second time period is reached, and the latest actual end execution time should not exceed the time corresponding to the maximum value of the second time period, so as to ensure that the actual execution duration of the scheduled task is within the expected duration range. In this way, the upper and lower limit thresholds of the actual end time are calculated using a statistical analysis method, thereby obtaining the second time period, and using the second time period as a benchmark to determine whether the actual end time meets expectations, and obtain a second monitoring result, thereby realizing task execution monitoring of multi-dependent scheduled tasks.
[0095] In one embodiment, in step 101, before the scheduled task in the multi-dependent tasks is executed, monitoring the scheduled task based on the first time period includes:
[0096] Get the actual start time of the scheduled task;
[0097] Monitor whether the actual start time is within the first time period to obtain a first monitoring result.
[0098] In actual application, when monitoring whether a scheduled task starts to execute on time, before the task is executed, the actual start time of the scheduled task to be monitored is monitored and obtained, and it is determined whether the actual start time falls within the first time period. When it falls within the first time period, it indicates that the actual start time of the scheduled task meets the expected range, and no pre-execution anomaly occurs before the task is executed, that is, the first monitoring result is normal before execution; when the actual start time does not fall within the first time period, it is determined whether the actual start time is less than the minimum value of the first time period, or greater than the maximum value of the first time period. When the actual start time is less than the minimum value of the first time period, it indicates that the scheduled task is executed in advance, or when the actual start time is greater than the maximum value of the first time period, it indicates that the scheduled task is executed late, and at this time, the first monitoring result is all pre-execution anomaly. In this way, by determining whether the actual start time of the scheduled task is within the first time period, the monitoring of the scheduled task before execution is realized.
[0099] In one embodiment, the method further includes:
[0100] When the first monitoring result indicates that the actual start time is not within the first time period, a first alarm message is output, and the first alarm message is used to issue an abnormal alarm before the scheduled task is executed.
[0101] In actual application, when the first monitoring result indicates that the actual start time is less than the minimum value of the first time period or greater than the maximum value of the first time period, it means that the scheduled task is executed ahead of schedule or delayed. In order to further determine the cause of the abnormality before the execution of the scheduled task, the first alarm information is automatically output according to the first monitoring result to issue an abnormal alarm before the execution of the scheduled task, so as to notify the operation and maintenance personnel to handle the abnormality in time.
[0102] In one embodiment, in step 102, during the execution of the scheduled task, monitoring the scheduled task based on the second time period includes:
[0103] Get the actual completion time of the scheduled task;
[0104] Monitor whether the actual completion time is within the second time period to obtain a second monitoring result.
[0105] In actual application, when monitoring whether the scheduled task is executed and completed on time, during task execution, monitor and obtain the actual end time of the scheduled task to be monitored, and determine whether the actual end time falls within the second time period. When it falls within the second time period, it indicates that the actual end time of the scheduled task is in line with the expected range, and no abnormality occurs during execution, that is, the second monitoring result is normal execution; when the actual end time does not fall within the second time period, determine whether the actual end time is less than the minimum value of the second time period, or greater than the maximum value of the second time period. When the actual end time is less than the minimum value of the second time period, it means that the scheduled task has ended ahead of schedule, or when the actual end time is greater than the maximum value of the second time period, it means that the scheduled task has been executed too long. At this time, the second monitoring results are all abnormalities during execution.
[0106] In one embodiment, the method further includes:
[0107] When the second monitoring result indicates that the actual completion time is not within the second time period, a second alarm message is output, and the second alarm message is used to issue an abnormal alarm during the execution of the scheduled task.
[0108] In actual application, when the second monitoring result indicates that the actual end time is less than the minimum value of the second time period or greater than the maximum value of the second time period, it means that the scheduled task ends prematurely or the execution time is too long. In order to further determine the cause of the abnormality in the execution of the scheduled task, the second alarm information is automatically output according to the second monitoring result to issue an abnormal alarm during the execution of the scheduled task, so as to notify the operation and maintenance personnel to handle the abnormality in time.
[0109] In one embodiment, after the scheduled task is executed in step 103, the execution result of the scheduled task is verified, including:
[0110] Performing a first verification operation on the execution result of the scheduled task to obtain a first indicator result;
[0111] Perform a second verification operation on the execution result of the scheduled task to obtain a second indicator result;
[0112] Determine a verification score of the execution result according to the first indicator result and the second indicator result;
[0113] It is determined whether the verification score is less than the first threshold value to obtain a third monitoring result.
[0114] In actual application, when monitoring whether the scheduled task is executed correctly, the verification score of the execution result is comprehensively determined based on the first indicator result and the second indicator result, and the verification score is compared to see whether it is less than the first threshold to obtain the third monitoring result, thereby judging whether the scheduled task is executed correctly.
[0115] In actual application, the first verification operation is to verify the strong verification indicators. The strong verification indicators include but are not limited to whether there is data, whether there is an index of a specific field, etc. Under strong verification, the first indicator result obtained is a value of 0 or 1, which can also be called a strong verification indicator score.
[0116] In actual application, the second verification operation is to verify some verification indicators. Weak verification indicators include but are not limited to data fill rate, data volatility, etc. Under weak verification, the second indicator result obtained is a value between 0 and 1, which can also be called a weak verification indicator score.
[0117] In actual application, the first threshold is a preset time threshold. For example, the first threshold can be obtained based on data such as the actual execution time in the historical log data of the scheduled task, the task execution time, ie, the execution duration, etc.
[0118] In actual application, the third monitoring result can be directly the comparison result of the verification score and the first threshold, or it can be an indication information of whether a post-execution exception occurs based on the comparison result. It can be set according to actual needs, and this application does not make specific limitations on this.
[0119] In actual application, the verification score of the execution result is determined according to the first indicator result and the second indicator result, which can be performed through the following steps:
[0120] After obtaining the strong check index score indicated by the first indicator result and the weak check index score indicated by the second indicator result, the strong check index score is multiplied and the weak check index score is averaged according to formula (3) to calculate the check score of the execution result of the scheduled task:
[0121]
[0122] Among them, m is the number of selected strong verification indicators, in units;
[0123] a i Score for strong validation indicators;
[0124] n is the number of selected weak verification indicators, in units;
[0125] b j Score for weak validation indicators.
[0126] Score is the verification score of the execution result.
[0127] In actual application, when there is only one 0 in the first indicator result, an alarm needs to be issued directly. When the first indicator results are all 1, the second indicator result and the verification score are calculated, and based on the pre-set first threshold, it is determined whether the verification score is greater than the first threshold, so as to perform post-execution monitoring, so that when the verification score is less than the first threshold, a post-execution abnormal alarm is issued. In this way, after the task is executed, the third monitoring result is obtained according to the verification score, so as to determine whether an abnormal alarm is required, and monitoring is performed by data verification, so that when the task is completed but not executed correctly, the abnormal situation can also be accurately monitored, and monitoring during task execution is realized.
[0128] In one embodiment, the method further includes:
[0129] When the third monitoring result indicates that the verification score is less than the first threshold, a third alarm information is output, and the third alarm information is used to issue an abnormal alarm after the scheduled task is executed.
[0130] In actual application, when the third alarm information represents that the verification score is less than the first threshold, it indicates that the execution result of the scheduled task does not meet expectations and an abnormality occurs after execution. In order to further determine the cause of the abnormality after execution of the scheduled task, the third alarm information is automatically output according to the third monitoring result to issue an abnormality alarm after the scheduled task is executed, so as to notify the operation and maintenance personnel to handle the abnormality in time.
[0131] In one embodiment, before the scheduled task in the multi-dependent task is executed in step 101, the method further includes:
[0132] Get the scheduled start time of the scheduled task;
[0133] The scheduled start time is updated based on the first time difference configuration.
[0134] In actual application, the first time difference indicates the difference between the historical actual start time of the scheduled task and the historical planned start time. The planned start time of the scheduled task is a pre-set time, which is used to start the task with reference to the planned start time. Because in complex scenarios, the normal execution of downstream scheduled tasks depends on the normal completion of upstream tasks, and there is uncertainty in the execution time of upstream tasks, in order to comprehensively consider the impact of dynamic changes in the execution time of upstream tasks on the execution time of downstream tasks, the planned start time of the scheduled task is configured and dynamically updated based on the first time difference, so as to realize flexible and dynamic adjustment of the planned start time of the scheduled task according to the upstream dependent tasks, and improve the accuracy of the execution time of the scheduled task.
[0135] In actual application, in order to improve the accuracy of configuration update, the difference between the actual start time and the planned start time of the scheduled task at each historical time is collected to obtain multiple first time differences, corresponding to the first time difference sequence. The first time difference sequence reflects the impact of the execution time of the scheduled task when it actually starts to execute on the upstream dependent task at each historical time. The smaller the difference, the smaller the impact of the upstream dependency. The first time difference is averaged to obtain the average impact of the execution time of the scheduled task when it actually starts to execute on the upstream dependent task in a historical period. Further, based on the currently preset scheduled task plan start time, the average value of the first time difference is considered to obtain the adjusted recommended plan start time, so that the adjusted recommended plan start time is more accurate. Configure and update the current planned start time so that the scheduled task executes the scheduled task according to the updated recommended plan start time. In this way, the planned start time of each scheduled task can be automatically configured and updated in batches, replacing the manual monitoring of the task execution, effectively reducing the execution time error between the planned start time and the actual start time of the scheduled task, saving manpower maintenance costs and improving system utilization.
[0136] The present application is described in further detail below in conjunction with application examples.
[0137] In a practical scenario, refer to Figure 2 As shown, the present application implements a full-process monitoring method for a scheduled multi-dependent task, which divides the monitoring process of the scheduled task into three stages, including monitoring and abnormal alarming of the scheduled task before, during and after the task is executed. The specific description is as follows:
[0138] Step 201, start.
[0139] Step 202: Before the task is executed, monitoring is performed according to the threshold of the task execution start time.
[0140] Step 203 , determine whether an exception occurs before task execution, if yes, proceed to step 204 , otherwise proceed to step 205 .
[0141] Step 204: Issue an abnormal warning message before task execution.
[0142] Send warning information in time when abnormalities are detected
[0143] Step 205: During task execution, monitoring is performed according to the threshold of the task end time.
[0144] Step 206 , determine whether an exception occurs during task execution, if yes, proceed to step 207 , otherwise proceed to step 208 .
[0145] Step 207: Issue an alarm message indicating an abnormality during task execution.
[0146] Send warning information in time when abnormalities are detected
[0147] Step 208: After the task is executed, data verification is performed on the task execution result.
[0148] Step 209 , determine whether an exception occurs after task execution, if yes, proceed to step 210 , otherwise proceed to step 211 .
[0149] After the task is executed, the data of the task execution result is verified, and an alarm is sent based on whether the verification result is abnormal.
[0150] Step 210: Issue an abnormal warning message after the task is executed.
[0151] Send warning information in time when abnormalities are detected
[0152] Step 211, end.
[0153] In the related art, when scheduling a scheduled task, the monitoring center only monitors the hardware memory indicator data, central processing unit (CPU) and other resource indicator data of the master node (Master) and the worker node (Worker), and sends a simple alarm message of execution failure when the above indicator data is abnormal and the task execution fails. When the upstream task on which the scheduled task depends has been running in timeout, the system does not determine it as an execution failure, and it is impossible to send an alarm message of execution abnormality in time.
[0154] Based on this, in a practical scenario, refer to Figure 3 As shown, the present application implements a full-process monitoring system 300 for timing multi-dependent tasks, including a user layer 301, an interaction layer 302 and a scheduling layer 303; wherein,
[0155] The user layer 301 is used for data analysts, big data developers, operation and maintenance personnel and other related personnel to input information, including inputting scheduled task scheduling configuration information and other related information related to scheduled task settings to the interactive layer, and receiving related information related to scheduled task execution results fed back by the interactive layer;
[0156] The interaction layer 302 is used to feed back the monitoring configuration information, the recommended execution time of the scheduled task and / or the alarm information received from the scheduling layer to the user layer, including performing human-computer interaction related operations with the data analysts, big data developers and operation and maintenance personnel of the user layer on the human-computer interaction interface of communication tools such as browsers, emails, and text messages, and sending the scheduled task scheduling configuration information input by the user layer to the scheduling layer to execute the scheduling of the scheduled task;
[0157] The scheduling layer 303 is used to execute the scheduling of scheduled tasks, including a scheduled task scheduling module 3031, a scheduled task data analysis module 3032, and a scheduled task monitoring module 3033; wherein,
[0158] The scheduled task scheduling module 3031 is to set the scheduled task scheduling configuration information input by the user layer, execute the scheduled task according to the scheduling configuration information, and generate a task execution log after executing the scheduled task;
[0159] The scheduled task data analysis module 3032 collects data on the execution time based on the task execution log generated by the scheduled task scheduling module 3031, and performs data analysis on the execution time based on the collected data, so as to generate monitoring configuration information and recommended planned start time of the scheduled task. The generated monitoring configuration information and recommended execution time of the scheduled task can be fed back to relevant personnel of the user layer through the interaction layer;
[0160] The scheduled task monitoring module 3033 generates a monitoring task based on the monitoring configuration information generated by the scheduled task data analysis module 3032, and monitors the entire process of the task and returns the monitoring result information when the scheduled task scheduling module 3031 executes the scheduled task. The scheduled task monitoring module 3033 performs an abnormality analysis based on the returned monitoring result information, and sends an alarm message in a timely manner when an abnormal monitoring result occurs, so as to feed back the monitoring alarm information to the relevant personnel at the user layer through the human-computer interaction interface of the interactive layer.
[0161] In a practical scenario, refer to Figure 4 As shown, the present application implements a method for scheduling scheduled tasks with multiple scheduled dependencies, which can be executed based on the above-mentioned full-process monitoring system for scheduled tasks with multiple scheduled dependencies. Taking a simple workflow of a scheduled task with upstream dependencies as an example, the specific description is as follows:
[0162] Preset the first planned start time (Plan Time, PT1) of the scheduled task TASK1 and the second planned start time PT2 of the scheduled task TASK2. Step 401, start. Step 402, execute the scheduled task TASK1: when the process starts, execute the scheduled task TASK1 according to the first planned start time PT1 of TASK1, confirm that the scheduled task TASK1 starts at the first actual start time (Start Time, ST1) and ends at the first actual completion time (End Time, ET1), when the scheduled task TASK1 is completed, trigger the execution process of the scheduled task TASK2, and enter step 403. Step 403, execute the scheduled task TASK2: execute the scheduled task TASK2 according to the second planned start time PT2 of TASK2, confirm that the scheduled task TASK2 starts at the second actual start time ST2 and ends at the second actual completion time ET2, and enter step 404. Step 404, end. The successful start of the execution process of the scheduled task TASK2 is dependent on the successful completion of the execution process of the scheduled task TASK1. If the scheduled task TASK1 fails, the scheduled task TASK2 will also fail.
[0163] Among them, the scheduled task will generate three time points, including the planned start time (Plan Time, PT) of the task, the actual start time (Start Time, ST) of the task, and the actual end time (End Time, ET) of the task. Figure 5 As shown in the figure, when the scheduling system is set to execute the user portrait data processing task at 8:00 every day, the upstream task is executed too late, resulting in the task actually starting at 8:15 and completing it at 8:21. The PT of the task is 8:00, the ST is 8:15, and the ET is 8:21. The task is monitored before execution based on PT, monitored during execution based on ST, and monitored after execution based on ET.
[0164] In actual production, when a scheduled task is executed according to the scheduled start time set by the developer, the execution status of the upstream dependent tasks of the scheduled task needs to be considered. Figure 6 As shown, it is a schematic diagram of a workflow 6 of a timed task with complex upstream dependencies. In addition to the mutual dependencies between the upstream and downstream timed tasks 601 within the workflow, the timed tasks 601 between different workflows also have mutual dependencies.
[0165] In a practical scenario, refer to Figure 7 As shown, the present application implements a method for analyzing scheduled task data of scheduled multi-dependent tasks, corresponding to Figure 8The data analysis module 800 shown or the above-mentioned scheduled task data analysis module 3032 can be executed based on the above-mentioned full-process monitoring system of scheduled multi-dependent tasks, and the specific description is as follows:
[0166] Step 701: Collect execution time data based on the scheduling log.
[0167] According to the scheduling log of the scheduled task scheduling system, the PT, ST, and ET of the scheduled tasks to be executed in the log at various historical times are obtained to obtain the corresponding three original sequence data: the task plan start time sequence {PT 1 ,PT 2 ,PT 3 ,...,PT t}, the task actual start time sequence {ST 1 ,ST 2 ,ST 3 ,...,ST t}, the actual end time sequence of the task {ET 1 ,ET 2 ,ET 3 ,...,ET t}, the original sequence is in time format.
[0168] Step 702: Store the collection results.
[0169] The collected data is synchronized to the database for recording.
[0170] In actual application, you can use big data log collection tools such as Flume to collect the above key data from the scheduling log of the scheduling system, and store the collected data in a data warehouse such as Hive for recording.
[0171] Step 703: Perform data analysis to generate monitoring thresholds and recommend plan start times.
[0172] Use data analysis tools such as Spark to analyze data to generate monitoring thresholds and recommend plan start times.
[0173] First, the numerical distribution of the collected results is analyzed.
[0174] According to the obtained PT and ST, the task execution plan time error T is calculated using formula (4): error , T error Represents the length of time that a scheduled task is in the execution waiting state from the scheduled start time until the task is actually started:
[0175] T error =ST-PT (4)
[0176] Among them, ST is the actual start time of the scheduled task execution, in seconds;
[0177] PT is the scheduled start time of the scheduled task execution, in seconds;
[0178] T error The time error of task execution plan, in seconds.
[0179] According to the obtained ST and ET, the task execution time T is calculated using formula (5): execute , T execute Represents the actual execution time of the scheduled task from the actual start to the actual end of the execution:
[0180] T execute =ET-ST (5)
[0181] Among them, ST is the actual start time of the scheduled task execution, in seconds;
[0182] ET is the actual end time of the scheduled task execution, in seconds;
[0183] T execute The actual execution time of the scheduled task in seconds.
[0184] Calculate the T of the scheduled tasks to be executed at each historical time error and T execute , generate the planned time error series and task execution time series
[0185] Calculate the mean μ and standard deviation σ of the two sequences respectively. Then perform Z-standardization on the data according to formula (1) or formula (2). The processed data conforms to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1.
[0186] Second, generate monitoring thresholds based on the numerical distribution.
[0187] The monitoring threshold indicates the time period to which the execution time should belong, including the upper and lower limits of the time period. The embodiment of the present application uses the 3sigma rule to calculate the upper and lower limits of the execution time; wherein,
[0188] The monitoring threshold includes the first time period corresponding to the first monitoring threshold, indicating the time period to which the actual start time ST of the scheduled task belongs. According to the 3sigma rule, the probability that the value is distributed in (μ-3σ,μ+3σ) is 0.9973, corresponding to the upper and lower limits of the standardized data, and then the corresponding T is calculated according to formula (4). error The upper and lower limits of PT are set in advance, and the corresponding upper and lower limits of ST are calculated: ST min 、STmax , thereby obtaining the first time period corresponding to the first monitoring threshold: [ST min ,ST max ].
[0189] The monitoring threshold includes the second time period corresponding to the first monitoring threshold, indicating the time period to which the actual end time ET of the scheduled task belongs. According to the 3sigma rule, the probability of the value being distributed in (μ-3σ,μ+3σ) is 0.9973, corresponding to the upper and lower limits of each data in the standardized actual end time ET sequence, and then the corresponding T is reversely calculated according to formula (5) and the upper and lower limits of the above ST. execute The upper and lower limits of ET are calculated accordingly: min , E.T. max , thereby obtaining the second time period corresponding to the second monitoring threshold: [ET min ,ET max ].
[0190] Third, based on the numerical distribution, generate the recommended plan start time.
[0191] According to the planned time error sequence Get the average value of the planned time error It represents the average value of the error between the scheduled start time and the actual start time of the scheduled task when the scheduled task is executed at various historical times, under the influence of the actual end time of the upstream task on which the scheduled task depends, and represents the average degree of influence of the upstream dependent task. Combined with formula (4), it can be seen that when the planned start time PT is closer to the actual start time ST, the corresponding planned time error when the scheduled task is actually executed is smaller. When considering the upstream tasks on which the scheduled task depends, the influence of the historical value of the planned time error on the planned start time of the scheduled task should be considered. Therefore, when generating the recommended planned start time, the recommended planned start time PT is set according to formula (6). rec :
[0192]
[0193] Among them, PT is the planned start time of the scheduled task execution, in seconds;
[0194] It is the average value of the planned time error sequence corresponding to each historical time of the scheduled task;
[0195] PT rec The recommended scheduled start time for a scheduled task under the influence of upstream dependent tasks.
[0196] For example, when the upstream dependent task of the scheduled task to be executed by the scheduling system can be completed at 8 o'clock, the scheduled task is pre-set to start at 8:15, but according to the historical execution situation, it is found that the actual start time of the scheduled task is 8:25 on average due to the execution of the upstream task. In other words, the average value of the planned time error is If the recommended start time of the scheduled task is 10 minutes, the recommended start time of the scheduled task can be set to 8:25. If the recommended start time of the scheduled task is 0:00, it will be in the execution waiting state from 0:00 during scheduling, and it will need to wait at least 8 hours after the upstream dependent task is completed at 8:00. If it is set to 18:00, the scheduled task will be executed at least 10 hours later.
[0197] The embodiment of the present application adds the average value of the planned time error of the scheduled task at each historical time on the basis of the pre-set planned start time to obtain a recommended planned start time, comprehensively considers the impact of the upstream dependent tasks of the scheduled task on the actual execution time of the scheduled task, and can automatically update the average value of the planned time error as time goes by, so that the recommended planned start time can be flexibly adjusted according to the actual situation, avoiding resource waste caused by setting the planned start time of the scheduled task too late or too early, effectively saving system resources and improving system utilization.
[0198] Step 704: store and display the monitoring threshold and recommended plan start time.
[0199] The results are stored in the MySQL database and displayed on the monitoring front page so that relevant personnel at the user level can view and use them intuitively. When the task volume is small, relevant personnel can directly enter the scheduled task execution threshold at the front page; when the task volume is large, the upper and lower limits of ST and ET are automatically set according to the above generated monitoring thresholds: ST min 、ST max , E.T. min , E.T. max .
[0200] Step 705: automatically set the task plan start time according to the recommended timing.
[0201] When the task volume is small, developers and operation and maintenance personnel can manually set and adjust the scheduled start time of the scheduled task according to the displayed monitoring threshold and recommended scheduled start time. When the number of tasks is very large, manually modifying the PT every day is very labor-intensive and cannot flexibly respond to task execution situations that may change or be abnormal at any time. Therefore, the embodiment of the present application automatically calculates the recommended scheduled start time of each scheduled task based on the above formula (6), and uses the relevant program to automatically batch modify the PT of each scheduled task to PT rec , thereby saving manpower maintenance costs while effectively saving system resources and improving system utilization.
[0202] In a practical scenario, combined with Figure 2 and Figure 5 As shown, the present application implements a method for monitoring a scheduled task with multiple dependent tasks, corresponding to the above-mentioned scheduled task monitoring module 3033, which can be executed based on the above-mentioned full-process monitoring system for scheduled multi-dependent tasks, and is specifically described as follows:
[0203] Figure 5 Perform pre-task monitoring in Figure 2 Step 202 in: Set the detection frequency, such as once every 10 minutes, to detect whether the scheduled task has started to execute. If ST is not within the first monitoring threshold, that is, the first time period corresponding to (ST min ,ST max ) range, an abnormal alarm is issued before the task is executed: if the monitoring reaches the monitoring upper limit value ST of the first period when the time reaches max After that, if the scheduled task has not started, it means that the scheduled task is executed too late, and an abnormal alarm before the task is executed is sent so that relevant personnel can check the abnormal situation in time. In this way, an alarm can be issued in time before the task is executed, which is convenient for operation and maintenance personnel and developers to conduct further inspections.
[0204] Figure 5 Monitor the execution of tasks in Figure 2 Step 205: Set the detection frequency, such as once every 10 minutes, to detect whether the scheduled task has finished executing. If ET is not within the second monitoring threshold (ET corresponding to the second time period), min ,ET max ) range, an abnormal alarm is issued during task execution: If the monitoring upper limit ET of the second period is reached at time maxAfterwards, if the scheduled task has not been completed, it means that the scheduled task has been executed for too long, and an abnormal alarm will be sent before the task is executed so that relevant personnel can check for abnormal situations in time. In this way, the task execution time can be effectively monitored on the basis of detecting whether the task is executed abnormally during task execution. For example, during the execution of offline data warehouse tasks, when the task is executed too quickly, it may be due to factors such as the decrease in the amount of data; when the task is executed too slowly, it may be due to factors such as the increase in the amount of data and cluster failure. In this way, monitoring the execution time, that is, the actual execution time, can enable developers and others to set the actual execution time of the task more efficiently, avoid the simultaneous execution of scheduled tasks that consume a lot of resources, and effectively improve the utilization of computing resources.
[0205] Figure 5 Perform post-task execution monitoring in Figure 2 Step 208: After the scheduled task is executed, refer to Fig. 9 As shown, the execution result is generated and stored in the database (such as Hive, HBase, MySQL, MongoDB, etc.). After obtaining the data of the execution result from the data storage layer, the data is statistically analyzed to obtain data verification indicators (such as whether there is data, whether there is an index, data fill rate, data volatility, etc.), and the verification score is calculated based on the data verification indicator. Based on the verification score and the score threshold, it is determined whether to alarm, thereby completing data verification to complete the post-execution monitoring of the scheduled task.
[0206] Among them, since the verification is divided into strong verification and weak verification, when the verification score is calculated based on the data verification index, the verification score includes the strong verification index score and the weak verification index score. The strong verification index score indicates that when the score is absolutely abnormal, an abnormal alarm will be directly issued. For example, after the feature processing task is executed, it is checked whether there is data in the mongo table of the day and whether the mongo table has an index of a specific field. The verification result returned is 0 or 1. When the verification result shows that there is no data and / or no index of a specific field, it indicates that the scheduled task execution is abnormal and an alarm will be issued directly; the weak verification index score indicates that the score is abnormal within a certain range, such as the fill rate, data volatility and other indicators, the proportion of abnormal values, etc., all have no clear range standards, and the return result is a value between 0-1.
[0207] After obtaining the strong check index score and weak check index score of the execution result, the check score of the execution result of the scheduled task is calculated according to the above formula (3). When there is only one 0 in the strong check index score, an alarm needs to be directly issued. In addition, the score threshold of the check score of the execution result, that is, the preset first threshold, can be pre-set. When the strong check index scores are all 1, post-execution monitoring can be performed according to the pre-defined score threshold, so that when the check score is less than the score threshold, a post-execution abnormal alarm is issued.
[0208] The scheduled task monitoring of this application is to monitor the actual execution time, execution results or execution status of the scheduled task in real time during the execution of the scheduled task. When the scheduled task encounters abnormal situations such as late execution or execution failure, the alarm system will send the abnormal situation to the operation and maintenance personnel in time, and the operation and maintenance personnel will solve the online business or network-related problems in time to avoid causing more serious losses.
[0209] The scheduled task monitoring of this application can promptly detect abnormalities such as task execution failure, delay, and early completion by real-time monitoring and tracking of scheduled tasks. It can also promptly notify operation and maintenance personnel to take measures to handle execution abnormalities through early warning, reduce task execution errors, ensure that tasks are executed on time and accurately, reduce potential risks such as business losses caused by abnormal task execution, and ensure business reliability and accuracy.
[0210] In order to implement the management method of the scheduled task in the embodiment of the present application, the embodiment of the present application also provides a management device for scheduled tasks, referring to Fig.10 As shown, the scheduled task management device 1000 includes: an acquisition unit 1001 and a processing unit 1002; wherein,
[0211] The processing unit 1002 is used to monitor the scheduled task based on a first time period before the scheduled task in the multi-dependent tasks is executed, where the first time period indicates the time period to which the actual start time of the scheduled task should belong;
[0212] The processing unit 1002 is used to monitor the scheduled task based on the second time period during the execution of the scheduled task, where the second time period indicates the time period to which the actual completion time of the scheduled task should belong;
[0213] The processing unit 1002 is used to verify the execution result of the scheduled task after the scheduled task is executed.
[0214] in,
[0215] In one embodiment, the acquisition unit 1001 is specifically used to: acquire a first time difference value of a scheduled task, where the first time difference value indicates a difference value between a historical actual start time of the scheduled task and a historical planned start time;
[0216] In one embodiment, the acquisition unit 1001 is specifically configured to: obtain, according to the first time difference, a first normal distribution result of a plurality of first time differences corresponding to the scheduled task at a plurality of historical times;
[0217] In one embodiment, the processing unit 1002 is specifically used to determine the first time period according to a first parameter and a second parameter in the first normal distribution result, wherein the first parameter indicates an average value of multiple first time differences, and the second parameter indicates a standard deviation of multiple first time differences.
[0218] In one embodiment, the acquisition unit 1001 is specifically used to: acquire a second time difference value of the scheduled task, where the second time difference value indicates a difference between a historical actual completion time and a historical actual start time of the scheduled task;
[0219] In one embodiment, the acquisition unit 1001 is specifically configured to: obtain, according to the second time difference, a second normal distribution result of a plurality of second time differences corresponding to the scheduled task at a plurality of historical times;
[0220] In one embodiment, the processing unit 1002 is specifically used to determine the second time period according to a third parameter and a fourth parameter in the second normal distribution result, where the third parameter indicates an average value of multiple second time differences and the fourth parameter indicates a standard deviation of multiple second time differences.
[0221] In one embodiment, the acquisition unit 1001 is specifically used to: acquire the actual start time of the scheduled task;
[0222] In one embodiment, the processing unit 1002 is specifically configured to: monitor whether the actual start time is within a first time period to obtain a first monitoring result.
[0223] In one embodiment, the processing unit 1002 is specifically used to: output first alarm information when the first monitoring result indicates that the actual start time is not within the first time period, and the first alarm information is used to issue an abnormal alarm before the scheduled task is executed.
[0224] In one embodiment, the acquisition unit 1001 is specifically used to: acquire the actual completion time of the scheduled task;
[0225] In one embodiment, the processing unit 1002 is specifically configured to monitor whether the actual completion time is within a second time period to obtain a second monitoring result.
[0226] In one embodiment, the processing unit 1002 is specifically used to: when the second monitoring result indicates that the actual completion time is not within the second time period, output second alarm information, and the second alarm information is used to issue an abnormal alarm during the execution of the scheduled task.
[0227] In one embodiment, the processing unit 1002 is specifically used to: after the scheduled task is executed, verify the execution result of the scheduled task, including: performing a first verification operation on the execution result of the scheduled task to obtain a first indicator result; performing a second verification operation on the execution result of the scheduled task to obtain a second indicator result; determining a verification score of the execution result based on the first indicator result and the second indicator result; and determining whether the verification score is less than a first threshold to obtain a third monitoring result.
[0228] In one embodiment, the processing unit 1002 is specifically used to: when the third monitoring result indicates that the verification score is less than the first threshold, output third alarm information, and the third alarm information is used to issue an abnormal alarm after the scheduled task is executed.
[0229] In one embodiment, the acquisition unit 1001 is specifically used to: before the scheduled task in the multi-dependent tasks is executed, acquire the planned start time of the scheduled task;
[0230] In one embodiment, the processing unit 1002 is specifically configured to: before the scheduled task in the multi-dependent tasks is executed, update the planned start time based on the first time difference configuration.
[0231] For the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0232] In order to implement the management method of the scheduled task in the embodiment of the present application, the embodiment of the present application also provides a management device for scheduled tasks, referring to Fig.11 As shown, the scheduled task management device 1100 includes: a processor 1101, a memory 1102, and a communication bus 1103; wherein,
[0233] Processor 1101, configured to execute the method provided by one or more of the above technical solutions when running a computer program;
[0234] A memory 1102 for storing computer programs that can be executed on the processor 1101;
[0235] The communication bus 1103 is used to realize the communication connection between the processor 1101 and the memory 1102.
[0236] It should be noted that the specific processing process of the processor 1101 can be understood by referring to the above method, which will not be repeated here.
[0237] Of course, in actual application, the various components in the scheduled task management device 1100 are coupled together through the communication bus 1103. It can be understood that the communication bus 1103 is used to realize the connection and communication between these components. In addition to the data bus, the communication bus 1103 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 8 Various buses are labeled as communication buses 1103.
[0238] The memory 1102 in the embodiment of the present application is used to store various types of data to support the operation of the scheduled task management device 1100. Examples of such data include: any computer program used to operate on the scheduled task management device 1100.
[0239] The method disclosed in the above embodiment of the present application can be applied to the processor 1101, or implemented by the processor 1101. The processor 1101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1101 or an instruction in software form. The processor 1101 can be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1101 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 1102, and the processor 1101 reads the information in the memory 1102 and completes the steps of the above method in combination with its hardware.
[0240] In an exemplary embodiment, the scheduled task management device 1100 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.
[0241] It can be understood that the memory (memory 1102) of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0242] In an exemplary embodiment, the present application embodiment further provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 1102 storing a computer program, and the computer program in the above memory 1102 can be executed by a processor 1101 of a scheduled task management device 1100 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0243] In an exemplary embodiment, the embodiment of the present application also provides a computer program product, including a computer program, which can be executed by the processor 1101 of the scheduled task management device 1100 to complete the steps of the above method of the aforementioned scheduled task management device.
[0244] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0245] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0246] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for managing scheduled tasks, characterized in that: The method comprises: Before executing a scheduled task among multi-dependent tasks, monitoring the scheduled task based on a first time period, the first time period indicating the time period to which the actual start time of the scheduled task should belong; During the execution of the scheduled task, the scheduled task is monitored based on a second time period, the second time period indicating the time period to which the actual completion time of the scheduled task should belong; After the scheduled task is executed, the execution result of the scheduled task is verified.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a first time difference of the scheduled task, where the first time difference indicates a difference between a historical actual start time of the scheduled task and a historical planned start time; According to the first time difference, obtaining a first normal distribution result of a plurality of first time differences corresponding to the scheduled task at a plurality of historical times; The first time period is determined according to a first parameter and a second parameter in the first normal distribution result, wherein the first parameter indicates an average value of the plurality of first time difference values, and the second parameter indicates a standard deviation of the plurality of first time difference values.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining a second time difference of the scheduled task, where the second time difference indicates a difference between a historical actual completion time of the scheduled task and a historical actual start time; According to the second time difference, a second normal distribution result of a plurality of second time differences corresponding to the scheduled task at a plurality of historical times is obtained; The second time period is determined according to a third parameter and a fourth parameter in the second normal distribution result, wherein the third parameter indicates an average value of the plurality of second time difference values, and the fourth parameter indicates a standard deviation of the plurality of second time difference values.
4. The method according to claim 1, characterized in that Before the scheduled task in the multi-dependent tasks is executed, monitoring the scheduled task based on the first time period includes: Obtaining the actual start time of the scheduled task; Monitor whether the actual start time is within the first time period to obtain a first monitoring result.
5. The method according to claim 4, characterized in that The method further comprises: When the first monitoring result indicates that the actual start time is not within the first time period, a first alarm message is output, where the first alarm message is used to issue an abnormal alarm before the scheduled task is executed.
6. The method according to claim 1, characterized in that During the execution of the scheduled task, monitoring the scheduled task based on the second time period includes: Obtaining the actual completion time of the scheduled task; Monitor whether the actual completion time is within the second time period to obtain a second monitoring result.
7. The method according to claim 6, characterized in that The method further comprises: When the second monitoring result indicates that the actual completion time is not within the second time period, second alarm information is output, and the second alarm information is used to issue an abnormal alarm during the execution of the scheduled task.
8. The method according to claim 1, characterized in that After the scheduled task is executed, verifying the execution result of the scheduled task includes: Performing a first verification operation on the execution result of the scheduled task to obtain a first indicator result; Performing a second verification operation on the execution result of the scheduled task to obtain a second indicator result; Determining a verification score of the execution result according to the first indicator result and the second indicator result; It is determined whether the verification score is less than a first threshold value to obtain a third monitoring result.
9. The method according to claim 8, characterized in that The method further comprises: When the third monitoring result indicates that the verification score is less than the first threshold, a third alarm information is output, where the third alarm information is used to issue an abnormal alarm after the scheduled task is executed.
10. The method according to claim 2, characterized in that Before the scheduled task in the multi-dependent task is executed, the method further includes: Get the scheduled start time of the scheduled task; The planned start time is updated based on the first time difference configuration.
11. A management device for scheduled tasks, characterized in that: The management device of the scheduled task includes: A processing unit, configured to monitor a scheduled task among multiple dependent tasks before the scheduled task is executed based on a first time period, wherein the first time period indicates a time period to which an actual start time of the scheduled task should belong; The processing unit is further configured to monitor the scheduled task based on a second time period during the execution of the scheduled task, wherein the second time period indicates the time period to which the actual completion time of the scheduled task should belong; The processing unit is further used to verify the execution result of the scheduled task after the scheduled task is executed.
12. A scheduled task management device, characterized in that: include: A processor and a memory for storing a computer program capable of running on the processor; wherein, The processor is used to execute the steps of the scheduled task management method according to any one of claims 1 to 10 when running the computer program.
13. A 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 for managing scheduled tasks according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, 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 10 are implemented.
