Batch task retry method, device, equipment and storage medium

Through the collaboration between the dispatch center and the task execution server, and by utilizing the service discovery mechanism and asynchronous monitoring technology, the problem of low efficiency in batch task retries is solved, automated retries and unified control are achieved, costs are reduced, and maintenance convenience is improved.

CN119512823BActive Publication Date: 2025-09-26湖南长银五八消费金融股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411736350.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-09-26
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In existing technologies, when batch tasks fail due to network jitter or concurrent operations, manual retry is inefficient and time-consuming. Automatic retry solutions require writing retry logic for each task, which increases R&D complexity and fails to systematically record task exceptions.

Method used

The batch task configuration parameters are obtained through the scheduling center, and a batch task execution framework software package with a service discovery mechanism is introduced to determine the task type and use the execution thread for asynchronous monitoring, predict the execution time, determine the tasks to be retried, and perform retry operations.

Benefits of technology

It achieves low-cost automation of batch task retries, improves maintenance convenience and unified task control, reduces labor costs and coding complexity, and supports the recording and display of task exceptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512823B_ABST
    Figure CN119512823B_ABST
Patent Text Reader

Abstract

The present application discloses a batch task retry method, apparatus, device and storage medium, which relates to the field of information technology, including: sending a batch task request generated based on the configuration parameters of the batch task obtained by the scheduling center to the memory queue of the task execution server; starting an execution thread based on a software package; the software package is a software package including a batch task execution framework provided based on a service discovery mechanism; if the configuration parameter is a parameter representing asynchronous execution of the batch task, then using the execution thread to execute the target batch task, judging whether the execution duration exceeds a target duration threshold, and determining a first execution result based on the judgment result; wherein a preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on the predicted duration obtained by a target execution duration prediction model; performing a task retry operation on the batch task to be retried determined based on the first execution result. Batch task retry can be achieved at a low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a batch task retry method, device, equipment and storage medium. Background Art

[0002] Currently, there are two solutions to the problem that batch tasks may not be successfully executed due to temporary issues such as data query failures caused by network jitter, failures caused by concurrent operations, etc. One is to have the development or operation and maintenance personnel manually restart the batch task after troubleshooting and confirming the problem, that is, manual retry; the other is to write automatic retry logic for each batch task during the development process, and automatically resolve the above problems through retry within the task execution. However, the former is inefficient and time-consuming to fix, and consumes additional manpower. Although the latter is slightly more efficient, each batch task needs to write its own retry logic for the same problem, which still requires a certain amount of R&D expenditure and increases the complexity of the coding. At the same time, we cannot automatically and reasonably record the execution exceptions and retries of batch tasks.

[0003] As can be seen from the above, how to implement batch task retry at low cost is an urgent problem to be solved. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a batch task retry method, device, equipment and storage medium, which can realize batch task retry at low cost. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a batch task retry method, comprising:

[0006] Using the scheduling center to obtain configuration parameters of the batch task, and sending the batch task request generated based on the configuration parameters to the corresponding task execution server, so that the task execution server stores the configuration parameters in the batch task request into a memory queue;

[0007] The software package introduced based on the task execution server starts the execution thread corresponding to the batch task, and obtains the batch task request from the memory queue through the execution thread; the software package is a software package including a batch task execution framework provided based on a service discovery mechanism;

[0008] Determining whether the configuration parameters corresponding to the batch task in the batch task request are parameters indicating asynchronous execution of the batch task;

[0009] If the configuration parameter is a parameter characterizing asynchronous execution of the batch task, the execution thread is used to execute the target batch task for which a preset monitoring method exists, and it is determined whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameter, and a first execution result of the target batch task is determined based on the determination result; wherein the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on the predicted duration obtained by the target execution duration prediction model;

[0010] The batch of tasks to be retried is determined based on the first execution result, and corresponding task retry operations are performed on the batch of tasks to be retried.

[0011] Optionally, starting an execution thread corresponding to the batch task based on the software package introduced by the task execution server, and obtaining the batch task request from the memory queue through the execution thread includes:

[0012] Encapsulating a batch task execution framework into a software package based on a service discovery mechanism, introducing the software package through the task execution server to start an execution thread corresponding to the batch task, and obtaining the corresponding batch task request from the memory queue through the execution thread;

[0013] Among them, the batch task execution framework includes a preset identification annotation corresponding to the batch task, a preset communication interface for receiving the batch task request sent by the scheduling center, a preset launcher for starting the task execution server, a registration thread for registering the service information corresponding to the batch task to the scheduling center, the execution thread for executing the batch task, and a preset executor interface encapsulated based on the execution thread.

[0014] Optionally, if the configuration parameter is a parameter indicating asynchronous execution of the batch tasks, then after using the execution thread to execute a target batch task with a preset monitoring method, determining whether the execution duration of the target batch task exceeds a target duration threshold in the configuration parameter, and determining a first execution result of the target batch task based on the determination result, the method further includes:

[0015] If the configuration parameter is not a parameter indicating asynchronous execution of the batch task, executing the batch task using the execution thread to obtain a second execution result;

[0016] Accordingly, determining the batch tasks to be retried based on the first execution result, and performing corresponding task retry operations on the batch tasks to be retried, includes:

[0017] The batch of tasks to be retried is determined based on the first execution result and the second execution result, and a corresponding task retry operation is performed on the batch of tasks to be retried.

[0018] Optionally, determining the batch of tasks to be retried based on the first execution result and the second execution result, and performing corresponding task retry operations on the batch of tasks to be retried, includes:

[0019] Determine a batch of tasks to be retried based on the first execution result and the second execution result, and determine whether the number of retries corresponding to the batch tasks to be retried is greater than a preset retry threshold;

[0020] If the number of retries corresponding to the batch task to be retried is greater than a preset retry threshold, marking the first scheduling record corresponding to the batch task to be retried as a failure state;

