A multitasking execution method, device, equipment and medium

By setting up independent threads and task priority lists for IEC61131-3 multi-task execution, the problem of unstable CPU load in programmable logic controllers during multi-task execution is solved, achieving stable task execution and load balancing.

CN115061793BActive Publication Date: 2026-02-06HANGZHOU HOLLYSYS AUTOMATION
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210669047.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-14
Publication Date
2026-02-06
Estimated Expiration
2042-06-14

AI Technical Summary

Technical Problem

When existing programmable logic controllers (PLCs) perform multi-task IEC61131-3 computation tasks, the CPU load is unstable, and the execution cycle of some tasks is limited by other tasks, resulting in task blocking and load imbalance.

Method used

Each computational task in the IEC61131-3 multi-task operation is assigned an independent thread, and a task priority list and target reference list are set for it. The execution order and data call relationship of each task are controlled by the programmable logic controller.

Benefits of technology

This enables the independent execution of each computational task, avoids task blocking, stabilizes the CPU load, and improves the task execution efficiency and reliability of the programmable logic controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115061793B_ABST
    Figure CN115061793B_ABST
Patent Text Reader

Abstract

The application discloses a multi-task execution method, device, equipment and medium, and belongs to the technical field of power electronics. The method comprises the following steps: setting independent threads for each operation task in an IEC61131-3 multi-operation task in advance; setting a task priority list for each operation task in the IEC61131-3 multi-operation task, and setting a target reference list according to the data calling relationship of each operation task; and sending the task priority list and the target reference list to a programmable logic controller, so that the programmable logic controller controls each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list. By using the method, the programmable logic controller can execute each operation task in the IEC61131-3 multi-operation task without being affected by other operation tasks, and the CPU load is more stable.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power electronics, and particularly relates to a multi-task execution method and device, equipment and a medium. BACKGROUND

[0002] IEC61131-3 is a standard specification formulated by the International Electrotechnical Commission for programmable logic controllers (PLC). The programmable logic controller can only support a single task of IEC61131-3 operation at present, that is, the programmable logic controller can only support one IEC61131-3 operation task. The programmable logic controller needs to perform reading of input signals, execution of user configuration programs, and writing of output signals when executing the IEC61131-3 operation task. Please refer to Figure 1 , Figure 1 FIG. 1 is a schematic diagram of the programmable logic controller in the prior art when executing one IEC61131-3 operation task.

[0003] Since the execution periods of the IEC61131-3 operation tasks in the user configuration program are different, in order to meet the task execution requirements of different IEC61131-3 operation tasks, the prior art sets the minimum execution period to solve the above problem. That is, the period with the shortest execution time of the IEC61131-3 operation task in the user configuration program is set as the minimum execution period, and the execution periods of the other IEC61131-3 operation tasks in the user configuration program are set as integer multiples of the minimum execution period. In this case, the corresponding IEC61131-3 operation task is executed once every integer multiple of the execution period. Please refer to Figure 2 , Figure 2 FIG. 2 is a schematic diagram of the programmable logic controller in the prior art when executing three IEC61131-3 operation tasks. Figure 2 In the prior art, the execution period of the A operation task is 100 ms, the execution period of the B operation task is 200 ms, and the execution period of the C operation task is 50 ms. Then the final execution result of the programmable logic controller is that the A operation task is executed once every 100 ms, the B operation task is executed once every 200 ms, and the C operation task is executed once every 50 ms, and the programmable logic controller serially executes all the operation tasks.

[0004] If the IEC61131-3 multi-operation task is executed in the above manner, the execution period of the C operation task is limited by the execution of the A operation task and the B operation task. For example, if the minimum execution period of the programmable logic controller in executing the A operation task and the B operation task exceeds 50 ms, the execution period of the C operation task cannot be guaranteed. In addition, if the IEC61131-3 multi-operation task is executed in the above manner, the CPU (Central Processing Unit) load of the programmable logic controller is unstable, and the CPU load can be extremely high or extremely low. At present, there is no effective solution to the above problems. SUMMARY

