Method and programmable control device for data processing

By introducing parallel processor cores on SPS and dynamically adjusting priority, the problem of low resource utilization efficiency in the prior art is solved, and more efficient data processing and better real-time performance are achieved.

CN112823337BActive Publication Date: 2025-02-18BECKHOFF AUTOMATION GMBH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201980066138.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-10-10
Filing Date
2019-10-10
Publication Date
2025-02-18
Estimated Expiration
2039-10-10

AI Technical Summary

Technical Problem

The existing programmable control devices (SPS) are difficult to effectively utilize resources when processing data, resulting in the inability to complete the input data processing on time, affecting the real-time nature of the automation system.

Method used

Optimize data processing by introducing a parallel processor core on SPS and dynamically adjusting the priority of the parallel processing segments of the program. The method includes assigning control tasks to multiple processor cores and evaluating and adjusting priorities through a priority manager to maximize computational effort and reduce management transactions.

Benefits of technology

It realizes more efficient data processing, ensures that SPS can complete tasks on time, and improves the real-time and computing efficiency of the automation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112823337B_ABST
    Figure CN112823337B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for optimizing data processing on a programmable control system (SPS). The SPS includes a control task, which includes a plurality of executable programs, wherein at least two programs of the control task each have at least one parallel processing segment including a work package, and the work package includes a plurality of subtasks. Priorities with preset priorities are assigned to the parallel processing segments in the corresponding programs, wherein the corresponding priorities are added to a data structure once the programs are executed on the parallel processing segments. At least one parallel processor core checks whether there is an entry in the data structure and if there is an entry, at least one parallel processor core processes the subtask in the work package of the program whose priority is at the first position of the entry in the data structure. During the program cycle, the expected computing amount of the control task is continuously evaluated and at least one priority of the parallel processing segments of the corresponding program is dynamically adjusted, thereby increasing the computing amount of the control task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for processing data on a programmable control device (speicherprogrammierbarenSteuerung, SPS). The invention also relates to a programmable control device, which is used in particular for regulating or controlling a machine or a system. Background Art

[0002] The machines or devices of an automation system are usually controlled by means of a programmable control unit (SPS). The SPS controls or regulates the actuators and sensors of the machine or device via a communication port. The communication port can be implemented, for example, as a fieldbus system, wherein the actuators and sensors of the machine or device can be interconnected via the fieldbus system.

[0003] The SPS obtains information about the state of a machine or device by reading the measurement data of sensors connected to the input of a programmable control device and / or the current actual data of an actuator. The actuator is connected to the output of a programmable control device and is capable of controlling a machine or device. In order to dynamically control the actuator, the SPS generates output data for the actuator based on the actual data and / or based on the measurement data of the sensor, wherein the data may be a single value or a value group. The actuator may also be controlled according to regulations, for example, according to a motion curve. In order to be able to provide the desired operating mode of the machine or device, the control task of the SPS determines which output data generated by the SPS according to the corresponding input data will be delivered to the actuator. The processing of data by the SPS is mostly performed cyclically and includes three steps: providing current input data (e.g., actual data of the actuator and / or measurement data of the sensor), processing the input data into output data, and outputting output data for motion control (e.g., target position, etc.).

[0004] In order to control an automation system, it is necessary to complete the processing of the input data at the latest at the time when the output data for the actuator is required. This time is called the deadline and usually corresponds to the end of the program cycle of the SPS. For programmable control devices, strict real-time requirements are usually required, which means that deadlines are met sequentially and may not be exceeded. In addition, valid results are available for the actuator at the time of the deadline. This is particularly important when exceeding the deadline would lead to damage to people or objects, for example, when a robot is not braked in time.

[0005] The program execution of SPS is determined, for example, in the standard IEC 61131-3. SPS has control tasks and it is mostly composed of one or more programs with tasks (so-called "Tasks") that usually need to be executed periodically. In the simplest case, a programmable control device has only a single processor core for multiple independent programs including tasks (Tasks). Therefore, the available computing time must be allocated so that all programs with corresponding tasks can follow their deadlines. Different program cycle times in SPS can be in the range of 100μs to 20ms according to the application, or in the range of 50ms to 100ms in the case of complex tasks. Due to different program cycle times, programs with tasks with longer cycle times can be prevented from delaying programs with tasks with shorter cycle times, so that they can no longer follow their deadlines. Usually this is only achieved when the execution of such a slower program is interrupted and continued to be executed later. Thus, each program with a corresponding task is usually assigned a preset priority. This priority can be derived from the deadline and / or the correlation of the corresponding program with other programs, if the program, for example, indicates the results of other programs. This priority can also correspond to an integer value.

[0006] Because a plurality of SPSs include processors and or a plurality of processors with a plurality of processor cores, SPSs can distribute programs with corresponding tasks to a plurality of processor cores or processors, so as to reduce the total processing time of programs with corresponding tasks by at least partially executing the corresponding tasks in parallel. Here, the so-called computational amount of the control task can be derived from the interruption time of the program, the number of program interruptions or the computational time of the corresponding program. In addition, the processor core of the control task can be related to the load amount of the processor core. If programs and tasks are distributed to a plurality of processor cores, due to the corresponding priorities, tasks that are just executed in parallel on the processor cores working in parallel are interrupted by other tasks associated with a higher priority in the corresponding program. The interruption of tasks increases the so-called management affairs and can change each other in time. Management affairs include the activation required when interrupting task processing in the program. This activation can be, for example, the intermediate result of the transmission and storage of the interrupted task, otherwise the task of the program must be reprocessed. Therefore, the computational amount during high management affairs can be reduced, because calculations are usually not performed during the interruption of the program. The computing time of a program can also have an impact on the amount of computation, since a program with a short program cycle time can be executed more quickly purely sequentially, if necessary without parallelization, than on processor cores operating in parallel. This is because a program on a processor core operating in parallel can be interrupted by other programs with higher priority, which can extend the total execution time of the program. If the processor core is not fully loaded, for example by executing the program sequentially, but in parallel with the processor core provided for this purpose, the processor core provided for parallelization cannot be fully utilized. This can also reduce the amount of computation of the control task. Summary of the invention

[0007] The object of the present invention is to provide a method for optimizing data processing which makes optimal use of available resources. It is also an object of the present invention to provide an improved programmable control device.

[0008] This object is achieved by the features of the independent claim. Further advantageous embodiments of the invention are given in the dependent claims.

[0009] According to the present invention, a method for optimizing data processing on a programmable control device (SPS) is proposed, wherein the SPS includes at least one parallel processor core. The SPS also has a control task, which includes a plurality of executable programs. At least two programs of the control task each have at least one parallel processing segment including a work package, and the work package includes a plurality of subtasks. Priorities with preset priorities are assigned to the parallel processing segments in the corresponding programs, wherein the corresponding priorities are added to a data structure once the programs are executed on the parallel processing segments. At least one parallel processor core checks whether there is an entry in the data structure and if there is an entry, at least one parallel processor core processes the subtask whose priority in the work package of the program is at the first position of the entry in the data structure. During the program cycle, the expected computational amount of the control task is continuously evaluated and at least one priority of the parallel processing segment of the corresponding program is dynamically adjusted, thereby increasing the computational amount of the control task.

[0010] A parallel processor core is a processor core of the SPS, which is used to process subtasks in parallel. In addition, the SPS may have other processor cores, so-called main processor cores. The main processor cores can execute one or more programs of the control task respectively. The multiple programs of the control task can have purely sequentially executed programs, wherein at least two programs of the control task include at least two parallel processing sections. The parallel processing sections of the program can be executed with the assistance of the parallel processor cores.

[0011] The computational load of the control task can be evaluated via the interruption time and the number of interruptions of the parallel processing section of the program. Because no calculation is performed during the interruption of the subtask of the parallel processing section of the processing program, but the intermediate results are transmitted and stored, and the priority entries in the data structure are rearranged, at least one parallel processor core must ask for idle subtasks for processing before processing the subtasks of the work package of another program with the parallel processing section or first access the intermediate result memory when continuing to process the interrupted subtask, so that the already calculated intermediate structure can be used as the starting point for the continued processing of the interrupted subtask. In this regard, the interruption time and the number of interruptions of the program with the parallel processing section have an impact on the computational load of the control task because it prolongs the total execution time of the program. Therefore, the maximum computational load of the control task can be achieved without interrupting the program with the parallel processing section.

[0012] By dynamically adjusting the value of at least one priority of the parallel processing section of the program, the number of interruptions of the program with the parallel processing section can be reduced, because the value of the at least one priority can be specifically adapted to the respective situation in order to reduce the pipeline workload of the control task. If a subtask of a work package is just being executed in parallel and is interrupted by other subtasks of another work package with a higher priority of the respective parallel processing section of the respective program, the value of the at least one priority of the subtask can be changed directly within the program cycle to avoid further interruptions of the subtask of the respective parallel processing section and to avoid additional management workload. The value of the at least one priority can also be adjusted for a new program cycle, in which the respective program is executed again from the beginning.

[0013] In order not to reduce the value of at least one priority for each program cycle, it can be ensured by an additional condition, for example in the form of the value of at least one priority for a new program cycle having to correspond at least to half the value of at least one preset priority level, that the value of at least one priority of the program is not set to a minimum value undesirably. This is because a minimum value of at least one priority of a parallel processing section of a program means that the corresponding program is executed sequentially on the corresponding main processor core. In this way, the computing power of at least one parallel processor core may not be fully utilized if necessary, wherein the unused computing power reduces the computing power of the control task. The load of the processor core can therefore advantageously be taken into account by means of the said lower limit additional condition for adjusting the value of at least one priority of a parallel processing section of a program.

[0014] In addition, the computational amount of the control task can be evaluated by the computing time of the parallel processing section. Although the program with a short program cycle time, for example, a subtask of 1ms, can be fully allocated for parallel processing subtasks in the parallel processing section of the program on at least one parallel processor core. But this may result in that the parallel processing section of the program is interrupted by the corresponding subtask of another parallel processing section with a higher priority. In the example, the parallelization of the program with a short program cycle time improves the management affairs and thus improves the computing time for the parallel processing section. The total program execution time can be slower than the situation where the program is purely sequentially and uninterruptedly executed due to parallelization. Because the sequential computing time of the program with a short program cycle time can be shorter than the computing time of the parallel processing section when necessary, it is advantageous that when evaluating the computing amount (except the time and number of interruptions of the parallel processing section and the load of the processor core), the corresponding required computing time for executing the program is considered at the same time to improve the computing amount of the control task.

[0015] The value of at least one priority of the parallel processing sections of the program is dynamically adjusted during program execution, thereby increasing the computational effort of the control task. If the value of at least one priority of the parallel processing sections is not dynamically adjusted in the corresponding program, the total execution time of the corresponding program is increased due to the interruption time and the additional management tasks associated therewith, and the control task is overall slower than if the program tasks were processed purely sequentially in the corresponding program without interruptions.