[0021] If the number of retries corresponding to the batch task to be retried is not greater than the preset retry threshold, marking the first scheduling record corresponding to the batch task to be retried as retried;

[0022] The batch task to be retried is used to create a second scheduling record for recording that the batch task to be retried is pulled by the task execution server, and based on a preset retry interval, the process jumps to the step of obtaining the configuration parameters of the batch task using the scheduling center.

[0023] Optionally, if the configuration parameter is a parameter indicating asynchronous execution of the batch task, executing the target batch task with a preset monitoring method using the execution thread includes:

[0024] If the configuration parameter is a parameter indicating asynchronous execution of the batch task, determining whether the preset executor interface corresponding to the batch task implements a preset monitoring method;

[0025] If the preset executor interface corresponding to the batch task implements the preset monitoring method, a target batch task that implements the preset monitoring method is obtained from the batch task.

[0026] Optionally, determining whether the execution duration of the target batch task exceeds a target duration threshold in the configuration parameter, and determining a first execution result of the target batch task based on the determination result includes:

[0027] Determine whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters;

[0028] If the execution time of the target batch task exceeds the target time threshold in the configuration parameter, the state after the target batch task is completed is considered as execution failure;

[0029] Accordingly, determining the batch of tasks to be retried based on the first execution result, and performing corresponding task retry operations on the batch of tasks to be retried, includes:

[0030] If the status of the target batch task after execution is execution failure, the target batch task is determined as a batch task to be retried, and a corresponding task retry operation is performed on the batch task to be retried.

[0031] Optionally, the process of determining the target duration threshold includes:

[0032] If the execution duration of the target batch task is not greater than the target threshold, a preset fixed duration threshold is used as the target duration threshold; the target threshold is a threshold determined based on a target execution time, and the target execution time is the execution time of the target batch task based on the target number and determined according to a preset sliding window rule;

[0033] If the execution time of the target batch tasks is greater than a target threshold, obtaining time series data based on the target number of target batch tasks, and performing a unit root test on the time series data;

[0034] Obtaining target time series data that meets a preset reliability condition based on the test results, and calculating the autocorrelation function and the partial autocorrelation function of the target time series data to obtain the corresponding number of autoregressive terms and the number of moving average terms;

[0035] Constructing each initial monitoring prediction model by using each difference order corresponding to the target time series data, each number of the autoregressive terms, and each number of the moving average terms, and evaluating each initial monitoring prediction model by using the Akaike information criterion and a chi-square test to obtain a target execution time prediction model;

[0036] When the target execution duration prediction model predicts the execution duration of the target batch task, if the obtained predicted duration is less than the target value, the preset duration threshold is used as the target duration threshold;

[0037] If the predicted duration is greater than the target value, the target duration threshold is obtained based on the predicted duration and the preset duration threshold.

[0038] In a second aspect, the present application provides a batch task retry device, comprising:

[0039] a task request sending module, configured to obtain configuration parameters of batch tasks from a scheduling center, and send batch task requests generated based on the configuration parameters to a corresponding task execution server, so that the task execution server stores the configuration parameters in the batch task requests into a memory queue;

[0040] An execution thread startup module, configured to start the execution thread corresponding to the batch task based on the software package introduced by the task execution server, and obtain the batch task request from the memory queue through the execution thread; the software package is a software package including a batch task execution framework provided based on a service discovery mechanism;

[0041] a configuration parameter determination module, configured to determine whether the configuration parameter corresponding to the batch task in the batch task request is a parameter indicating asynchronous execution of the batch task;

[0042] an execution result determination module configured to, if the configuration parameter is a parameter indicating asynchronous execution of the batch task, utilize the execution thread to execute a target batch task for which a preset monitoring method exists, determine whether the execution duration of the target batch task exceeds a target duration threshold in the configuration parameter, and determine a first execution result of the target batch task based on the determination result; wherein the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on a predicted duration obtained by a target execution duration prediction model;

[0043] The task retry module is used to determine the batch tasks to be retried based on the first execution result, and perform corresponding task retry operations on the batch tasks to be retried.

[0044] In a third aspect, the present application provides an electronic device, comprising:

[0045] Memory, used to store computer programs;

[0046] The processor is configured to execute the computer program to implement the aforementioned batch task retry method.

[0047] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned batch task retry method when executed by a processor.

[0048] The present application uses a scheduling center to obtain configuration parameters of batch tasks, and sends a batch task request generated based on the configuration parameters to the corresponding task execution server, so that the configuration parameters in the batch task request are stored in a memory queue through the task execution server; based on the software package introduced by the task execution server, the execution thread corresponding to the batch task is started, and the batch task request is obtained from the memory queue through the execution thread; the software package is a software package containing a batch task execution framework provided based on a service discovery mechanism; it is determined whether the configuration parameters corresponding to the batch task in the batch task request are indicative of asynchronous execution of the batch task execution parameters; if the configuration parameters are parameters that characterize the asynchronous execution of the batch tasks, the execution thread is used to execute the target batch task with a preset monitoring method, and it is judged whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameters, and the first execution result of the target batch task is determined based on the judgment result; wherein, the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined by the predicted duration obtained by the target execution duration prediction model; based on the first execution result, the batch task to be retried is determined, and the corresponding task retry operation is performed on the batch task to be retried.

