A task starting method and terminal

By receiving update task instructions and asynchronously processing intermediate data, the time-consuming problem during task update is solved, and efficient execution and system performance improvement are achieved during task restart.

CN113918293BActive Publication Date: 2025-09-26FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111180348.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2025-09-26
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

In the prior art, when updating a task, it is necessary to stop the old task and wait for it to be completely closed before starting the new task, which causes the task execution to take too long and increases the system pressure.

Method used

By receiving the update task instruction, it is determined whether the task processing logic has changed. If it has changed, the updated task is initialized and started after the task to be updated is closed; otherwise, the intermediate data is saved and the updated task is initialized after the data saving is completed, and the updated task is executed asynchronously.

Benefits of technology

It reduces the time consumed during task restart, improves system performance, and ensures the accuracy and efficiency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918293B_ABST
    Figure CN113918293B_ABST
Patent Text Reader

Abstract

The present invention discloses a task startup method and terminal. The method receives a task update instruction and determines whether the task processing logic of the task to be updated is changed in the task update instruction. If so, the updated task is initialized when the task to be updated is executed, and the updated task is started after the task to be updated is completely closed. Otherwise, the intermediate data of the task to be updated is saved and the updated task is initialized at the same time. After the intermediate data is saved, the updated task processes the intermediate data and closes the task to be updated. Therefore, when the calculation method is not updated, the updated task can be started and process the intermediate data after the intermediate data is saved. By asynchronously executing the updated task, the time consumed during task restart can be reduced, thereby improving system performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a task starting method and a terminal. Background Art

[0002] With the rapid development of the mobile internet, a wide variety of client apps exist, each requiring corresponding server-side support. With the influx of apps, users have increased dramatically, bringing with it a surge in user data. This increase in data volume has also placed significant pressure on various online and offline processing tasks.

[0003] Currently, various online computing tasks exist on the server side. The entire task execution process, using Java as an example, involves the client uploading the corresponding task JAR file. This JAR file contains the task's specific logic, subsequent tasks, and the task management module, which activates the relevant task scheduling functions. Ultimately, the task is assigned to each task node, and each subtask node performs the specific task execution operations. This is a normal task update process.

[0004] In the current system, the task scheduling module involves numerous initialization steps, and the online system still has tasks running. Therefore, when updating a task, the old task must be stopped first. Only after the old task has completely stopped can the new task be started synchronously. Therefore, it takes several minutes from the time the old task stops to the time the new task starts. Furthermore, the time it takes for the new task to be reprocessed and calculated due to the old task being stopped further increases the time required. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a task starting method and a terminal, which can reduce the execution time of the task.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A task starting method includes the following steps:

[0008] Receive an update task instruction, determine whether the update task instruction changes the task processing logic of the task to be updated, and if so, initialize the updated task when executing the task to be updated, and start the updated task after the task to be updated is closed;

[0009] Otherwise, the intermediate data of the task to be updated is saved, and the updated task is initialized at the same time. After the intermediate data is saved, the intermediate data is processed by the updated task and the task to be updated is closed.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A task initiation terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0012] Receive an update task instruction, determine whether the update task instruction changes the task processing logic of the task to be updated, and if so, initialize the updated task when executing the task to be updated, and start the updated task after the task to be updated is closed;

[0013] Otherwise, the intermediate data of the task to be updated is saved, and the updated task is initialized at the same time. After the intermediate data is saved, the intermediate data is processed by the updated task and the task to be updated is closed.

[0014] The beneficial effects of the present invention are as follows: receiving an update task instruction, determining whether the update task instruction changes the task processing logic of the task to be updated; if so, initializing the updated task when executing the task to be updated, and starting the updated task after the task to be updated is completely closed; otherwise, saving the intermediate data of the task to be updated and simultaneously initializing the updated task; after the intermediate data is saved, processing the intermediate data by the updated task and closing the task to be updated. Therefore, when the calculation method is not updated, the updated task can start and process the intermediate data after saving the intermediate data. By asynchronously executing the updated task, the time consumed during task restart can be reduced, thereby improving system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a flowchart of a task starting method according to an embodiment of the present invention;

[0016] Figure 2 A schematic diagram of a task starting terminal according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.

[0018] Please refer to Figure 1 , an embodiment of the present invention provides a task starting method, comprising the steps of:

[0019] Receive an update task instruction, determine whether the update task instruction changes the task processing logic of the task to be updated, and if so, initialize the updated task when executing the task to be updated, and start executing the updated task after the task to be updated is closed;