[0016] In addition to dynamically adjusting the value of at least one priority of the parallel processing section of the program during program execution, it is also conceivable to obtain an optimal value of at least one priority of the parallel processing section of the program by means of simulation before the program of the control task of the SPS starts. The optimal value of at least one priority of the parallel processing section of the program obtained in this way can be used as a starting value for program execution when multiple programs of the control task of the SPS are assigned to the main processor core and when only one program is executed on each main processor core.

[0017] In another embodiment, at least one priority of the parallel processing section of the corresponding program is adjusted when the processing of the subtask of the program is interrupted. The computational amount of the control task is related to the time of interrupting the processing subtask, because the subtask of the parallel processing section of the program is not processed during this time, but the intermediate results of the calculation of the subtask are transmitted and stored when necessary. In addition, each interruption is different in time. Therefore, the interruption time can extend the total execution time of the program, because the interruption time must be considered in addition to the calculation time of the program. It can also be seen that the processing of the tasks of the parallel processing section of the frequent interruption leads to a reduction in the computational amount, because the management affairs of the intermediate results of the calculation subtasks are also increased by increasing the transmission and storage of the calculation subtasks with the frequency of interruption calculation. Therefore, the number of interruptions and the duration should be kept as low as possible, so that the high computational amount of the control task can be achieved in this way. This can be achieved when the subtasks of the parallel processing section of the interrupt processing of the program are processed.

[0018] Another embodiment is to adjust at least one priority of a parallel processing segment of the corresponding program when a subtask of a program is interrupted by another subtask of another program with a higher priority of the parallel processing segment on at least one parallel processor core. If a subtask of a work package is interrupted on at least one parallel processor core by another subtask of another work package associated with a higher priority value of the parallel processing segment of the corresponding program, the value of at least one priority of the interrupted subtask can be changed directly in the program cycle in order to generate as few management transactions as possible for the subtasks that are still waiting.

[0019] It is also possible to adjust the value of at least one priority level of the interrupted subtasks of the parallel processing section of the corresponding program accordingly for the next program cycle as described above. With the aid of the above-mentioned additional condition for the starting value of at least one priority level for the next program cycle, it can be ensured that the value of at least one priority level does not undesirably drop below a lower limit.

[0020] The computational load of the control task is derived from the interruption time and number of the program with the task, i.e., the management affairs. The computational load can be increased by reducing the management affairs, i.e., the number of program interruptions. In addition, the computational load can be increased by considering the computational time of the corresponding program. If the program of the subtask with a short program cycle time is purely sequential, i.e., executed without interruption with a shorter sequential computation time, it can be faster than in the parallel processing section of the program that may have an interruption, then the computational load of the control task can also be increased by considering the corresponding computational time in the program. Since the computing power of at least one parallel processor core is fully utilized and the subtasks that need to be processed in parallel of the parallel processing section of the corresponding program are processed by at least one processor core, the computational load of the control task can also be increased, wherein the program that needs to be executed sequentially is executed on the corresponding main processor core. In addition, the increased computational load also helps to reduce the total execution time of the program and the subtask, because the control task obtains more computing time in this way.

[0021] In another embodiment, additional conditions, in particular real-time conditions of the control tasks, are taken into account when adjusting at least one priority of the parallel processing section of the respective program. Dynamic adjustment of the value of at least one priority of the parallel processing section of the respective program during program execution can also ensure the real-time performance of the automation system. In any case, the deadline of the program can be met by adjusting the value of the priority. In addition to the real-time conditions, the possible conditions for the lower limit of the at least one priority can also be taken into account for adjusting at least one priority of the parallel processing section of the program.

[0022] In another embodiment, when a subtask of a program is interrupted by other subtasks of another program with a higher priority of a parallel processing segment on at least one parallel processor core, at least one priority of the parallel processing segment of the corresponding program is reduced by a factor. Reducing the value of at least one priority of the parallel processing segment of the corresponding program by a factor can help reduce management transactions. Because the value of at least one priority of the corresponding parallel processing segment in the corresponding program associated with the subtask is interrupted, in order to avoid continuing to interrupt the parallel processing segment with the subtask, it is directly reduced in the program cycle. In addition, when the calculation of the subtask in the parallel processing segment of the interrupted program occurs, the current intermediate results must be transmitted and the data must be stored. Therefore, frequent interruptions of subtasks can generate huge costs, which should be minimized. The value of at least one priority of the parallel processing segment of the corresponding program is always adjusted under the following conditions so that the real-time performance of the automation can be ensured, that is, the processing of the input data must be completed at the time point when the output data for the actuator is required at the latest. Therefore, it must be possible to ensure that, despite the reduction of the value of at least one priority of the parallel processing segment of the corresponding program, the deadline of the program can be further maintained.

[0023] In addition, the value of at least one priority of the parallel processing section of the program of the interrupted subtask can be increased immediately after the interrupt processing subtask. Increasing the value of at least one priority of the parallel processing section of the program can help the corresponding subtask no longer be interrupted by another parallel processing section of another program. In addition to dynamically adjusting the value of at least one priority of the interrupted subtask of the parallel processing section of the program, it is also conceivable to adjust the value of the priority of the program so as to cause the processing of the subtask of the parallel processing section of another program to be interrupted. Therefore, it is avoided that the subtask currently being processed by the parallel processing section of a program will not be interrupted again by another parallel processing section of another program.

[0024] Instead of reducing the interruption time and the number of interruptions of the parallel processing segments in the corresponding program by adjusting the value of at least one priority of the parallel processing segments, it is also conceivable to simultaneously take into account the calculation time of the parallel processing segments of the corresponding program when evaluating the calculation amount. In other words, it can be decided separately whether to adjust the value of at least one priority of the parallel processing segments of the corresponding program and / or whether the subtasks of the program should be processed purely sequentially if the sequential calculation time for the subtasks of the corresponding program is less than the calculation time of the parallel processing segments of the corresponding program. This applies to the following embodiments in the same way, so the alternatives of the following embodiments will not be repeated.

[0025] Another embodiment is to set at least one priority of the parallel processing section of the corresponding program to a minimum value when the subtasks of the program can be executed sequentially in the corresponding program. In an extreme case, the value of at least one priority of the parallel processing sections of multiple programs of the control task can be set to a minimum value. In particular, embodiments are conceivable in which the subtasks do not have to be executed in parallel, but can also be processed sequentially in the corresponding program.

[0026] In another embodiment, at least one priority of the parallel processing sections of the respective program is reset to a preset value at the start of a new program cycle. The advantage of adjusting the value of the priority of the parallel processing sections of the respective program is that this can be done temporarily. The value of at least one priority can be adjusted dynamically directly during the program runtime and does not need to be done identically for the total runtime of the program. For example, the value of the priority can be reset again to a preset value for a new program cycle and can be changed again during the program cycle and / or for the next program cycle.

[0027] Another embodiment is to increase at least one priority of the parallel processing section of the corresponding program when the subtasks were previously executed sequentially in the corresponding program at the beginning of a new program cycle. Instead of reducing the value of at least one priority of the parallel processing section of the corresponding program, the value of at least one priority can also be increased. For example, the value of at least one priority can be adjusted when a new program cycle is started. This design scheme can be thought of when the subtasks with the corresponding priority are processed purely sequentially in the corresponding program in the previous program cycle. With the help of this design scheme, it is possible to avoid that too many programs of the control task have the minimum value of at least one priority of the parallel processing section of the program at some time and execute the program purely sequentially. If the program is executed purely sequentially on the main processor core, this may cause the available computing power of the parallel processor core to no longer be fully utilized, which subsequently causes the total computing amount of the control task to be reduced.

[0028] According to the present invention, a programmable control device (SPS) is also proposed. The SPS includes a communication port for reading in sensor data and for outputting actuator data. In addition, the SPS includes a data processing mechanism and a control mechanism, the data processing mechanism includes at least one parallel processor core for executing a control task so as to generate actuator data from sensor data, and the control mechanism has a data structure memory for storing a data structure with priorities and a priority manager for managing priorities in the data structure. The control mechanism includes an intermediate structure memory on which intermediate results of calculations are stored. The control task also includes a plurality of executable programs, wherein at least two programs of the control task each have at least one parallel processing segment including a work package, and the work package includes a plurality of subtasks. Priorities with preset priorities are assigned to the parallel processing segments in the corresponding programs. The priority manager is configured such that once the program is executed on the parallel processing segment, the corresponding priority is added to the data structure in the data structure memory, and at the same time, the entry with the highest priority is set to the first position of the entry of the data structure. At least one parallel processor core is configured to check whether a data structure in a data structure memory has an entry of a priority and, if an entry exists, to process a subtask in a work package of the corresponding program whose priority is located at the first position of the entry in the data structure. The control mechanism is configured to continuously evaluate the expected computational effort of the control task during a program cycle. In addition, the priority manager is designed to dynamically adjust at least one of the priorities of the parallel processing segments of the corresponding program, thereby increasing the computational effort of the control task.

[0029] Programmable control devices usually form the basis of automation systems and currently have complex calculation and regulation functions, which require powerful hardware and efficient software to realize. Here, high computing power can be based on the simultaneous use of multiple processor cores, so as to efficiently operate the system and optimally load existing resources. The SPS designed thus can follow the deadline of the program and can also ensure real-time data processing. The method for optimizing data processing on SPS can be this efficient software for SPS, so as to optimally utilize existing processor cores, wherein the program of the control task can be distributedly executed on multiple processor cores. If the program is executed on at least one parallel processor core in parallelization, then based on the priority assigned for the corresponding parallel processing section of the program, the program is interrupted by other programs with higher priority of the parallel processing section. The interruption of the program of the control task of SPS is usually undesirable because it reduces the calculation amount of the control task. In addition, it prolongs the total execution time of the program because the interruption time of the program acts on the pure calculation time of the program with addition. Advantageously, during the program cycle, when a program with a parallel processing segment is interrupted, the value of at least one priority of the parallel processing segment of the program can be dynamically adjusted by the priority manager of the control mechanism of the SPS. Here, the control mechanism of the SPS is used to obtain and evaluate the expected computing amount of the control task. The control mechanism can also trigger the priority manager of the SPS to adjust the value of at least one priority of the parallel processing segment of the corresponding program when the computing amount is increased by the value of at least one priority of the parallel processing segment of the program that may be adjusted in this way. If necessary, the control mechanism of the SPS decides when the program cycle time is short whether the subtasks of the program should be executed purely sequentially, rather than in the parallel processing segments of the program that may be associated with the interruption subtask calculation. In other cases, the total execution time of the program can be made slower than the situation where the subtasks of the program are processed sequentially when there is no interruption by parallelization.

[0030] Furthermore, when evaluating the amount of computation, the control mechanism can simultaneously take into account the computational power of the at least one parallel processor core and cause programs to be executed in parallel that should not be executed sequentially on the corresponding main processor core to be executed by the at least one parallel processor core. The control mechanism of the SPS notifies the priority manager that it should adjust the value of at least one priority of the parallel processing section of the program, for example, increase the value of at least one priority of the parallel processing section of the program if it was previously the minimum.