[0049] As can be seen from the above, by introducing a software package containing a batch task execution framework provided based on a service discovery mechanism into the task execution server, the execution thread of the batch task is started, and it is determined whether the configuration parameters corresponding to the batch task are parameters that characterize the asynchronous execution of the batch task. If the configuration parameters are parameters that characterize the asynchronous execution of the batch task, it is determined whether there is a preset listening method in the batch task. If there is a preset listening method in the batch task, the batch task is determined as the target batch task, and the target batch task is executed using the execution thread. Then, it is determined whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters, and the first execution result corresponding to the target batch task is determined based on the judgment result. In this way, the scheduling center can determine the batch task to be retried through the first execution result, integrate the retry mechanism of the batch task into the scheduling center, improve the function of the scheduling center, make the control and operation of the batch task more unified, improve the convenience of maintenance, and reduce the cost of batch task retry. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0051] Figure 1 This is a flow chart of a batch task retry method disclosed in this application;

[0052] Figure 2 A functional diagram of a software package provided for this application;

[0053] Figure 3 A schematic diagram of a batch task execution method provided by this application;

[0054] Figure 4 A flow chart of a specific batch task retry method provided in this application;

[0055] Figure 5 This is a structural diagram of a batch task retry device disclosed in this application;

[0056] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0058] Currently, there are two solutions for batch task retry. One is that after troubleshooting and confirming the problem, the development or operation and maintenance personnel manually restart the batch task, which is called manual retry. The other is that during the development process, the automatic retry logic is written for each batch task, and when the above problem occurs, it is automatically resolved by retrying within the task execution. However, the former is inefficient and time-consuming to repair, and consumes extra manpower. Although the latter has a slight improvement in efficiency, each batch task needs to write its own retry logic for the same problem, which still has a certain amount of R&D cost and increases the complexity of coding. At the same time, we cannot automatically make a complete and reasonable system record of the execution exceptions and retries of batch tasks. To this end, this application provides a batch task retry method that integrates the retry mechanism of batch tasks into the dispatch center, improves the function of the dispatch center, makes the control and operation of batch tasks more unified, improves the convenience of maintenance, and reduces the cost of batch task retry.

[0059] See also Figure 1 As shown, an embodiment of the present invention discloses a batch task retry method, comprising:

[0060] Step S11: Obtain configuration parameters of batch tasks using the scheduling center, and send a batch task request generated based on the configuration parameters to the corresponding task execution server, so that the task execution server stores the configuration parameters in the batch task request into a memory queue.

[0061] In this embodiment, the dispatch center can configure corresponding configuration parameters for batch tasks. The dispatch center obtains these configuration parameters and sends a batch task request containing the batch tasks and the corresponding configuration parameters to the corresponding task execution server. After receiving the batch task request, the task execution server places the configuration parameters in the batch task request into the task execution server's memory queue. The configuration parameters include, but are not limited to, the maximum number of retries, whether the task is asynchronous, and the retry interval.

[0062] Step S12: starting the execution thread corresponding to the batch task based on the software package introduced by the task execution server, and obtaining the batch task request from the memory queue through the execution thread; the software package is a software package including a batch task execution framework provided based on a service discovery mechanism.

[0063] In this embodiment, a software package including a batch task execution framework is provided based on a service discovery mechanism, and the software package is introduced through the task execution server to start the execution thread corresponding to the batch task, so as to pull the corresponding batch task request from the memory queue through the execution thread. Specifically, the software package introduced based on the task execution server starts the execution thread corresponding to the batch task, and obtains the batch task request from the memory queue through the execution thread, including: encapsulating the batch task execution framework into the software package based on the service discovery mechanism, and introducing the software package through the task execution server to start the execution thread corresponding to the batch task, and obtaining the corresponding batch task request from the memory queue through the execution thread; wherein the batch task execution framework includes a preset identification annotation corresponding to the batch task, a preset communication interface for receiving the batch task request sent by the scheduling center, a preset launcher for starting the task execution server, a registration thread for registering the service information corresponding to the batch task to the scheduling center, the execution thread for executing the batch task, and a preset executor interface encapsulated based on the execution thread.

[0064] It is understood that the software package includes a batch task execution framework, Figure 2This is a functional diagram of a software package provided in this embodiment. The software package includes preset identification annotations corresponding to the batch tasks, a preset communication interface for receiving the batch task requests sent by the scheduling center, an HTTP interface, a preset launcher for starting the task execution server, a registration thread for registering the service information corresponding to the batch tasks with the scheduling center, the execution thread for executing the batch tasks, and a preset executor interface encapsulated based on the execution thread. Among them, the preset identification annotation is a custom annotation used to identify the batch task; the http (hypertext transfer protocol) interface is used to receive various requests from the scheduling center, mainly requests for detecting the health status of the task execution server and batch task invocation requests; the preset launcher is started when the server is started, and scans the bean of the executor implementation class of the batch task (that is, the role of the application material) according to the preset identification annotation, encapsulates it into the execution thread object of the execution thread, and starts the execution thread. In addition, it is also responsible for starting the registration thread; the registration thread is used to register the service information corresponding to the execution of the batch task to the scheduling center; the execution thread is responsible for the batch task invocation and encapsulates the batch task execution process framework of the server; the preset executor interface is an encapsulated batch task execution interface, which provides a standard task invocation method for the access party to implement, and provides an optional preset listening method to handle the asynchronous execution of the batch tasks.

[0065] Step S13: Determine whether the configuration parameters corresponding to the batch tasks in the batch task request are parameters indicating asynchronous execution of the batch tasks.

[0066] In this embodiment, after the batch task request is obtained, it is determined whether the configuration parameters corresponding to the batch tasks in the batch task request are parameters indicating asynchronous execution of the batch tasks, so that different methods are executed based on different configuration parameters. Figure 3 A schematic diagram of a batch task execution method provided for this embodiment, wherein the encapsulation interface includes an execution method responsible for invoking the batch task and a listenProgress method (i.e., a preset listening method) for monitoring the progress of asynchronous batch task execution. For batch tasks in which the entire process of invocation, data processing, and the return of result information is executed synchronously, it is only necessary to implement the execution method. However, the logic contained in the execution method is relatively more complex, including not only the invocation of the task but also the determination of the final status after the task execution is completed. For batch tasks that are executed asynchronously, two methods must be implemented, wherein the execution method is responsible for invoking the batch task, and the preset listening method is responsible for determining whether the batch task is completed and the completion status.

