Task repair method, device, equipment and storage medium based on task scheduling
By automatically judging the resource dimension or time dimension of the task, and adjusting the failed task repair, the problem of low repair efficiency of manual execution failed tasks is solved, the task repair efficiency is improved, and the failure of the task chain is avoided.
Patent Information
- Application Number
- CN202110417751.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-16
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-04-16
AI Technical Summary
In the prior art, manual execution of failed tasks is less efficient in repairing, resulting in failure of the task chain and production accidents.
By obtaining key information of the task, we judge whether the task has failed to execute, and judge whether the preset repair conditions are met based on the resource dimension or time dimension, and automatically adjust the task repair to avoid task accumulation and chain breakage.
Improve the efficiency of failed task repair, prevent the failure of the task chain, and reduce the need for manual intervention.
Smart Images

Figure CN113220494B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of scheduling task processing, and in particular to a task repair method, device, equipment and storage medium based on task scheduling. Background Art
[0002] In the Internet era of data explosion, the amount of data is growing exponentially. A large number of scheduling tasks are needed every day to complete data processing. The failure of tasks due to self- or third-party reasons is also inevitable. If the failed task cannot be repaired in time, it will cause the subsequent tasks to fail to proceed normally, resulting in the failure of the entire task chain. Often, a production accident is caused by the failure to repair a task in time. Currently, the repair of failed tasks is performed manually, but the efficiency of repairing failed tasks manually is low. Summary of the invention
[0003] The main purpose of the present invention is to provide a task repair method, device, equipment and storage medium based on task scheduling, aiming to solve the technical problem of low efficiency in manually executing failed task repair.
[0004] To achieve the above object, an embodiment of the present invention provides a task repair method based on task scheduling, and the task repair method based on task scheduling includes:
[0005] Obtaining key information of the task, and determining whether the task has failed to execute according to the key information;
[0006] If the task fails to be executed, obtaining the resource dimension or time dimension of the task;
[0007] If the resource dimension or the time dimension meets the preset repair condition, the task is repaired.
[0008] Preferably, the preset repair condition includes that the resource dimension is less than a first preset parameter; if the resource dimension or the time dimension satisfies the preset repair condition, the step of activating the task for repair includes:
[0009] Comparing the resource dimension with the first preset parameter;
[0010] If the resource dimension is smaller than the first preset parameter, it is determined that the resource dimension meets a preset repair condition, and the task is repaired.
[0011] Preferably, the preset repair condition further includes that the time dimension is greater than a preset time; if the resource dimension or the time dimension satisfies the preset repair condition, the step of activating the task for repair further includes:
[0012] If the resource dimension is greater than or equal to the first preset parameter, comparing the time dimension with the preset time;
[0013] If the time dimension is greater than the preset time, it is determined that the time dimension meets the preset repair condition, and the task is called up for repair.
[0014] Preferably, the step of calling up and repairing the task includes:
[0015] If the number of times of calling up and repairing is greater than or equal to the preset number and the task execution fails, calling up and repairing the task is stopped and a prompt message is output.
[0016] Preferably, after the step of obtaining the resource dimension or time dimension of the task, the step further includes:
[0017] Detecting whether there is a preset identifier in the task;
[0018] If the preset identifier exists in the task, comparing the resource dimension with a second preset parameter;
[0019] If the resource dimension is smaller than the second preset parameter, the task and its predecessor failed task are called up for repair.
[0020] Preferably, the step of calling up and repairing the task and its predecessor failed task comprises:
[0021] Detect whether the task has a failed predecessor task;
[0022] If the task has a predecessor failed task, the predecessor failed task and the task are recursively repaired upward.
[0023] Preferably, the step of detecting whether the task has a predecessor failed task comprises:
[0024] Obtaining the predecessor task information of the task;
[0025] Detecting whether there is a predecessor task that failed in execution in the predecessor task information;
[0026] If there is a predecessor task that has failed in execution in the predecessor task information, it is determined that the task has a predecessor task that has failed.
[0027] To achieve the above object, the present invention further provides a task repair device based on task scheduling, the task repair device based on task scheduling comprising:
[0028] A determination module, used to obtain key information of the task and determine whether the task has failed to execute according to the key information;
[0029] An acquisition module, used for acquiring a resource dimension or a time dimension of the task if the task execution fails;
[0030] The repair module is used to call up and repair the task if the resource dimension or the time dimension meets a preset repair condition.
[0031] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a task repair device based on task scheduling, wherein the task repair device based on task scheduling includes a memory, a processor, and a task repair program based on task scheduling stored in the memory and executable on the processor, wherein the task repair program based on task scheduling implements the steps of the above-mentioned task repair method based on task scheduling when executed by the processor.
[0032] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a task repair program based on task scheduling is stored, and when the task repair program based on task scheduling is executed by a processor, the steps of the above-mentioned task repair method based on task scheduling are implemented.
[0033] The embodiment of the present invention provides a task repair method, device, equipment and storage medium based on task scheduling, which obtains key information of the task, and determines whether the task fails to execute according to the key information; if the task fails to execute, the resource dimension or time dimension of the task is obtained; if the resource dimension or the time dimension meets the preset repair condition, the task is called up for repair. When the task fails to execute, the present invention automatically and timely calls up and repairs the failed task according to the resource dimension or time dimension of the task, avoiding task accumulation and task chain breakage, and effectively improving the efficiency of failed task repair. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a structural schematic diagram of the hardware operating environment involved in the embodiment of the task repair method based on task scheduling of the present invention;
[0035] Figure 2 It is a flowchart of a first embodiment of a task repair method based on task scheduling of the present invention;
[0036] Figure 3 It is a flowchart of a second embodiment of a task repair method based on task scheduling of the present invention;
[0037] Figure 4 It is a flowchart of a third embodiment of a task repair method based on task scheduling of the present invention;
[0038] Figure 5 It is a functional module diagram of a preferred embodiment of a task repair device based on task scheduling of the present invention.
[0039] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0040] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0041] The embodiment of the present invention provides a task repair method, device, equipment and storage medium based on task scheduling, which obtains key information of the task, and determines whether the task fails to execute according to the key information; if the task fails to execute, the resource dimension or time dimension of the task is obtained; if the resource dimension or the time dimension meets the preset repair condition, the task is called up for repair. When the task fails to execute, the present invention automatically and timely calls up and repairs the failed task according to the resource dimension or time dimension of the task, avoiding task accumulation and task chain breakage, and effectively improving the efficiency of failed task repair.
[0042] like Figure 1 As shown, Figure 1 It is a structural diagram of a task repair device based on task scheduling in a hardware operating environment involved in an embodiment of the present invention.
[0043] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0044] The task repair device based on task scheduling in the embodiment of the present invention may be a PC, or a portable terminal device such as a tablet computer or a portable computer.
[0045] like Figure 1 As shown, the task repair device based on task scheduling may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0046] Those skilled in the art will understand that Figure 1 The structure of the task repair device based on task scheduling shown in the figure does not constitute a limitation of the task repair device based on task scheduling, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0047] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a task repair program based on task scheduling.
[0048] exist Figure 1 In the device shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the task repair program based on task scheduling stored in the memory 1005, and perform the following operations:
[0049] Obtaining key information of the task, and determining whether the task has failed to execute according to the key information;
[0050] If the task fails to be executed, obtaining the resource dimension or time dimension of the task;
[0051] If the resource dimension or the time dimension meets the preset repair condition, the task is repaired.
[0052] Further, the preset repair condition includes that the resource dimension is less than a first preset parameter; if the resource dimension or the time dimension satisfies the preset repair condition, the step of activating and repairing the task includes:
[0053] Comparing the resource dimension with the first preset parameter;
[0054] If the resource dimension is smaller than the first preset parameter, it is determined that the resource dimension meets a preset repair condition, and the task is repaired.
[0055] Furthermore, the preset repair condition also includes that the time dimension is greater than a preset time; if the resource dimension or the time dimension satisfies the preset repair condition, the step of activating the task for repair also includes:
[0056] If the resource dimension is greater than or equal to the first preset parameter, comparing the time dimension with the preset time;
[0057] If the time dimension is greater than the preset time, it is determined that the time dimension meets the preset repair condition, and the task is called up for repair.
[0058] Further, after the step of calling up and repairing the task, the processor 1001 may be used to call a task repair program based on task scheduling stored in the memory 1005, and perform the following operations:
[0059] If the number of times of calling up and repairing is greater than or equal to the preset number and the task execution fails, calling up and repairing the task is stopped and a prompt message is output.
[0060] Furthermore, after the step of obtaining the resource dimension or time dimension of the task, the step further includes:
[0061] Detecting whether there is a preset identifier in the task;
[0062] If the preset identifier exists in the task, comparing the resource dimension with a second preset parameter;
[0063] If the resource dimension is smaller than the second preset parameter, the task and its predecessor failed task are called up for repair.
[0064] Furthermore, the step of calling up and repairing the task and its predecessor failed task includes:
[0065] Detect whether the task has a failed predecessor task;
[0066] If the task has a predecessor failed task, the predecessor failed task and the task are recursively repaired upward.
[0067] Furthermore, the step of detecting whether the task has a predecessor failed task includes:
[0068] Obtaining the predecessor task information of the task;
[0069] Detecting whether there is a predecessor task that failed in execution in the predecessor task information;
[0070] If there is a predecessor task that has failed in execution in the predecessor task information, it is determined that the task has a predecessor task that has failed.
[0071] In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0072] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0073] Reference Figure 2 The first embodiment of the present invention provides a flow chart of a task repair method based on task scheduling. In this embodiment, the task repair method based on task scheduling includes the following steps:
[0074] Step S10, obtaining key information of the task, and determining whether the task has failed to execute according to the key information;
[0075] In this embodiment, the task repair method based on task scheduling is applied to the task repair system based on task scheduling. The task repair system based on task scheduling is used to repair failed tasks that occur when using task scheduling. For the convenience of description, the task repair system based on task scheduling will be referred to as the system in the following. It can be understood that in the Internet era of data explosion, the amount of data is growing exponentially, and a large number of scheduling tasks are required every day to complete the processing of data. The failure of tasks due to their own or third-party reasons is also an inevitable phenomenon. If the failed task cannot be repaired in time, it will cause the subsequent tasks to be unable to proceed normally, resulting in the failure of the entire task chain. Often, a production accident will be caused because of the failure to repair a task in time. On this basis, the present application proposes a task repair method based on task scheduling. When a task fails to execute, the failed task is automatically and timely called up and repaired according to the resource dimension or time dimension of the task, avoiding task accumulation and task chain breakage, and effectively improving the efficiency of failed task repair.
[0076] Furthermore, in order to be able to repair the task in time after the task execution fails, the system uses Spring Schedule technology to periodically obtain key information on whether the task execution fails at regular intervals. The SpringSchedule technology is a task scheduling based on the spring framework, and the key information includes success, failure, and pending execution. After obtaining the key information of the task, the system determines whether the task execution fails based on the key information. Specifically, if the key information is success, the task execution is determined to be successful; if the key information is pending execution, the task is determined to be in an unexecuted state; if the key information is failure, the task execution is determined to have failed. After determining that the task execution has failed, the task can be automatically repaired according to the resource dimension or time dimension of the task, thereby improving the efficiency of repairing failed tasks.
[0077] Step S20, if the task execution fails, obtaining the resource dimension or time dimension of the task;
[0078] Furthermore, if it is determined through the key information of the task that the task has failed, the system obtains the resource dimension or time dimension of the task to determine whether the task needs to be called up for repair based on the resource dimension or time dimension of the task, so as to improve the efficiency of repairing failed tasks. In this embodiment, the resource dimension of the task is obtained first, and whether to repair the task is determined based on the resource dimension of the task. When the resource dimension of the task does not meet the repair condition, the time dimension of the task is obtained, and whether to repair the task is determined based on the time dimension of the task. The resource dimension in this embodiment is the cluster resource utilization rate, and the time dimension in this embodiment is Beijing time.
[0079] Step S30: If the resource dimension or the time dimension meets the preset repair condition, the task is repaired.
[0080] Further, the system determines whether the resource dimension or time dimension of the task meets the preset repair condition, wherein the preset repair condition includes that the resource dimension is less than the first preset parameter, and the time dimension is greater than the preset time; when the failed task is a core task, the preset repair condition includes that the resource dimension is less than the second preset parameter, and the time dimension is greater than the core task time; wherein the first preset parameter and the second preset parameter are parameters set according to actual needs and the second preset parameter is greater than the first preset parameter, the preset time and the core task time are times set according to actual needs and the core task time is less than the preset time, and the first preset parameters corresponding to different tasks may be the same or different, the second preset parameters corresponding to different tasks may be the same or different, the preset times corresponding to different tasks may be the same or different, and the core task times corresponding to different tasks may be the same or different. Specifically, the system first determines whether the resource dimension of the task meets the preset repair condition, and if the resource dimension of the task meets the preset repair condition, the task is called up for repair; if the resource dimension of the task does not meet the preset repair condition, it further determines whether the time dimension of the task meets the preset repair condition, and if the time dimension of the task meets the preset repair condition, the task is called up for repair. Through the resource dimension or time dimension of the task, the failed tasks can be automatically and timely called up for repair, avoiding task accumulation and task chain breakage, and effectively improving the efficiency of failed task repair.
[0081] Furthermore, the step of calling up and repairing the task includes:
[0082] Step S40: If the number of times of calling up and repairing is greater than or equal to the preset number and the task execution fails, the calling up and repairing of the task is stopped and a prompt message is output.
[0083] It is understandable that after the system calls up and repairs the task, it will detect the status of the task that has been called up and repaired. If the status of the task is still execution failure, the task will be called up and repaired for a preset number of times to repair the status of the task to successful execution. After the task is successfully repaired, the task is repaired, where the preset number of times is preferably 5 times in this embodiment. Furthermore, if the task is called up and repaired for a number of times greater than or equal to the preset number of times, and the status of the task is still execution failure, it means that there is a logical problem in the task or an external factor causes a problem with the task. The system stops calling up and repairing the task and outputs a prompt message via SMS to notify the task leader, reminding the task leader to check the problem with the task and manually repair the task, thereby preventing multiple cluster resource wastes and avoiding task accumulation, effectively improving the efficiency of repairing failed tasks.
[0084] The present embodiment provides a task repair method, apparatus, device and storage medium based on task scheduling, which obtains key information of the task, and determines whether the task fails to execute according to the key information; if the task fails to execute, the resource dimension or time dimension of the task is obtained; if the resource dimension or the time dimension meets the preset repair condition, the task is called up for repair. When the task fails to execute, the present invention automatically and timely calls up the failed task for repair according to the resource dimension or time dimension of the task, avoiding task accumulation and task chain breakage, and effectively improving the efficiency of failed task repair.
[0085] Further, refer to Figure 3 Based on the first embodiment of the task repair method based on task scheduling of the present invention, a second embodiment of the task repair method based on task scheduling of the present invention is proposed. In the second embodiment, if the resource dimension or the time dimension meets the preset repair condition, the step of calling up the task for repair includes:
[0086] Step S31, comparing the resource dimension with the first preset parameter;
[0087] Step S32: If the resource dimension is smaller than the first preset parameter, it is determined that the resource dimension meets a preset repair condition, and the task is repaired.
[0088] Furthermore, if the task is not a core task, the system compares the resource dimension of the task with the first preset parameter. Since the resource dimension in this embodiment is the cluster resource utilization rate, the system compares the cluster resource utilization rate of the task with the first preset parameter to determine the size relationship between the cluster resource utilization rate and the first preset parameter. Further, if the cluster resource utilization rate representing the resource dimension is determined to be less than the first preset parameter through comparison, since the preset repair condition when the task is not a core task is that the resource dimension is less than the first preset parameter, and the resource dimension is represented by the cluster resource utilization rate, the system determines that the resource dimension of the task meets the preset repair condition, and calls up and repairs the failed task to avoid task accumulation and task chain breakage, effectively improving the efficiency of failed task repair.
[0089] Furthermore, if the resource dimension or the time dimension meets a preset repair condition, the step of initiating repair of the task further includes:
[0090] Step S33: if the resource dimension is greater than or equal to the first preset parameter, then compare the time dimension with the preset time;
[0091] Step S34: if the time dimension is greater than the preset time, it is determined that the time dimension meets the preset repair condition, and the task is called up for repair.
[0092] Further, if it is determined by comparison that the cluster resource utilization rate representing the resource dimension of the task is greater than or equal to the first preset parameter, that is, the cluster resource has not been able to meet the resource dimension, when the time dimension meets the preset repair condition, the task must be called up for repair, because the time dimension meets the preset repair condition, indicating that the preset time may affect the subsequent tasks, so it is necessary to ignore the cluster resource utilization rate and call up the task for repair. The system further compares the time dimension of the task with the preset time. Since the time dimension in this embodiment is Beijing time, the system compares the Beijing time of the task failure with the preset time to determine the size relationship between the background time of the failure and the preset time. If it is determined by comparison that the Beijing time of the execution failure representing the time dimension is greater than the preset time, that is, the Beijing time of the execution failure exceeds the preset time, since the preset repair condition is that the time dimension is greater than the preset time when the task is not a core task, and the time dimension is represented by the Beijing time of the execution failure, the system determines that the time dimension of the task meets the preset repair condition, and calls up and repairs the failed task to avoid task accumulation and task chain breakage, effectively improving the efficiency of failed task repair.
[0093] When a task fails to execute, this embodiment automatically and timely calls up and repairs the failed task according to the resource dimension or time dimension of the task, thereby avoiding task accumulation and task chain breakage, and effectively improving the efficiency of failed task repair.
[0094] Further, refer to Figure 4 Based on the first embodiment of the task repair method based on task scheduling of the present invention, a third embodiment of the task repair method based on task scheduling of the present invention is proposed. In the third embodiment, after the step of obtaining the resource dimension or time dimension of the task, the following steps are further included:
[0095] Step A1, detecting whether there is a preset mark in the task;
[0096] Step A2: if the preset identifier exists in the task, comparing the resource dimension with a second preset parameter;
[0097] Step A3: If the resource dimension is smaller than the second preset parameter, the task and its predecessor failed task are repaired.
[0098] It is understandable that if the task to be executed is relatively important, a preset mark used to characterize the task as a core task can be added to the task when the task is initiated, such as adding a triangle, a five-pointed star, or even "core" information as a preset mark. Further, when the system detects that the status of the task is execution failure, it first detects whether there is a preset mark in the task, such as detecting whether there is a triangle, a five-pointed star, or even "core" information in the task. If it is determined through detection that there is a preset mark in the task, the task is determined to be a core task, and the resource dimension of the task is compared with the second preset parameter to determine whether the resource dimension of the task is less than the second preset parameter, so as to determine the size relationship between the resource dimension of the task and the second preset parameter. If it is determined through comparison that the resource dimension of the task is less than the second preset parameter, the task and its predecessor failed task are called up for repair, wherein the predecessor failed task is a predecessor task that has a dependency relationship with the task and fails to execute, and the predecessor task is a task that must be completed before executing the current task.
[0099] It can be understood that if the resource dimension of the task is greater than or equal to the second preset parameter, it is further determined whether the time dimension of the task is greater than the core task time. If the time dimension of the task is greater than the core task time, the task and its predecessor failed task are called up and repaired.
[0100] Furthermore, the step of calling up and repairing the task and its predecessor failed task includes:
[0101] Step A31, detecting whether the task has any predecessor failed task;
[0102] Step A32: If the task has a predecessor failed task, recursively repair the predecessor failed task and the task upward.
[0103] Furthermore, since different tasks may derive core tasks in the subsequent process, when the priority of the predecessor task from which the core task is derived is not high, it may happen that the subsequent core task is repaired but the predecessor task has not been repaired. Therefore, when repairing the core task, it is necessary to repair the predecessor task first and then repair the current core task. Therefore, the system detects whether there is a predecessor failed task for the currently failed task. If there is no predecessor failed task, the current task as the core task is called up for repair. On the contrary, if there is a predecessor failed task for the currently failed task, the system recursively repairs the predecessor failed task and the currently failed task upwards. Specifically, the system first repairs the predecessor failed task of the task. If there are multiple predecessor failed tasks, the repair starts from the predecessor failed task at the top. After all predecessor failed tasks are repaired, the task is called up for repair. For example, Task 4 derives from Task 5, which in turn derives from Task 6, and Task 4, Task 5, and Task 6 are all failed tasks. Task 4 and Task 5 have lower priority than Task 6. When Task 6 is a core task and the resource dimension meets the preset repair conditions, Task 4 needs to be repaired first, then Task 5, and finally Task 6 to complete the dependency repair of Task 6.
[0104] Furthermore, the step of detecting whether the task has a predecessor failed task includes:
[0105] Step A311, obtaining the predecessor task information of the task;
[0106] Step A312, detecting whether there is a predecessor task that has failed in execution in the predecessor task information;
[0107] Step A313: If there is a predecessor task that has failed in execution in the predecessor task information, it is determined that the task has a predecessor task that has failed.
[0108] Furthermore, the system obtains the predecessor task information of the currently failed task, wherein the number of predecessor task information is zero when the task is the topmost task (i.e., the task has no subsequent tasks derived therefrom), and can be one or more when the task is not the topmost task. After obtaining the predecessor task information of the task, the system detects whether there are any predecessor tasks that have failed to execute in the predecessor task information. Specifically, the system obtains the key information of whether each predecessor task has failed to execute in the predecessor task information through the Spring Schedule technology, and then determines whether each predecessor task has failed to execute based on the key information of each predecessor task; if it is determined through the detection that there are one or more predecessor tasks that have failed to execute in the predecessor task information, then it is determined that the task has a failed predecessor task.
[0109] In this embodiment, when the currently failed task is a core task and the resource dimension or time dimension of the task meets the preset repair conditions, the task and its predecessor failed tasks are recursively repaired upward to complete the dependency repair of the task, avoid task accumulation and task chain breakage, and effectively improve the efficiency of failed task repair.
[0110] Furthermore, the present invention also provides a task repair device based on task scheduling.
[0111] Reference Figure 5 , Figure 5 It is a functional module diagram of the first embodiment of the task repair device based on task scheduling of the present invention.
[0112] The task repair device based on task scheduling includes:
[0113] A determination module 10 is used to obtain key information of the task and determine whether the task has failed to be executed according to the key information;
[0114] An acquisition module 20, configured to acquire a resource dimension or a time dimension of the task if the task execution fails;
[0115] The repair module 30 is used to call up and repair the task if the resource dimension or the time dimension meets a preset repair condition.
[0116] Furthermore, the acquisition module 20 includes:
[0117] A first detection unit, used to detect whether a preset mark exists in the task;
[0118] A first comparison unit, configured to compare the resource dimension with a second preset parameter if the preset identifier exists in the task;
[0119] The first repairing unit is used to call up and repair the task and its predecessor failed task if the resource dimension is smaller than the second preset parameter.
[0120] Furthermore, the acquisition module 20 further includes:
[0121] A second detection unit, used to detect whether the task has a failed predecessor task;
[0122] The second repairing unit is used for recursively repairing the predecessor failed task and the task upwards if the task has a predecessor failed task.
[0123] Furthermore, the acquisition module 20 further includes:
[0124] An acquisition unit, used to acquire the predecessor task information of the task;
[0125] A third detection unit, used to detect whether there is a predecessor task that failed to execute in the predecessor task information;
[0126] The determining unit is configured to determine that the task has a failed predecessor task if there is a failed predecessor task in the predecessor task information.
[0127] Furthermore, the repair module 30 includes:
[0128] A second comparing unit, configured to compare the resource dimension with the first preset parameter;
[0129] The third repair unit is used to determine that the resource dimension meets a preset repair condition if the resource dimension is less than the first preset parameter, and to call up and repair the task.
[0130] Furthermore, the repair module 30 also includes:
[0131] A third comparing unit, configured to compare the time dimension with the preset time if the resource dimension is greater than or equal to the first preset parameter;
[0132] The fourth repairing unit is used to determine that the time dimension meets the preset repair condition if the time dimension is greater than the preset time, and to call up and repair the task.
[0133] Furthermore, the repair module 30 also includes:
[0134] The output unit is used to stop calling up and repairing the task and output a prompt message if the number of times of calling up and repairing is greater than or equal to a preset number and the task execution fails.
[0135] In addition, the present invention also provides a storage medium, which is preferably a computer-readable storage medium, on which a task repair program based on task scheduling is stored. When the task repair program based on task scheduling is executed by a processor, the steps of each embodiment of the above-mentioned task repair method based on task scheduling are implemented.
[0136] In the embodiments of the task repair device and computer-readable medium based on task scheduling of the present invention, all technical features of the above-mentioned embodiments of the task repair method based on task scheduling are included, and the description and explanation content are basically the same as those of the above-mentioned embodiments of the task repair method based on task scheduling, so they will not be repeated here.
[0137] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0138] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes several instructions for enabling a terminal device (which can be a fixed terminal, such as an IoT smart device, including smart air conditioners, smart lights, smart power supplies, smart routers and other smart homes; it can also be a mobile terminal, including smart phones, wearable networked AR / VR devices, smart speakers, self-driving cars and many other networked devices) to execute the methods described in the various embodiments of the present invention.
[0140] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A task repair method based on task scheduling, It is characterized in that The task repair method based on task scheduling includes: Obtaining key information of the task, and determining whether the task has failed to execute according to the key information; If the task fails to be executed, the resource dimension or time dimension of the task is obtained, wherein the resource dimension is the cluster resource utilization rate, and the time dimension is Beijing time; If the resource dimension or the time dimension meets the preset repair condition, the task is repaired; The preset repair condition includes that the resource dimension is less than a first preset parameter; if the resource dimension or the time dimension satisfies the preset repair condition, the step of calling up and repairing the task includes: Comparing the resource dimension with the first preset parameter; If the resource dimension is less than the first preset parameter, it is determined that the resource dimension meets the preset repair condition, and the task is repaired; The preset repair condition further includes that the time dimension is greater than a preset time; if the resource dimension or the time dimension satisfies the preset repair condition, the step of activating and repairing the task further includes: If the resource dimension is greater than or equal to the first preset parameter, comparing the time dimension with the preset time; If the time dimension is greater than the preset time, it is determined that the time dimension meets the preset repair condition, and the task is called up for repair.
2. The task repair method based on task scheduling as claimed in claim 1, It is characterized in that The step of calling up and repairing the task includes: If the number of times of calling up and repairing is greater than or equal to the preset number and the task execution fails, calling up and repairing the task is stopped and a prompt message is output.
3. The task repair method based on task scheduling as claimed in claim 1, It is characterized in that After the step of obtaining the resource dimension or time dimension of the task, the following step is further included: Detecting whether there is a preset identifier in the task; If the preset identifier exists in the task, comparing the resource dimension with a second preset parameter; If the resource dimension is smaller than the second preset parameter, the task and its predecessor failed task are called up for repair.
4. The task repair method based on task scheduling as claimed in claim 3, It is characterized in that The step of calling up and repairing the task and its predecessor failed task comprises: Detect whether the task has a failed predecessor task; If the task has a predecessor failed task, the predecessor failed task and the task are recursively repaired upward.
5. The task repair method based on task scheduling as claimed in claim 4, It is characterized in that The step of detecting whether the task has a predecessor failed task comprises: Obtaining the predecessor task information of the task; Detecting whether there is a predecessor task that failed in execution in the predecessor task information; If there is a predecessor task that has failed in execution in the predecessor task information, it is determined that the task has a predecessor task that has failed.
6. A task repair device based on task scheduling, It is characterized in that The task repair device based on task scheduling includes: A determination module, used to obtain key information of the task and determine whether the task has failed to execute according to the key information; An acquisition module, used for acquiring a resource dimension or a time dimension of the task if the task fails to be executed, wherein the resource dimension is a cluster resource utilization rate and the time dimension is Beijing time; A repair module, configured to call up and repair the task if the resource dimension or the time dimension meets a preset repair condition; The preset repair condition includes that the resource dimension is less than a first preset parameter, and the repair module includes: A second comparison unit, used to compare the resource dimension with a first preset parameter; A third repair unit, configured to determine that the resource dimension satisfies a preset repair condition if the resource dimension is less than the first preset parameter, and to call up and repair the task; The preset repair condition also includes that the time dimension is greater than a preset time, and the repair module further includes: A third comparing unit, configured to compare the time dimension with a preset time if the resource dimension is greater than or equal to the first preset parameter; The fourth repairing unit is used to determine that the time dimension meets the preset repair condition if the time dimension is greater than the preset time, and to call up and repair the task.
7. A task repair device based on task scheduling, It is characterized in that The task repair device based on task scheduling includes a memory, a processor, and a task repair program based on task scheduling stored in the memory and executable on the processor. When the task repair program based on task scheduling is executed by the processor, the steps of the task repair method based on task scheduling as described in any one of claims 1 to 5 are implemented.
8. A storage medium, It is characterized in that The storage medium stores a task repair program based on task scheduling, and when the task repair program based on task scheduling is executed by the processor, the steps of the task repair method based on task scheduling as described in any one of claims 1 to 5 are implemented.