[0005] Therefore, the present application aims to provide a multi-task execution method, device, equipment and medium, so that the programmable logic controller is not affected by other operation tasks when executing each operation task in the IEC61131-3 multi-operation task, and the CPU load of the programmable logic controller is more stable when executing the IEC61131-3 multi-operation task. The specific scheme is as follows:

[0006] A multi-task execution method, comprising:

[0007] setting independent threads for each operation task in the IEC61131-3 multi-operation task in advance;

[0008] setting a task priority list for each operation task in the IEC61131-3 multi-operation task, and setting a target reference list according to the data calling relationship of each operation task;

[0009] sending the task priority list and the target reference list to a programmable logic controller, so that the programmable logic controller regulates and controls each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list.

[0010] Preferably, the process of setting a task priority list for each operation task in the IEC61131-3 multi-operation task comprises:

[0011] setting the task priority list according to the task execution period of each operation task in the IEC61131-3 multi-operation task.

[0012] Preferably, the process of regulating and controlling each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list by the programmable logic controller comprises:

[0013] According to the priority of each operation task in the task priority list and the target reference list, each operation task in the IEC61131-3 multi-operation task is executed in sequence until the IEC61131-3 multi-operation task is completed.

[0014] Preferably, the process of executing each operation task in the IEC61131-3 multi-operation task in sequence according to the priority of each operation task in the task priority list and the target reference list comprises:

[0015] During the execution of the first operation task by the programmable logic controller, it is determined according to the task priority list whether there is a second operation task with a higher priority than the first operation task at the current time;

[0016] If not, the first operation task is continuously executed;

[0017] If yes, the first operation task is interrupted and the second operation task is executed.

[0018] Preferably, the process further comprises:

[0019] The code area and the data area of each operation task in the IEC61131-3 multi-operation task are set independently in advance.

[0020] Preferably, the process further comprises:

[0021] When the programmable logic controller finishes executing the first operation task, it is determined according to the target reference list whether there is a target operation task having a data calling relationship with the first operation task in the IEC61131-3 multi-operation task;

[0022] If yes, the target configuration information of the first operation task is sent to the data area corresponding to the target operation task.

[0023] Preferably, the process further comprises:

[0024] If abnormal running information occurs in the execution of the IEC61131-3 multi-operation task by the programmable logic controller, the abnormal running information is stored.

[0025] Correspondingly, the application also discloses a multi-task execution device, which comprises:

[0026] A thread setting module is configured to set independent threads for each operation task in the IEC61131-3 multi-operation task.

[0027] The list setting module is configured to set a task priority list for each operation task in the IEC61131-3 multi-operation task and set a target reference list according to the data calling relationship of each operation task.

[0028] The task control module is configured to send the task priority list and the target reference list to the programmable logic controller, so that the programmable logic controller controls each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list.

[0029] Correspondingly, the application further discloses a multi-task execution device, which comprises:

[0030] The memory is configured to store a computer program.

[0031] The processor is configured to execute the computer program to implement the steps of the multi-task execution method.

[0032] Correspondingly, the application further discloses a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the multi-task execution method.

[0033] It can be seen that, in the multi-task execution method, the threads of each operation task in the IEC61131-3 multi-operation task are set to be independent of each other, the task priority list for each operation task in the IEC61131-3 multi-operation task is set, and the target reference list is set according to the data calling relationship of each operation task. Then, the task priority list and the target reference list are sent to the programmable logic controller, so that the programmable logic controller can control each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list. Compared with the prior art, because the threads of each operation task in the IEC61131-3 multi-operation task are independent of each other, the programmable logic controller can execute each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list in turn in the process of executing the IEC61131-3 multi-operation task, and the situation of task blocking does not occur. Moreover, the programmable logic controller can interrupt the operation task executed at the current time according to the task priority list in the process of executing the IEC61131-3 multi-operation task, so that the CPU load of the programmable logic controller in executing the IEC61131-3 multi-operation task is more stable. Correspondingly, the multi-task execution device, equipment and medium provided by the application also have the beneficial effects described above. BRIEF DESCRIPTION OF DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on the provided drawings are within the scope of the present application.

[0035] Figure 1 A schematic diagram of a programmable logic controller in the prior art when executing an IEC61131-3 operation task;