[0020] Otherwise, the intermediate data of the task to be updated is saved, and the updated task is initialized at the same time. After the intermediate data is saved, the intermediate data is processed by the updated task and the task to be updated is closed.

[0021] As can be seen from the above description, the beneficial effects of the present invention are as follows: receiving an update task instruction, determining whether the update task instruction changes the task processing logic of the task to be updated; if so, initializing the updated task when executing the task to be updated, and starting the updated task after the task to be updated is completely closed; otherwise, saving the intermediate data of the task to be updated and initializing the updated task at the same time; after the intermediate data is saved, processing the intermediate data through the updated task and closing the task to be updated. Therefore, when the calculation method is not updated, the updated task can start and process the intermediate data after saving the intermediate data. By asynchronously executing the updated task, the time consumed during task restart can be reduced, thereby improving system performance.

[0022] Furthermore, saving the intermediate data of the task to be updated includes:

[0023] Send a notification message to each subtask node where the task to be updated is located, and receive and save the intermediate data and response information sent by each subtask of the task to be updated according to the notification message;

[0024] The task to be updated is marked as a state where intermediate data has been saved according to the response information.

[0025] From the above description, it can be seen that by obtaining the intermediate data and response information sent by each subtask node of the task to be updated according to the notification message, all the intermediate data in the task to be updated can be accurately obtained, ensuring the accuracy of the intermediate data acquisition, thereby ensuring the accuracy of subsequent updated tasks inheriting the intermediate data and processing them.

[0026] Furthermore, after the intermediate data is saved, processing the intermediate data by the updated task and closing the task to be updated includes:

[0027] After the intermediate data is saved, the parameters inheriting the intermediate data are passed to the updated task through the task to be updated, so that the updated task obtains the intermediate data according to the parameters;

[0028] The tasks to be updated that have saved intermediate data are suspended, and the suspended tasks to be updated are gradually closed.

[0029] From the above description, it can be seen that after the intermediate data is saved, the parameters that inherit the intermediate data are passed to the updated task so that the updated task can obtain the intermediate data according to the parameters; and after the intermediate data is saved, the task to be updated is suspended and gradually closed, and there is no need to start the updated task after the task to be updated is completely closed, thereby reducing the time spent on task startup.

[0030] Furthermore, starting the updated task after closing the task to be updated includes:

[0031] When the task to be updated and its subtasks are all completed and closed, the updated task is started.

[0032] From the above description, it can be seen that when changing the task processing logic of the task to be updated in the update task instruction, it is necessary to wait until the task to be updated and its various subtasks are completed and closed before the updated task can be started to avoid dirty data and ensure the accuracy of data processing after the task is started.

[0033] Furthermore, the initializing of the updated task includes:

[0034] Request the total resources for the updated task;

[0035] Subnodes are allocated to the updated task, and a preparation notification for starting the updated task is sent.

[0036] As can be seen from the above description, while the task to be updated is being executed, the updated task can apply for resources, allocate child nodes, and send a startup preparation notification, further reducing the time consumed in task startup.

[0037] Please refer to Figure 2 Another embodiment of the present invention provides a task initiation terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0038] Receive an update task instruction, determine whether the update task instruction changes the task processing logic of the task to be updated, and if so, initialize the updated task when executing the task to be updated, and start the updated task after the task to be updated is closed;

[0039] Otherwise, the intermediate data of the task to be updated is saved, and the updated task is initialized at the same time. After the intermediate data is saved, the intermediate data is processed by the updated task and the task to be updated is closed.

[0040] As can be seen from the above description, the system receives an update task instruction and determines whether the update task instruction changes the task processing logic of the task to be updated. If so, the updated task is initialized when executing the task to be updated, and the updated task is started after the task to be updated is completely closed. Otherwise, the intermediate data of the task to be updated is saved and the updated task is initialized at the same time. After the intermediate data is saved, the updated task processes the intermediate data and closes the task to be updated. Therefore, if the calculation method has not been updated, the updated task can start and process the intermediate data after saving it. By asynchronously executing the updated task, the time spent on task restart can be reduced, thereby improving system performance.

[0041] Furthermore, saving the intermediate data of the task to be updated includes:

[0042] Send a notification message to each subtask node where the task to be updated is located, and receive and save the intermediate data and response information sent by each subtask of the task to be updated according to the notification message;

[0043] The task to be updated is marked as a state where intermediate data has been saved according to the response information.

[0044] From the above description, it can be seen that by obtaining the intermediate data and response information sent by each subtask node of the task to be updated according to the notification message, all the intermediate data in the task to be updated can be accurately obtained, ensuring the accuracy of the intermediate data acquisition, thereby ensuring the accuracy of subsequent updated tasks inheriting the intermediate data and processing them.

