Method and system for controlling task process
By saving the pause status and instruction information of the task process, creating a new task process and continuing to execute from a breakpoint, it solves the problem that task process cannot be restored in the existing technology, improves efficiency and security, and reduces costs.
Patent Information
- Application Number
- CN202411318080.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-27
AI Technical Summary
The existing technology cannot continue execution from the breakpoint after the task process is suspended, resulting in restarting execution, wasting time and labor costs, and affecting automated continuous production.
By saving the pause status information and instruction information of the task process, create a new task process and continue execution from a breakpoint to avoid starting from scratch.
It significantly improves the execution efficiency of task processes, reduces labor and time costs, ensures the continuity of automatic control, and identifies and stops real safety hazard instructions during suspension, improving safety and efficiency.
Smart Images

Figure CN119200450A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to automation control, and more particularly to a method and system for controlling a task flow. Background Art
[0002] In modern industrial environments, programmable logic controllers (PLCs) are often designed to implement automation control. Sometimes the PLC can also be implemented by software, in which case the PLC implemented by software can be called a task flow. The task flow includes executing one or more instructions.
[0003] However, when one or more task processes need to be stopped due to a human stop or an alarm in the equipment, once a task process has been paused, it cannot be continued from the paused point after it is resumed, and the task process must be executed from the beginning. For example, in the process of cutting pipes by machine tools, when executing the task process for loading materials, a certain intermediate link suddenly stops. When it is resumed, the pipe being loaded must be manually unloaded, and then the loading task process must be re-executed from the beginning. This undoubtedly consumes a lot of time and labor costs, which is extremely unfavorable to automated continuous production.
[0004] Therefore, there is an urgent need for a new technology that can continue to execute the task flow from the place where it was suspended when resuming the suspended task flow. Summary of the invention
[0005] The present invention aims to overcome the above and / or other problems in the prior art. The method and system for controlling a task flow provided by the present invention can resume the execution of the task flow from the place where it was paused when resuming the paused task flow, without having to execute the task flow from the beginning, thereby significantly improving the execution efficiency of the task flow.
[0006] According to a first aspect of the present invention, a method for controlling a task flow is provided, wherein the task flow includes executing one or more instructions, and the method may include the following steps: a) stopping the task flow that needs to be suspended from executing new instructions, and at the same time executing a stop action on the instructions that need to execute the stop action among the executed instructions of each of the task flows to be suspended; b) saving the pause status information and the pause instruction information of all suspended task flows; c) when it is necessary to resume at least one of the suspended task flows, for each task flow that needs to be resumed, creating a new task flow based on the saved pause status information and the pause instruction information; and d) executing the new task flow and re-executing the instructions that were executed for the stop action.
[0007] According to a second aspect of the present invention, there is provided a system for controlling a task flow, wherein the task flow includes executing one or more instructions, and the system includes an executor unit and a manager unit. The manager unit may be configured to: a) stop the task flow that needs to be suspended from executing new instructions, and at the same time, cause the executor unit to execute a stop action on the instructions that need to execute the stop action among the executed instructions of each task flow to be suspended; b) save the pause status information and the pause instruction information of all suspended task flows; c) when it is necessary to resume at least one of the suspended task flows, for each task flow that needs to be resumed, create a new task flow based on the saved pause status information and pause instruction information; and d) cause the executor unit to execute the new task flow, and at the same time re-execute the instructions that were executed to stop the action.
[0008] The above method and system of the present invention saves the breakpoint information of the suspended task flow innovatively and executes a new task flow created based on the saved breakpoint information when the suspended task flow needs to be resumed, thereby realizing the continued execution of the task flow from the previously suspended breakpoint position. Compared with the prior art that requires the suspended task flow to be executed again from the beginning, the present invention greatly reduces the manpower cost and time cost, significantly improves the execution efficiency of the task flow, and ensures the continuity of automatic control.
[0009] In the above method, step a) may include the following steps: a1) when a task flow needs to be suspended, identifying all instructions with safety hazards or instructions that are expected to be stopped among the executed instructions of the task flow and performing a stop action on the instructions with safety hazards or the instructions that are expected to be stopped; a2) based on the correlation between the instructions with safety hazards or the instructions that are expected to be stopped and other parallel task flows being executed, determining whether it is necessary to suspend other parallel task flows being executed; and a3) if it is necessary to suspend other parallel task flows being executed, executing steps a1) and a2) on the other parallel task flows being executed that need to be suspended. Accordingly, in the above system, when executing a), the manager unit can be further configured to: a1) when a task flow needs to be suspended, identify all instructions with safety hazards or instructions that are expected to be stopped in the executed instructions of the task flow and enable the executor unit to perform a stop action on the instructions with safety hazards or the instructions that are expected to be stopped; a2) based on the correlation between the instructions with safety hazards or the instructions that are expected to be stopped and other parallel task flows being executed, determine whether it is necessary to suspend other parallel task flows being executed; and a3) if it is necessary to suspend other parallel task flows being executed, execute a1) and a2) on the other parallel task flows being executed that need to be suspended.
[0010] When stopping a task flow, the corresponding actions of the instructions that have been completed instantaneously before will not stop immediately, so it is necessary to execute stop instructions for these actions. The present invention can further improve the execution efficiency of the task flow while ensuring safety by identifying those actions that really have safety hazards or are really expected to be stopped and executing stop instructions accordingly. In addition, the present invention does not need to stop all parallel task flows, but only stops those parallel task flows that are really related to the task flow to be stopped, and also executes a1) and a2) for the parallel task flows that need to be paused, so that all parallel task flows can be traversed, each parallel task flow that needs to be paused can be found, and stop instructions can be executed for those actions that really have safety hazards or are really expected to be stopped, thereby achieving more efficient task flow stop control while ensuring safety.
[0011] The pause instruction information may include a pause instruction parameter and a pause instruction queue sequence number.
[0012] In the above method, the step c) may include the following steps: parsing the pause state information and the pause instruction information; creating a paused instruction; and restoring instruction parameters to the pause instruction parameters. Accordingly, in the above system, when executing c), the manager unit may be further configured to: parse the pause state information and the pause instruction information; create a paused instruction; and restore instruction parameters to the pause instruction parameters.
[0013] In the above method, the step d) may include executing the new task flow from the instruction of the pause instruction queue sequence number. Accordingly, in the above system, when executing d), the executor unit may be further configured to: execute the new task flow from the instruction of the pause instruction queue sequence number.
[0014] According to a third aspect of the present invention, there is also provided a computer-readable storage medium having encoded instructions recorded thereon, which implement the above-mentioned method of controlling a task flow of the present invention when the instructions are executed.
[0015] According to a fourth aspect of the present invention, there is also provided a computer program product, comprising a computer program, which implements the above-mentioned method of controlling a task flow of the present invention when the computer program is executed.
[0016] Other features and aspects of the present invention will become more apparent from the following detailed description in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention may be better understood by describing exemplary embodiments of the present invention in conjunction with the accompanying drawings, in which:
[0018] Figure 1 A flowchart of a method for controlling a task flow according to an embodiment of the present invention is shown;
[0019] Figure 2 Shows Figure 1 a flow chart of a variation of the method shown;
[0020] Figure 3A-3C A timing diagram for controlling a task flow according to an exemplary embodiment of the present invention is shown;
[0021] Figure 4 Shows Figure 1 A flowchart of another variation of the method shown; and
[0022] Figure 5 A structural block diagram of a system for controlling a task flow according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0023] The present invention will be further described below in conjunction with specific embodiments and drawings. More details are elaborated in the following description to facilitate a full understanding of the present invention. However, the present invention can obviously be implemented in a variety of other ways different from the description herein. Those skilled in the art can make similar generalizations and deductions based on actual application situations without violating the spirit of the present invention. Therefore, the scope of protection of the present invention should not be limited by the content of this specific embodiment.
[0024] Unless otherwise defined, the technical or scientific terms used in the claims and the specification shall have the usual meaning understood by persons with ordinary skills in the technical field to which the invention belongs. The words "first", "second" and similar words used in the specification and claims of this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "one" or "one" do not indicate a quantitative limitation, but indicate the existence of at least one. Words such as "include" or "comprise" and similar words mean that the elements or objects appearing before "include" or "comprise" include the elements or objects listed after "include" or "comprise" and their equivalent elements, and do not exclude other elements or objects. Words such as "connect" or "connected" and similar words are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.
[0025] According to an embodiment of the present invention, a method for controlling a task flow is provided.
[0026] Figure 1 FIG. 1 is a flow chart showing a method 100 for controlling a task flow according to an embodiment of the present invention. Figure 1As shown in , the method 100 may include step 120 , step 140 , step 160 , and step 180 .
[0027] In step 120 , the task flow to be suspended may be stopped from executing new instructions, and at the same time, a stop action is performed on the instructions that need to be stopped among the executed instructions of each task flow to be suspended.
[0028] Taking the material loading task process in machine tool processing as an example, it may include executing the following instructions:
[0029] Sensor open command: open the sensor for monitoring;
[0030] Axis motion command: starts the linear axis and rotary axis of the machine tool to move;
[0031] Conveyor belt motion instruction: moves the conveyor belt to transport the workpiece to the support of the machine tool;
[0032] Support raising command: causes the support to rise so as to move the workpiece on the support to the chuck clamping area; and
[0033] Chuck clamping instruction: The workpiece transferred to the chuck clamping area is clamped and fixed by the chuck.
[0034] When the loading task process is paused, assuming that the sensor opening instruction, axis movement instruction, conveyor belt movement instruction and bracket rising instruction have been executed, the loading task process will no longer execute the chuck clamping instruction.
[0035] As for the sensor opening instructions, axis movement instructions, conveyor movement instructions and bracket rising instructions that have been executed, since their corresponding actions have been completed before, they will not stop immediately. You can select those instructions that may affect safety according to the pre-set plan and execute the corresponding stop actions, or you can identify those instructions that really affect safety according to the actual processing situation and execute the corresponding stop actions. Obviously, the latter method can adapt to the actual processing situation more flexibly, and can further improve the safety and execution efficiency of the task process, which will be expanded in detail below.
[0036] Returning to method 100 , next, in step 140 , the pause state information and the pause instruction information of all the paused task flows may be saved.
[0037] Still taking the above-mentioned material loading task process in machine tool processing as an example, after a pause occurs, the pause status information and pause instruction information of the material loading task process can be saved. The pause status information can indicate the machine tool number (for example, machine tool A) where the material loading task process is paused. The pause instruction information can indicate the instruction whose execution is suspended, that is, the chuck clamping instruction that has not yet been executed. The pause instruction information can, for example, include pause instruction parameters and pause instruction queue sequence number, that is, the instruction parameters of the chuck clamping instruction and the sequence number of the chuck clamping instruction in the instruction queue (for example, the chuck clamping instruction is the fifth instruction in the instruction queue of the material loading task process).
[0038] Next, in step 160, when at least one suspended task flow needs to be resumed, for each task flow that needs to be resumed, a new task flow is created based on the saved pause state information and pause instruction information. Next, in step 180, the new task flow is executed, and the instruction of the executed stop action is re-executed.
[0039] In the above example, only the loading task flow of a certain machine tool is suspended, but in actual operation, multiple task flows of the machine tool or the loading task flows of multiple machine tools or multiple task flows of multiple machine tools may also be suspended. When these task flows are suspended, the above steps 120 and 140 may also be executed. When at least one of the suspended task flows needs to be resumed, a new task flow is created for each task flow that needs to be resumed based on the saved pause state information and pause instruction information.
[0040] For example, if the suspended loading task flow in the above example needs to be resumed, a new task flow is created based on the previously saved machine tool pause status information and chuck clamping instruction information. The new task flow is to execute the chuck clamping instruction on machine tool A. At the same time, the instructions that were previously executed to stop (all or part of the sensor opening instruction, axis movement instruction, conveyor belt movement instruction, and bracket rise instruction) are also re-executed. After the suspended loading task flow is resumed, the axis continues to move, the transmission belt continues to move, the bracket continues to rise, and the chuck then completes the clamping and fixation of the workpiece.
[0041] Once a task flow is paused, if you want to continue executing the task flow later, you can only restart it, and you cannot continue from the instruction at the pause point. In other words, if you want to resume the paused task flow, you must execute the task flow from the beginning, and all the instructions completed before the task flow was paused must be executed again. Still taking the above-mentioned loading task flow in machine tool processing as an example, when loading the pipe, if the loading task flow stops when the chuck clamping instruction is executed, when you want to continue to execute the loading task flow, you must re-execute the sensor opening instruction, axis movement instruction, conveyor belt movement instruction and bracket rising instruction, and then execute the chuck clamping instruction, which seriously affects the processing efficiency. In order to restart the loading task flow, all the previously completed progress needs to be restored to the initial state first. For example, you need to manually unload the pipe first and then reload it. A large pipe weighs more than one ton. It is unloaded from the loading equipment and then installed to the initial position and restarted. This process requires a lot of manpower and time, which is even more unfavorable to automated continuous production.
[0042] In order to break the limitation of the above-mentioned prior art that when resuming a paused task flow, the present invention creates a new task flow based on the pause state information and the pause instruction information, and cleverly separates the instructions that have not been executed at the time of suspension from the suspended task flow. Therefore, when it is necessary to resume the suspended task flow, just execute the created new task flow, which is equivalent to continuing the original suspended task flow from the instruction (breakpoint) that was not executed before the suspension, which greatly improves the execution efficiency of the task flow, and the user does not need to restore the equipment and workpiece when resuming the task flow, thereby reducing time cost and labor cost.
[0043] Optionally, the above step 120 may include step 1202 and step 1204, such as Figure 2 In step 1202, when a task flow needs to be suspended, all instructions with potential safety hazards or instructions expected to be stopped in the executed instructions of the task flow are identified and a stop action is performed on the instructions with potential safety hazards or the instructions expected to be stopped.
[0044] As an illustration and not limitation, the instruction with potential safety hazards can be an instruction with corresponding processing logic built into the system that has potential safety hazards in all scenarios (for example, excessive load power), or it can be an instruction for a specific application that needs to be processed when it is paused and is configured by the user through a configuration interface (for example, a shortage of materials in the above-mentioned machine tool processing application). In step 1204, based on the correlation between the instruction with potential safety hazards or the instruction expected to stop and other parallel task processes being executed, it is determined whether it is necessary to pause other parallel task processes being executed. If it is determined that it is also necessary to pause other parallel task processes being executed, the method returns to step 1202, that is, steps 1202 and 1204 are also executed for the other parallel task processes being executed that need to be suspended, and so on, until no other parallel task processes being executed need to be suspended.
[0045] As mentioned above, when a task flow is stopped, the corresponding actions of the instructions that have been completed instantaneously in the task flow will not stop immediately. For example, the conveyor belt used for loading and unloading in machine tool processing is undoubtedly very dangerous. In order to avoid the occurrence of such dangerous situations, the instructions that may affect safety can be selected from the completed instructions according to the preset scheme and the corresponding stop actions can be executed. This method can improve safety to a certain extent, but it requires the user to pre-set it, especially when the equipment involved in the task flow has different instruction actions, which will increase the user's workload. In addition, this method must have situations that are not taken into account by the scheme, so the stop instruction may be executed for the action that does not need to be stopped, while the stop instruction is not executed for the action that really needs to be stopped. Moreover, the above method will also cause the mutual influence of different task flows, because when a task flow stops, all related parallel task flows will stop. It is precisely with the above factors in mind that the inventor provides another identification mechanism based on actual conditions for the instructions involved in step 120 that need to execute the stop action, that is, identifying instructions with security risks or instructions that are expected to be stopped from the executed instructions, and deciding whether to also suspend other parallel task processes being executed based on the relevance of these instructions to other parallel task processes being executed (for example, the corresponding resource call situation and the degree of security risks they may bring, etc.), thereby further improving security and the execution efficiency of task processes.
[0046] Figure 3A The timing diagram of three machine tools executing the loading task process 310 in parallel is shown in the figure, wherein for each machine tool (i.e., machine tool A, machine tool B, machine tool C), the loading task process 310 includes: sensor opening instruction (instruction 1), axis movement instruction (instruction 2), conveyor belt movement instruction (instruction 3), bracket rising instruction (instruction 4), and chuck clamping instruction (instruction 5).
[0047] A certain buffer zone can be set on the conveyor belt to temporarily store excess workpieces when there is a speed mismatch between the upstream equipment (such as the loader) and the downstream equipment (such as the processing machine), thereby preventing production interruptions caused by inconsistent equipment speeds. Managing the conveyor belt buffer zone can optimize the efficiency and stability of the production line. Figure 3B A timing diagram is shown of three machine tools executing the buffer management task process 320 in parallel, wherein for each machine (i.e., machine tool A, machine tool B, and machine tool C), the buffer management task process 320 includes: an alarm start instruction (instruction 1': start the alarm to automatically sound an alarm when the buffer is about to overflow or other abnormal conditions occur), a sensor reading instruction (instruction 2': read the position, quantity, and other information of the workpieces on the conveyor belt through the sensor), a logic judgment instruction (instruction 3': determine whether it is necessary to adjust the speed of the conveyor belt based on the current processing situation, for example, determine whether the buffer has reached a certain capacity so that the conveyor belt should be slowed down to avoid overfilling the buffer zone), and a speed adjustment instruction (instruction 4': adjust the conveying speed of the conveyor belt, for example, slow down the conveyor belt to avoid overfilling the buffer zone, or speed up the conveyor belt to quickly transport the workpieces to downstream processing equipment).
[0048] Assume that when machine tool A has executed instructions 1-4, machine tool A is out of material. At this time, it is expected to suspend the loading task process 310 of machine tool A. In addition to no longer executing instruction 5 in the loading task process 310, it is also necessary to determine whether it is necessary to perform corresponding stop actions for instructions 1-4. According to the pre-set plan, for example, if a situation that affects safety occurs, the corresponding stop actions will be performed on instructions 1-4, but in fact, in some cases, it is not necessary to turn on the sensor of stop instruction 1, on the contrary, the sensor needs to remain on for continued monitoring; for example, if a situation that affects safety occurs, only the corresponding stop actions are performed on instructions 2-4, but in some cases the sensor also needs to be turned off, that is, instruction 1 also needs to execute a stop action.
[0049] The present invention provides a new identification mechanism, which can identify the instructions that really have safety hazards or the instructions that are expected to be stopped according to the actual processing situation, thereby making up for the incompleteness of the above scheme. First, for instruction 1, it turns on the sensor, but even if the loading is suspended, the sensor still needs to continue to monitor the status of the workpiece and the equipment to ensure that accurate status information can be immediately obtained when the loading is resumed, so there is no need to execute the stop action on instruction 1. Once the axis movement of instruction 2 is completed, the axis will continue to move, so a stop instruction is required to prevent the axis from continuing to move. The conveyor belt movement of instruction 3 is a continuous dynamic process. Once started, it will not end by itself, so a clear instruction is required to stop the conveyor belt movement to avoid idling of the conveyor belt. Similarly, if the bracket rising movement of instruction 4 is not stopped, the bracket will continue to rise without loading the workpiece. Therefore, in step 1202, only the instructions 2, instruction 3 and instruction 4 in instructions 1-4 that have been executed are executed (that is, the axis stop, conveyor belt stop, and bracket stop). It is understandable that if the reason for pausing the loading task process is that the load power is too large, then in step 1202, it is necessary to stop all the executed instructions 1-4, because the sensor also needs to be turned off at this time. The recognition mechanism that adapts to the actual situation provided by the present invention can more safely and accurately shut down the instructions that really have safety hazards or are expected to be stopped.
[0050] For machine tools B and C, since machine tools A, B, and C each have corresponding sensors, axes, conveyor belts, brackets, and chucks, etc., even if the loading task process 310 of machine tool A is paused, the loading task process 310 of machine tools B and C does not need to be paused.
[0051] However, when the loading task flow 310 of machine tool A is suspended, the conveyor belt movement is stopped and the workpiece transmission is also stopped. If the buffer management task flow 320 is continued to be executed at this time, there will be no actual workpiece transmission information to be managed. In addition, if machine tool A no longer runs the loading task flow 310, continuing to execute the buffer management task flow 320 will result in unnecessary calculation and resource usage. Therefore, while pausing the loading task flow 310 of machine tool A, it is also desirable to suspend the buffer management task flow 320 corresponding to machine tool A.
[0052] Assume that at this time, machine tool A has executed all instructions 1'-instruction 4' in the buffer management task flow 320. Since, as mentioned above, the conveyor belt movement of machine tool A has been stopped, it is no longer necessary to adjust the speed of the conveyor belt, and the speed adjustment instruction (instruction 4') that has been executed in the buffer management task flow 320 can be stopped. Similarly, the logic judgment instruction (instruction 3') is to judge whether it is necessary to adjust the speed of the conveyor belt, which is not necessary when the conveyor belt movement is stopped, so the logic judgment instruction can be stopped to avoid wasting computing resources. In contrast, the sensor reading instruction (instruction 2') usually does not need to be stopped, because keeping the sensor reading helps to immediately obtain accurate workpiece information when the feeding task flow 310 and the buffer management task flow 320 are resumed. The alarm start instruction (instruction 1') usually does not need to be stopped, because the alarm can still help monitor abnormal conditions during the pause period. Therefore, with respect to the buffer management task flow 320, it is only necessary to stop the executed instructions 3' and 4'.
[0053] Similarly, the buffer management task flow 320 of machine tool B and machine tool C will not be affected by the suspension of the buffer management task flow 320 of machine tool A, and therefore do not need to be suspended.
[0054] In the above example, for the loading task flow of machine tool A, "other parallel task flows being executed" only lists the buffer management task flow of machine tool A and the loading task flow and buffer management task flow of machine tools B and C, but it can be understood that in actual operation, other parallel task flows of machine tools A, B and C can also be included. In addition, it can also be understood that in the above example, the loading task flow and the buffer management task flow are independent of each other in each machine tool, so there is no need to suspend the loading task flow or buffer management task flow of the remaining machine tools because of the suspension of the loading task flow or buffer management task flow of one machine tool. However, for some task flows, such as the obstacle avoidance task flow, the various machine tools need to coordinate and cooperate with each other. At this time, suspending the obstacle avoidance task flow of one machine tool will inevitably require suspending the obstacle avoidance task flow of the remaining machine tools at the same time.
[0055] According to an embodiment of the present invention, once there is a task process that needs to be suspended, other task processes related to the instructions in the task process that need to execute the stop action can be traversed, and according to actual needs, only the stop action is executed on the instructions that really need to be stopped in each related task process, thereby exhausting all instructions that may cause safety hazards due to equipment alarms or human needs to stop, while improving the execution efficiency of the task process.
[0056] Optionally, the above step 160 may include step 1602, step 1604 and step 1606. Figure 4 shown.
[0057] In step 1602, the pause state information and the pause instruction information may be parsed.
[0058] At step 1604, a suspended instruction may be created.
[0059] At step 1606, the command parameters may be restored to the pause command parameters.
[0060] Optionally, the above step 180 may include: executing the new task process starting from the instruction with the sequence number of the pause instruction queue.
[0061] The following Figure 3A and Figure 3B Based on the combination Figure 3C The timing diagram shown further describes in detail an example of controlling the parallel task flow in machine tool processing by the present invention.
[0062] As mentioned above, after machine tool A executes the bracket rising instruction (instruction 4), a shortage of material occurs. At this time, for the loading task flow 310, the chuck clamping instruction (instruction 5) is no longer executed, and the stop action is performed on instructions 2, 3, and 4, that is, the axis stops moving, the conveyor stops moving, and the bracket stops rising. (For example, by the system manager) Save the information that the loading task flow 310 of machine tool A is suspended, and save the information that the corresponding stop actions of instructions 2, instructions 3, and instructions 4 are executed, and that instruction 5 has not been executed. For the buffer management task flow 320 of machine tool A parallel to the loading task flow 310, stop the instructions 3' and 4', that is, stop the logic judgment, and stop the conveyor speed adjustment. Save the information that the buffer management task flow 320 of machine tool A is suspended, and save the information that the corresponding stop actions of instructions 3' and instructions 4' are executed.
[0063] After solving the cause of the task flow suspension, you can check whether there is a suspended task flow and perform the corresponding recovery work. Of course, you can also recover only part of it as needed. In this example, the cause of the task flow suspension is that machine tool A is short of materials. After replenishing the workpieces of machine tool A, it is checked that the loading task flow of machine tool A is suspended, and the suspended loading task flow is restored.
[0064] First, a new task flow 310' is created for machine tool A, and instruction 5 (chuck clamping instruction) is created by parsing the saved pause status information (information about the suspension of the loading task flow 310 of machine tool A) and the pause instruction information (information that instruction 5 has not been executed), and the instruction parameters of the task flow 310' are restored to the parameters of the chuck clamping instruction. Subsequently, the above-mentioned new task flow 310' is executed to complete the fixation and clamping of the workpiece by the chuck, and at the same time, instructions 2, 3 and 4 that were previously executed with the stop action are identified, and these instructions are continued to be executed, that is, the axis continues to move, the conveyor belt continues to move, and the bracket continues to rise. Accordingly, the information about the suspension of the loading task flow 310 of machine tool A, the information about the execution of the corresponding stop action of instructions 2-4, and the information that instruction 5 has not been executed, which were saved during the previous pause, can be deleted.
[0065] Then, it is checked that the buffer management task flow of machine tool A is also suspended, and the suspended buffer management task flow is resumed. Since there are no unexecuted instructions in the buffer management task flow when it was previously suspended, there is no need to create a new task flow, but only need to re-execute instructions 3' and 4' that were executed when the stop action was suspended, that is, re-perform logical judgment and conveyor belt speed adjustment. Accordingly, the information about the suspension of the buffer management task flow 320 of machine tool A and the information about the execution of the corresponding stop action of instructions 3' and 4' saved during the previous suspension can be deleted.
[0066] Then, it is possible to continue to check whether there are other suspended task processes, and perform corresponding recovery work as needed. In this example, after rechecking, all previously suspended task processes have been restored, and the task process recovery work is completed. It should be noted that although the above description is based on a machine tool processing system including three machine tools, the control method of the present invention can also be applied to a machine tool processing system including only one machine tool, two machine tools, or four or even more machine tools.
[0067] It is also understandable that, although the above illustrative embodiments relate to the field of machine tool processing, the method of controlling the task flow of the present invention can also be applied to any other modern industrial scenarios of automated control.
[0068] So far, the method for controlling the task flow according to the present invention has been described. It provides a new mechanism for restoring the task flow from a breakpoint to address the defect of the prior art that the suspended task flow can only be executed from the beginning. The suspended task flow is restored from the breakpoint by saving the breakpoint of the relevant task flow that needs to be suspended and executing a new task flow created based on the breakpoint information. This greatly improves the execution efficiency of the task flow and effectively saves the labor cost and time cost spent in the prior art to restore the suspended task flow to the initial state. In addition, the control method of the present invention also innovates a mechanism for identifying instructions that actually have safety hazards or are expected to be stopped according to the actual processing situation when pausing the task flow, so that instructions that actually have safety hazards or are expected to be stopped can be shut down more safely and accurately when pausing the task flow.
[0069] According to an embodiment of the present invention, there is also provided a computer-readable storage medium having encoded instructions recorded thereon, which can implement the above-mentioned method for controlling the task flow according to the present invention when the instructions are executed. The computer-readable storage medium may include a hard disk drive, a floppy disk drive, a compact disk read / write (CD-R / W) drive, a digital versatile disk (DVD) drive, a flash drive and / or a solid-state storage device, etc.
[0070] According to an embodiment of the present invention, a computer program product is also provided, including a computer program, which can implement the above-mentioned method for controlling a task flow according to the present invention when the computer program is executed. The computer program product can be implemented using a variety of programming languages, such as C, C++, Java, Python, JavaScript, etc., to adapt to different development environments and platform requirements.
[0071] According to an embodiment of the present invention, a system for controlling a task flow is also provided accordingly.
[0072] refer to Figure 5 , which shows a system 500 for controlling a task flow according to the present invention, which may include an executor unit 520 and a manager unit 540.
[0073] The manager unit 540 can be configured to: a) stop the task flow that needs to be suspended from executing new instructions, and at the same time, enable the executor unit 520 to perform a stop action on the instructions that need to be stopped in the executed instructions of each task flow to be suspended; b) save the pause status information and pause instruction information of all suspended task flows; c) when it is necessary to resume at least one of the suspended task flows, for each task flow that needs to be resumed, create a new task flow based on the saved pause status information and pause instruction information; and d) enable the executor unit 520 to execute the new task flow and re-execute the instructions that were executed to stop the action.
[0074] Optionally, when executing a), the manager unit 540 may be further configured to: a1) when a task flow needs to be paused, identify all instructions with safety hazards or instructions that are expected to be stopped among the executed instructions of the task flow and enable the executor unit 520 to perform a stop action on the instructions with safety hazards or the instructions that are expected to be stopped; a2) based on the correlation between the instructions with safety hazards or the instructions that are expected to be stopped and other parallel task flows being executed, determine whether it is necessary to pause other parallel task flows being executed; and a3) if it is necessary to pause other parallel task flows being executed, execute a1) and a2) on the other parallel task flows being executed that need to be paused.
[0075] Optionally, the pause instruction information may include a pause instruction parameter and a pause instruction queue sequence number.
[0076] Optionally, when executing c), the manager unit 540 may be further configured to: parse the pause state information and the pause instruction information; create a paused instruction; and restore instruction parameters to the pause instruction parameters.
[0077] Optionally, when executing step d), the executor unit 520 may be further configured to: execute the new task flow starting from the instruction of the pause instruction queue sequence number.
[0078] The system 500 for controlling the task flow can implement the method for controlling the task flow according to the present invention as described above. Many design concepts and details applicable to the method for controlling the task flow of the present invention are also applicable to the system 500 for controlling the task flow, and the same beneficial technical effects can be obtained, which will not be repeated here.
[0079] Various aspects of the present invention have been described above through some exemplary embodiments. However, it should be understood that various modifications may be made to the above exemplary embodiments without departing from the spirit and scope of the present invention. For example, if the described techniques are performed in a different order and / or if the components in the described system, architecture, device or circuit are combined in different ways and / or replaced or supplemented by other components or their equivalents, suitable results may be achieved, and accordingly, these modified other embodiments also fall within the scope of protection of the claims.
Claims
1. A method for controlling a task flow, wherein the task flow includes executing one or more instructions, and the method comprises the following steps: a) stopping the task flow to be suspended from executing new instructions, and performing a stop action on the instructions that need to be stopped among the executed instructions of each task flow to be suspended; b) Save the pause status information and pause instruction information of all paused task flows; c) when it is necessary to resume at least one of the suspended task flows, for each task flow that needs to be resumed, creating a new task flow based on the saved pause state information and pause instruction information; and d) executing the new task flow and re-executing the instruction of the executed stop action.
2. The method according to claim 1, characterized in that The step a) comprises: a1) When a task flow needs to be suspended, identifying all instructions with potential safety hazards or instructions that are expected to be stopped among the executed instructions of the task flow and performing a stop action on the instructions with potential safety hazards or the instructions that are expected to be stopped; a2) determining whether it is necessary to suspend other parallel task processes being executed based on the correlation between the instruction with potential safety hazard or the instruction to be stopped and other parallel task processes being executed; and a3) If it is necessary to pause other parallel task processes being executed, then steps a1) and a2) are performed on the other parallel task processes being executed that need to be paused.
3. The method according to claim 1, characterized in that The pause instruction information includes a pause instruction parameter and a pause instruction queue sequence number.
4. The method according to claim 3, characterized in that The step c) comprises: parsing the pause state information and the pause instruction information; Create the suspended instructions; and Restore the command parameters to the pause command parameters.
5. The method according to claim 4, characterized in that The step d) comprises: The new task flow is executed starting from the instruction of the pause instruction queue sequence number.
6. A system for controlling a task flow, the task flow comprising executing one or more instructions, the system comprising: Actuator unit; as well as The manager unit is configured as follows: a) stopping the task flow to be suspended from executing new instructions, and causing the executor unit to execute a stop action on the instructions that need to be stopped among the executed instructions of each task flow to be suspended; b) Save the pause status information and pause instruction information of all paused task flows; c) when it is necessary to resume at least one of the suspended task flows, for each task flow that needs to be resumed, creating a new task flow based on the saved pause state information and pause instruction information; as well as d) enabling the executor unit to execute the new task flow and re-execute the instruction of the executed stop action.
7. The system according to claim 6, characterized in that When executing a), the manager unit is further configured to: a1) when a task flow needs to be suspended, identifying all instructions with potential safety hazards or instructions that are expected to be stopped among the executed instructions of the task flow and causing the executor unit to perform a stop action on the instructions with potential safety hazards or the instructions that are expected to be stopped; a2) determining whether it is necessary to suspend other parallel task processes being executed based on the correlation between the instruction with potential safety hazard or the instruction expected to be stopped and other parallel task processes being executed; as well as a3) If it is necessary to pause other parallel task processes being executed, then a1) and a2) are executed for the other parallel task processes being executed that need to be paused.
8. The system according to claim 6, characterized in that The pause instruction information includes a pause instruction parameter and a pause instruction queue sequence number.
9. The system according to claim 8, characterized in that When executing c), the manager unit is further configured to: parsing the pause state information and the pause instruction information; Create the suspended instructions; and Restore the command parameters to the pause command parameters.
10. The system according to claim 9, characterized in that When executing d), the actuator unit is further configured to: The new task flow is executed starting from the instruction of the pause instruction queue sequence number.
11. A computer-readable storage medium having encoded instructions recorded thereon, which implement the method according to any one of claims 1 to 5 when the instructions are executed.
12. A computer program product, comprising a computer program, which implements the method according to any one of claims 1 to 5 when the computer program is executed.