[0031] Programmable control devices and methods for optimizing data processing can be flexible and versatile for different tasks of automation systems. For example, SPS can generate data important for quality assurance / control of automation systems from sensor data. If the sensor is implemented in the form of a camera, for example, the quality of the manufactured component can be evaluated by means of the camera. In this case, SPS does not generate actuator data as a result, but evaluates the component quality, for example, as defective or good. SPS can also be transformed into a transportation system by means of a method for optimizing data processing, wherein it is required that the transportation component can be manipulated and positioned on a modular guide rail by means of a module. Because the transportation component can be positioned separately, the calculation for the transportation component can be parallelized and distributed to multiple processor cores for execution. SPS and the above-mentioned method can help to efficiently utilize the computing power of the processor core, provide the high reliability of the positioning of the transportation component by means of calculation, and make it low-cost to realize it by the flexible use of SPS.

[0032] In another embodiment, the priority manager is configured to adjust at least one priority of a parallel processing section of the corresponding program when interrupting the processing of a subtask of the program. The priority manager can adjust the value of at least one priority within a program cycle directly when interrupting the processing of a subtask of the program to avoid further interruptions of the program for subtasks that are still waiting. Similarly, the priority manager can adjust the value of at least one priority of a parallel processing section of the program for the next program cycle.

[0033] In another embodiment, the priority manager is designed to adjust at least one priority of the parallel processing section of the corresponding program when the subtask is interrupted due to other subtasks of another program with higher priority on at least one parallel processor core. The priority manager can adjust the value of at least one priority of the parallel processing section of the corresponding program for the interrupted subtask on at least one parallel processor core, so as to prevent the subtask on the at least one parallel processor core from being interrupted and to achieve the lowest possible management transaction for the subtasks that are still waiting. Because each time a subtask is interrupted, the intermediate results calculated by the at least one parallel processor core must be transmitted and stored in the intermediate result memory. At each interruption, the priority manager also rearranges the entries of the priority in the data structure. At each time an interrupted subtask is continued, the at least one parallel processor core must re-access the intermediate result memory and use the stored intermediate results as the starting point for continuing to process the subtask. Thus, the subtask should be interrupted as little as possible, so as to generate a higher calculation amount of the control task and reduce the total execution time of the program and the subtask in this way.

[0034] Another embodiment is that the priority manager is designed to take into account additional conditions, in particular real-time conditions of the control task, when adjusting at least one priority of the parallel processing section of the corresponding program. The priority manager coordinates the values ​​of the priority entries in the data structure and dynamically adjusts the values ​​and simply communicates with at least one parallel processor core. In addition, the real-time performance of the automation system can be ensured by means of the priority manager, because the priority manager adjusts the value of at least one priority of the parallel processing section of the corresponding program in such a way that the deadline of the program is always observed. The priority manager adjusts the computational effort of at least one priority, thereby increasing the computational effort of the control task. The control mechanism can continuously evaluate the computational effort of the control task during a program cycle and activate the priority manager to adjust the value of at least one priority of the parallel processing section in the corresponding program based on the evaluation of the computational effort.

[0035] Another embodiment is that the priority manager is configured so that when a subtask of the program is interrupted due to other subtasks of another program with a higher priority on at least one parallel processor core, the value of at least one priority of the parallel processing section of the corresponding program is reduced by a factor. The priority manager can be designed so that the value of at least one priority of the parallel processing section of the corresponding program is reduced by a factor. For example, the value of at least one priority of the parallel processing section of the corresponding program can be reduced by half directly during the program cycle each time the subtask of the corresponding program is interrupted. Alternatively, it is also conceivable to adjust the value of at least one priority of the parallel processing section of the corresponding program by a smaller factor. In addition, the value of at least one priority of the parallel processing section of the corresponding program can be adjusted for each program cycle in different ways. For example, it is not necessary to keep the value of at least one priority of the parallel processing section of the corresponding program unchanged for each program cycle. The priority manager can adjust the value of at least one priority of the parallel processing section of the corresponding program after the evaluation calculation amount performed by the control mechanism. Because the control mechanism continuously evaluates the calculation amount during a program cycle, the priority manager can dynamically adjust the value of the priority in each program cycle and for each new program cycle.

[0036] In another embodiment, the priority manager is designed to set at least one priority of the parallel processing section of the corresponding program to the minimum value when the subtasks of the program can be executed sequentially in the corresponding program. The priority manager can set the value of at least one priority of the parallel processing section of the corresponding program to the minimum value. If the priority manager sets the value of at least one priority of the parallel processing section of the corresponding program to the minimum possible value, the corresponding subtasks are processed sequentially in the corresponding program. Because the minimum value of the priority means that the subtask can follow the deadline of the program without mandatory parallel processing, this is not that at least one parallel processor core just does not process other subtasks, but that the subtasks can also be processed sequentially by the corresponding program. This embodiment can also be thought of when the calculation of the subtask is frequently interrupted in the parallel processing section, because the priority manager can make the value of the priority of the parallel processing section of the program drop in the same manner, so that the subtasks are continued to be processed in the corresponding program after the calculation is interrupted on at least one parallel processor core. In this way, management transactions can also be reduced.

[0037] In the embodiment shown above, the value of at least one priority of the parallel processing section of the program can be set to the minimum value in a targeted manner by the priority manager, so that the subtasks of the program are processed sequentially in the corresponding program, because they do not need mandatory parallelization. However, the value of at least one priority of the parallel processing section of the program can be reduced by the priority manager during the program cycle directly after the subtasks of the parallel processing section of the program are interrupted. In any case, in this case, if the processing of the subtasks of the parallel processing section of the program is interrupted in the previous program cycle, it is advantageous to further reduce the value of at least one priority of the parallel processing section of the program for the new program cycle. However, in order not to reduce the value of at least one priority for each program cycle, it can be ensured that the value of at least one priority of the program is not unexpectedly set to the minimum value via additional conditions, such as additional conditions that can be achieved by making the value of at least one priority of the new program cycle correspond to at least half of the value of at least one priority of the preset.

[0038] Another embodiment is that the priority manager is configured to reset at least one priority of the parallel processing section of the corresponding program to a preset value when starting a new program cycle. The priority manager can, as described, dynamically match the value of at least one priority of the parallel processing section of the corresponding program to each program cycle. Therefore, in this article, the priority manager can reset the value of at least one priority of the parallel processing section of the corresponding program to the value of the preset priority for the new program cycle. The advantage of adjusting the value of at least one priority of the parallel processing section of the corresponding program by the priority manager is that it is temporarily performed and can be returned again.

[0039] In another embodiment, the priority manager is designed to increase at least one priority of the parallel processing section of the corresponding program when starting a new program cycle, if the subtasks of the program were previously executed sequentially in the corresponding program. The priority manager can also increase the value of at least one priority of the parallel processing section of the corresponding program of the control task, whereby the corresponding subtask can be processed before other subtasks of another work package and the program on at least one parallel processor core can be processed. This embodiment is conceivable when the subtasks were previously processed sequentially in the corresponding program. With the help of this embodiment, it is avoided that too many programs of the control task have the minimum value of at least one priority of the parallel processing section of the program at some time and execute the program purely sequentially. If the program is executed purely sequentially on the main processor core, this may cause the available computing power of the parallel processor core to no longer be fully utilized, which then causes the total computing amount of the control task to be reduced.

[0040] In another embodiment, the priority manager is designed to change a priority entry in a data structure in a data structure memory as a function of the adjustment of at least one priority. In addition, the priority manager is designed to inform at least one parallel processor core about the change in the priority entry in the data structure. The priority manager is responsible, on the one hand, for dynamically adjusting the value of at least one priority of a corresponding parallel processing section of a corresponding program and, on the other hand, can also inform at least one parallel processor core about the adjustment of the value of at least one priority in the data structure.

[0041] In another embodiment, the priority manager is designed to be executable in a distributed manner on a plurality of programs of a control task. The priority manager is a component of the control device and can, for example, include a plurality of modules (e.g. software modules), wherein individual modules (e.g. software modules) of the priority manager can be executed in a plurality of programs of a control task. It is also conceivable that the priority manager has only a single central module (e.g. software module) which is executed in one of the plurality of programs of a control task. It is also conceivable that the priority manager can be implemented as an independent program or as one or more external hardware modules.

[0042] The advantageous embodiments and developments of the invention described above and / or presented in the dependent claims can be used individually and in any desired combination with one another, except, for example, in the case of exclusive dependencies or non-compatible alternatives. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The characteristics, features and advantages of the present invention described above and the manner in which they are achieved are better and more clearly understood in conjunction with the following embodiments described in detail in conjunction with the schematic diagrams. It is shown in which:

[0044] Figure 1 A schematic diagram of an embodiment of the present invention of an automation system is shown, the automation system comprising a programmable control device (SPS);

[0045] Figure 2 shows the process for creating a work package with subtasks and Figure 1 A simplified diagram of management priorities within the SPS;

[0046] Figure 3 shows the Figure 1 and Figure 2 A simplified diagram of a method for optimizing data processing on an SPS; and

[0047] Figure 4 shows a method for dynamically matching Figure 3 Flowchart of the priorities of parallel processing sections of a program. DETAILED DESCRIPTION

[0048] An embodiment of a method for optimizing data processing on a programmable control system (SPS) is described according to the following figures. It should be noted that the drawings are only schematic and are not shown to scale. For a better understanding, the parts and components shown in the drawings may be shown enlarged or reduced. It is also noted that the reference numerals in the drawings are selected so as not to change when components and / or parts and / or variables of the same structure are involved.

[0049] Programmable control systems (SPS) usually form the basis of automation systems and are used to control or regulate equipment or machines. Here, the SPS or equipment or machines are controlled via sensors and actuators. Sensors and actuators can be interconnected with machines or equipment via communication ports, wherein the SPS uses the communication ports to interact with sensors and actuators. The data processing of the SPS is mostly cyclical and the deadlines are followed sequentially by the SPS, specifically by the control task requirements. In this article, for example, it is not allowed to complete the processing of input data at the time when the output data of the actuator is required. That is, the control task must be able to ensure the real-time performance of the automation system.

[0050] In most cases, the control tasks of the SPS consist of one or more programs with tasks "Task" that are executed periodically. Because a plurality of SPSs include processors and / or a plurality of processors with a plurality of processor cores that can be implemented, for example, as a main processor core and / or a parallel processor core, the SPS can distribute the program with tasks (Task) to a plurality of processor cores and / or a plurality of processors in order to reduce the total processing time of the program with tasks and reliably follow the deadlines of the programs. If the tasks of the programs of a plurality of processor cores (main processor core and parallel processor core) are processed in parallel, it is advantageous that the tasks of the programs can be classified for processing preset priorities. Thus, a preset priority is usually assigned to each program with a corresponding task. The preset priority can be obtained by the deadline and / or by the relevance of the corresponding program to another program when the program, for example, indicates the result of another program.

[0051] The priorities of the respective programs with tasks are arranged in a data structure by a priority manager. The priority manager stores the entries of the priorities in the data structure. If there are no other entries of the priorities in the data structure, the priority manager sets the priorities at the first position in the data structure. In addition, the priority manager can be configured to notify the processor cores working in parallel when the order of the priority entries in the data structure changes. For example, when new entries of the priorities are added to the data structure, the order can change, wherein the priorities can now have higher values ​​than the priorities of the entries so far. In this case, the parallel processor cores interrupt the processing of the current tasks of the respective programs and start processing the tasks corresponding to the higher priorities of the respective programs in order to meet their deadlines. The tasks of the respective programs can be stored in a plurality of work packages with subtasks.

