Batch task execution method and device, electronic equipment and storage medium
By identifying and re-executing erroneous tasks in the batch task set and using structured query statements to obtain business data, the inefficiency problem in existing technologies is solved, and efficient task execution is achieved.
Patent Information
- Application Number
- CN202211565674.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-07
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-12-07
AI Technical Summary
When an execution error is found in a batch processing task set, existing technologies require re-executing all tasks from the first batch processing task, resulting in low efficiency.
By acquiring the batch task set and business data, the system identifies tasks that are executed incorrectly and uses structured query statements to retrieve the business data of the incorrect tasks. The incorrect tasks are then executed again, thus avoiding the duplication of all tasks.
It improves the execution efficiency of batch task sets, avoids unnecessary duplication of work, and ensures the accuracy of task results.
Smart Images

Figure CN116128588B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a batch task execution method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of computer technology, enterprises and companies in various industries generate a large amount of work data, and this work data needs to be statistically analyzed. Through the statistical results, we can intuitively understand the situation and problems reflected by this work data.
[0003] When statistically analyzing this work data, batch processing tasks are typically performed to test the statistical data analysis equipment and ensure the accuracy of the output results. In related technologies, the batch processing task set contains multiple batch processing tasks. When an error is found in the execution of a batch processing task, all batch processing tasks are re-executed starting from the first task in the set. This significantly reduces the efficiency of completing the batch processing task set. Therefore, improving the efficiency of completing the batch processing task set is a pressing issue that needs to be addressed. Summary of the Invention
[0004] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide a batch task execution method, apparatus, electronic device, and storage medium. By re-executing batch tasks whose actual execution results differ from preset results using structured query statements, the application avoids the situation where all batch tasks in a batch task set are executed repeatedly.
[0005] In a first aspect, one embodiment of this application provides a batch task execution method, the method comprising: obtaining a batch task set and corresponding batch business data, wherein the batch task set contains multiple batch tasks; sequentially executing the multiple batch tasks contained in the batch task set based on the batch business data to obtain the actual execution results corresponding to each of the multiple batch tasks; if, based on the actual execution results corresponding to each of the multiple batch tasks, it is determined that there is a batch task with an execution error among the multiple batch tasks, then obtaining a structured query statement corresponding to the batch task with the execution error, wherein the batch task with the execution error includes batch tasks whose actual execution results do not match the preset execution results, and the structured query statement is used to find the batch business data corresponding to the batch task with the execution error; obtaining the batch business data corresponding to the batch task with the execution error from the batch business data corresponding to the batch task set based on the structured query statement corresponding to the batch task with the execution error; and re-executing the batch task with the execution error based on the batch business data corresponding to the batch task with the execution error.
[0006] Secondly, one embodiment of this application provides a batch task execution apparatus, which includes: a first acquisition module, configured to acquire a batch task set and corresponding batch business data, wherein the batch task set contains multiple batch tasks; a first execution module, configured to sequentially execute the multiple batch tasks contained in the batch task set based on the batch business data, and obtain the actual execution results corresponding to each of the multiple batch tasks; a second acquisition module, configured to, if based on the actual execution results corresponding to each of the multiple batch tasks, determine that there is a batch task with an execution error among the multiple batch tasks, then acquire a structured query statement corresponding to the batch task with the execution error, wherein the batch task with the execution error includes batch tasks whose actual execution results do not match the preset execution results, and the structured query statement is used to find the batch business data corresponding to the batch task with the execution error; a third acquisition module, configured to, based on the structured query statement corresponding to the batch task with the execution error, acquire the batch business data corresponding to the batch task with the execution error from the batch business data corresponding to the batch task set; and a second execution module, configured to, based on the batch business data corresponding to the batch task with the execution error, execute the batch task with the execution error again.
[0007] Thirdly, one embodiment of this application provides a computer-readable storage medium storing a computer program for performing the method described in the first aspect.
[0008] Fourthly, one embodiment of this application provides an electronic device, the electronic device comprising: a processor; a memory for storing processor-executable instructions; the processor being configured to perform the method described in the first aspect.
[0009] The batch task execution method provided in this application involves obtaining a batch task set and corresponding batch business data; sequentially executing multiple batch tasks contained in the batch task set based on the batch business data to obtain the actual execution results of each batch task; if, based on the actual execution results of each batch task, it is determined that there is a batch task with an execution error, then a structured query statement corresponding to the erroneous batch task is obtained; based on the structured query statement corresponding to the erroneous batch task, the batch business data corresponding to the erroneous batch task is obtained from the batch business data corresponding to the batch task set; and based on the batch business data corresponding to the erroneous batch task, the erroneous batch task is executed again. When an erroneous batch task is detected, this application uses a structured query statement to re-execute the batch task whose actual result does not match the preset result, avoiding the situation where all batch tasks in the batch task set are executed repeatedly, thereby improving the efficiency of completing the batch task set execution. Attached Figure Description
[0010] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0011] Figure 1 The diagram shown is a scenario applicable to an embodiment of this application.
[0012] Figure 2 The diagram shown is a flowchart of a batch task execution method provided in an embodiment of this application.
[0013] Figure 3 The diagram shown is a flowchart illustrating the e-commerce platform settlement method provided in this embodiment of the application.
[0014] Figure 4 The diagram shown is a schematic diagram of the batch task execution device provided in an embodiment of this application.
[0015] Figure 5 The diagram shown is a structural schematic of the e-commerce platform settlement device provided in an embodiment of this application.
[0016] Figure 6 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. Detailed Implementation
[0017] The technical solutions in the embodiments of this application will now be described in conjunction with the accompanying drawings.
[0018] The embodiments described herein are clearly and completely specific, and obviously, only a portion of the embodiments of this application, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0019] The technical solutions of this application embodiment can be applied to the e-commerce industry, which is a platform for trading goods through e-commerce platforms. In the e-commerce industry, stores on e-commerce platforms usually settle their daily business data to obtain settlement data. Through the settlement data, one can intuitively understand the store's business situation on that day.
[0020] When settling these sales data, e-commerce platform settlement devices are typically used for statistical analysis. Before using these devices, it's usually necessary to test them by executing batch processing tasks with large amounts of sales data to ensure the accuracy of the output settlement data. In related technologies, when an error is detected in the batch processing task set, all batch processing tasks are re-executed from the first task in the set, significantly reducing the efficiency of executing the batch processing task set. Therefore, improving the efficiency of batch processing task set execution is a pressing issue that needs to be addressed.
[0021] To improve the efficiency of batch processing tasks, this embodiment of the application can obtain a set of batch processing tasks and the corresponding batch processing business data. Based on the batch processing business data, multiple batch processing tasks contained in the set are executed sequentially to obtain the actual execution results for each task. If, based on the actual execution results, it is determined that there are batch processing tasks with execution errors, a structured query statement corresponding to the task with the error is obtained. Based on the structured query statement, the corresponding batch processing business data is obtained from the batch processing business data of the set. Based on the corresponding batch processing business data, the task with the error is executed again. By re-executing batch processing tasks whose actual results do not match the preset results using a structured query statement, the situation of repeatedly executing all batch processing tasks in the set is avoided, thus improving the efficiency of completing the batch processing task set.
[0022] Figure 1 The diagram shown illustrates a scenario applicable to an embodiment of this application. This scenario includes a user 101, an e-commerce platform 102, a batch processing task execution system 103, and an e-commerce platform settlement system 104.
[0023] For example, user 101 can be a staff member with review permissions for the backend of the store on e-commerce platform 102. User 101 can select the sales data of the corresponding store on e-commerce platform 102 and can filter the sales data, such as selecting sales data of a certain product for a certain period of time, or data of a certain type of product for a certain period of time, etc., without limitation. Further, the sales data is input into the batch processing task execution system 103, and a batch processing task corresponding to the sales data is created in the batch processing task execution system 103, such as a settlement task for sales data of a certain product for a certain period of time, so that the batch processing task execution system 103 can execute the batch processing task using the sales data.
[0024] For example, e-commerce platform 102 is a platform for online shopping. User 101 can select to import the sales data of the corresponding store into batch processing task execution system 103 through e-commerce platform 102, so that batch processing task execution system 103 can execute batch processing tasks.
[0025] For example, the batch processing task execution system 103 is included in the e-commerce platform settlement system 104. The batch processing task execution system 103 can import batch processing tasks created by user 101 through the e-commerce platform 102, so that the e-commerce platform settlement system 104 can output the e-commerce data table corresponding to the batch processing task through the execution result of the batch processing task. The e-commerce data table may include the sales data imported by user 101 through the e-commerce platform 102 and the profit value calculated based on the sales data, etc. The execution method used by the batch processing task execution system 103 will be explained in detail in the following embodiments, and will not be repeated here.
[0026] For example, the e-commerce platform settlement system 104 can use the batch task execution system 103 to execute batch tasks, and output the e-commerce data table corresponding to the batch task through the execution result of the batch task, so that users can read the corresponding settlement data through the e-commerce data table.
[0027] In practical applications, user 101 can select the data to be settled through e-commerce platform 102 and import it into batch task execution system 103. In batch task execution system 103, a corresponding batch task is created. After the batch task execution system 103 completes the execution of the batch task set, e-commerce platform settlement system 104 outputs an e-commerce data table based on the execution results. User 101 reads the corresponding settlement data through the output e-commerce data table.
[0028] Figure 2 The diagram shown is a flowchart illustrating a batch task execution method provided in an exemplary embodiment of this application. Figure 2 As shown in the embodiments of this application, the batch task execution method may include the following steps.
[0029] Step S201: Obtain the batch processing task set and the corresponding batch processing business data.
[0030] For example, a batch processing task set may contain multiple batch processing tasks. A batch processing task could be a task that uses a computer system to automatically close accounts using batch processing business data, generate general ledgers in batches, and generate system reports in batches. The batch processing business data can be data reconstructed through certain computational logic, or it can be previously used batch processing business data; there are no limitations on this.
[0031] For example, the batch processing data contains all the data needed to perform the batch processing task.
[0032] Step S202: Based on the batch processing business data, execute multiple batch processing tasks contained in the batch processing task set in sequence to obtain the actual execution results corresponding to each batch processing task.
[0033] For example, batch processing tasks can be created by users, and the batch processing tasks in the batch processing task set can be executed sequentially according to the order in which they are created by the users, so as to obtain the actual execution results corresponding to each batch processing task. The actual execution results are the results calculated by the batch processing task using the corresponding batch processing business data.
[0034] In practical applications, the actual execution result can be an e-commerce data table, which contains all the batch processing business data corresponding to the batch processing task. The batch processing business data is then summed and averaged according to rows and columns using preset algorithms to obtain settlement data.
[0035] Specifically, based on the batch processing business data, multiple batch processing tasks contained in the batch processing task set are executed sequentially to obtain the actual execution results corresponding to each of the multiple batch processing tasks. This can include the following steps.
[0036] Step A: Obtain the start time of task execution for the batch task set.
[0037] For example, the task execution start time of a batch task set can be considered as the task execution start time of the first batch task in the batch task set, and the execution log of the batch task can also include the task execution start time of the batch task.
[0038] For example, the task execution start time is determined based on the execution start times of multiple historical tasks in the batch task set, and the execution times of these historical tasks are different. Specifically, the accuracy rate of the actual execution results when the batch task set starts execution at the execution start times of the multiple historical tasks can be statistically analyzed. The accuracy rate of the actual execution results is the sum of the probabilities of the actual execution results of each batch task in the batch task set matching the preset execution results. After statistical analysis, the execution start time of the historical task with the highest accuracy rate can be selected as the task execution start time.
[0039] Step B: Based on the batch processing business data, execute multiple batch processing tasks contained in the batch processing task set sequentially at the task execution start time to obtain the actual execution results corresponding to each batch processing task.
[0040] In practical applications, taking the e-commerce industry as an example, it's common practice to compile daily sales data. However, real-time statistics can increase workload and negatively impact results as sales data fluctuates. Therefore, it's necessary to set the timing for sales data collection. For instance, setting it to midnight daily allows for the automatic execution of batch task sets at midnight. This avoids the problem of inaccurate sales data results caused by the sales data being updated again after being compiled during batch task execution.
[0041] Specifically, in the process of sequentially executing multiple batch tasks contained in the batch task set based on batch business data to obtain the actual execution results corresponding to each of the multiple batch tasks, the batch task execution method may also include the following steps.
[0042] Step A: Use the asynchronous query task interface to query the actual execution results of each completed batch task.
[0043] For example, the asynchronous query task interface allows for real-time querying of the actual execution results of completed batch tasks during the execution of multiple batch tasks in a batch task set.
[0044] For example, the actual execution result, preset execution result, and structured query statement corresponding to each batch task are stored in an execution log. The actual execution result corresponding to each completed batch task can be queried from the execution log through the asynchronous query task interface. Similarly, the preset execution result and structured query statement can also be obtained from the execution log, which will not be elaborated further below.
[0045] Step B: Obtain the preset execution results corresponding to each completed batch task.
[0046] For example, after querying a completed batch task, the preset execution result of the queried batch task can be obtained to determine the correctness of the actual execution result.
[0047] Step C: Determine whether there are any batch tasks that have executed errors and whose actual execution results do not match their corresponding preset execution results.
[0048] For example, both the actual execution result and the preset execution result can be presented in the form of a data table. The data in the actual execution result data table are compared with the data in the preset execution result data table. If there is no difference between the data in the two data tables, the actual execution result is considered to be consistent with the corresponding preset execution result. If there is a difference between the data in the two data tables, the actual execution result is considered to be inconsistent with the corresponding preset execution result.
[0049] Specifically, the judgment is made by whether the actual execution result is the same as the preset execution result. If they are the same, they are consistent; if they are different, they are inconsistent.
[0050] For example, in actual application, if the judgment result of step C is negative, that is, there is no batch task with execution error in each batch task that has been executed and whose actual execution result does not match the corresponding preset execution result, then step D is executed. If the judgment result of step C is positive, that is, there is a batch task with execution error in each batch task that has been executed and whose actual execution result does not match the corresponding preset execution result, then step E is executed.
[0051] Step D: Confirm that the batch task set has been completed.
[0052] For example, batch execution tasks are executed based on executable code. If the actual execution result of the batch execution task matches the preset execution result, then the executable code corresponding to the batch execution task can be considered as the correct executable code.
[0053] Step E: Obtain the reverse structured query statement corresponding to the batch task that failed to execute.
[0054] Step F: Use the reverse structured query statement corresponding to the batch running task that failed to execute to retrieve the execution code corresponding to the batch running task that failed to execute.
[0055] For example, as the batch processing tasks in the batch processing task set proceed, the overall execution code of the batch processing tasks also runs continuously. The overall execution code of the batch processing task set includes the execution code of each individual batch processing task within the set. A reverse structured query statement can retrieve the execution code corresponding to a batch processing task from the overall execution code of the batch processing task set.
[0056] Step G: Based on the difference between the actual execution result and the preset execution result, modify the execution code corresponding to the batch task that failed to execute.
[0057] For example, the difference between the actual execution result and the preset execution result is the distinction between the actual execution result and the preset execution result. Based on the difference, the execution code corresponding to the batch task that erroneously executes can be modified so that when the batch task is run again, it can be executed using the modified execution code. The actual execution result obtained after running the batch task again is compared with the preset execution result. If the actual execution result and the preset execution result are still different, the execution code is modified again until the actual execution result and the preset execution result are exactly the same, so as to ensure the correctness of the batch task execution result.
[0058] For example, after modifying the execution code corresponding to the batch task that malfunctioned, a batch task with the same task type as the malfunctioning task can be selected from the subsequent batch tasks. The execution logs of this batch task with the same task type can then be retrieved. Furthermore, the execution code of this batch task with the same task type can be retrieved using a reverse structured query in the execution logs, and then modified. Here, "same task type" means that the batch tasks use the same calculation method, such as summation, difference, or average. The calculation method is not limited here.
[0059] In practical applications, the completed batch task can be queried through the asynchronous query task interface. If the actual execution result of the batch task differs from the preset result, the execution code corresponding to the batch task can be retrieved from the total execution code of the batch task set through a reverse structured query statement. The execution code can then be modified, and the modified batch task will be executed using the modified execution code.
[0060] In another practical application, as batch tasks in the batch task set are executed, the asynchronous query task interface can be used to immediately query the completed batch tasks. After confirming that the actual execution result of the queried batch task is the same as the preset execution result, the subsequent batch tasks can continue to be executed. If the actual execution result differs from the preset execution result, the corresponding execution code can be retrieved using a reverse structured query statement. After retrieval, the execution code is modified according to the difference, and the modified execution code is inserted into the total execution code of the batch task set in reverse, so that the batch tasks can be executed again and the subsequent batch tasks can be executed sequentially after the re-execution.
[0061] Specifically, before obtaining the structured query statement corresponding to the batch task that failed to execute, the batch task execution method may also include the following steps.
[0062] Step A: Based on the task execution data of each of the multiple batch running tasks, generate the execution logs corresponding to each of the multiple batch running tasks.
[0063] For example, the task execution data of a batch processing task includes the data obtained after executing the execution code corresponding to the batch processing task.
[0064] For example, the execution log may include the structured query statements, actual execution results, preset execution results, and task execution start time for each of the multiple batch tasks. The corresponding structured query statements, actual execution results, and preset execution results can be obtained from the execution log by calling the execution log corresponding to the batch task.
[0065] Step B: Based on the execution logs of each of the multiple batch processing tasks, determine the structured query fields for each of the multiple batch processing tasks.
[0066] For example, the structured query field is the index corresponding to the structured query statement. When querying other data such as the actual execution result, the corresponding field can also be determined from the execution log to determine the corresponding data.
[0067] Step C: Parse and process the structured query fields corresponding to each of the multiple batch processing tasks to determine the structured query statements corresponding to each of the multiple batch processing tasks.
[0068] Step S203: Determine whether there are any batch tasks with execution errors among the multiple batch tasks based on the actual execution results of each of the multiple batch tasks.
[0069] For example, batch processing tasks that result in execution errors can include those where the actual execution result does not match the preset execution result. Specifically, the judgment can be based on a preset execution result obtained in advance and verified using the batch processing task. If the actual execution result does not match the preset execution result, it can be considered that there is a batch processing task with execution errors; if the actual execution result matches the preset execution result, it can be considered that there is no batch processing task with execution errors. The preset execution result can be the execution result of a batch processing task that has been previously completed and verified, or it can be the execution result of a batch processing task manually calculated using the corresponding batch processing business data, depending on whether the batch processing business data is reconstructed or previously used.
[0070] For example, in actual application, if the judgment result of step S203 is negative, then step S204 is executed; if the judgment result of step S203 is positive, then step S205 is executed.
[0071] Step S204: Confirm that the batch task set has been completed.
[0072] Step S205: Obtain the structured query statement corresponding to the batch task that failed to execute.
[0073] For example, structured query statements can be used to find batch processing business data corresponding to batch processing tasks that have failed to execute.
[0074] Specifically, during the execution of the batch task set, an execution log is generated for each batch task after it is completed. The structured query statement corresponding to the batch task can be obtained from the execution log. The execution log will be explained in detail in the following embodiments and will not be repeated here.
[0075] Step S206: Based on the structured query statement corresponding to the batch running task that failed to execute, retrieve the batch running business data corresponding to the batch running task that failed to execute from the batch running business data corresponding to the batch running task set.
[0076] For example, the structured query statement exists in the form of code. The structured query statement can be used to directly retrieve the execution code of the batch task that failed to execute and the batch business data required to execute the execution code. The structured query statement can be used to retrieve the execution code of the batch task that failed to execute and the batch business data required to execute the execution code. The execution code and the required batch business data can be used to execute the batch task again.
[0077] Specifically, based on the structured query statement corresponding to the batch running task that failed to execute, the batch running business data corresponding to the batch running task set can be obtained from the batch running business data corresponding to the batch running task that failed to execute, which may include the following steps.
[0078] Step A: Obtain the reverse structured query statement from the structured query statement.
[0079] For example, a reverse structured query statement is used to query the execution code corresponding to a batch task that has an execution error.
[0080] Step B: Retrieve the execution code corresponding to the batch task that failed to execute, based on the reverse structured query statement.
[0081] For example, the execution code corresponding to a batch task that malfunctions is included in the total execution code of the batch task set.
[0082] For example, the reverse structured query statement exists in code form. It can be used to determine the execution code of the batch task that failed to execute, and then retrieve that execution code by executing the reverse structured query statement. Here, the code is retrieved.
[0083] Step C: Based on the execution code corresponding to the batch running task that malfunctioned, retrieve the batch running business data corresponding to the batch running task that malfunctioned from the batch running business data corresponding to the batch running task set.
[0084] For example, the reverse structured query statement can also retrieve batch processing business data. By executing the execution code corresponding to the erroneous batch processing task, the batch processing business data required by the execution code can be determined and retrieved by the reverse structured query statement.
[0085] Specifically, based on the execution code corresponding to the batch running task that erred, obtaining the batch running business data corresponding to the batch running task that erred from the batch running business data can include the following steps.
[0086] Step C1: Insert the modified execution code corresponding to the batch task with the execution error into the total execution code of the batch task set.
[0087] For example, once the execution code is completed, it will become invalid. Therefore, the execution code needs to be inserted into the total execution code of the batch task set, and the inserted code will be executed.
[0088] For example, inserting the modified execution code corresponding to the batch task with the execution error into the total execution code of the batch task set means inserting the modified execution code in reverse order into the total execution code of the batch task set. For instance, the execution code consists of three lines of code: code 1, code 2, and code 3. The execution order is: first execute code 1, then code 2, and finally code 3. When these three lines of code need to be inserted back into the total execution code for re-execution after execution, code 3 needs to be inserted first, then code 2, and finally code 1.
[0089] Step C2: Based on the inserted modified execution code corresponding to the batch running task with the execution error, retrieve the batch running business data corresponding to the batch running task with the execution error from the batch running business data.
[0090] Step S207: Based on the batch processing business data corresponding to the batch processing task that failed to execute, re-execute the batch processing task that failed to execute.
[0091] Specifically, re-executing the batch processing task that resulted in the error, based on the batch processing business data corresponding to the task that failed, can include the following steps.
[0092] Step A: Obtain the forward structured query statement from the structured query statement.
[0093] For example, a forward structured query statement is used to query the execution order of the execution code corresponding to a batch task that has an execution error.
[0094] Step B: Based on the execution order of the execution code corresponding to the batch running task with execution error found by the positive structured query statement, re-execute the batch running task with execution error using the batch running business data corresponding to the batch running task with execution error.
[0095] For example, since the executable code can include multiple lines of code, the execution order of the multiple lines of code in the batch execution code corresponding to the batch task with execution errors, retrieved by a forward structured query, can be used to execute the inserted code. This avoids the situation where the executable code is executed in an incorrect order when an error occurs during insertion or execution. For instance, the executable code includes three lines of code: code 1, code 2, and code 3. The execution order is: first code 1, then code 2, and finally code 3. When these three lines of code need to be inserted back into the overall executable code, if the insertion order changes to insert code 3, then code 1, and finally code 2, the execution order will be: first code 2, then code 1, and finally code 3. In this case, the execution order of the multiple lines of code retrieved by the forward structured query will be used to insert code 3, code 2, and code 1 in that order, thus ensuring that code 1 is executed first, then code 2, and finally code 3.
[0096] For example, the completion of a batch task execution is considered to have obtained the actual execution result of the batch task, and the completion of a batch task set execution is considered to have obtained the actual execution results of all batch tasks in the batch task set, and the actual execution results are all consistent with the corresponding preset execution results.
[0097] In practical applications, after all batch tasks in the batch task set have been executed, the actual execution results of each batch task can be viewed. If the actual execution result of a batch task does not match the preset execution result, then the batch task can be executed again using a structured query statement.
[0098] In another practical application, based on the batch processing business data, the first batch processing task in the batch processing task set can be executed first to obtain the actual execution result of the first batch processing task. Then, the actual execution result of the first batch processing task is compared with the corresponding preset execution result. If they match, the subsequent batch processing tasks are executed sequentially, starting from the second batch processing task, until all batch processing tasks in the batch processing task set are completed. If they do not match, the first batch processing task is executed again, and then the subsequent batch processing tasks are executed sequentially, starting from the second batch processing task, until all batch processing tasks in the batch processing task set are completed.
[0099] In this embodiment, after multiple batch tasks in the batch task set have been executed, if the actual execution result of a certain batch task does not match the preset execution result, the inconsistent batch task can be executed again directly through a structured query statement, without having to start execution from the first batch task in the batch task set, thus improving the efficiency of batch execution.
[0100] Figure 3 The diagram shown is a flowchart illustrating an e-commerce platform settlement method provided in an exemplary embodiment of this application. Figure 3 As shown in the embodiments of this application, the e-commerce platform settlement method may include the following steps.
[0101] Step S301: In response to the settlement application from the e-commerce platform, obtain the e-commerce batch processing task set and the e-commerce batch processing business data corresponding to the e-commerce batch processing task set from the e-commerce platform.
[0102] For example, the settlement application may include e-commerce batch processing business data that needs to be settled on the e-commerce platform.
[0103] For example, an e-commerce wholesale task set contains multiple e-commerce wholesale tasks. The e-commerce wholesale business data can be the sales data of one or more stores on an e-commerce platform at a certain time.
[0104] Step S302: Execute multiple e-commerce batch processing tasks based on e-commerce batch processing business data.
[0105] For example, using the above Figure 2 The method described in the mentioned embodiments executes multiple e-commerce batch processing tasks.
[0106] Step S303: After multiple e-commerce batch processing tasks are completed, generate the e-commerce data tables corresponding to each of the multiple e-commerce batch processing tasks.
[0107] For example, the e-commerce data table records the e-commerce wholesale business data and the settlement data such as the sum, difference and average value calculated from the e-commerce wholesale business data.
[0108] Step S304: Based on the e-commerce data tables corresponding to each of the multiple e-commerce batch processing tasks, determine the settlement data corresponding to the settlement application.
[0109] In this embodiment, the batch processing task execution method is applied to an e-commerce platform. By executing the e-commerce batch processing task, an e-commerce data table is obtained, which is used to determine the settlement data corresponding to the settlement application.
[0110] The above text combined Figure 2 The following describes in detail an embodiment of the batch task execution method of this application, in conjunction with... Figure 4 This document describes in detail the embodiments of the batch task execution apparatus of this application. It should be understood that the descriptions of the batch task execution method embodiments correspond to the descriptions of the batch task execution apparatus embodiments; therefore, any parts not described in detail can be referred to the preceding method embodiments.
[0111] Figure 4 The diagram shown is a schematic representation of a batch task execution device provided in an exemplary embodiment of this application. Figure 4 As shown in the embodiments of this application, the batch task execution device may include the following modules.
[0112] The first acquisition module 401 is used to acquire the batch processing task set and the batch processing business data corresponding to the batch processing task set.
[0113] The first execution module 402 is used to sequentially execute multiple batch tasks contained in the batch task set based on the batch business data, and obtain the actual execution results corresponding to each of the multiple batch tasks.
[0114] The second acquisition module 403 is used to acquire the structured query statement corresponding to the batch task with execution error if it is determined that there is a batch task with execution error among the multiple batch tasks based on the actual execution results of each of the multiple batch tasks.
[0115] The third acquisition module 404 is used to retrieve the batch business data corresponding to the batch task that failed to execute from the batch business data corresponding to the batch task set based on the structured query statement corresponding to the batch task that failed to execute.
[0116] The second execution module 405 is used to re-execute the batch task that failed to execute based on the batch business data corresponding to the batch task that failed to execute.
[0117] In one embodiment of this application, the third acquisition module 404 is further configured to acquire a reverse structured query statement from the structured query statement, wherein the reverse structured query statement is used to query the execution code corresponding to the batch task that has an execution error. Based on the execution code corresponding to the batch task that has an execution error retrieved by the reverse structured query statement, the execution code corresponding to the batch task that has an execution error is retrieved, and the execution code corresponding to the batch task that has an execution error is included in the total execution code of the batch task set. Based on the execution code corresponding to the batch task that has an execution error, the batch business data corresponding to the batch task that has an execution error is obtained from the batch business data corresponding to the batch task set.
[0118] In one embodiment of this application, the batch task execution device may further include the following modules.
[0119] The query module is used to query the actual execution results of each completed batch task using the asynchronous query task interface.
[0120] The fourth acquisition module is used to acquire the preset execution results corresponding to each completed batch task.
[0121] The fifth acquisition module is used to acquire the reverse structured query statement corresponding to the batch task with execution error if there is a batch task with execution error in each batch task that has been completed and the actual execution result does not match the corresponding preset execution result.
[0122] The retrieval module is used to retrieve the execution code corresponding to the batch task that failed to execute, using the reverse structured query statement corresponding to the batch task that failed to execute.
[0123] The modification module is used to modify the execution code of batch tasks that have execution errors based on the difference between the actual execution results and the preset execution results.
[0124] In one embodiment of this application, the third acquisition module 404 is further configured to insert the modified execution code corresponding to the batch task with execution error into the total execution code of the batch task set. Based on the inserted modified execution code corresponding to the batch task with execution error, the batch business data corresponding to the batch task with execution error is obtained from the batch business data.
[0125] In one embodiment of this application, the second execution module 405 is further configured to obtain a forward structured query statement from the structured query statement, wherein the forward structured query statement is used to query the execution order of the execution code corresponding to the batch running task with execution error. Based on the execution order of the execution code corresponding to the batch running task with execution error obtained from the forward structured query statement, the batch running task with execution error is executed again using the batch running business data corresponding to the batch running task with execution error.
[0126] In one embodiment of this application, the batch task execution device may further include the following modules.
[0127] The generation module is used to generate execution logs for each of the multiple batch tasks based on their respective task execution data. The task execution data of the batch tasks includes the data obtained after executing the corresponding execution code of the batch task.
[0128] The determination module is used to parse and process the execution logs of each of the multiple batch tasks to determine the structured query statements corresponding to each of the multiple batch tasks.
[0129] In one embodiment of this application, the batch task execution device may further include the following modules.
[0130] The third execution module is used to continue executing other batch tasks after the batch task that failed to execute, until all batch tasks after the batch task that failed to execute have been completed.
[0131] In one embodiment of this application, the first execution module 402 is further configured to obtain the task execution start time of the batch task set, wherein the task execution start time is determined based on multiple historical tasks of the batch task set.
[0132] Since the start time of task execution is fixed, the execution times of multiple historical tasks may differ. Based on batch processing business data, 5 executes multiple batch processing tasks contained in the batch processing task set sequentially at the task execution start time, obtaining the actual execution results corresponding to each of the multiple batch processing tasks.
[0133] It should be understood that Figure 4 The operation and functions of the first acquisition module 401, the first execution module 402, the second acquisition module 403, the third acquisition module 404, and the second execution module 405 in the provided batch task execution device can be referred to the above. Figure 2 To avoid repetition, the provided batch task execution method will not be described again here.
[0134] The above text combined Figure 3 This paper describes in detail the implementation examples of the e-commerce platform settlement method of this application. The following is a combination of... Figure 5 This application provides a detailed description of embodiments of the e-commerce platform settlement device. It should be understood that the descriptions of the e-commerce platform settlement method embodiments correspond to the descriptions of the e-commerce platform settlement device embodiments; therefore, any parts not described in detail can be found in the preceding method embodiments.
[0135] 5 Figure 5 The diagram shown illustrates the structure of an e-commerce platform settlement device provided in an exemplary embodiment of this application.
[0136] Intention. For example Figure 5 As shown in the embodiments of this application, the e-commerce platform settlement device may include the following modules.
[0137] The acquisition module 501 is used to respond to the settlement application of the e-commerce platform, and to obtain the e-commerce batch processing task set and the e-commerce batch processing business data corresponding to the e-commerce batch processing task set from the e-commerce platform. The e-commerce batch processing task set contains multiple e-commerce batch processing tasks.
[0138] Execution module 502 is used to execute multiple e-commerce batch processing tasks based on e-commerce batch processing business data.
[0139] For example, using the above Figure 4 The apparatus of the mentioned embodiment performs multiple e-commerce batch processing tasks.
[0140] The generation module 503 is used to generate e-commerce data tables corresponding to each of the multiple e-commerce batch processing tasks after they are completed.
[0141] The determination module 504 is used to determine the settlement data corresponding to the settlement application based on the e-commerce data tables corresponding to each of the multiple e-commerce batch processing tasks.
[0142] It should be understood that Figure 5The operation and functions of the acquisition module 501, execution module 502, generation module 503, and determination module 504 in the provided e-commerce platform settlement device can be referred to the above. Figure 3 To avoid duplication, the payment methods provided by the e-commerce platforms will not be repeated here.
[0143] Below, for reference Figure 6 This describes an electronic device according to embodiments of the present application. Figure 6 The diagram shown is a structural schematic of an electronic device provided in an exemplary embodiment of this application.
[0144] like Figure 6 As shown, the electronic device 60 includes one or more processors 601 and memory 602.
[0145] The processor 601 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 60 to perform desired functions.
[0146] The memory 602 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 601 may execute the program instructions to implement the methods of the various embodiments of this application described above and / or other desired functions. The computer-readable storage medium may also store various contents such as batch processing business data, batch processing tasks, and preset execution results.
[0147] In one example, the electronic device 60 may also include an input device 603 and an output device 604, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0148] The input device 603 may include, for example, a keyboard, a mouse, etc.
[0149] The output device 604 can output various information to the outside, including batch processing data, batch processing tasks, preset execution results, etc. The output device 604 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0150] Of course, for the sake of simplicity, Figure 6Only some of the components of the electronic device 60 relevant to this application are shown in this illustration; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 60 may include any other suitable components depending on the specific application.
[0151] In addition to the methods and apparatus described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this application.
[0152] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0153] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this application.
[0154] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0155] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.
[0156] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0157] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.
[0158] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0159] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A method for executing batch tasks, characterized in that, include: Obtain a batch processing task set and the batch processing business data corresponding to the batch processing task set, wherein the batch processing task set contains multiple batch processing tasks; Based on the batch processing business data, multiple batch processing tasks contained in the batch processing task set are executed sequentially to obtain the actual execution results corresponding to each of the multiple batch processing tasks. If, based on the actual execution results of the multiple batch processing tasks, it is determined that there is a batch processing task with an execution error among the multiple batch processing tasks, then a structured query statement corresponding to the batch processing task with the execution error is obtained. The batch processing task with the execution error includes batch processing tasks whose actual execution results do not match the preset execution results. The structured query statement is used to find the execution code corresponding to the batch processing task with the execution error and the batch processing business data corresponding to the batch processing task with the execution error. The difference between the actual execution results and the preset execution results is used to modify the execution code corresponding to the batch processing task with the execution error. Based on the structured query statement corresponding to the batch running task with the execution error, obtain the batch running business data corresponding to the batch running task set from the batch running business data corresponding to the batch running task set; Based on the modified execution code and the batch processing business data corresponding to the batch processing task that failed to execute, the batch processing task that failed to execute is executed again.
2. The method according to claim 1, characterized in that, The step of retrieving the batch processing business data corresponding to the batch processing task with the execution error from the batch processing business data corresponding to the batch processing task set based on the structured query statement corresponding to the batch processing task with the execution error includes: Obtain the first sub-structured query statement from the structured query statement. The first sub-structured query statement is used to query the execution code corresponding to the batch task with the execution error. Based on the execution code corresponding to the batch running task with the execution error retrieved by the first sub-structured query statement, the execution code corresponding to the batch running task with the execution error is retrieved, and the execution code corresponding to the batch running task with the execution error is included in the total execution code of the batch running task set; Based on the execution code corresponding to the batch running task with the execution error, the batch running business data corresponding to the batch running task set is obtained from the batch running business data corresponding to the batch running task set.
3. The method according to claim 1, characterized in that, The execution process, which involves sequentially executing multiple batch tasks included in the batch task set based on the batch business data to obtain the actual execution results corresponding to each of the multiple batch tasks, further includes: Use the asynchronous query task interface to query the actual execution results of each completed batch task; Obtain the preset execution results corresponding to each completed batch task; If there is a batch task with an execution error among the batch tasks that have been completed, then obtain the first sub-structured query statement corresponding to the batch task with the execution error. Using the first sub-structured query statement corresponding to the batch running task that erred in execution, the execution code corresponding to the batch running task that erred in execution is retrieved; Based on the difference between the actual execution result and the preset execution result, modify the execution code corresponding to the batch task with the execution error.
4. The method according to claim 3, characterized in that, The step of retrieving the batch processing business data corresponding to the batch processing task with the execution error from the batch processing business data corresponding to the batch processing task set based on the execution code corresponding to the batch processing task with the execution error includes: Insert the modified execution code corresponding to the batch task with the execution error into the total execution code of the batch task set; Based on the inserted modified execution code corresponding to the batch running task with the execution error, the batch running business data corresponding to the batch running task with the execution error is obtained from the batch running business data.
5. The method according to any one of claims 1 to 3, characterized in that, Also includes: Obtain the second sub-structured query statement from the structured query statement. The second sub-structured query statement is used to query the execution order of the execution code corresponding to the batch task with the execution error.
6. The method according to any one of claims 1 to 3, characterized in that, Before obtaining the structured query statement corresponding to the batch task with the execution error, the method further includes: Based on the task execution data of the multiple batch running tasks, an execution log corresponding to each of the multiple batch running tasks is generated. The task execution data of the batch running tasks includes the data obtained after executing the execution code corresponding to the batch running task. Based on the execution logs of the multiple batch processing tasks, the structured query fields of each of the multiple batch processing tasks are determined. The structured query fields of each of the multiple batch processing tasks are parsed and processed to determine the corresponding structured query statements for each of the multiple batch processing tasks.
7. The method according to any one of claims 1 to 3, characterized in that, The process involves sequentially executing multiple batch tasks contained in the batch task set based on the batch processing business data, and obtaining the actual execution results corresponding to each of the multiple batch processing tasks, including: Obtain the task execution start time of the batch task set. The task execution start time is determined based on the execution start times of multiple historical tasks in the batch task set, and the execution times of the multiple historical tasks are different. Based on the batch processing business data, multiple batch processing tasks included in the batch processing task set are executed sequentially at the task execution start time to obtain the actual execution results corresponding to each of the multiple batch processing tasks.
8. A batch task execution device, characterized in that, include: The first acquisition module is used to acquire a batch processing task set and the batch processing business data corresponding to the batch processing task set, wherein the batch processing task set contains multiple batch processing tasks. The first execution module is used to sequentially execute multiple batch tasks contained in the batch task set based on the batch business data, and obtain the actual execution results corresponding to each of the multiple batch tasks. The second acquisition module is used to acquire a structured query statement corresponding to the batch task with execution error if it is determined that there is a batch task with execution error among the multiple batch tasks based on the actual execution results corresponding to each of the multiple batch tasks. The batch task with execution error includes batch tasks whose actual execution results do not match the preset execution results. The structured query statement is used to find the execution code corresponding to the batch task with execution error and the batch business data corresponding to the batch task with execution error. The difference between the actual execution results and the preset execution results is used to modify the execution code corresponding to the batch task with execution error. The third acquisition module is used to acquire the batch business data corresponding to the batch task with execution error from the batch business data corresponding to the batch task set based on the structured query statement corresponding to the batch task with execution error. The second execution module is used to re-execute the batch task that erred based on the modified execution code and the batch business data corresponding to the batch task that erred.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is used to execute the batch task execution method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the batch task execution method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Batch processing method, equipment and device based on artificial intelligence, and storage medium
CN110308946A
Batch processing task testing method and device, storage medium and program product
CN114238137A