[0036] Figure 2 A schematic diagram of a programmable logic controller in the prior art when executing three IEC61131-3 operation tasks;

[0037] Figure 3 A flow chart of a multi-task execution method provided by an embodiment of the present application, which comprises:

[0038] Figure 4 A schematic diagram when executing IEC61131-3 multi-operation tasks;

[0039] Figure 5 A schematic diagram of a programmable logic controller when executing operation task A, operation task B and operation task C;

[0040] Figure 6 A resource occupation schematic diagram of a programmable logic controller when executing operation task A, operation task B and operation task C;

[0041] Figure 7 A structural diagram of a multi-task execution device provided by an embodiment of the present application;

[0042] Figure 8 A structural diagram of a multi-task execution device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments only represent some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.

[0044] Please refer to Figure 3 , Figure 3 A flow chart of a multi-task execution method provided by an embodiment of the present application, which comprises:

[0045] Step S11: setting independent threads for each operation task in the IEC61131-3 multi-operation task in advance;

[0046] Step S12: setting a task priority list for each operation task in the IEC61131-3 multi-operation task, and setting a target reference list according to the data calling relationship of each operation task;

[0047] Step S13: sending the task priority list and the target reference list to the programmable logic controller, so that the programmable logic controller controls each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list.

[0048] In this embodiment, a multi-task execution method is provided. By using the method, the programmable logic controller can execute each operation task in the IEC61131-3 multi-operation task without being affected by other operation tasks, and the CPU load of the programmable logic controller during execution of the IEC61131-3 multi-operation task is more stable.

[0049] In the multi-task execution method, the configuration software is taken as the execution subject. Specifically, in the multi-task execution method, independent threads are set for each operation task in the IEC61131-3 multi-operation task in advance, and a task priority list is set for each operation task in the IEC61131-3 multi-operation task in advance, and a target reference list is set according to the data calling relationship of each operation task in the IEC61131-3 multi-operation task.

[0050] It can be understood that when independent threads are set for each operation task in the IEC61131-3 multi-operation task, any operation task in the IEC61131-3 multi-operation task will not be affected by other operation tasks during execution of the task, thereby ensuring the overall reliability of the IEC61131-3 multi-operation task during execution of the task.

[0051] When the configuration software sets the task priority list and the target reference list according to the user instruction, the task priority list and the target reference list are sent to the programmable logic controller. After the programmable logic controller receives the task priority list and the target reference list sent by the configuration software, the programmable logic controller can control each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list, and complete the IEC61131-3 multi-operation task.

[0052] Please refer to Figure 4 , Figure 4The flow chart for executing the IEC61131-3 multi-operation task is shown in FIG. 1. When the IEC61131-3 multi-operation task is executed, the configuration software needs to set up threads for each operation task in the IEC61131-3 multi-operation task independently, set up a task priority list according to the configuration information of each operation task, and set up a target reference list according to the data calling relationship between each operation task. The configuration information of each operation task includes task code, storage data area information, task execution period, task execution priority, program entry address, and calling relationship between operation tasks, etc. After the configuration software sets up the task priority list and the target reference list, the task priority list and the target reference list are sent to the programmable logic controller. After the programmable logic controller receives the task priority list and the target reference list sent by the configuration software, the IEC task scheduling management module in the programmable logic controller parses the task priority list and the target reference list, and sends corresponding scheduling instructions to each operation task in the IEC61131-3 multi-operation task. In addition, the programmable logic controller can output the task execution times, task execution time, minimum running time, maximum running time, cumulative running time, running status / sleeping / suspended / ready, and abnormal running information, etc. during the execution of the IEC61131-3 multi-operation task.

[0053] It can be seen that in the multi-task execution method provided in the embodiment, threads for each operation task in the IEC61131-3 multi-operation task are set up independently, a task priority list for each operation task in the IEC61131-3 multi-operation task is set up, and a target reference list is set up according to the data calling relationship of each operation task. Then, the task priority list and the target reference list are sent to the programmable logic controller, so that the programmable logic controller can control each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list. Compared with the prior art, because the threads of each operation task in the IEC61131-3 multi-operation task are independent of each other, in this case, the programmable logic controller can execute each operation task in the IEC61131-3 multi-operation task in turn according to the task priority list and the target reference list during the execution of the IEC61131-3 multi-operation task, without the occurrence of task blocking. Moreover, the programmable logic controller can interrupt the operation task being executed at the current time according to the task priority list during the execution of the IEC61131-3 multi-operation task, so that the CPU load of the programmable logic controller during the execution of the IEC61131-3 multi-operation task is more stable.