[0067] Step S14: If the configuration parameter is a parameter characterizing asynchronous execution of the batch task, the execution thread is used to execute the target batch task for which a preset monitoring method exists, and it is determined whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameter, and a first execution result of the target batch task is determined based on the judgment result; wherein the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on the predicted duration obtained based on the target execution duration prediction model.

[0068] In this embodiment, after determining whether the configuration parameter corresponding to the batch task in the batch task request is a parameter representing the asynchronous execution of the batch task, the execution method of the batch task is different based on the different configuration parameters. In a specific embodiment, if the configuration parameter is a parameter representing the asynchronous execution of the batch task, it is determined whether the preset executor interface that executes the batch task implements the preset monitoring method. If the preset executor interface implements the preset monitoring method, the batch task corresponding to the preset monitoring method is determined as the target batch task. Specifically, if the configuration parameter is a parameter representing the asynchronous execution of the batch task, the target batch task with the preset monitoring method is executed using the execution thread, including: if the configuration parameter is a parameter representing the asynchronous execution of the batch task, it is determined whether the preset executor interface corresponding to the batch task implements the preset monitoring method; if the preset executor interface corresponding to the batch task implements the preset monitoring method, the target batch task that implements the preset monitoring method is obtained from the batch task.

[0069] Furthermore, after obtaining the target batch task, it is determined whether the execution time of the target batch task exceeds the target time threshold determined based on the predicted time obtained by the target execution time prediction model. If the execution time of the target batch task exceeds the target time threshold, the first execution result of the target batch task is characterized as execution failure. Specifically, the determination of whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters, and determining the first execution result of the target batch task based on the determination result, includes: determining whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters; if the execution time of the target batch task exceeds the target time threshold in the configuration parameters, the state of the target batch task after completion of execution is characterized as execution failure.

[0070] In another specific embodiment, if the configuration parameter is not a parameter representing the asynchronous execution of the batch task, then the batch task is proved to be a synchronously executed task, and the batch task is executed by the execution thread to obtain a second execution result. Specifically, if the configuration parameter is not a parameter representing the asynchronous execution of the batch task, then the batch task is executed by the execution thread to obtain a first execution result corresponding to the final state after the batch task is executed. Specifically, if the configuration parameter is a parameter representing the asynchronous execution of the batch task, then the target batch task with a preset monitoring method is executed by the execution thread, and it is determined whether the execution time of the target batch task exceeds the target time threshold in the configuration parameter, and after determining the first execution result of the target batch task based on the judgment result, it also includes: if the configuration parameter is not a parameter representing the asynchronous execution of the batch task, then the batch task is executed by the execution thread to obtain a second execution result.

[0071] In this embodiment, as the business volume gradually increases and fluctuates, the corresponding execution time will change accordingly. Therefore, the operation and maintenance or development personnel need to reset the monitoring time at regular intervals, and after determining the target time threshold based on the predicted time obtained by the target execution time prediction model, determine whether the execution time of the target batch task exceeds the target time threshold. Wherein, the process of determining the target time threshold includes: if the execution time of the target batch task is not greater than the target threshold, then the preset fixed time threshold is used as the target time threshold; the target threshold is a threshold determined based on the target execution time, and the target execution time is the execution time determined based on the target number of target batch tasks and in accordance with the preset sliding window rule; if the execution time of the target batch task is greater than the target threshold, then the time series data is obtained based on the target number of target batch tasks, and the unit root test is performed on the time series data; based on the test results, the target time series data that meets the preset reliability conditions is obtained, and the target time series data is automatically tested by performing a unit root test on the target time series data. Correlation function calculation and partial autocorrelation function calculation are performed to obtain the corresponding number of autoregressive terms and moving average terms; each initial monitoring prediction model is constructed by the differential orders corresponding to the target time series data, each of the autoregressive terms and each of the moving average terms, and each of the initial monitoring prediction models is evaluated and chi-squared tested using the Akaike information criterion to obtain a target execution duration prediction model; when the target execution duration prediction model predicts the execution duration of the target batch task, if the obtained predicted duration is less than the target value, the preset duration threshold is used as the target duration threshold; if the predicted duration is greater than the target value, the target duration threshold is obtained based on the predicted duration and the preset duration threshold.

[0072] Furthermore, a target execution duration prediction model can be used to predict the execution duration of asynchronous batch tasks. For a new target batch task, due to insufficient data volume, the execution progress of the target batch task is monitored based on an initially configured initial duration threshold. When the data volume meets a preset trigger condition, the target batch task based on the target number is triggered, and the target execution time is determined according to a preset sliding window rule. In a specific implementation, the latest 180 pieces of data can be taken, and the number of data falling within the window can be intercepted and counted with a window size of 5 minutes and a step size of 1 minute, that is, window 1 is 0-5 minutes, and window 2 is 1-6 minutes. Check whether the start time corresponding to the window with the largest number of data is less than 60 minutes. At this time, 60 minutes is equivalent to the target threshold. If the window time period corresponding to the window with the largest number of data is less than 60 minutes, it indicates that the execution time of the target batch task is short, and 60 minutes can be used as the target time threshold. If the window time period corresponding to the window with the largest number of data is not less than 60 minutes, the 180 pieces of data are divided into 4 groups of time series with a window size of 90 and a step size of 30, that is, 0-90 pieces as a group, 30-120 pieces as a group, 60-160 pieces as a group, and 0-180 pieces as a group. The following operations are performed on each group of original time series: First, use ADF (Augmented Decomposition) to calculate the time series. The Dickey-Fuller test (a statistical method used to test the stationarity of time series data) tests the original time series, the first-order difference series, and the second-order difference series at 90%, 95%, and 99% confidence levels, respectively, to eliminate series that fail any of the tests. A first-order difference series is an operation that calculates the difference between each element in the original time series and the previous element. Specifically, for the nth element in a sequence, its first-order difference is defined as the difference between the nth element and the n-1th element.