[0045] Furthermore, after the intermediate data is saved, processing the intermediate data by the updated task and closing the task to be updated includes:

[0046] After the intermediate data is saved, the parameters inheriting the intermediate data are passed to the updated task through the task to be updated, so that the updated task obtains the intermediate data according to the parameters;

[0047] The tasks to be updated that have saved intermediate data are suspended, and the suspended tasks to be updated are gradually closed.

[0048] From the above description, it can be seen that after the intermediate data is saved, the parameters that inherit the intermediate data are passed to the updated task so that the updated task can obtain the intermediate data according to the parameters; and after the intermediate data is saved, the task to be updated is suspended and gradually closed, and there is no need to start the updated task after the task to be updated is completely closed, thereby reducing the time spent on task startup.

[0049] Furthermore, starting the updated task after closing the task to be updated includes:

[0050] When the task to be updated and its subtasks are all completed and closed, the updated task is started.

[0051] From the above description, it can be seen that when changing the task processing logic of the task to be updated in the update task instruction, it is necessary to wait until the task to be updated and its various subtasks are completed and closed before the updated task can be started to avoid dirty data and ensure the accuracy of data processing after the task is started.

[0052] Furthermore, the initializing of the updated task includes:

[0053] Request the total resources for the updated task;

[0054] Subnodes are allocated to the updated task, and a preparation notification for starting the updated task is sent.

[0055] As can be seen from the above description, while the task to be updated is being executed, the updated task can apply for resources, allocate child nodes, and send a startup preparation notification, further reducing the time consumed in task startup.

[0056] A task startup method and terminal of the present invention are suitable for updating and starting online computing tasks, which can reduce the time consumed in re-executing tasks and the time consumed during task restart, thereby improving system performance. The following is an explanation of the specific implementation method:

[0057] Example 1

[0058] Please refer to Figure 1 , a task starting method, comprising the steps of:

[0059] S1. Receive an update task instruction, determine whether the update task instruction changes the task processing logic of the task to be updated, and if so, initialize the updated task when executing the task to be updated, and start executing the updated task after the task to be updated is closed.

[0060] Specifically, in this embodiment, there is a task A to be updated that is processing data. At this time, the task update process operation is performed. Subsequently, the updated task B will be started to process the data.

[0061] A new independent switch is added. This switch indicates whether it is necessary to inherit the intermediate data from the executing task A and continue to be executed by task B. Therefore, it is necessary to determine whether the task processing logic of the task to be updated is changed in the update task instruction, that is, whether it involves changes in the algorithm or specific calculation rules. If so, the independent switch is turned off and step S11 is executed. Otherwise, the independent switch is turned on and step S2 is executed.

[0062] S11. Apply for total resources of the updated task, allocate subnodes to the updated task, and send a preparation notification for starting the updated task.

[0063] Specifically, when the independent switch is turned off, Task A is currently being executed, and Task B can be started in advance and the task initialization operation of Task B can be started. That is, Task B can apply for the total resources of the task during the execution of Task A, allocate subnodes to Task B, and send a preparation notification for Task B to start. However, the start operation of Task B will not be performed for the time being.

[0064] S12: After the task to be updated and its subtasks are completed and closed, start the updated task.

[0065] Specifically, Task B waits for all Task A to be closed before it can start Task B and resume execution.

[0066] S2. Otherwise, save the intermediate data of the task to be updated and initialize the updated task. After the intermediate data is saved, process the intermediate data through the updated task and close the task to be updated.

[0067] S21. Send a notification message to each subtask node where the task to be updated is located, receive and save the intermediate data and response information sent by each subtask of the task to be updated according to the notification message, and mark the task to be updated as a state with saved intermediate data according to the response information.

[0068] Specifically, when the independent switch is turned on, Task A is currently executing, and Task B can be started in advance, and the task initialization operation of Task B begins. At this time, the task management module will send a notification message to each subtask node where Task A is located. When each subtask of Task A receives the notification message, it will pre-record the intermediate data status of each subtask in local memory and return a response message to the task management module, indicating that the intermediate data status has been recorded.

[0069] S22. After the intermediate data is saved, the parameters inheriting the intermediate data are passed to the updated task through the task to be updated, so that the updated task obtains the intermediate data according to the parameters, suspends the task to be updated that has saved the intermediate data, and gradually closes the suspended task to be updated.