[0054] Based on the above embodiment, the technical solution is further explained and optimized. As a preferred embodiment, the step of setting a task priority list for each operation task in the IEC61131-3 multi-operation task includes:

[0055] Setting the task priority list according to the task execution period of each operation task in the IEC61131-3 multi-operation task.

[0056] Specifically, when setting the task priority list, the task priority list can be set according to the task execution period of each operation task in the IEC61131-3 multi-operation task. That is, when setting the task priority list, the operation task with shorter execution time in the IEC61131-3 multi-operation task can be set as high priority, and the operation task with longer execution time in the IEC61131-3 multi-operation task can be set as low priority.

[0057] Suppose there are three operation tasks in the IEC61131-3 multi-operation task, namely operation task A, operation task B, and operation task C, and the task execution periods of the three operation tasks are 100ms, 200ms, and 50ms respectively. When setting the task priority list of operation task A, operation task B, and operation task C, the priority of operation task A can be set as medium, the priority of operation task B can be set as low, and the priority of operation task C can be set as high.

[0058] Please refer to Figure 5 , Figure 5 for a schematic diagram of the programmable logic controller when executing operation task A, operation task B, and operation task C. In Figure 5 , the programmable logic controller needs to read the input signal related to operation task C according to the task priority list, and obtain the shared data related to operation task C from other operation tasks according to the target reference list, then the programmable logic controller executes operation task C, when the programmable logic controller finishes executing operation task C, the configuration information of operation task C is sent to the operation task related to operation task C, and finally the output signal of operation task C is written; similarly, the programmable logic controller executes operation task A and operation task B in turn according to the task priority list and the target reference list.

[0059] Based on the above embodiment, the technical solution is further explained and optimized. As a preferred embodiment, the step of setting a task priority list for each operation task in the IEC61131-3 multi-operation task includes:

[0060] According to the priority of each operation task in the task priority list and the target reference list, each operation task in the IEC61131-3 multi-operation task is executed in turn until the IEC61131-3 multi-operation task is completed.

[0061] In the present embodiment, the programmable logic controller needs to parse the task priority list sent by the configuration software to determine the priority of each operation task in the IEC61131-3 multi-operation task during the execution of the IEC61131-3 multi-operation task, and determine which operation task needs to call the data in other operation tasks according to the target reference list. Then, the programmable logic controller sends corresponding scheduling instructions to each operation task in the IEC61131-3 multi-operation task in turn according to the task priority list and the target reference list until each operation task in the IEC61131-3 multi-operation task is completed.

[0062] As a preferred embodiment, the above-mentioned step of executing each operation task in the IEC61131-3 multi-operation task in turn according to the priority of each operation task in the task priority list and the target reference list includes:

[0063] In the process of executing the first operation task by the programmable logic controller, it is determined whether there is a second operation task with a higher priority than the first operation task according to the task priority list at the current time;

[0064] If not, the first operation task is continued to be executed;

[0065] If so, the first operation task is interrupted, and the second operation task is executed.

[0066] When the programmable logic controller executes the IEC61131-3 multi-operation task according to the task priority list and the target reference list, if the programmable logic controller determines that there is a second operation task with a higher priority than the first operation task according to the task priority list in the process of executing the first operation task, the programmable logic controller can interrupt the first operation task and execute the second operation task first. If the programmable logic controller determines that there is no operation task with a higher priority than the first operation task according to the task priority list in the process of executing the first operation task, the programmable logic controller can continue to execute the first operation task, and after the first operation task is executed, the programmable logic controller can execute the operation task with a lower priority than the first operation task according to the task priority list and the target reference list.