[0073] If the confidence test of each difference sequence fails, continue to calculate the n-order difference sequence; then perform model identification on all the obtained sequences, first calculate their autocorrelation function (ACF, Autocorrelation Function) and partial autocorrelation function (PACF, Partial AutoCorrelation Function), for example, a set of time series , and The correlation coefficient is The k-order correlation coefficient, the autocorrelation coefficient calculation formula is as follows:

[0074] ;

[0075] in, is the length of the time series, is the mean of the complete time series, is the autocovariance, and the calculation formula of the autocovariance is:

[0076] ;

[0077] For example, a complete time series is , the first part is , the latter part is , the mean is , the variance of the time series is:

[0078] ; The autocovariance is:

[0079] ;

[0080] The autocorrelation coefficient is:

[0081] ;

[0082] It is understood that any partial autocorrelation function (PACF) calculation method can be used to obtain the corresponding number of autoregressive terms p and moving average terms q. From this, the three key parameters of the initial monitoring prediction model (p, q, and differencing order d) are obtained. Difference order d is the order of differencing required for the original time series, allowing for the construction of multiple usable prediction models. The resulting prediction models are then evaluated, and the Akaike Information Criterion (AIC) is used to determine the target execution time prediction model for each data set. This unique p, d, and q are determined for each of the four data sets. If the target execution time prediction model for each of the four data sets is the same, the target execution time prediction model is directly used for prediction. Otherwise, the first three data sets are predicted using the established model, and the predicted data are compared with the actual data using a chi-square test. Specifically, the predicted data for each of the first three data sets are compared with the actual data, with the error being calculated as |predicted data - actual data| / actual data. If the error is less than 5%, the prediction is considered valid; otherwise, it is invalid. The frequencies of valid and invalid data in the three groups are counted and chi-square tests are performed on each pair, ultimately yielding a unique optimal target execution duration prediction model. The target execution duration prediction model is used to predict the next execution duration of the target batch task. When the target execution duration prediction model predicts the execution duration of the target batch task, if the predicted duration is lower than the target value, the default preset duration threshold is used; if the predicted value is higher than the target value, the preset duration threshold is added to the predicted duration as the target duration threshold.

[0083] Step S15: Determine the batch tasks to be retried based on the first execution result, and perform corresponding task retry operations on the batch tasks to be retried.

[0084] In this embodiment, after obtaining the first execution result and the second execution result, a batch of tasks to be retried is determined based on the first execution result and the second execution result, and a corresponding task retry operation is performed on the batch of tasks to be retried. Specifically, determining the batch of tasks to be retried based on the first execution result and performing the corresponding task retry operation on the batch of tasks to be retried includes: determining the batch of tasks to be retried based on the first execution result and the second execution result, and performing the corresponding task retry operation on the batch of tasks to be retried.

[0085] It is understandable that if the first execution result or the second execution result is an execution failure, the batch task or the target batch task that failed to execute will be determined as a batch task to be retried, and a task retry operation will be performed on the batch task to be retried. Specifically, the batch task to be retried is determined based on the first execution result, and the corresponding task retry operation is performed on the batch task to be retried, including: if the status of the target batch task after execution is an execution failure, the target batch task is determined as a batch task to be retried, and the corresponding task retry operation is performed on the batch task to be retried.

[0086] Furthermore, after determining the batch tasks to be retried, it is determined that the number of retries corresponding to the batch tasks to be retried is greater than a preset retry threshold, and based on the judgment result, the scheduling record corresponding to the batch tasks to be retried is marked or the batch task scheduling process is reopened. Specifically, the method of determining the batch tasks to be retried based on the first execution result and the second execution result, and performing corresponding task retry operations on the batch tasks to be retried, includes: determining the batch tasks to be retried based on the first execution result and the second execution result, and judging whether the number of retries corresponding to the batch tasks to be retried is greater than a preset retry threshold; if the number of retries corresponding to the batch tasks to be retried is greater than the preset retry threshold, marking the first scheduling record corresponding to the batch tasks to be retried as a failed state; if the number of retries corresponding to the batch tasks to be retried is not greater than the preset retry threshold, marking the first scheduling record corresponding to the batch tasks to be retried as retried; using the batch tasks to be retried to create a second scheduling record for recording that the batch tasks to be retried are pulled by the task execution server, and jumping to the step of obtaining the configuration parameters of the batch tasks using the scheduling center based on the preset retry interval time.

[0087] In a specific embodiment, during the first scheduling, the preset retry threshold corresponding to the batch task to be retried is read. When the task retry operation is performed on the batch task to be retried, the original retry record -1 is used as the new number of retries, until the number of retries is 0, indicating that the batch task to be retried cannot continue to be retried. If the batch task to be retried cannot continue to be retried, that is, the number of retries corresponding to the batch task to be retried is greater than the preset retry threshold, the scheduling record corresponding to the batch task to be retried is marked as a failed state and sealed; if the batch task to be retried can continue to be retried, that is, the number of retries corresponding to the batch task to be retried is not greater than the preset retry threshold, then the database transaction is started, the scheduling record corresponding to the batch task to be retried is marked as retried, and a new scheduling record is initialized to be associated with the batch task to be retried, and finally the task scheduling process is restarted based on the preset retry interval. It should be pointed out that the preset retry threshold and the preset retry interval can be adjusted according to actual conditions and are not specifically limited here.