[0052] The expected computational amount of the control task is continuously evaluated during the program cycle. According to the evaluation, it can be determined that when the computational amount of the control task is increased by matching the value of at least one priority of the parallel processing segment, at least one priority of the parallel processing segment of the corresponding program of the control task is dynamically matched. The expected computational amount of the control task is related to the number of interruptions of the parallel processing segment of the program, because the number of interruptions of the parallel processing segment of the program causes management affairs. Management affairs represent the activities required for interrupting the processing of the subtasks in the parallel processing segment in the program of the control task, such as transmitting and saving intermediate results. Therefore, the processing interruption of the parallel processing segment leads to more management affairs. For the computational amount, the interruption duration of the program is important, because no calculation is performed during the processing interruption of the subtasks of the parallel processing segment of the program, but the above-mentioned activities are performed. Therefore, the interruption duration prolongs the execution time of the program, because the interruption duration is added to the actual computing time of the program and it is usually preset. In addition, the interruption duration varies with the time of the parallel processing segment when the program is interrupted. Therefore, the goal is to keep the management affairs as low as possible and dynamically adjust the value of at least one priority so as to reduce the frequency of the program calculation interruption and thus increase the computational amount.

[0053] Furthermore, the expected computational effort of the control task is related to the computing power used by the at least one parallel processor core. If the program is executed purely sequentially on the corresponding main processor core, for example, the program is assigned a minimum value of at least one priority of the parallel processing section of the program, it can happen that at least one parallel processor core performs no active computation or is only limitedly active. This reduces the computational effort of the control task, since the computing power of the at least one parallel processor core is not or not fully utilized. In this case, the value of at least one priority of the parallel processing section of the program can be adjusted, for example, increased, so that the program is executed in parallel on the at least one parallel processor core and the computing power of the available processor cores is optimally utilized.

[0054] In addition, the calculation time of the parallel processing section of the program is also taken into account when evaluating the expected calculation amount of the control task. Because the subtasks including the shorter program cycle time may be executed purely sequentially faster than the corresponding parallel processing section in the program without parallelization. The parallel processing section of the corresponding program can be interrupted for another parallel processing section of another program with a higher corresponding priority. Because the interruption of the parallel processing section can be triggered arbitrarily frequently by other programs with parallel processing sections, it may occur that the total execution time of the program interrupted by other parallel processing sections of other programs is longer than the case without parallelization. In this case, it is conceivable to execute the program with subtasks purely sequentially, so as to achieve a shorter execution time of the corresponding program and improve the calculation amount in this way.

[0055] The core of the present invention is that the value of at least one priority of the parallel processing section of the corresponding program of the control task can be adjusted dynamically. Because by dynamically adjusting the value of at least one priority of the parallel processing section of the corresponding program, it can be flexibly determined whether the subtasks of the corresponding program should be processed sequentially on the corresponding main processor core or additionally on at least one parallel processor core in the corresponding parallel processing section of the program. In this way, the best utilization of resources can be provided, that is, the main processor core and the parallel processor core jointly complete the subtasks of the corresponding program. The real-time performance of the control task can be further ensured by adjusting the value of the priority of the parallel processing section of the corresponding program of the control task, wherein the value of the priority is always adjusted so that the real-time performance of the control task and the deadline of the program can be complied with.

[0056] Figure 1 A programmable control device (SPS) 100 is shown for controlling a machine or system 200. The SPS 100 has a communication port 130 and a data processing device 110. The SPS 100 can control corresponding actuators 210 and sensors 220 of a machine or system 200 of an automation system via the communication port 130, which is implemented, for example, in the form of a fieldbus system constructed based on hardware and / or software, wherein the actuators 210 and sensors 220 can be interconnected with each other by means of the fieldbus system.

[0057] In order to provide the desired operating mode of the machine or device 200, the control task of the SPS 100 determines which output data generated by the SPS 100 according to the corresponding input data are fed to the actuator 210. The SPS 100 obtains information about the state of the machine or device 200, wherein the SPS reads the measurement data of the sensor 220 connected to the input end of the SPS 100 and / or the actual data of the actuator 210. The sensor 220 can generate an electrical signal for detecting the measured variable or the measured variable itself is performed in an analog or digital manner. The actuator 210 is connected to the output end of the SPS 100 and converts the electrical signal of the output data of the SPS 100 into a mechanical movement or other physical variable (such as temperature, pressure, etc.).

[0058] The dynamic control of the actuator 210 is primarily based on reading the current actual data of the actuator 210. Based on the actual data of the actuator 210 and the measured data of the sensor 220, output data for the actuator 210 can be generated from the input data. Alternatively, the actuator 210 can be controlled based on a specification, for example according to a motion profile.

[0059] The data processing mechanism 110 may include multiple processor cores, wherein Figure 11 and 11. The first main processor core 111 and the second main processor core 112 as well as the first parallel processor core 113 and the second parallel processor core 114 are shown by way of example. It is also conceivable that the data processing mechanism 110 has a different number of main processor cores and / or parallel processor cores. The design advantage of the data processing mechanism 110 having the first main processor core 111 and the second main processor core 112 as well as the first parallel processor core 113 and the second parallel processor core 114 is that the subtasks to be processed of the corresponding program of the control task of the SPS 100 can be distributed to the two main processor cores 111, 112 and the two parallel processor cores 113, 114 according to the following description. This can reduce the computing time and additionally ensure the optimal use of resources.

[0060] At least two of the multiple executable programs of the control task have parallel processing sections, and the multiple executable programs of the control task can be executed on the first and second main processor cores 111, 112, wherein the first parallel processor core 113 and the second parallel processor core 114 can play an auxiliary role in processing the subtasks in the corresponding parallel sections of the program of the control task as described above. The control task can be composed of a program cycle executed in the SPS 100, wherein the program cycle includes receiving input data (measurement data of the sensor 220 and current actual data of the actuator 210), processing the input data into output data for the actuator 210, and outputting the output data for the actuator 210. After the processing is completed, that is, after the program cycle is ended, the program cycle of the control task is restarted.

[0061] Unlike the program cycle of the control task according to the present invention, the fieldbus cycle includes, in addition to the above-mentioned program cycle steps, the transmission of input data of the sensor 220 or the actuator 210 via the fieldbus to the SPS 100. The output data generated in the SPS 100 during the program cycle is also transmitted to the actuator 210 via the fieldbus during the fieldbus cycle, so that the actuator 210 can process according to the received output data.

[0062] Subtasks in a program that need to be parallelized and processed by multiple processor cores can be respectively assigned to at least one parallel processing segment in the program of the first main processor core 111 or in the program of the second main processor core 112. Priorities having a preset first priority and a preset second priority can be assigned to the parallel processing segments in the respective programs of the first main processor core 111 and the second main processor core 112, wherein the first priority and the second priority are arranged by the priority manager 350 of the control mechanism 120. The priority manager 350 is first used to manage the first and second priorities in the data structure and to adjust the values ​​of the corresponding priorities of the corresponding parallel processing segments of the program. The data structure can also have methods that can be called by the program on the two main processor cores 111, 112 and the two parallel processor cores 113, 114. When the first main processor core 111, for example, involves a parallel processing segment in the program, it calls the "add my subtask" method from the data structure of the priority manager 350. In the method, the subtasks can then be sorted into a data structure and the priority manager 350 can be designed to inform the first and second parallel processor cores 113, 114 about new, higher entries or a change in the order of priority entries in the data structure if a subtask of the method is associated with a higher priority, wherein the method is executed on the first main processor core 111. The two parallel processor cores then interrupt their processing of the current subtask, sort the intermediate results and then call the "save my intermediate results" method from the data structure of the priority manager 350. In the method, the priority of the corresponding subtask in the data structure can also be adjusted if necessary. This means that the method is executed on the first and second parallel processor cores 113, 114, respectively.

[0063] It is usually not necessary for the priority manager 350 to inform the first and second main processor cores 111, 112 or the programs that need to be executed on the two main processor cores 111, 112 about the change in the value of at least one priority level. Because the first and second main processor cores 111, 112 always process the subtasks belonging to them, even if these subtasks are not at the top of the priority entry associated with the subtask in the data structure. This means that the two main processor cores 111, 112 process the subtasks belonging to them independently of the assistance of the two parallel processor cores 113, 114. The purely sequential processing of subtasks on the first and second main processor cores 111, 112 reflects the difference between the first and second parallel processor cores 113, 114. Since the first and second parallel processor cores 113, 114 call the "give me a new subtask" method from the data structure of the priority manager 350 and there are only subtasks associated with the minimum value of the priority of the parallel processing section of the program, a purely sequential processing is set on the first and second main processor cores 111, 112, whereby the two parallel processor cores 113, 114 receive the "no subtask available" response. For simplicity, the description of the individual methods of the data structure of the priority manager 350 is omitted below. Therefore, the above-mentioned methods and other methods for implementing the data structure of the method according to the present invention can be applied to the following figures.

[0064] The priority manager 350 may be distributed and executed on multiple programs in the form of multiple modules (e.g., software modules). It is also conceivable that the priority manager 350 is implemented as an independent module in the program (e.g., as a software module), and the first parallel processor core 113 and the second parallel processor core 114 can access the program to assist the first main processor core 111 and the second main processor core 112 in processing subtasks. In addition, it is conceivable that the priority manager 350 is implemented as an independent program or one or more external hardware modules.

[0065] A first work package and a second work package are also created in the parallel processing section in the program of the first main processor core 111 and the second main processor core 112. The first work package includes a first number of subtasks and the second work package includes a second number of subtasks. The first number of subtasks and the second number of subtasks can be processed by the first main processor core 111 and the second main processor core 112 or the first parallel processor core 113 and the second parallel processor core 114 according to the first and second priorities of the corresponding parallel processing section.

[0066] It is possible that a program includes multiple sequential processing sections and multiple parallel processing sections, wherein the sequential processing sections of the program are different from the parallel processing sections and cannot be divided into work packages with subtasks and must be routed through the priority manager. Because the sequential processing sections of the program that do not need to be parallelized can be executed on the corresponding main processor cores 111, 112 without the assistance of the first and second parallel processor cores 113, 114. The sequential and parallel processing sections of a program can appear alternately. In addition, the program can only be executed sequentially. The sequential processing section or the program that needs to be executed sequentially can have a sequential priority, which is applicable to the entire program of the sequential processing section or the control task. In addition, the sequential priority is independent of whether the program of the control task has a parallel processing section. These tasks can be processed purely sequentially in the sequential processing sections of the program or in the program that needs to be executed sequentially of the corresponding main processor cores 111, 112.