[0067] Here, the priority of operation task A is medium, the priority of operation task B is low, and the priority of operation task C is high. Please refer to Figure 6 ,Figure 6 Fig. 2 is a schematic diagram of resource occupation of a programmable logic controller in executing operation task A, operation task B and operation task C. As shown in Fig. 2, because operation task C has the highest priority, the programmable logic controller can preempt the resources of operation task B and operation task A when executing operation task C, so that the execution logic of operation task C will not be blocked by operation task A and operation task B, and the CPU load of the programmable logic controller will not be too high or too low during the execution of the operation tasks. Figure 6

[0068] Obviously, the technical solution provided by the embodiment can ensure that the operation task with higher priority will not be blocked in the execution process.

[0069] As a preferred embodiment, the above multi-task execution method further comprises:

[0070] The IEC61131-3 multi-operation task is set with mutually independent code area and data area for each operation task.

[0071] In the embodiment, the IEC61131-3 multi-operation task is set with mutually independent code area and data area for each operation task. The code area is used to store the execution code of the operation task, and the data area is used to store the relevant data information of the operation task in the execution process of the operation task.

[0072] It is conceivable that when the IEC61131-3 multi-operation task is set with mutually independent code area and data area for each operation task, there will be no function call relationship and variable interaction relationship between the operation tasks, which can effectively improve the safety and reliability of the programmable logic controller in executing the IEC61131-3 multi-operation task. Moreover, this setting method can also make each operation task more effectively and orderly call the data information related to itself in the execution process of the operation task according to the target reference list in the data area of other operation tasks, thereby further improving the task execution efficiency of the programmable logic controller in executing the IEC61131-3 multi-operation task.

[0073] As a preferred embodiment, the above multi-task execution method further comprises:

[0074] When the programmable logic controller finishes executing the first operation task, it is determined according to the target reference list whether there is a target operation task having data call relationship with the first operation task in the IEC61131-3 multi-operation task;

[0075] ​If the target configuration information of the first operation task exists, the target configuration information of the first operation task is sent to a data area corresponding to the target operation task.

[0076] In the process that the programmable logic controller executes the IEC61131-3 multi-operation task, if the programmable logic controller finishes the first operation task according to the task priority list, and the programmable logic controller judges that there is still a target operation task having a data calling relationship with the first operation task in the IEC61131-3 multi-operation task according to the target reference list, the programmable logic controller can directly send the target configuration information of the first operation task to the data area corresponding to the target operation task, so that the data consistency of the programmable logic controller in executing the IEC61131-3 multi-operation task can be ensured.

[0077] Based on the above embodiment, the technical solution is further described and optimized, and as a preferred embodiment, the above multi-task execution method further comprises:

[0078] If abnormal running information occurs in the programmable logic controller in executing the IEC61131-3 multi-operation task, the abnormal running information is stored.

[0079] It can be understood that in the process that the programmable logic controller executes the IEC61131-3 multi-operation task, abnormal phenomena such as shutdown, interruption or running error are inevitable, therefore, in order to enable the staff to quickly locate and maintain the abnormal phenomena occurring in the programmable logic controller in executing the IEC61131-3 multi-operation task, the abnormal running information occurring in the programmable logic controller in executing the IEC61131-3 multi-operation task can be stored.

[0080] It can be conceived that through such a setting mode, the staff can conveniently track and trace the abnormal phenomena occurring in the programmable logic controller in executing the IEC61131-3 multi-operation task, so that the maintenance efficiency of the staff in processing and maintaining the abnormal phenomena can be further improved.

[0081] Please refer to Figure 7 , Figure 7 A structure diagram of a multi-task execution device provided by the embodiment of the present application, the device comprises:

[0082] The thread setting module 21 is used for setting independent threads for each operation task in the IEC61131-3 multi-operation task in advance.

[0083] The list setting module 22 is configured to set a task priority list for each operation task in the IEC61131-3 multi-operation task, and set a target reference list according to the data calling relationship of each operation task.

[0084] The task control module 23 is configured to send the task priority list and the target reference list to the programmable logic controller, so that the programmable logic controller controls each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list.

[0085] The multi-task execution device provided by the embodiment of the present application has the beneficial effects of the multi-task execution method disclosed above.

[0086] Please refer to Figure 8 , Figure 8 The structure diagram of the multi-task execution device provided by the embodiment of the present application is shown in the figure, and the device comprises:

[0087] The memory 31 is configured to store a computer program.

[0088] The processor 32 is configured to execute the computer program to realize the steps of the multi-task execution method disclosed above.

[0089] The multi-task execution device provided by the embodiment of the present application has the beneficial effects of the multi-task execution method disclosed above.

[0090] Correspondingly, the embodiment of the present application further discloses a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of the multi-task execution method disclosed above.

[0091] The computer readable storage medium provided by the embodiment of the present application has the beneficial effects of the multi-task execution method disclosed above.

[0092] In the specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. For the device disclosed by the embodiment, since it corresponds to the method disclosed by the embodiment, the description is relatively simple, and the related parts can be referred to the method part.

[0093] Finally, it needs to be pointed out that in this article, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0094] The above describes in detail a multi-task execution method, device, equipment and medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples in this article. The above example is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed. In view of the above, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A multi-task execution method, characterized in that, include: Independent threads are pre-configured for each computational task in the IEC61131-3 multi-computation task; Set a task priority list for each computing task in the IEC61131-3 multi-computation task, and set a target reference list according to the data call relationship of each computing task; The task priority list and the target reference list are sent to the programmable logic controller (PLC) so that the PLC can control each computation task in the IEC61131-3 multi-computation task according to the task priority list and the target reference list. Also includes: Each computational task in the IEC61131-3 multi-computation task is pre-set with an independent code area and data area; Also includes: When the programmable logic controller completes the first operation task, it determines whether there is a target operation task in the IEC61131-3 multi-operation task that has a data call relationship with the first operation task according to the target reference list; If it exists, the target configuration information of the first computing task is sent to the data area corresponding to the target computing task.

2. The multi-task execution method according to claim 1, characterized in that, The process of setting a task priority list for each computation task in the IEC61131-3 multi-computation task includes: The task priority list is set according to the task execution cycle of each computing task in the IEC61131-3 multi-computation task.

3. The multi-task execution method according to claim 1, characterized in that, The process by which the programmable logic controller regulates each computational task in the IEC61131-3 multi-computation task according to the task priority list and the target reference list includes: According to the priority of each computation task in the task priority list and the target reference list, each computation task in the IEC61131-3 multi-computation task is executed sequentially until the IEC61131-3 multi-computation task is completed.

4. The multi-task execution method according to claim 3, characterized in that, The process of sequentially executing each computation task in the IEC61131-3 multi-computation task according to the priority of each computation task in the task priority list and the target reference list includes: During the execution of the first computation task by the programmable logic controller, it is determined from the task priority list whether there is a second computation task with a higher priority than the first computation task at the current moment. If it does not exist, continue executing the first computation task; If it exists, the first computation task is interrupted, and the second computation task is executed.

5. A multi-task execution method according to any one of claims 1 to 4, characterized in that, Also includes: If the programmable logic controller encounters abnormal operation information while executing the IEC61131-3 multi-operation task, the abnormal operation information is stored.

6. A multi-tasking execution device, characterized in that, include: The thread setting module is used to pre-set independent threads for each computation task in the IEC61131-3 multi-computation task; The list setting module is used to set a task priority list for each computing task in the IEC61131-3 multi-computation task, and to set a target reference list according to the data call relationship of each computing task; The task control module is used to send the task priority list and the target reference list to the programmable logic controller, so that the programmable logic controller can control each operation task in the IEC61131-3 multi-operation task according to the task priority list and the target reference list; Also includes: Each computational task in the IEC61131-3 multi-computation task is pre-set with an independent code area and data area; Also includes: When the programmable logic controller completes the first operation task, it determines whether there is a target operation task in the IEC61131-3 multi-operation task that has a data call relationship with the first operation task according to the target reference list; If it exists, the target configuration information of the first computing task is sent to the data area corresponding to the target computing task.

7. A multi-tasking execution device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of a multitasking execution method as described in any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a multitasking execution method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • PLC task scheduling method and device

    CN110794759A

  • Multi-energy system digital twin application process modeling and deploying method and system

    CN112541836A

  • Task scheduling method, game engine, equipment and storage medium

    CN113641476A