[0088] As can be seen from the above, by introducing a software package containing a batch task execution framework provided based on a service discovery mechanism into the task execution server, the execution thread of the batch task is started, and it is determined whether the configuration parameters corresponding to the batch task are parameters that characterize the asynchronous execution of the batch task. If the configuration parameters are parameters that characterize the asynchronous execution of the batch task, it is determined whether there is a preset listening method in the batch task. If there is a preset listening method in the batch task, the batch task is determined as the target batch task, and the target batch task is executed using the execution thread. Then, it is determined whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters, and the first execution result corresponding to the target batch task is determined based on the judgment result. In this way, the scheduling center can determine the batch task to be retried through the first execution result, integrate the retry mechanism of the batch task into the scheduling center, improve the function of the scheduling center, make the control and operation of the batch task more unified, improve the convenience of maintenance, and reduce the cost of batch task retry.

[0089] It can be seen from the above embodiments that the present application performs task retry operations on batch tasks that are executed synchronously or asynchronously based on the scheduling center and the task execution server. Therefore, the process of performing task retry operations on batch tasks that are executed synchronously or asynchronously based on the scheduling center and the task execution server is described.

[0090] See also Figure 4 As shown, the embodiment of the present invention provides a specific batch task retry method, including:

[0091] First, the scheduling center obtains the various configuration parameters corresponding to the execution of batch tasks, and sends the batch task request generated by the configuration parameters to the corresponding task execution server. The task execution server receives the batch task request and stores the configuration parameters in the batch task request in a memory queue. At the same time, the software package containing the batch task execution framework introduced by the task execution server starts the service to start the execution thread, then pulls the batch task request from the memory queue, and determines whether the configuration parameters corresponding to the batch task in the batch task request are parameters that represent asynchronous execution of the batch task. If the configuration parameters are parameters that represent asynchronous execution of the batch task, the execution thread is used to execute the target batch task with the preset monitoring method until the target batch task is executed and a first execution result is obtained. If the configuration parameters are parameters that represent synchronous execution of the batch task, the execution thread is used to execute the batch task and obtain a second execution result based on the execution result status. The first execution result and the second execution result are sent to the scheduling center in the form of a message queue.

[0092] After obtaining the message queue through the dispatch center, the batch tasks to be retried are retrieved based on the message queue, and the original scheduling record and corresponding configuration parameters for the batch tasks to be retried are queried from the database. A series of service and status checks can be performed in conjunction with the wired state machine. Specifically, the state machine is initialized using the current state of the original scheduling record, and the retry signal corresponding to the batch tasks to be retried is input. If the next state is output normally, the next step can be continued. If the state machine exits, the message is intercepted. Then, it is determined whether the number of retries corresponding to the batch tasks to be retried exceeds the preset retry threshold. If the number of retries corresponding to the batch tasks to be retried exceeds the preset retry threshold, the original scheduling record corresponding to the batch tasks to be retried is marked as failed and sealed. If the number of retries corresponding to the batch tasks to be retried does not exceed the preset retry threshold, the first scheduling record corresponding to the batch tasks to be retried is marked as retried and sealed, and then a new scheduling record is initialized for association. Finally, the task scheduling process is restarted according to the preset retry interval.

[0093] As can be seen from the above, introducing the batch task retry framework into the task execution server in the form of a software package avoids a large amount of repeated development or manual maintenance, and improves the efficiency of task retry; integrating the batch task retry mechanism into the scheduling platform improves the functionality of the scheduling platform, making the control and operation of batch tasks more unified and improving the convenience of maintenance; recording the retry of batch tasks and supporting page display helps to understand and control the task execution status and helps to troubleshoot and handle task execution anomalies.

[0094] Accordingly, see Figure 5 As shown, the present application also provides a batch task retry device, comprising:

[0095] The task request sending module 11 is used to obtain the configuration parameters of the batch task from the scheduling center, and send the batch task request generated based on the configuration parameters to the corresponding task execution server, so that the configuration parameters in the batch task request are stored in the memory queue by the task execution server;

[0096] An execution thread starting module 12 is configured to start an execution thread corresponding to the batch task based on a software package introduced by the task execution server, and obtain the batch task request from the memory queue through the execution thread; the software package is a software package including a batch task execution framework provided based on a service discovery mechanism;

[0097] A configuration parameter determination module 13 is configured to determine whether the configuration parameter corresponding to the batch task in the batch task request is a parameter indicating asynchronous execution of the batch task;

[0098] an execution result determination module 14 for, if the configuration parameter is a parameter indicating asynchronous execution of the batch task, using the execution thread to execute a target batch task for which a preset monitoring method exists, determining whether the execution duration of the target batch task exceeds a target duration threshold in the configuration parameter, and determining a first execution result of the target batch task based on the determination result; wherein the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on a predicted duration obtained by a target execution duration prediction model;

[0099] The task retry module 15 is configured to determine a batch of tasks to be retried based on the first execution result, and perform corresponding task retry operations on the batch of tasks to be retried.

[0100] As can be seen from the above, by introducing a software package containing a batch task execution framework provided based on a service discovery mechanism into the task execution server, the execution thread of the batch task is started, and it is determined whether the configuration parameters corresponding to the batch task are parameters that characterize the asynchronous execution of the batch task. If the configuration parameters are parameters that characterize the asynchronous execution of the batch task, it is determined whether there is a preset listening method in the batch task. If there is a preset listening method in the batch task, the batch task is determined as the target batch task, and the target batch task is executed using the execution thread. Then, it is determined whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters, and the first execution result corresponding to the target batch task is determined based on the judgment result. In this way, the scheduling center can determine the batch task to be retried through the first execution result, integrate the retry mechanism of the batch task into the scheduling center, improve the function of the scheduling center, make the control and operation of the batch task more unified, improve the convenience of maintenance, and reduce the cost of batch task retry.