[0067] It is conceivable in this context that multiple programs of a control task can be executed on a single main processor core 111, 112, wherein the priority of the sequence is important. The priority of the sequence of programs can be different from the priority of the parallel processing segments equipped for the respective programs. For example, it is possible to execute subtasks of a work package of a parallel processing segment of the respective program on the parallel processor cores 113, 114 and at the same time sequentially process tasks that do not require parallelization by a main processor core 111, 112. If the sequential processing of tasks is interrupted on the main processor cores 111, 112 by a higher priority program (with tasks that are not parallelized) that needs to be executed sequentially or a sequential processing segment of a program (with tasks that are not parallelized), the parallel processing of the subtasks of the respective work package can be performed on the first and second parallel processor cores 113, 114 essentially without interruption, because the parallel processing segments in the respective programs can be assigned a priority level that is separate from the priority level of the sequence.

[0068] Therefore, not only in the case of parallel processing of subtasks on parallel processor cores 113, 114, but also in the case of sequential processing of tasks without parallelization on one main processor core 111, 112, the current subtask can be interrupted by another subtask of higher priority. In the embodiment with a single main processor core 111, 112, the value of the priority of the parallel processing section of the corresponding program of the control task can be adjusted by the priority manager 350 during a program cycle or for a new program cycle.

[0069] Figure 2 shows the process for creating a work package with subtasks and Figure 1A simplified diagram 600 for managing priorities within an SPS of a processor core 110 is shown. Multiple executable programs of a control task of the SPS can be executed, for example, on the first and second main processor cores 111, 112, wherein at least two programs in the control task each have at least one parallel processing segment. The arrow with reference numeral 500 indicates that a first work package 305 is created at the beginning of a parallel processing segment of the first main processor core 111. The first work package 305 includes a first number of subtasks 320, which in the example shown consists of a first subtask 321, a second subtask 322, a third subtask 323, and a fourth subtask 324. The first work package 305 also includes a reference to a first priority 340 of the parallel processing segment of the first main processor core 111. The arrow with reference numeral 505 shows that the reference to the first priority 340 of the parallel processing segment of the first main processor core 111 is transmitted to the priority manager 350. The priority manager 350 adds the first priority 340 to the data structure 355 and stores the data structure 355 in the data structure memory of the control mechanism, which is not shown in the figure. If the data structure 355 has no entry, the priority manager 350 adds a reference to the first priority 340 to the first position of the priority entry of the data structure 355.

[0070] The arrows with reference numerals 510 and 515 show that the first and second parallel processor cores 113 and 114 query the priority manager 350 which priority entry is at the first entry position in the data structure 355. For example, the first entry of the priority in the data structure 355 may be a reference to the first priority 340 of the first main processor core 111. Since the first priority 340 relates to the parallel processing segment of the first main processor core 111, the first parallel processor core 113 and the second parallel processor core 114 access the first work package 305 corresponding thereto. The access of the first and second parallel processor cores 113 and 114 to the first work package 305 is shown by the arrows with reference numerals 520 and 525.

[0071] The first parallel processor core 113 can, for example, query the first work package 305 whether there are free first to fourth subtasks 321-324 that have not yet been assigned. The query of the first parallel processor core 113 is shown by means of an arrow with reference numeral 520. For example, this can be the first subtask 321, which is assigned to the first parallel processor core 113 for processing. The first subtask 321 is not yet available for allocation, so that multiple allocations of the same subtask can be avoided. In this way, the second parallel processor core 114 can be assigned, for example, the second subtask 322. The parallel execution of the first and second subtasks 321, 322 of the first and second parallel processor cores 113, 114 is shown by means of reference numeral 360 and a box around the first and second parallel processor cores 113, 114. The first main processor core 111 can also process subtasks sequentially in the program during the parallel processing segment, so it also queries the first work package 305 for free first to fourth subtasks 321-324 for processing. The query of the first main processor core 111 is indicated by the arrow with reference 530. For example, the third subtask 323 may be assigned to it.

[0072] Once the first main processor core 111 or one of the two parallel processor cores 113, 114 has completely processed its first to third subtasks 321-323, the remaining fourth subtask 324 can be assigned as described above. One embodiment is for the distribution of the first to fourth subtasks 321-324 on the first main processor core 111 and the first and second parallel processor cores 113, 114. It is also conceivable to distribute the first to fourth subtasks 321-324 to the first main processor core 111 and the first and second parallel processor cores 113, 114 in other ways.

[0073] If the second main processor core 112 reaches the parallel processing section in its program, it creates a second work package 310 with a second number of subtasks 330, which in the embodiment consists of a fifth subtask 331, a sixth subtask 332 and a seventh subtask 333. The creation of the second work package 310 of the second main processor core 112 is indicated by means of an arrow with reference numeral 535. The second work package 310 also includes a reference to the second priority 345 of the parallel processing section in the program of the second main processor core 112. The second main processor core 112 also transmits the reference to the second priority 345 to the priority manager 350. The transmission of the reference to the second priority is indicated by an arrow with reference numeral 540. The priority manager 350 assigns the reference to the second priority 345 to the second position of the priority entry in the data structure 355 or to the first position of the priority entry in the data structure 355 according to its value. If another entry previously existed at the first position of the priority entry in the data structure 355, the second position of the priority entry in the data structure 355 is set by the priority manager 350 for the case where the first priority 340 is lower than the second priority 345 of the new entry and the entry of the data structure 355 is stored in the data structure memory.

[0074] If the order of the priority entries in the data structure 355 changes, the priority manager 350 notifies the first and second parallel processor cores 113, 114. This process is accompanied by the interruption of the first, second and possibly fourth subtasks 321, 322, 324, which are currently processed by the first parallel processor core 113 and / or the second parallel processor core 114 and consist of the first number of subtasks 320. The intermediate results of the calculation can be transmitted to Figure 1 The control mechanism 120 shown in FIG. 1 and stored in an intermediate result memory not shown. If the interrupted first, second and possibly fourth subtask 321, 322, 324 should continue to be processed on the parallel processor cores 113, 114, the first and second main processor cores 111, 112 and the first and second parallel processor cores 113, 114 can access the intermediate result memory.

[0075] While the first main processor core 111 continues to sequentially process the third subtask 323 consisting of the first number of subtasks 320 of the first work package 305, the first parallel processor core 113 and the second parallel processor core 114 and the second main processor core 112 query the second work package 310 for the fifth to seventh subtasks 331-333 consisting of the second number of subtasks 330. The query of the respective processor cores is indicated by means of three arrows with reference numerals 545, 550, 555. For example, the fifth subtask 331 can be assigned to the first parallel processor core 113 and the seventh subtask 333 can be assigned to the parallel processor core 114. The seventh subtask 332 can be sequentially processed by the second main processor core 112 during this period. In order to distribute the fifth to seventh subtasks 331-333 to the first and second parallel processor cores 113, 114 and the second main processor core 112, it is also conceivable to distribute the fifth to seventh subtasks 331-333 differently from the example shown.

[0076] The two parallel processor cores 113, 114 do not have to wait until the fifth to seventh subtasks 331-333 of the second work packet 310 of the higher priority of the parallel processing section of the program of the second main processor core 112 have been processed. If the first parallel processor core 113 has, for example, completely processed its fifth subtask 331, while the second parallel processor core 114 is still processing the seventh subtask 333 of the second work packet 310 and the second main processor core 112 is processing the sixth subtask 332, the first parallel processor core 113 can thus have started processing one of the previously interrupted first to fourth subtasks 321-324 of the first work packet 305, which is associated with a lower priority. If the first parallel processor core 113 queries the second work packet 310 for free subtasks after processing its fifth subtask 331, but there are no free subtasks at the first position of the second work packet, this is possible, wherein the two work packets 305, 310 can also be part of the data structure 355. At this time, the first parallel processor core 113 can start processing one of the first to fourth subtasks 321-324 in the first work package 305, thereby making optimal use of the computing performance of the first parallel processor core 113. This means that unnecessary waiting time for starting to process the first to seventh subtasks 321-324, 331-333 of the two parallel processor cores 113, 114 can be avoided.

[0077] When the first and second subtasks 321, 322 of the first work packet 305 are reprocessed by the first and second parallel processor cores 113, 114, the first and second subtasks 321, 322 in the first work packet 305 can be distributed to the first and second parallel processor cores 113, 114, for example, similar to the embodiment, that is, the first parallel processor core 113 obtains the first subtask 321 of the first work packet 305 and the second parallel processor core 114 is allocated the second subtask 322. The two parallel processor cores 113, 114 access the intermediate result memory and can use the intermediate results of the first and second subtasks 321, 322 for further processing of the subtasks.

[0078] If the fifth, sixth and seventh subtasks 331 , 332 , 333 of the processor core consisting of the second number of subtasks 330 are completely completed, the corresponding second work package 310 notifies this to the priority manager 350 , whereupon the priority manager 350 removes the corresponding reference to the second priority 345 from the priority entry in the data structure 355 .

[0079] Because the first main processor core 111 continues to process the third subtask 323 of the first work package 305, while the first parallel processor core 113 processes the fifth subtask 331 in the second work package 310 and the second parallel processor core 114 processes the seventh subtask 333, the first main processor core 111 can also completely finish processing the third subtask 323 during the time when the parallel processor cores 113, 114 completely process the fifth and seventh subtasks 331, 333 assigned to them. Then, the first main processor core 111 can query the first work package 305 for the remaining third subtask 324 and process it, while the parallel processor cores 113, 114 reprocess the first and second subtasks 321, 322. The query of the first main processor core 111 to the first work package 305 is indicated by the arrow with reference number 530.

[0080] If the first, second and fourth subtasks 321, 322, 324 have been completely processed by the first and second parallel processor cores 113, 114 and the first main processor core 111, and the third subtask 323 has been completed by the first main processor core 111, the corresponding first work package 305 reports the completion of the first to fourth subtasks 321-324 to the priority manager 350, whereupon the priority manager removes the reference to the first priority 340 from the priority entry in the data structure 355. It is also conceivable that the priority manager 350 itself queries the first and second work packages 305, 310 whether the first to seventh subtasks 321-324, 331-333 consisting of the first and second number of subtasks 320, 330 have been completed, and then removes the corresponding references to the first and second priority levels 340, 345 from the data structure 355 in the data structure memory, if necessary.

[0081] Once the first and second main processor cores 111, 112 require additional first to seventh subtasks 321-324, 331-333 from their respective work packages 305, 310 in the parallel processing section, but no unprocessed first to seventh subtasks 321-324, 331-333 are available, the first and second main processor cores 111, 112 wait until the parallel processor cores 113, 114 finish processing the currently executed first to seventh subtasks 321-324, 331-333. Then the first and second main processor cores 111, 112 leave the respective parallel processing section and delete the first and second work packages 305, 310. The first and second main processor cores 111, 112 can then perform any other (non-parallelized) calculations, for example based on the results of the previous parallel processing section.