[0070] Specifically, once the task management module has confirmed that all subtask nodes have completed recording intermediate states, Task B is directly initiated to process the data. In this scenario, a parameter specifying the intermediate data to be inherited must be passed to Task B, so that Task B knows to retrieve the intermediate data from local memory. Furthermore, Task B's subtask nodes must be consistent with Task A's subtask nodes, as intermediate data must be retrieved from local memory.

[0071] And after the task to be updated saves the intermediate processing data, the task to be updated is suspended and gradually closed.

[0072] Therefore, this embodiment saves the intermediate processing data of the task to be updated when an update task is available. After the task to be updated has saved the intermediate processing data, the task to be updated is suspended and gradually closed. At the same time, the initialized updated task processes the remaining data of the task to be updated. This asynchronous data rotation between the old and new tasks can further reduce task execution time and improve system performance in task change scenarios.

[0073] Example 2

[0074] Please refer to Figure 2 A task starting terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of a task starting method in embodiment one is implemented.

[0075] In summary, the present invention provides a task startup method and terminal, which receives an update task instruction, determines whether the task processing logic of the task to be updated is changed in the update task instruction, and if so, initializes the updated task when executing the task to be updated. When the task to be updated and its various subtasks are completed and closed, start the updated task to avoid dirty data and ensure the accuracy of data processing after the task is started; otherwise, obtain the intermediate data and response information sent by each subtask node of the task to be updated according to the notification message, and can accurately obtain all the intermediate data in the task to be updated, ensuring the accuracy of the intermediate data acquisition. At the same time, initialize the updated task, and after the intermediate data is saved, process the intermediate data through the updated task and close the task to be updated. Therefore, when the calculation method is not updated, the updated task can start and process the intermediate data after saving the intermediate data. By asynchronously executing the updated task, the time consumed during the task restart can be reduced, thereby improving the performance of the system.

[0076] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A task starting method, characterized in that: Including steps: Receive an update task instruction, and determine whether the update task instruction changes the task processing logic of the task to be updated, including whether it involves a change in the algorithm or specific calculation rules; If so, initializing the updated task when executing the task to be updated, and starting the updated task after closing the task to be updated; Otherwise, a notification message is sent to each subtask node where the task to be updated is located. When the subtask node receives the notification message, it records the intermediate data of the subtask into the local memory, receives the response information sent by the subtask node, and marks the task to be updated as having saved the intermediate data according to the response information. The intermediate data is the data intermediate state; At the same time, the updated task is initialized. After the intermediate data is saved, the parameters inheriting the intermediate data are passed to the updated task through the task to be updated, so that the updated task obtains the intermediate data according to the parameters. The tasks to be updated that have saved intermediate data are suspended, and the suspended tasks to be updated are gradually closed.

2. A task starting method according to claim 1, characterized in that: Starting the updated task after the task to be updated is closed includes: When the task to be updated and its subtasks are all completed and closed, the updated task is started.

3. A task initiation method according to claim 1 or 2, characterized in that: Initializing the updated task includes: Request the total resources for the updated task; Subnodes are allocated to the updated task, and a preparation notification for starting the updated task is sent.

4. A task starting terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Receive an update task instruction, and determine whether the update task instruction changes the task processing logic of the task to be updated, including whether it involves a change in the algorithm or specific calculation rules; If so, initializing the updated task when executing the task to be updated, and starting the updated task after closing the task to be updated; Otherwise, a notification message is sent to each subtask node where the task to be updated is located. When the subtask node receives the notification message, it records the intermediate data of the subtask into the local memory, receives the response information sent by the subtask node, and marks the task to be updated as having saved the intermediate data according to the response information. The intermediate data is the data intermediate state; At the same time, the updated task is initialized. After the intermediate data is saved, the parameters inheriting the intermediate data are passed to the updated task through the task to be updated, so that the updated task obtains the intermediate data according to the parameters. The tasks to be updated that have saved intermediate data are suspended, and the suspended tasks to be updated are gradually closed.

5. A task starting terminal according to claim 4, characterized in that: Starting the updated task after the task to be updated is closed includes: When the task to be updated and its subtasks are all completed and closed, the updated task is started.

6. A task starting terminal according to claim 4 or 5, characterized in that: Initializing the updated task includes: Request the total resources for the updated task; Subnodes are allocated to the updated task, and a preparation notification for starting the updated task is sent.

Citation Information

Patent Citations

  • Computational task processing device, method and system

    CN104750549A

  • Communication protocol upgrading method, device and system based on low earth orbit satellite

    CN110865832A

  • Dynamic program switching control system

    JP2004213425A