[0101] In some specific implementations, the execution thread start module 12 may specifically include:

[0102] The task request acquisition unit is used to encapsulate the batch task execution framework into a software package based on the service discovery mechanism, introduce the software package through the task execution server to start the execution thread corresponding to the batch task, and obtain the corresponding batch task request from the memory queue through the execution thread.

[0103] In some specific implementations, the batch task retry device may further include:

[0104] a first configuration parameter judgment unit, configured to, if the configuration parameter is not a parameter indicating asynchronous execution of the batch task, execute the batch task using the execution thread to obtain a second execution result;

[0105] Accordingly, the task retry module 15 may specifically include:

[0106] The first task retry completing unit is configured to determine a batch of tasks to be retried based on the first execution result and the second execution result, and perform a corresponding task retry operation on the batch of tasks to be retried.

[0107] In some specific implementations, the task retry module 15 may specifically include:

[0108] a retry count determination unit, configured to determine a batch task to be retried based on the first execution result and the second execution result, and determine whether the number of retries corresponding to the batch task to be retried is greater than a preset retry threshold;

[0109] A first record marking unit, configured to mark a first scheduling record corresponding to the batch task to be retried as a failure state if the number of retries corresponding to the batch task to be retried is greater than a preset retry threshold;

[0110] A second record marking unit is configured to mark the first scheduling record corresponding to the batch task to be retried as retried if the number of retries corresponding to the batch task to be retried is not greater than a preset retry threshold;

[0111] A scheduling record creation unit is used to use the batch task to be retried to create a second scheduling record for recording that the batch task to be retried is pulled by the task execution server, and jump to the step of using the scheduling center to obtain the configuration parameters of the batch task based on the preset retry interval time.

[0112] In some specific implementations, the configuration parameter determination module 13 may specifically include:

[0113] a second configuration parameter determination unit configured to determine, if the configuration parameter is a parameter indicating asynchronous execution of the batch task, whether a preset executor interface corresponding to the batch task implements a preset monitoring method;

[0114] The target task acquisition unit is configured to acquire a target batch task that implements the preset monitoring method from the batch tasks if the preset executor interface corresponding to the batch tasks implements the preset monitoring method.

[0115] In some specific implementations, the execution result determination module 14 may specifically include:

[0116] An execution duration judgment unit, configured to judge whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameters;

[0117] a task status determining unit, configured to indicate that the target batch task is in a failed execution state if the execution duration of the target batch task exceeds the target duration threshold in the configuration parameter;

[0118] Accordingly, the task retry module 15 may specifically include:

[0119] The second task retry completion unit is configured to determine the target batch task as a batch task to be retried if the status of the target batch task after execution is execution failure, and perform a corresponding task retry operation on the batch task to be retried.

[0120] In some specific implementations, the execution result determination module 14 may specifically include:

[0121] a target duration threshold determination unit, configured to use a preset fixed duration threshold as the target duration threshold if the execution duration of the target batch task is not greater than the target threshold; the target threshold is a threshold determined based on a target execution time, and the target execution time is an execution time determined based on the target number of target batch tasks and in accordance with a preset sliding window rule;

[0122] a data verification unit, configured to obtain time series data based on a target number of target batch tasks and perform a unit root test on the time series data if the execution time of the target batch tasks is greater than a target threshold;

[0123] a function calculation unit, configured to obtain target time series data that meets a preset reliability condition based on the test result, and to obtain the corresponding number of autoregressive terms and moving average terms by performing autocorrelation function calculation and partial autocorrelation function calculation on the target time series data;

[0124] a target model determination unit, configured to construct each initial monitoring prediction model using each difference order, each number of autoregressive terms, and each number of moving average terms corresponding to the target time series data, and to evaluate each initial monitoring prediction model using the Akaike information criterion and a chi-square test to obtain a target execution duration prediction model;

[0125] a first threshold determination unit, configured to, when the target execution duration prediction model predicts the execution duration of the target batch task, use a preset duration threshold as the target duration threshold if the predicted duration is less than a target value;

[0126] The second threshold determination unit is configured to obtain the target duration threshold based on the predicted duration and the preset duration threshold if the predicted duration is greater than the target value.

[0127] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the batch task retry method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0128] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0129] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0130] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the batch task retry method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of implementing other specific tasks.

[0131] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned disclosed batch task retry method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.

[0132] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0133] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0134] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0135] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0136] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A batch task retry method, characterized in that: include: Using the scheduling center to obtain configuration parameters of the batch task, and sending the batch task request generated based on the configuration parameters to the corresponding task execution server, so that the task execution server stores the configuration parameters in the batch task request into a memory queue; Starting an execution thread corresponding to the batch task based on the software package introduced by the task execution server, and obtaining the batch task request from the memory queue through the execution thread; The software package is a software package including a batch task execution framework provided based on a service discovery mechanism; Determining whether the configuration parameters corresponding to the batch task in the batch task request are parameters indicating asynchronous execution of the batch task; If the configuration parameter is a parameter characterizing asynchronous execution of the batch task, the execution thread is used to execute the target batch task for which a preset monitoring method exists, and it is determined whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameter, and a first execution result of the target batch task is determined based on the determination result; wherein the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on the predicted duration obtained by the target execution duration prediction model; The batch tasks to be retried are determined based on the first execution result, and corresponding task retry operations are performed on the batch tasks to be retried.

2. The batch task retry method according to claim 1, characterized in that: The software package introduced based on the task execution server starts the execution thread corresponding to the batch task, and obtains the batch task request from the memory queue through the execution thread, including: Encapsulating a batch task execution framework into a software package based on a service discovery mechanism, introducing the software package through the task execution server to start an execution thread corresponding to the batch task, and obtaining the corresponding batch task request from the memory queue through the execution thread; Among them, the batch task execution framework includes a preset identification annotation corresponding to the batch task, a preset communication interface for receiving the batch task request sent by the scheduling center, a preset launcher for starting the task execution server, a registration thread for registering the service information corresponding to the batch task to the scheduling center, the execution thread for executing the batch task, and a preset executor interface encapsulated based on the execution thread.