[0082] By distributing the individual first to seventh subtasks 321-324, 331-333 to the first and second main processor cores 111, 112 and the first and second parallel processor cores 113, 114, the total processing time of the first to seventh subtasks 321-324, 331-333 can be reduced and the computing capacity can be optimally utilized. In addition, the program deadlines are met and the real-time performance of the control task is ensured, taking into account the first and second priorities 340, 345 of the corresponding parallel processing sections of the program of the first and second main processor cores 111, 112. Because with the first and second priorities 340, 345, the processing of the first to fourth subtasks 321-324 consisting of the first number of subtasks 320 is interrupted for the other fifth to seventh subtasks 331-333 consisting of the second number of subtasks 330 when the other fifth to seventh subtasks 331-333 consisting of the second number of subtasks 330 are assigned the higher second priority 345. It is also conceivable that the processing of the fifth to seventh subtasks 331-333 consisting of the second number of subtasks and having the second priority 345 is interrupted because the first to fourth subtasks 321-324 of the first number of subtasks 320 have a higher priority and the first priority. The interrupted first to seventh subtasks 321-324, 331-333 consisting of the first and second number of subtasks 320, 330 can continue to be processed. Because the reference to the first and second priority entries 340, 345 is retained in the data structure 355 in the data structure memory, as long as the corresponding first to seventh subtasks 321-324, 331-333 consisting of the first and second number of subtasks 320, 330 of the first and second work packages 305, 310 have not been completely processed.

[0083] In one embodiment, the first and second work packages 305, 310 with the first and second number of subtasks 320, 330 and the references to the first and second priorities 340, 345 are created at the start of the execution of the corresponding program by the first and second main processor cores 111, 112. It is also conceivable that at the start of another parallel processing segment, a new work package is created in the program of the first main processor core 111 and / or the second main processor core 112, respectively.

[0084] However, when the processing of the first to seventh subtasks 321-324, 331-333 is interrupted in the parallel processing section of the corresponding program, it is usually not possible to determine which data is important for continuing the subtasks in the corresponding program after the interruption, because the first to seventh subtasks 321-324, 331-333 can be interrupted at any position in the corresponding program during the execution time of the program. In this regard, when no corresponding interruption point is set in the first to seventh subtasks 321-324, 331-333 until the processing of the first to seventh subtasks 321-324, 331-333 is continued and then interrupted, this embodiment requires that all data created or processed when processing the first to seventh subtasks 321-324, 331-333 in the parallel processing section in the corresponding program be stored. Because, for example, by means of the preset interruption points that can be set in the control structure in the first to seventh subtasks 321-324, 331-333, it is known which data is required when continuing the interrupted first to seventh subtasks 321-324, 331-333. When the interruption points are set, it is not necessary to store all the data, but it is sufficient to store the current control structure iteration and any intermediate calculation results, and the iteration can be a closed loop.

[0085] Another embodiment is to immediately interrupt the processing of the first to seventh subtasks 321-324, 331-333 in the parallel processing section of the corresponding program on the first and second parallel processor cores 113, 114 without storing the intermediate results of the calculation. Therefore, the interrupted first to seventh subtasks 321-324, 331-333 are recalculated again. Immediately disconnecting the currently executed first to seventh subtasks 321-324, 331-333 on the two parallel processor cores 113, 114 without storing data can be used, for example, when the first or second main processor core 111, 112 has a parallel processing section with a very small program cycle time and parallelization is required so that the deadline can be met. Advantageously, this design can achieve the shortest possible waiting time, wherein the waiting time represents the time between interrupting the calculation of the current first to fourth subtasks 321-324 (fifth to seventh subtasks 331-333) on the parallel processor cores 113, 114 and starting the calculation of the new fifth to seventh subtasks 331-333 (first to fourth subtasks 321-324) on the parallel processor cores 113, 114, the new fifth to seventh subtasks being associated with a higher priority. This embodiment achieves the shortest possible waiting time, thereby discarding the intermediate results of the first to seventh subtasks 321-324, 331-333 having a low priority.

[0086] Instead of interrupting the currently executed first to fourth subtasks 321-324, it is also conceivable that the first to fourth subtasks 321-324 are processed to completion and new fifth to seventh subtasks 331-333 with a higher priority of the corresponding parallel processing segment are set in the data structure 355 of the priority manager 350, but there is no need to interrupt the processing of the current first to fourth subtasks 321-324. If the new fifth to seventh subtasks 331-333 are assigned a higher priority than the current first to fourth subtasks 321-324, the parallel processor cores 113, 114 do not have to interrupt their calculations immediately or interrupt the calculations in this way. Because once both processor cores 113, 114 have finished processing their current first to fourth subtasks 321-324 with a lower priority, they are assigned the new higher priority fifth to seventh subtasks 331-333 when searching for the next subtask via the traditional path. For example, this design solution can be used when the first to seventh subtasks 321-324, 331-333 in the first work package 305 and the second work package 310 are relatively small and can therefore be processed immediately by the processor core. The advantage of this design solution is that the first to seventh subtasks 321-324, 331-333 on the two parallel processor cores 113, 114 do not need to be interrupted or disconnected, and the calculation amount is maximized.

[0087] The embodiment of interrupting the first to seventh subtasks 321-324, 331-333 currently being processed and storing the intermediate results thereof in the intermediate result memory may correspond to a good compromise between waiting time and computing effort. The above-mentioned different interruptions, immediate disconnections or appropriate additions to the first to seventh subtasks may be combined with each other and implemented appropriately according to the situation.

[0088] In one embodiment, the priority manager 350 can actively inform the first and second parallel processor cores 113, 114 about the change of the first entry of the first or second priority 340, 345 in the data structure 355. As a result, the first and second parallel processor cores 113, 114 can directly query the corresponding first or second work package 305, 310 for free first to seventh subtasks 321-324, 331-333 and start processing them in advance. The query of the corresponding parallel processor cores 113, 114 is indicated by reference numerals 520, 525, 545, 550. The priority manager 350 can also be designed so that the first and second parallel processor cores 113, 114 themselves actively query the priority manager 350 whether the order of the entries of the first and second priority 340, 345 has changed. The query of the first and second parallel processor cores 113, 114 is indicated by two arrows with reference numerals 510, 515.

[0089] It is also conceivable that the query of the first and second main processor cores 111, 112 and the first and second parallel processor cores 113, 114 to the first or second work package 305, 310 is controlled by a central mechanism. The query of the corresponding processor cores is indicated by means of arrows with reference numerals 520, 525, 530, 545, 550, 555. The central mechanism can also control the task distribution of the first to seventh subtasks 321-324, 331-333 consisting of the first and second number of subtasks 320, 330 of the first and second work packages 305, 310. In addition, the central mechanism is used to transmit a message that all the first to seventh subtasks 321-324, 331-333 consisting of the first and second number of subtasks 320, 330 of the first and second work packages 305, 310 have been completed to the priority manager 350.

[0090] If the first and second priorities 340, 345 of the corresponding parallel processing segments in the programs of the first and second main processor cores 111, 112 have the same value, the first and second main processor cores 111, 112 may inform the first and second parallel processor cores 113, 114 to execute 360 ​​the first to seventh subtasks 321-324, 331-333 in parallel.

[0091] The description so far relates to the fact that the value of at least one priority of the corresponding parallel processing section of the program does not change during the program cycle, thus simplifying the description of the creation of work packages and access to work packages and the management of the priorities of the parallel processing sections of the program. The value of at least one priority of the corresponding parallel processing section of the program of the control task can be changed by the priority manager for the task in the program cycle. Figure 1 and Figure 2 The embodiment shown is adjusted as described in the following figure in the case of parallel processing sections of the interrupt program. In order to increase the computing power of the control task, in the evaluation Figure 1 and Figure 2 When evaluating the computational load of the control task (and the following figures), the computational time of the corresponding parallel processing sections of the program of the control task can also be taken into account at the same time, and the subtasks of the corresponding program that do not have to be run in parallel are processed purely sequentially on the corresponding main processor cores. It is also advantageous if the computing power of the two parallel main processor cores is taken into account at the same time when evaluating the computational load of the control task and if their computing power is not fully utilized, parallel processing subtasks are assigned to them. For this purpose, it may be necessary for the priority manager to appropriately adjust the value of at least one priority of the parallel processing sections of the program.

[0092] Figure 3 shows the Figure 1 and Figure 2 A simplified diagram of a method 300 for processing data on an SPS. Figure 1 and Figure 2 , the first and second main processor cores 111, 112 and the first and second parallel processor cores 113, 114 are used as starting points. However, a different number of main and parallel processor cores is also conceivable. However, for the parallel implementation 375, 380, 385, 390 of the subtasks of the corresponding parallel processing sections 303, 304 of the program of the control task, at least one parallel processor core is required. Figures 1 to 3 For different numbers of main processor cores shown in , the number of work packages and the number of subtasks can be different. Figure 3 In the illustrated embodiment, the first main processor core 111 first reaches its parallel processing section 303 in the program. The parallel processing section is indicated by means of the uppermost horizontal stripe and the curly bracket with the reference numeral 303. When starting its parallel processing section 303, the first main processor core 111 creates a first work package with the first to fourth subtasks and a reference to the first priority of the assigned parallel processing section 303, as described above. A detailed description of the assignment of the corresponding subtasks is omitted here because it is similar to that in Figure 2 Proceed in the same manner as described in.

[0093] The first to fourth subtasks can be executed sequentially on the first main processor core 111 in the parallel processing section 303 of the corresponding program, which is indicated by reference numeral 365. In the parallel processing section 303 of the first main processor core 111, the first to fourth subtasks are also executed in parallel by the first and second parallel processor cores 113, 114 in addition to the sequential execution 365. The parallel execution of the first to fourth subtasks is indicated by the two lower striped bars with reference numerals 375 and 380. Initially, only the first to fourth subtasks of the first work package of the parallel processing section 303 of the first main processor core 111 are available and can therefore be processed by the first and second parallel processor cores 113, 114 without contention and without previous interruption.

[0094] However, if the second main processor core 112 reaches its parallel processing section 304 during the program, the first to fourth subtasks previously actively processed on the first and second parallel processor cores 113, 114 are interrupted. The interruption of the processing of the first to fourth subtasks of the parallel processing section 303 of the program executed on the first main processor core 111 is indicated by reference numeral 366. The interruption of the processing of the first to fourth subtasks of the parallel processing section 303 of the corresponding program can be based on the combination of Figure 2The management transaction is performed according to the scheme described above. If necessary, the intermediate calculation results obtained can be transferred to the intermediate result memory and stored there. The management transaction makes it impossible for the first and second parallel processor cores 113 and 114 to immediately start processing the subtasks of the parallel processing segment 304 of the corresponding program executed on the second main processor core 112 after the time point when the processing of the first to fourth subtasks of the parallel processing segment 303 of the program executed on the first main processor core 111 is interrupted. Based on the management transaction, the processing of the subtasks of the parallel processing segment 304 of the program executed on the second main processor core 112 can be delayed by a corresponding time.