3. The batch task retry method according to claim 1, characterized in that: If the configuration parameter is a parameter indicating asynchronous execution of the batch task, the method further includes: executing the target batch task for which a preset monitoring method is provided by using the execution thread, determining whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameter, and determining a first execution result of the target batch task based on the determination result. If the configuration parameter is not a parameter indicating asynchronous execution of the batch task, executing the batch task using the execution thread to obtain a second execution result; Accordingly, determining the batch tasks to be retried based on the first execution result, and performing corresponding task retry operations on the batch tasks to be retried, includes: The batch of tasks to be retried is determined based on the first execution result and the second execution result, and a corresponding task retry operation is performed on the batch of tasks to be retried.

4. The batch task retry method according to claim 3, characterized in that: The determining the batch of tasks to be retried based on the first execution result and the second execution result, and performing corresponding task retry operations on the batch of tasks to be retried, includes: Determine a batch of tasks to be retried based on the first execution result and the second execution result, and determine whether the number of retries corresponding to the batch tasks to be retried is greater than a preset retry threshold; If the number of retries corresponding to the batch task to be retried is greater than a preset retry threshold, marking the first scheduling record corresponding to the batch task to be retried as a failed state; If the number of retries corresponding to the batch task to be retried is not greater than the preset retry threshold, marking the first scheduling record corresponding to the batch task to be retried as retried; The batch task to be retried is used to create a second scheduling record for recording that the batch task to be retried is pulled by the task execution server, and based on a preset retry interval, the process jumps to the step of obtaining the configuration parameters of the batch task using the scheduling center.

5. The batch task retry method according to any one of claims 1 to 4, characterized in that: If the configuration parameter is a parameter indicating asynchronous execution of the batch task, executing the target batch task with a preset monitoring method using the execution thread includes: If the configuration parameter is a parameter indicating asynchronous execution of the batch task, determining whether the preset executor interface corresponding to the batch task implements a preset monitoring method; If the preset executor interface corresponding to the batch task implements the preset monitoring method, a target batch task that implements the preset monitoring method is obtained from the batch task.

6. The batch task retry method according to claim 1, characterized in that: The determining whether the execution duration of the target batch task exceeds the target duration threshold in the configuration parameter, and determining the first execution result of the target batch task based on the determination result, includes: Determine whether the execution time of the target batch task exceeds the target time threshold in the configuration parameters; If the execution time of the target batch task exceeds the target time threshold in the configuration parameter, the status of the target batch task after completion of execution is considered as execution failure; Accordingly, determining the batch tasks to be retried based on the first execution result, and performing corresponding task retry operations on the batch tasks to be retried, includes: If the status of the target batch task after execution is execution failure, the target batch task is determined as a batch task to be retried, and a corresponding task retry operation is performed on the batch task to be retried.

7. The batch task retry method according to claim 6, characterized in that: The process of determining the target duration threshold includes: If the execution duration of the target batch task is not greater than the target threshold, a preset fixed duration threshold is used as the target duration threshold; the target threshold is a threshold determined based on a target execution time, and the target execution time is the execution time of the target batch task based on the target number and determined according to a preset sliding window rule; If the execution time of the target batch tasks is greater than a target threshold, obtaining time series data based on the target number of target batch tasks, and performing a unit root test on the time series data; Obtaining target time series data that meets a preset reliability condition based on the test results, and calculating the autocorrelation function and the partial autocorrelation function of the target time series data to obtain the corresponding number of autoregressive terms and the number of moving average terms; Constructing each initial monitoring prediction model by using each difference order corresponding to the target time series data, each number of the autoregressive terms, and each number of the moving average terms, and evaluating each initial monitoring prediction model by using the Akaike information criterion and a chi-square test to obtain a target execution time prediction model; When the target execution duration prediction model predicts the execution duration of the target batch task, if the obtained predicted duration is less than the target value, the preset duration threshold is used as the target duration threshold; If the predicted duration is greater than the target value, the target duration threshold is obtained based on the predicted duration and the preset duration threshold.

8. A batch task retry device, characterized in that: include: a task request sending module, configured to obtain configuration parameters of batch tasks from a scheduling center, and send batch task requests generated based on the configuration parameters to a corresponding task execution server, so that the task execution server stores the configuration parameters in the batch task requests into a memory queue; An execution thread starting module, configured to start an execution thread corresponding to the batch task based on the software package introduced by the task execution server, and obtain the batch task request from the memory queue through the execution thread; The software package is a software package including a batch task execution framework provided based on a service discovery mechanism; a configuration parameter determination module, configured to determine whether the configuration parameter corresponding to the batch task in the batch task request is a parameter indicating asynchronous execution of the batch task; an execution result determination module configured to, if the configuration parameter is a parameter indicating asynchronous execution of the batch task, utilize the execution thread to execute a target batch task for which a preset monitoring method exists, determine whether the execution duration of the target batch task exceeds a target duration threshold in the configuration parameter, and determine a first execution result of the target batch task based on the determination result; wherein the preset monitoring method is used to monitor the execution progress of the target batch task, and the target duration threshold is a duration threshold determined based on a predicted duration obtained by a target execution duration prediction model; The task retry module is used to determine the batch tasks to be retried based on the first execution result, and perform corresponding task retry operations on the batch tasks to be retried.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the batch task retry method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the batch task retry method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data consistency processing method and equipment

    CN113392119A

  • Method and device for processing batch tasks

    CN114327816A