[0095] The second main processor core 112 creates a second work package 310 having the fifth to seventh subtasks and a reference to the priority of the assigned parallel processing segment 304 at the beginning of its parallel processing segment 304 in the corresponding program. The fifth to seventh subtasks can be executed sequentially in the parallel processing segment 304 of the corresponding program on the second main processor core 112, which is indicated by reference numeral 370. In addition to the sequential execution 370 of the fifth to seventh subtasks in the parallel processing segment 304 of the second main processor core 112, they can also be executed in parallel by the first and second parallel processor cores 113, 114. The parallel execution of the fifth to seventh subtasks is indicated by the two lower dotted bars with reference numerals 385, 390. Figure 3 It is assumed that the value of the second priority of the parallel processing section 304 of the corresponding program executed on the second main processor core 112 is higher than the value of the first priority of the corresponding parallel processing section 303 of another program executed on the first main processor core 111. This assumption causes the processing of the first to fourth subtasks of the parallel processing section 303 of the corresponding program on the first and second parallel processor cores 113, 114 to be interrupted.

[0096] If the Figure 3If the embodiment in is extended to the main and parallel processor cores, it can be seen that the number of interruptions when processing the corresponding subtasks of the corresponding parallel processing segment of the program on the parallel processor core will increase. If the subtasks of the corresponding parallel processing segments 303, 304 of the program require non-mandatory parallel execution 375, 380, 385, 390 on the first and second parallel processor cores 113, 114, the priority values ​​assigned to the corresponding parallel processing segments 303, 304 are dynamically adjusted during the program cycle. In a specific example, the value of the second priority can be reduced by a factor or immediately set to the minimum value through the priority manager, so that the fifth to seventh subtasks of the parallel processing segment 304 of the corresponding program can be directly processed by the second main processor core 112 without interrupting the processing of the first to fourth subtasks 321-324 on the two parallel processor cores 113, 114. The advantage of reducing the priority value of the parallel processing section 304 of the program executed on the second main processor core 112 is that interruption of the processing of the first to fourth subtasks of the parallel processing section 303 of the corresponding program executed on the first main processor core 111 can be avoided. Thus, the management tasks can be minimized, wherein the priority value of the parallel processing section of the program is dynamically adjusted by the priority manager, thereby increasing the computing power of the control task. The increase in the computing power of the control task can particularly advantageously affect programs with high priority values ​​of the parallel processing sections 303, 304 of the program and, for example, can achieve shorter deadlines. In this way, the operating speed of a machine or device of the automation system can be increased.

[0097] Furthermore, the real-time performance of the automation system can be ensured by means of the priority manager, since the priority manager adjusts the value of the priority of the respective parallel processing section 303 of the respective program in such a way that the deadlines of the program are always adhered to.

[0098] The value of at least one priority level can be reduced as desired. For example, the priority level remains unchanged when the corresponding parallel processing segment 303, 304 of the program is interrupted for the first time by the priority manager. After the corresponding parallel processing segment 303, 304 of the program is interrupted for the second time (not shown), the priority manager can reduce the value of the priority level of the corresponding parallel processing segment 303, 304 by a factor. Here, for example, the greater the value of the priority level of the corresponding parallel processing segment 303, 304 of the program is reduced, the more frequently the corresponding parallel processing segments 303, 304 with the contained subtasks of the program are interrupted.

[0099] The priority manager can adjust the value of the priority of the parallel processing segments 303, 304 when these subtasks are interrupted by other subtasks of another program with a higher priority on the two parallel processor cores 113, 114. The priority manager can adjust the value of the priority of the parallel processing segments 303, 304 of the corresponding program for the interrupted subtasks on the two parallel processor cores 113, 114 in order to prevent the continued interruption of the subtasks on the two parallel processor cores 113, 114 and in order to minimize the management transaction for the subtasks still waiting in the corresponding work package.

[0100] In addition, the priority manager can also adjust the value of the priority of the parallel processing section 303, 304 of the program, which is used to interrupt the processing of the subtasks of the parallel processing section of the program. Alternatively to this, the priority manager can adjust the value of the priority of the parallel processing section 303, 304 of the corresponding program when the corresponding priority is as an entry in the data structure in the data structure memory and the subtasks in the corresponding parallel processing section 303, 304 are just not actively processed by the two main and parallel processor cores 111-114. In addition, the priority manager adjusts the value of the priority of the parallel processing section 303, 304 of the corresponding program when the subtasks in the corresponding parallel processing section 303, 304 of the program are actively processed by the processor core and there are idle unprocessed subtasks in the corresponding work package. In this case, the value of the priority of the parallel processing section 303, 304 is adjusted to relate to the idle subtasks of the work package.

[0101] The advantage when adjusting the value of the priority of the parallel processing section 303,304 of the corresponding program is that it can be temporarily carried out. The dynamic adjustment of the value of at least one priority does not need to be carried out in the same way for the entire program cycle. The value of the priority can be reset to a preset value for a new program cycle and changed again for another program cycle, for example. In this program cycle, the value of at least one priority of the parallel processing section of the program can be adjusted arbitrarily frequently by the priority manager. In this article, if the subtasks in the previous program cycle are processed purely sequentially in the corresponding program, the value of at least one priority of the parallel processing section 303,304 of the corresponding program can also be improved for the next program cycle, so that the deadline of the program can be followed or the first to seventh subtasks of the corresponding parallel processing section of the program can be executed in parallel for the corresponding next program cycle. It can be ensured at the same time that the computing power of the two parallel processor cores 113,114 is optimally utilized.

[0102] It is also conceivable that a program that must be executed temporarily (for example, due to a short program cycle time and a short deadline) is set to a very high value for the priority of the parallel processing section of the program by the priority manager, and although the parallel processing section 303, 304 with the corresponding priority may be interrupted, the priority value is kept as constant as possible by the priority manager for the next program cycle. When the corresponding parallel processing section is interrupted, the value of the priority of the corresponding parallel processing section 303, 304 of the program with the corresponding first to seventh subtasks is increased, so that the corresponding parallel processing section 303, 304 of the program with the corresponding first to seventh subtasks is no longer interrupted in the next program cycle.

[0103] The values ​​of the priority of the parallel processing sections 303 and 304 of the program described in the regulation are respectively related to reducing the management affairs by interrupting the parallel processing sections 303 and 304 of the program less frequently and realizing the maximum utilization of the computing power of the processor core. When the expected computing amount of the control mechanism should be evaluated, the number of interruptions of the parallel processing sections 303 and 304 and the interruption time interval and the computing power of the processor core used can be obtained by the control mechanism of the SPS. The expected computing amount can also be obtained according to the computing time of the parallel processing sections 303 and 304 of the program of the control task. That is, when the sequential computing time is shorter than the computing time of the subtasks of the parallel processing sections 303 and 304 with the possibility of interrupting the parallel processing sections 303 and 304, the subtasks of the corresponding programs without mandatory parallel execution 375, 380, 385, 390 can be processed purely sequentially on the corresponding main processor core. For this purpose, the priority manager reduces or minimizes the value of at least one priority of the parallel processing sections 303, 304 of the program, so that the subtasks of the parallel processing sections 303, 304 are executed sequentially if necessary, if the subtasks do not necessarily need to be executed in parallel. In addition, in this case, the control task must check whether the computing power of the two parallel processor cores 113, 114 is substantially optimally utilized by sequentially processing the subtasks of the parallel processing sections 303, 304 in order to evaluate the computing effort.

[0104] Figure 4 Shown is the Figure 3 A flowchart for dynamically adjusting at least one priority level of a parallel processing segment of a program, wherein Figure 1 and Figure 2The priority manager 350 in the control task adjusts the value of at least one priority of the parallel processing segment of the corresponding program. The first step 401 is shown as starting to dynamically adjust the value of at least one priority of the parallel processing segment of the corresponding program. In the second step 402, the priority manager determines the starting values ​​of the first to k priorities of the parallel processing segment of the program for the corresponding program cycle, where k can be a positive integer actually greater than 1. The value of the priority of the corresponding parallel processing segment of the program can be an integer value.

[0105] In the next third step 403, a check is made in a branch whether the processing of the first to fourth subtasks of the first work package in the corresponding parallel processing section of the program (with the corresponding first priority) is interrupted by a subtask of the kth work package in the corresponding parallel processing section (with the corresponding kth priority), wherein the value of the kth priority is higher than the value of the first priority. If this is not the case, a jump is made back to the second step 402, i.e. the corresponding starting value of the priority of the parallel processing section of the program is determined by the priority manager. If the check of the interruption of the processing of the subtask in the third step 403 yields a positive result, then in a fourth step 404 it is also checked whether the interrupted first to fourth subtasks of the first work package of the parallel processing section of the corresponding program of the control task should be executed sequentially.

[0106] For example, in a program with a very short program cycle time, the priority manager can directly set the priority value of the parallel processing segment of the program to the minimum value when the corresponding subtask is interrupted for the first time, so that the subtasks are processed sequentially by the corresponding main processor core. If the priority manager sets the priority value to the minimum value when the subtask of the parallel processing segment of the program is interrupted for the first time, the parallel processor core is no longer fully loaded if necessary. That is, when the parallel processing segment with subtasks of higher priority is completed and other higher priority tasks of another program of the parallel processing segment that is not included for processing on the parallel processor core are completed, there is idle computing time available. This available time should be used by two parallel processor cores to process the parallel processing segment with lower priority of the subtask under normal circumstances. Only when the control unit evaluates the computing amount, the parallel processing segment with lower priority of the subtask of a work package is considered to be frequently interrupted although the priority value is reduced many times, which can trigger the priority manager so that the interrupted subtask of the parallel processing segment is set to the minimum priority.

[0107] If the first to fourth subtasks of the first work package of the parallel processing section of the program indicate parallelization in order to meet the deadline of the program, the priority manager adjusts the value of the first priority (and / or the kth priority, if necessary) of the parallel processing section of the corresponding program of the control task accordingly in the fifth step 406. The adjustment of the first and / or the kth priority value of the parallel processing section of the corresponding program by the priority manager may be a value that lowers or increases the priority, similar to Figure 3 As described in order to prevent possible continued interruption of the parallel processing section of the program having the first to fourth subtasks or to reduce their number in order to minimize the management tasks and increase the calculation amount of the control task.

[0108] If the check in the fourth step 404 is confirmed, the priority manager sets the value of the first priority of the parallel processing section of the program to the minimum value in the sixth step 405, so that the subtasks of the parallel processing section of the program can be directly and purely sequentially executed on the corresponding main processor core for the current program cycle. The branch in the fourth step 404 leads to the seventh step 407 of another branch for the above two schemes. In the branch in the seventh step 407, the priority manager checks whether the parallel processing section of the corresponding program has ended. If this is not the case, that is, the processing of the first to fourth subtasks of the parallel processing section of the program is still in progress, then jump back to the third step 403, in which it is checked whether the first to fourth subtasks of the first work package of the parallel processing section of the program are interrupted due to the subtasks of the kth work package with a higher value of the kth priority. The subsequent steps of the branch of the third step 403 are then performed as described.

[0109] If it is checked in the seventh step 407 that the parallel processing section has ended, the branch goes directly to the eighth step 408. In the eighth step 408, the priority manager checks whether the value of the first priority of the adjustment of the parallel processing section of the program should remain unchanged for the next program cycle. If the check of the priority manager in the eighth step 408 yields a positive result, the value of the first priority of the adjustment of the parallel processing section of the program remains unchanged for the next program cycle and the eighth step 408 returns to the branch of the third step 403. In the third step 403, it is checked whether the processing of the first to fourth subtasks of the first work package of the parallel processing section of the program is interrupted due to the subtasks of the kth work package of the corresponding parallel processing section with a higher kth priority. In this way, the subsequent check steps are performed as described.

[0110] If the value of the adjusted first priority of the parallel processing section of the program is not to remain unchanged for the next program cycle, the priority manager sets the value of the first priority to a preset value, i.e. returns to the starting value, in a ninth step 409. The dynamic adjustment of the value of the priority of the parallel processing section of the program is terminated in a tenth step 410. This may be the case, for example, when the processing of a subtask is deleted and the corresponding entry of the priority of the parallel processing section is removed from the data structure.

[0111] The first to tenth individual steps 401 to 410 can be checked by the priority manager and, if necessary, by the control device, since the control device continuously evaluates the expected computing effort of the control task and, if necessary, activates the priority manager to adjust the value of the priority of the parallel processing sections of the corresponding program.

[0112] The present invention is described in detail by preferred embodiments. However, it is not limited by the disclosed examples, because the skilled person can deduce other variants therefrom without departing from the protection scope of the present invention.

[0113] Reference numerals list

[0114] 100 Programmable control devices

[0115] 110 Data processing agency

[0116] 111 First main processor core

[0117] 112 Second main processor core

[0118] 113 First Parallel Processor Core

[0119] 114 Second parallel processor cores

[0120] 120 Control mechanism

[0121] 130 Communication port

[0122] 200 Machines / Equipment

[0123] 210 Actuator

[0124] 220 Sensors

[0125] 300 Methods for processing data on SPS

[0126] 303 Parallel processing segment of the first main processor core

[0127] 304 Parallel processing segment of the second main processor core

[0128] 310 Second work package

[0129] 320 The first quantity subtask

[0130] 330 The second quantity subtask

[0131] 321 First Subtask

[0132] 322 Second Subtask

[0133] 323 The Third Subtask

[0134] 324 The Fourth Subtask

[0135] 331 Fifth Subtask

[0136] 332 Sixth Subtask

[0137] 333 Seventh Subtask

[0138] 340 First priority

[0139] 345 Second priority

[0140] 350 Priority Manager

[0141] 355 Data Structures

[0142] 360 Parallel Execution

[0143] 365 Sequential execution of the first main processor core

[0144] 366 Interrupt

[0145] 370 Sequential execution of the second main processor core

[0146] 375 First parallel execution of the first parallel processor core

[0147] 380 The first parallel execution of the second parallel processor core

[0148] 385 The second parallel execution of the first parallel processor core

[0149] 390 Second parallel execution of the second parallel processor core

[0150] 400 Flowchart for Dynamic Priority Adjustment

[0151] 401 Start

[0152] 402 Starting value of the first to kth priority

[0153] 403 Is the subtask of the first work package interrupted by the subtask of the kth work package with higher priority?

[0154] 404 Can the subtasks of the first work package also be executed sequentially?

[0155] 405 Set the corresponding priority to the minimum value

[0156] 406 Lower or raise the value of the first and / or kth priority

[0157] 407 Parallel processing segment ended?

[0158] 408 Does the value of the corresponding adjusted priority remain unchanged for the next program cycle?

[0159] 409 Set the corresponding priority value to the corresponding starting value

[0160] 410 End

[0161] 500 First Arrow

[0162] 505 Second Arrow

[0163] 510 Third Arrow

[0164] 515 Fourth Arrow

[0165] 520 Fifth Arrow

[0166] 525 Sixth Arrow

[0167] 530 Seventh Arrow

[0168] 535 Eighth Arrow

[0169] 540 Ninth Arrow

[0170] 545 Tenth Arrow

[0171] 550 Eleventh Arrow

[0172] 555 Twelfth Arrow

[0173] 600 Create work packages with subtasks and manage priorities

Claims

1. A method for executing a control task of a programmable control device (100) in a program cycle, in, The programmable control device (100) comprises a data processing unit (110) having a control unit (120), a first main processor core (111), a second main processor core (112) and at least one parallel processor core. The control task includes a first executable program and a second executable program. wherein the first executable program of the control task is associated with the first main processor core (111) and is executed by the first main processor core (111) in a program cycle, wherein the second executable program of the control task is associated with the second main processor core (112) and is executed by the second main processor core (112) in the program cycle, wherein the first executable program of the control task and the second executable program of the control task each include at least one parallel processing segment (303), Each of the parallel processing segments (303) includes a plurality of subtasks. wherein each of the parallel processing segments (303) is assigned a priority having a preset priority, wherein once the program is executed on the parallel processing segment (303) in the program cycle, the corresponding priority is added to the data structure (355), wherein the at least one parallel processor core checks in the program cycle whether an entry exists in the data structure (355) and wherein if an entry exists, the subtask of the parallel processing segment having a priority at the first position of the entry in the data structure (355) is processed by the at least one parallel processor core, wherein the at least one parallel processor core interrupts the execution of a subtask of a parallel processing segment, and a parallel processing segment with a higher priority is indicated by a priority manager (350) of the control mechanism (120), wherein the expected computational effort of the control task is continuously evaluated during the program cycle, wherein in the evaluation of the computational volume of the control task, the time interruption period and the number of interruptions of the subtasks of the parallel processing section of the program are taken into account, the interruptions originating from the order of the entries of the priority of the parallel processing section (303) in the data structure, and At least one of the priorities of the parallel processing segment (303) is dynamically adjusted when the number of interruptions of the subtasks of the parallel processing segment is reduced and the computational complexity of the control task is increased.

2. The method according to claim 1, wherein: When the processing of the subtask of the program is interrupted (366), at least one priority level of the parallel processing section (303) of the corresponding program is adjusted.

3. The method according to claim 2, wherein: When the subtask of the program is interrupted due to other subtasks of another program having a higher priority of the parallel processing segment (303) on the at least one parallel processor core, the at least one priority of the parallel processing segment (303) of the corresponding program is adjusted.

4. The method according to claim 1, wherein: Additional conditions are taken into account when adjusting at least one priority level of the parallel processing sections (303) of the respective programs.

5. The method according to claim 3, wherein: When the subtask of the program is interrupted on the at least one parallel processor core by other subtasks of another program having a higher priority of the parallel processing segment (303), the at least one priority of the parallel processing segment (303) of the corresponding program is reduced by a factor.

6. The method according to claim 3, wherein: When the subtasks of the program can be sequentially executed in the corresponding program, the at least one priority of the parallel processing section (303) of the corresponding program is set to a minimum value.

7. The method according to any one of claims 1 to 6, wherein: At the beginning of a new program cycle, at least one priority level of the parallel processing section (303) of the corresponding program is reset to a preset value.

8. The method according to claim 6, wherein: When the subtasks were previously executed sequentially in the corresponding program, the at least one priority level of the parallel processing section (303) of the corresponding program is increased when a new program cycle is started.

9. A programmable control device (100) for an automatic system, comprising: a communication port (130) for reading in sensor data and for outputting actuator data, a data processing device (110), the data processing device comprising a control device (120), a first main processor core (111), a second main processor core (112), and at least one parallel processor core for executing control tasks of the automatic system, so as to generate actuator data from the sensor data, wherein the control mechanism (120) has a data structure memory for storing a data structure (355) having priorities and a priority manager (350) for managing the priorities in the data structure (355), The control mechanism (120) includes an intermediate result storage device on which the intermediate results of the calculation are stored. The control task includes a first executable program and a second executable program. wherein the first executable program of the control task is associated with the first main processor core (111) and is executed by the first main processor core (111) in a program cycle, wherein the second executable program of the control task is associated with the second main processor core (112) and is executed by the second main processor core (112) in the program cycle, wherein the first executable program of the control task and the second executable program of the control task each include at least one parallel processing segment (303), Each of the parallel processing segments (303) includes a plurality of subtasks. wherein each of the parallel processing segments (303) in the corresponding program is assigned a priority having a preset priority, wherein the priority manager (350) is configured such that, once the program is executed on the parallel processing segment (303), the corresponding priority is added to the data structure (355) in the data structure memory, by setting the entry with the highest priority to the first position of the entry of the data structure (355), wherein the at least one parallel processor core is configured to check whether the data structure (355) in the data structure memory has an entry of the priority level, and if an entry exists, process the subtask of the parallel processing segment (303) of the corresponding program whose priority level is at the first position of the entry in the data structure (355), wherein the at least one parallel processor core interrupts the execution of a subtask of a parallel processing segment, and a parallel processing segment with a higher priority is indicated by a priority manager (350) of the control mechanism (120), The control device (120) is designed to continuously evaluate the expected computational effort of the control task during a program cycle, and wherein in the evaluation of the computational volume of the control task, the time interruption period and the number of interruptions of the subtasks of the parallel processing section of the program are taken into account, the interruptions originating from the order of the entries of the priority of the parallel processing section (303) in the data structure, and The priority manager (350) dynamically adjusts at least one of the priorities of the parallel processing segment (303) when the number of interruptions of the subtasks of the parallel processing segment is reduced and the computational effort of the control task is increased.

10. The programmable control device according to claim 9, wherein: The priority manager is designed to adjust at least one priority level of the parallel processing sections (303) of the corresponding program when processing of the subtask of the program is interrupted (366).

11. The programmable control device according to claim 10, wherein: The priority manager (350) is designed to adjust the at least one priority of the parallel processing segment (303) of the corresponding program when the subtask is interrupted by the subtask of another program with a higher priority on the at least one parallel processor core.

12. The programmable control device according to claim 9, wherein: The priority manager (350) is designed to take additional conditions into account when adjusting at least one priority of the parallel processing sections (303) of the respective program.

13. The programmable control device according to claim 10, wherein: The priority manager (350) is configured to reduce the at least one priority level of the parallel processing segment (303) of the corresponding program by a factor when the subtask of the program is interrupted by another subtask of another program having a higher priority level on the at least one parallel processor core.

14. The programmable control device according to claim 10, wherein: The priority manager (350) is designed to set the at least one priority of the parallel processing section (303) of the corresponding program to a minimum value when the subtasks of the program can be sequentially executed in the corresponding program.

15. The programmable control device according to claim 9, wherein: The priority manager (350) is designed to reset at least one priority level of the parallel processing section (303) of the corresponding program to a preset value when a new program cycle is started.

16. The programmable control device according to claim 14, wherein: The priority manager (350) is designed to increase the at least one priority level of the parallel processing section (303) of the corresponding program at the beginning of a new program cycle if the subtasks of the program were previously executed sequentially in the corresponding program.

17. The programmable control device according to claim 9, wherein: The priority manager (350) is configured to change an entry of the priority in the data structure (355) in the data structure storage in accordance with an adjustment made to the at least one priority, and The priority manager (350) is configured to notify the at least one parallel processor core of a change in the entry of the priority level in the data structure (355).

18. The programmable control device according to any one of claims 9 to 17, wherein: The priority manager (350) is designed to be executable in a distributed manner across a plurality of programs of the control task.

Citation Information

Patent Citations

  • Method and system of a hierarchical task scheduler for a multi-thread system

    US20150135183A1