KR20180012600A - Apparatus for monitoring and controlling - Google Patents

Apparatus for monitoring and controlling Download PDF

Info

Publication number
KR20180012600A
KR20180012600A KR1020160095641A KR20160095641A KR20180012600A KR 20180012600 A KR20180012600 A KR 20180012600A KR 1020160095641 A KR1020160095641 A KR 1020160095641A KR 20160095641 A KR20160095641 A KR 20160095641A KR 20180012600 A KR20180012600 A KR 20180012600A
Authority
KR
South Korea
Prior art keywords
task
global variable
main
main task
cycle
Prior art date
Application number
KR1020160095641A
Other languages
Korean (ko)
Other versions
KR102492399B1 (en
Inventor
신용각
Original Assignee
엘에스산전 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 엘에스산전 주식회사 filed Critical 엘에스산전 주식회사
Priority to KR1020160095641A priority Critical patent/KR102492399B1/en
Publication of KR20180012600A publication Critical patent/KR20180012600A/en
Application granted granted Critical
Publication of KR102492399B1 publication Critical patent/KR102492399B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The present invention provides an apparatus for monitoring and controlling which comprises: a task processing unit for processing a main task first during a predetermined main task period and processing a subtask during the remaining time after processing the main task; and a global variable managing unit for providing information stored in a global variable to the task processing unit and updating the global variable according to a task process result by the task processing unit. The task processing unit processes a deferred subtask while excluding the stored information in the global variable during the remaining time of the predetermined main task period if a subtask, deferred by the main task, exists and defers the subtask being processed when the predetermined main task period finishes before completing the subtask process. Therefore, the reliability of the processing result of the subtask can be improved by referring to the information of the global variable whose concurrency is maintained when processing the subtask deferred by the main task.

Description

감시제어장치 {APPARATUS FOR MONITORING AND CONTROLLING}[0001] APPARATUS FOR MONITORING AND CONTROLLING [0002]

본 발명은 태스크 단위로 이루어진 프로그램을 실현하기 위하여 태스크들을 수행하는 감시제어장치에 관한 것이다.The present invention relates to a supervisory control apparatus for performing tasks in order to realize a program composed of task units.

감시제어장치는 다수의 대상기기를 일괄적으로 감시 및 제어함으로써, 다수의 대상기기를 포함하는 작업 공정을 자동화하기 위한 것이다. 이러한 감시제어장치로는 PLC(Programmable Logic Controller) 및 DCS(Distributed Control System)가 있다. 그리고, 감시제어장치에 의해 감시 및 제어되는 다수의 대상기기로는 세이프티 기기, 비전 시스템, 모션 기기, 입출력 기기 및 통신기기 등이 있다. The monitoring control device is for automating a work process including a plurality of target devices by collectively monitoring and controlling a plurality of target devices. Such monitoring and control devices include PLC (Programmable Logic Controller) and DCS (Distributed Control System). A plurality of target devices monitored and controlled by the monitor and control device include a safety device, a vision system, a motion device, an input / output device, and a communication device.

감시제어장치는 사용자가 지정한 프로그램에 따라 다수의 대상기기를 감시 및 제어하는데, 이때 각 프로그램은 태스크 단위로 이루어진다. 즉, 감시제어장치는 복수의 태스크를 순차적으로 수행함으로써, 프로그램을 실현한다.The supervisory control device monitors and controls a plurality of target devices according to a program designated by the user, wherein each program is performed on a task-by-task basis. That is, the supervisory control apparatus realizes a program by sequentially executing a plurality of tasks.

태스크들은 각각의 우선순위에 따라 주태스크와 부태스크로 구분될 수 있다. 예시적으로, 주태스크는 대상기기의 제어에 관한 것이고, 부태스크는 대상기기에 대한 감시에 관한 것일 수 있다.Tasks can be classified into main task and sub-task according to their priority. Illustratively, the main task relates to control of the target device and the subtask may be related to the monitoring of the target device.

감시제어장치는 태스크 수행 효율을 증가시키기 위해, 각 주태스크 주기에서 주태스크를 먼저 수행한 후, 나머지 여분기간 동안 부태스크를 수행할 수 있다. 그리고, 이번 주태스크 주기가 종료되면, 다음 주태스크 주기에 대응하는 주태스크를 수행하기 위해, 수행 완료되지 않은 상태의 부태스크를 유예한다.In order to increase the task execution efficiency, the supervisory controller can perform the main task in the main task cycle first and then perform the negative task in the remaining spare period. When the task cycle of this week ends, the task is suspended in order to perform the main task corresponding to the next main task cycle.

그리고, 감시제어장치에 의해 실현되는 프로그램에 포함된 변수 중 일부는 주태스크와 부태스크 모두 접근 가능한 글로벌변수(global variable; 전역변수)일 수 있다. 즉, 주태스크 및 부태스크 각각은 글로벌변수에 저장된 정보를 참조하여 수행될 수 있고, 주태스크 및 부태스크 각각의 수행 완료에 따른 결과값으로 글로벌변수가 업데이트된다.Some of the variables included in the program implemented by the supervisory control device may be a global variable accessible to both the main task and the subtask. That is, each of the main task and the sub-task can be performed with reference to the information stored in the global variable, and the global variable is updated with the result of the execution of each of the main and sub-tasks.

그런데, 각 주태스크는 실행 우선순위가 높으므로, 다른 태스크의 영향을 받지 않기 때문에, 주태스크의 수행을 시작할 때 참조된 글로벌변수의 정보가 수행이 완료될 때까지 그대로 유지된다. 따라서, 주태스크에 참조되는 글로벌변수의 정보는 동시성을 유지할 수 있다. However, since each main task has a high execution priority, it is not influenced by other tasks. Therefore, the information of the global variable referred to at the start of main task is maintained until the execution is completed. Therefore, the information of the global variable referenced to the main task can maintain the concurrency.

그러나, 우선순위가 상대적으로 낮은 부태스크는 하나의 부태스크 주기 내에서 분할되어 수행된다. 즉, 부태스크는 주태스크의 수행 완료 후부터 다음 주태스크의 수행 시작 시까지의 여분기간에 수행되었다가, 다음 주태스크의 수행이 시작되면 부태스크의 수행은 유예되고, 다음 주태스크의 수행이 완료되면 유예된 부태스크의 수행이 재개된다. However, a subtask with a relatively low priority is divided and executed within one subtask cycle. That is, the subtask is executed in a spare period from the completion of the main task to the start of the next main task. When the execution of the next main task is started, the subtask is suspended. When the execution of the next main task is completed Execution of the deferred sub-task is resumed.

그런데, 종래 기술에 따르면, 주태스크의 수행 완료에 따른 결과값으로 글로벌변수가 업데이트되고, 주태스크의 수행 완료 후에 개시되는 부태스크의 수행 시 글로벌변수의 정보를 다시 참조한다. 이에 따라, 유예전 부태스크에 참조된 글로벌변수의 정보와, 유예 후 수행 재개된 부태스크에 참조되는 글로벌변수의 정보가 서로 상이해진다. 그러므로, 주태스크에 의해 유예되는 부태스크는 동시성을 상실한 글로벌변수의 정보를 참조하여 수행되는 문제점이 있다. 그로 인해, 부태스크의 수행 결과가 사용자의 설계와 상이해짐으로써, 감시제어장치의 제어확정성 및 신뢰도가 저하되는 문제점이 있다.However, according to the related art, the global variable is updated to the result value according to completion of the execution of the main task, and the information of the global variable is referred to again when the sub-task is started after completion of execution of the main task. Accordingly, the information of the global variable referred to in the pre-existing secondary task and the information of the global variable referred to in the post-deferred secondary task are different from each other. Therefore, a task deferred by the main task has a problem that it is performed by referring to the information of the global variable that has lost the concurrency. As a result, the result of execution of the secondary task becomes different from the design of the user, thereby deteriorating the control determination and reliability of the supervisory control apparatus.

또한, 종래기술에 따르면, 유예된 부태스크의 수행이 종료되기 전이라도, 부태스크에서 유예 상태로 들어가기 전에 발생된 글로벌변수의 연산결과(이하, "부결과값"이라 함)가 글로벌변수에 반영된다. 즉, 부태스크가 수행 완료되지 않고 유예된 상태에서 생성되는 불완전한 결과값으로 글로벌변수가 업데이트된다. 이에 따라, 유예된 부태스크 이후에 수행되는 주태스크는 불완전한 결과값으로 업데이트된 글로벌변수의 정보를 참조한다. 그로 인해, 주태스크의 수행 결과가 사용자의 설계와 상이해짐으로써, 주태스크의 수행 결과에 대한 신뢰도가 저하되므로, 감시제어장치의 제어확정성 및 신뢰도가 저하되는 문제점이 있다.According to the related art, even if the execution of the suspended subtask is terminated, the operation result (hereinafter referred to as "subtraction result") of the global variable generated before entering the suspended state in the subtask is reflected in the global variable do. That is, the global variable is updated to an incomplete result value generated in a state where the subtask is not executed and suspended. Accordingly, the main task executed after the deferred sub-task refers to the information of the updated global variable with an incomplete result value. As a result, the performance of the main task is different from the design of the user, so that the reliability of the performance of the main task is lowered, so that the control determinism and reliability of the supervisory control apparatus are deteriorated.

본 발명은 주태스크에 의해 유예되는 부태스크를 수행 시에도, 동시성이 유지된 글로벌변수의 정보를 참조할 수 있어, 부태스크의 수행 결과에 대한 신뢰도가 향상될 수 있는 태스크 수행방법 및 이를 실시하는 감시제어장치를 제공한다.The present invention relates to a task execution method capable of referring to information of a global variable whose concurrency is maintained even when a secondary task deferred by the primary task is performed and reliability of a result of the secondary task can be improved, And provides a monitoring and control apparatus.

그리고, 본 발명은 유예된 부태스크에 의해 업데이트된 글로벌변수로 인해 주태스크의 수행 결과에 대한 신뢰도가 저하되는 것을 방지할 수 있는 태스크 수행방법 및 이를 실시하는 감시제어장치를 제공한다.Further, the present invention provides a task execution method and a monitor control apparatus that can prevent reliability of a main task from being degraded due to a global variable updated by a suspended task.

이로써, 본 발명은 감시제어장치의 제어 확정성과 신뢰도를 향상할 수 있는 태스크 수행방법 및 이를 실시하는 감시제어장치를 제공한다.Thus, the present invention provides a task execution method and a monitor control apparatus that can improve the control determination and reliability of the monitoring control apparatus.

본 발명의 목적들은 이상에서 언급한 목적으로 제한되지 않으며, 언급되지 않은 본 발명의 다른 목적 및 장점들은 하기의 설명에 의해서 이해될 수 있고, 본 발명의 실시예에 의해 보다 분명하게 이해될 것이다. 또한, 본 발명의 목적 및 장점들은 특허 청구 범위에 나타낸 수단 및 그 조합에 의해 실현될 수 있음을 쉽게 알 수 있을 것이다.The objects of the present invention are not limited to the above-mentioned objects, and other objects and advantages of the present invention which are not mentioned can be understood by the following description and more clearly understood by the embodiments of the present invention. It will also be readily apparent that the objects and advantages of the invention may be realized and attained by means of the instrumentalities and combinations particularly pointed out in the appended claims.

이와 같은 과제를 해결하기 위하여, 본 발명은 소정의 주태스크 주기에서 주태스크를 먼저 수행하고, 상기 주태스크 주기 중 상기 주태스크를 수행하고 남는 여분기간 동안 부태스크를 수행하는 태스크 수행부, 상기 태스크 수행부에 글로벌변수에 저장된 정보를 제공하고, 상기 태스크 수행부에 의한 태스크 수행 결과에 따라 상기 글로벌변수를 업데이트하는 글로벌변수 관리부를 포함하는 감시제어장치를 제공한다.In order to solve such a problem, the present invention provides a task execution unit for performing a main task in a predetermined main task cycle, and performing a subtask during an extra period of performing the main task during the main task cycle, And a global variable manager for providing the information stored in the global variable to the execution unit and updating the global variable according to a task execution result by the task execution unit.

여기서, 상기 태스크 수행부는 상기 주태스크에 의해 유예된 상태의 부태스크가 존재하는 경우, 상기 소정의 주태스크 주기의 상기 여분기간 동안 상기 글로벌변수에 저장된 정보를 배제한 상태에서 상기 유예된 부태스크를 수행하고, 상기 부태스크를 수행 완료하기 전에 상기 소정의 주태스크 주기가 종료되면 상기 수행중인 부태스크를 유예한다.Here, the task execution unit may perform the suspended sub task in a state where the information stored in the global variable is excluded during the spare period of the predetermined main task cycle, when the sub task remains in the suspended state by the main task And suspends the sub-task being executed if the predetermined main task cycle ends before completion of the sub-task execution.

그리고, 상기 태스크 수행부는 상기 소정의 주태스크 주기에서, 상기 글로벌변수에 저장된 정보에 기초하여 상기 주태스크를 수행하고, 상기 주태스크를 수행 완료하여 주결과값을 생성하며, 상기 주결과값을 상기 글로벌변수 관리부에 전달하고, 상기 글로벌변수 관리부는 상기 전달된 주결과값으로 상기 글로벌변수를 업데이트한다.The task execution unit may perform the main task on the basis of the information stored in the global variable in the predetermined main task cycle, complete the main task to generate a main result value, To the global variable management unit, and the global variable management unit updates the global variable with the delivered main result value.

상기 태스크 수행부는 상기 주태스크에 의해 유예된 상태의 부태스크가 존재하지 않는 경우, 상기 소정의 주태스크 주기의 상기 여분기간 동안 상기 글로벌변수에 저장된 정보에 기초하여 상기 부태스크의 수행을 시작한다.Wherein the task execution unit starts performing the secondary task based on the information stored in the global variable during the spare period of the predetermined main task cycle when the secondary task in the state of being suspended by the main task does not exist.

상기 태스크 수행부는 상기 소정의 주태스크 주기의 상기 여분기간 동안 상기 부태스크를 수행 완료하여 상기 글로벌변수에 대응하는 부결과값을 생성하는 경우, 상기 부결과값을 상기 글로벌변수 관리부에 전달하고, 상기 글로벌변수 관리부는 상기 전달된 부결과값으로 상기 글로벌변수를 업데이트한다.Wherein the task execution unit transmits the resultant value to the global variable management unit when the task execution unit completes the subtask during the spare period of the predetermined main task cycle and generates a resultant value corresponding to the global variable, The global variable management unit updates the global variable with the delivered negative result value.

상기 태스크 수행부는 상기 수행중인 부태스크를 유예하는 경우, 상기 부태스크에 의해 상기 글로벌변수에 대응하고 상기 글로벌변수에 저장된 정보와 상이한 유예결과값을 상기 글로벌변수 관리부에 전달하지 않는다.The task execution unit does not deliver to the global variable management unit a grace result value that corresponds to the global variable and differs from the information stored in the global variable by the secondary task when deferring the executing secondary task.

상기 태스크 수행부는 상기 글로벌변수에 대한 변경 권한을 소유하는 주태스크를 수행하는 경우, 상기 글로벌변수에 대응하고 상기 글로벌변수에 저장된 정보와 상이한 중간결과값이 생성되면, 상기 중간결과값을 상기 글로벌변수 관리부에 전달하고, 상기 글로벌변수 관리부는 상기 전달된 중간결과값으로 상기 글로벌변수를 업데이트한다.When the task execution unit executes a main task having a right to change the global variable, if the task execution unit generates an intermediate result value corresponding to the global variable and different from the information stored in the global variable, And the global variable management unit updates the global variable with the delivered intermediate result value.

전술한 바와 같은 감시제어장치는 글로벌변수에 저장된 정보를 배제한 상태에서 유예된 부태스크를 수행한다. 그러므로, 주태스크에 의해 유예되는 부태스크를 수행 시에도, 동시성이 유지된 글로벌변수의 정보를 참조할 수 있는 장점이 있다. 이로써, 부태스크의 수행 결과에 대한 신뢰도가 향상될 수 있으므로, 감시제어장치의 제어 확정성과 신뢰도가 향상될 수 있다.The supervisory control apparatus as described above performs the deferred subtask while excluding the information stored in the global variable. Therefore, there is an advantage that the information of the global variable in which the concurrency is maintained can be referred to even when executing the subtask deferred by the main task. Thereby, the reliability of the result of the subtask can be improved, so that the control accuracy and reliability of the supervisory control apparatus can be improved.

그리고, 전술한 바와 같은 감시제어장치에 따르면, 유예된 부태스크에 의해 글로벌변수에 저장된 정보와 상이한 결과값이 발생되더라도, 유예된 부태스크에 의한 결과값으로 글로벌변수를 업데이트하는 것이 배제된다. 이로써, 유예된 부태스크에 따른 불완전한 결과값으로 업데이트된 글로벌변수로 인해, 주태스크의 수행 결과에 대한 신뢰도가 저하되는 것이 방지될 수 있다. 그러므로, 감시제어장치의 제어 확정성과 신뢰도가 향상될 수 있다.According to the monitoring control apparatus as described above, even if a different result value is generated from information stored in the global variable by the deferred sub-task, updating of the global variable with the result value by the deferred sub-task is excluded. As a result, reliability of the execution result of the main task can be prevented from being lowered due to the global variable updated to the incomplete result value according to the suspended sub task. Therefore, the control determination and reliability of the monitoring control apparatus can be improved.

도 1은 본 발명의 일 실시예에 따른 감시제어장치를 나타낸 블록도이다.
도 2는 본 발명의 일 실시예에 따른 도 1에 도시한 감시제어장치의 태스크 수행부가 태스크를 수행하는 방법을 나타낸 순서도이다.
도 3은 도 2의 태스크 수행방법을 설명하기 위한 일 예시이다.
도 4는 본 발명의 다른 일 실시예에 따른 태스크 수행방법을 설명하기 위한 일 예시이다.
1 is a block diagram showing a monitoring control apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart illustrating a method of performing a task by a task performing unit of the monitor and control apparatus shown in FIG. 1 according to an embodiment of the present invention.
3 is an example for explaining a task performing method of FIG.
FIG. 4 is an illustration for explaining a task performing method according to another embodiment of the present invention.

전술한 목적, 특징 및 장점은 첨부된 도면을 참조하여 상세하게 후술되며, 이에 따라 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명의 기술적 사상을 용이하게 실시할 수 있을 것이다. 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 상세한 설명을 생략한다. 이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시예를 상세히 설명하기로 한다. 도면에서 동일한 참조부호는 동일 또는 유사한 구성요소를 가리키는 것으로 사용된다.The above and other objects, features, and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings, which are not intended to limit the scope of the present invention. In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the drawings, the same reference numerals are used to denote the same or similar elements.

이하, 본 발명의 각 실시예에 따른 태스크 수행방법에 대해 첨부한 도면을 참고로 하여 상세히 설명한다.Hereinafter, a task execution method according to each embodiment of the present invention will be described in detail with reference to the accompanying drawings.

먼저, 도 1을 참조하여 본 발명의 일 실시예에 따른 감시제어장치에 대해 설명한다. First, a monitoring control apparatus according to an embodiment of the present invention will be described with reference to FIG.

도 1은 본 발명의 일 실시예에 따른 감시제어장치를 나타낸 블록도이다.1 is a block diagram showing a monitoring control apparatus according to an embodiment of the present invention.

도 1에 도시한 바와 같이, 본 발명의 일 실시예에 따른 감시제어장치(100)는 각 주태스크주기 및 각 부태스크주기에 대응하는 태스크를 수행하는 태스크 수행부(110), 태스크 수행부(110)에 주태스크를 제공하는 주태스크 공급부(120), 태스크 수행부(110)에 부태스크를 제공하는 부태스크 공급부(121) 및 태스크 수행부(110)에 글로벌변수에 저장된 정보를 제공하고 태스크 수행부(110)에 의한 태스크 수행 결과에 따라 글로벌변수를 업데이트하는 글로벌변수 관리부(130)를 포함한다.1, the supervisory control apparatus 100 according to an embodiment of the present invention includes a task performing unit 110 for performing tasks corresponding to each main task cycle and each sub-task cycle, a task performing unit A main task supply unit 120 for providing a main task to the task execution unit 110, a task supply unit 121 for providing a subtask to the task execution unit 110 and the task execution unit 110, And a global variable manager 130 for updating a global variable according to a task execution result by the execution unit 110.

태스크 수행부(110)는 각 주태스크 주기에서, 주태스크 공급부(120)로부터 제공되는 주태스크를 먼저 수행하고, 이후 남는 여분기간 동안 부태스크 공급부(121)로부터 제공되는 부태스크를 나누어 수행한다. The task execution unit 110 performs the main task provided from the main task supply unit 120 first in each main task cycle and divides the auxiliary task provided from the auxiliary task supply unit 121 during the remaining spare period.

구체적으로, 태스크 수행부(110)는 현재 주태스크 주기가 시작되는 시점에 주태스크를 수행하고, 주태스크를 수행 완료한 후부터 각 주태스크 주기가 종료되는 시점 이전까지의 여분기간 동안 부태스크를 수행한다. 이어서, 태스크 수행부(110)는 다음 주태스크 주기가 시작되는 시점에 주태스크를 수행하기 위하여, 수행중인 부태스크를 유예한다. 그리고, 태스크 수행부(110)는 다음 주태스크 주기에 대응하는 주태스크를 수행 완료한 후부터 유예된 부태스크를 이어서 수행한다. Specifically, the task execution unit 110 executes the main task at the start of the current main task cycle, and performs the subtask during the spare period from the completion of the main task to the end of the main task cycle, do. Then, the task execution unit 110 suspends the sub-task being executed in order to perform the main task at the start of the next main task cycle. The task execution unit 110 then executes the suspended sub task from the completion of the main task corresponding to the next main task cycle.

또한, 태스크 수행부(110)는 글로벌변수 관리부(130)로부터 제공되는 글로벌변수의 정보에 기초하여 주태스크 및 부태스크 각각을 수행한다. 그리고, 태스크 수행부(110)는 주태스크 및 부태스크 각각의 수행 완료 후에 글로벌변수를 태스크 수행 결과로 업데이트할 것을 글로벌변수 관리부(130)에 요청한다. The task execution unit 110 performs the main task and the sub task based on the global variable information provided from the global variable management unit 130. [ The task execution unit 110 requests the global variable management unit 130 to update the global variable to the task execution result after completion of execution of each of the main task and the subtask.

주태스크 공급부(120)는 프로그램을 구성하는 다수의 태스크 중 우선순위가 비교적 높은 주태스크를 선별하여 태스크 수행부(110)에 공급한다.The main task supply unit 120 selects a main task having a relatively high priority among a plurality of tasks constituting the program and supplies the selected main task to the task performing unit 110. [

그리고, 부태스크 공급부(121)는 다수의 태스크 중 우선순위가 비교적 낮은 부태스크를 선별하여 태스크 수행부(110)에 공급한다.The sub-task supply unit 121 selects a sub-task having a relatively low priority among a plurality of tasks and supplies the selected sub-task to the task performing unit 110. [

예시적으로, 주태스크는 대상기기의 제어에 관한 작업일 수 있고, 부태스크는 대상기기의 상태를 감시 또는 표시하는 작업에 관한 것일 수 있다. 즉, 대상기기를 온오프하는 작업, 턴온 상태의 대상기기에 초기 구동전류를 공급하는 작업 및 대상기기의 구동전류를 가변하는 작업 등은 주태스크일 수 있다. 그리고, 대상기기가 턴온상태인지 여부를 체크하는 작업, 대상기기의 구동전류를 체크하는 작업 및 대상기기의 구동 상태를 사용자에게 표시하는 작업 등은 대상기기의 구동에 직접적인 연관성이 낮으므로, 우선순위가 비교적 낮은 부태스크로 분류될 수 있다. Illustratively, the main task may be an operation related to control of the target device, and the auxiliary task may be related to an operation of monitoring or displaying the state of the target device. That is, an operation to turn on / off the target device, an operation to supply an initial drive current to the target device in the turn-on state, a task to vary the drive current of the target device, and the like may be the main task. Since the operation of checking whether the target device is in the turned-on state, checking the drive current of the target device, and displaying the drive status of the target device to the user are low in direct relevance to driving of the target device, Can be classified as a relatively low secondary task.

글로벌변수 관리부(130)는 태스크 수행부(110)에서 태스크를 수행하기 전에 태스크 수행부(110)의 요청에 따라 글로벌변수에 저장된 정보를 제공한다. 그리고, 글로벌변수 관리부(130)는 태스크를 수행 완료한 후에 태스크 수행부(110)의 요청에 따라 태스크 수행 결과에 따른 정보로 글로벌변수를 업데이트한다.The global variable management unit 130 provides the information stored in the global variable according to a request from the task execution unit 110 before performing the task in the task execution unit 110. [ After completion of the task, the global variable management unit 130 updates the global variable with information according to the task execution result at the request of the task execution unit 110. [

구체적으로, 태스크 수행부(110)는 소정의 주태스크 주기에서 주태스크를 먼저 수행하고, 주태스크 주기 중 주태스크를 수행하고 남는 여분기간 동안 부태스크를 수행한다.Specifically, the task performing unit 110 performs a main task in a predetermined main task cycle, and performs a subtask during a spare period during which the main task is performed in the main task cycle.

즉, 태스크 수행부(110)는 소정의 주태스크 주기 중 실행기간 동안 글로벌변수에 저장된 정보에 기초하여 주태스크를 수행하고, 그로 인해 주태스크를 수행 완료하여 주결과값을 생성한다. 그리고, 태스크 수행부(110)는 주결과값을 글로벌변수 관리부(130)로 전달하고, 글로벌변수 관리부(130)는 전달된 주결과값으로 글로벌변수를 업데이트한다.That is, the task performing unit 110 performs the main task based on the information stored in the global variable during the execution period of the predetermined main task cycle, thereby completing the main task and generating the main result value. The task execution unit 110 transfers the main result value to the global variable management unit 130, and the global variable management unit 130 updates the global variable with the transferred main result value.

그리고, 태스크 수행부(110)는 소정의 주태스크 주기에서 주태스크에 의해 유예된 상태의 부태스크가 존재하는 경우, 실행기간을 제외한 나머지인 여분기간 동안 글로벌변수에 저장된 정보를 배제한 상태에서 유예된 부태스크를 수행한다. When there is a sub task in a state of being suspended by the main task in a predetermined main task cycle, the task performing unit 110 suspends the information stored in the global variable during an extra period excluding the execution period Perform the subtask.

즉, 소정의 부태스크 주기 중 첫번째에 배치된 주태스크 주기가 아닌 경우, 이전 주태스크 주기의 여분기간동안 수행되었다가 이번 주태스크 주기의 시작 시에 유예된 부태스크가 존재하므로, 태스크 수행부(110)는 여분기간 동안 유예된 부태스크를 이어서 수행한다. That is, when the main task cycle is not the first main task cycle of the predetermined sub-task cycle, there is a delayed sub-task at the start of the main task cycle of this week, 110) continues the deferred subtask for an extra period of time.

그리고, 주태스크 주기가 종료되기 전에 부태스크를 수행 완료하여 부결과값을 생성하면, 태스크 수행부(110)는 부결과값을 글로벌변수 관리부(130)로 전달하고, 글로벌변수 관리부(130)는 부결과값으로 글로벌변수를 업데이트한다.The task execution unit 110 transfers the resultant value to the global variable management unit 130, and the global variable management unit 130 stores the result of the subtraction in the global variable management unit 130, Update the global variable with the negative result value.

반면, 부태스크를 수행 완료하기 전에, 주태스크 주기가 종료되면, 태스크 수행부(110)는 수행중인 부태스크를 유예한다. 그리고, 유예된 부태스크에 의해 글로벌변수에 대응하고 글로벌변수에 저장된 정보와 상이한 유예결과값이 생성되더라도, 태스크 수행부(110)는 유예결과값을 글로벌변수 관리부(130)로 전달하지 않는다. 이에, 글로벌변수가 부태스크의 유예결과값으로 업데이트되는 것이 배제된다.On the other hand, before the completion of the subtask, when the main task cycle ends, the task performing unit 110 suspends the subtask being executed. The task execution unit 110 does not transmit the grace result value to the global variable management unit 130 even if the graceful subtask corresponds to the global variable and generates the grace result value different from the information stored in the global variable. Therefore, it is excluded that the global variable is updated with the grace result value of the subtask.

또한, 소정의 주태스크 주기에서 주태스크에 의해 유예된 상태의 부태스크가 존재하지 않는 경우, 태스크 수행부(110)는 여분기간 동안 글로벌변수에 저장된 정보에 기초하여 부태스크의 수행을 시작한다. In addition, when there is no sub-task in a state of being suspended by the main task in a predetermined main task cycle, the task performing unit 110 starts executing the sub-task based on the information stored in the global variable during the extra period.

즉, 소정의 부태스크 주기 중 첫번째에 배치된 주태스크 주기인 경우, 부태스크는 이전 주태스크 주기의 여분기간동안 수행 완료되므로, 태스크 수행부(110)는 새로운 부태스크의 수행을 시작한다. That is, when the main task period is the first main task period among the predetermined sub-task periods, the sub-task is completed during the spare period of the previous main task period, so the task performing unit 110 starts performing the new sub-task.

이러한 본 발명의 일 실시예에 따른 감시제어장치(100)는 부태스크에 반영되는 글로벌변수의 정보가 동시성을 유지할 수 있도록, 다음과 같이 태스크들을 수행한다.The supervisory control apparatus 100 according to an embodiment of the present invention performs tasks as follows so that information of a global variable reflected in a subtask can maintain concurrency.

도 2는 본 발명의 일 실시예에 따른 도 1에 도시한 감시제어장치의 태스크 수행부가 태스크를 수행하는 방법을 나타낸 순서도이고, 도 3은 도 2의 태스크 수행방법을 설명하기 위한 일 예시이다.FIG. 2 is a flowchart illustrating a method of performing a task according to an exemplary embodiment of the present invention. FIG. 3 illustrates an exemplary task execution method of FIG.

도 2는 어느 하나의 부태스크 주기에 대응하는 태스크 수행방법을 나타낸 순서도이다. 여기서, 어느 하나의 부태스크 주기는 주태스크 주기의 정수배로 설정된다. 2 is a flowchart illustrating a task execution method corresponding to any one of the task periods. Here, any one of the task periods is set to an integral multiple of the main task period.

즉, 부태스크 주기가 주태스크 주기의 n배(여기서, n은 1 이상의 자연수)인 경우, 감시제어장치(100)의 태스크 수행부(110)는 하나의 부태스크 주기 동안 n개의 주태스크와, 한 개의 부태스크를 수행한다. 이때, 부태스크 주기와 주태스크 주기 각각은 사용자의 설계에 따라 특정된다. 그리고, 주태스크 주기는 주태스크를 수행 시작한 시점부터 수행 완료한 시점까지의 실행기간보다 길게 특정된다. 즉, 주태스크 주기 중 일부는 주태스크의 수행을 위한 실행기간이고, 실행기간을 제외한 나머지는 부태스크를 분할 수행하기 위한 여분기간이다. That is, when the task cycle is n times the main task cycle (where n is a natural number equal to or greater than 1), the task execution unit 110 of the supervisory control device 100 transmits n main tasks, Perform one negative task. At this time, each of the negative task cycle and the main task cycle is specified according to the design of the user. The main task cycle is specified longer than the execution period from the start of execution of the main task to the completion of execution of the main task. That is, part of the main task cycle is an execution period for execution of the main task, and the remainder excluding the execution period is an extra period for performing the sub task.

도 2에 도시한 바와 같이, 본 발명의 일 실시예에 따른 태스크 수행방법은 부태스크 주기 및 주태스크 주기가 시작된 이후에(S11, S12), 글로벌변수에 저장된 정보에 기초하여 주태스크를 수행하고(S13), 주태스크를 수행 완료하여 글로벌변수에 대응하는 주결과값을 생성하는 단계(S20), 글로벌변수를 주결과값으로 업데이트하는 단계(S30), 주태스크에 의해 유예된 부태스크가 존재하는 경우(S40), 글로벌변수에 저장된 정보를 배제한 상태에서 유예된 부태스크를 수행하는 단계(S41) 및 부태스크가 수행 완료되지 않은 상태(S50)에서, 주태스크 주기가 종료되면 부태스크를 유예하는 단계(S51)를 포함한다.As shown in FIG. 2, a task execution method according to an exemplary embodiment of the present invention performs a main task based on information stored in a global variable (S11, S12) after a sub task cycle and a main task cycle are started (S30) of updating the global variable to a main result value (S30), and when the main task is deferred by the main task (Step S40). In step S41, the suspended sub-task is excluded while the information stored in the global variable is excluded. In a state in which the sub-task is not completed (S50) (Step S51).

이때, 부태스크를 유예하는 단계(S51)에서, 유예된 부태스크에 의해 글로벌변수에 대응하고 글로벌변수에 저장된 정보와 상이한 유예결과값이 생성된 경우, 유예결과값으로 글로벌변수를 업데이트하는 것을 배제한다. At this time, in the step of suspending the subtotal (S51), when a graceful sub task corresponds to the global variable and the grace result value different from the information stored in the global variable is generated, excluding updating of the global variable with the grace result value do.

그리고, 태스크 수행방법은, 주결과값으로 글로벌변수를 업데이트하는 단계(S30) 이후에, 주태스크에 의해 유예된 부태스크가 존재하지 않는 경우(S40), 글로벌변수에 저장된 정보에 기초하여 부태스크의 수행을 시작하는 단계(S42)를 더 포함한다.The task execution method includes a step S30 of updating the global variable with the main result value, if there is no deferred task by the main task (S40) (S42).

또한, 태스크 수행방법은 주태스크 주기가 종료되는 단계(S51) 이전에, 부태스크를 수행 완료하여 글로벌변수에 대응하는 부결과값을 생성하는 단계(S50), 및 부결과값으로 글로벌변수를 업데이트하는 단계(S52)를 더 포함한다. The task execution method further includes a step (S50) of completing the subtask to generate a negative result value corresponding to the global variable (S50) before the main task cycle ends (S51), and a step (S52).

이어서, 태스크 수행방법은 부태스크 주기가 종료되는 단계(S14)를 더 포함한다. Next, the task performing method further includes a step (S14) in which the negative task period ends.

일 예로, 도 3에 도시한 바와 같이, 각 부태스크 주기가 주태스크 주기의 3배인 경우를 가정하여, n-1번째 부태스크 주기와 n+1번째 부태스크 주기 사이의 n번째 부태스크 주기에서의 태스크 수행방법에 대해 설명한다.For example, as shown in FIG. 3, assuming that each sub-task cycle is three times the main task cycle, the n-th sub-task cycle between the (n-1) th sub- Will be described.

n-1번째 부태스크 주기의 종료 시에(S14), n-1번째 부태스크를 수행 완료하여, 그에 따른 결과값(RP, RP; Result_previously, 이하 "이전결과값"이라 함)으로 글로벌변수(GV; Global Variable)를 업데이트한다. (S52)(n-1) th sub-task is completed at the end of the (n-1) th sub-task cycle at step S14 and the resultant values RP, RP; Result_previously GV (Global Variable). (S52)

n-1번째 부태스크 주기의 종료된 이후(S14), n번째 부태스크 주기가 시작되고 (S11), 제 1 주태스크 주기가 시작된다. (S12) After the end of the (n-1) th sub-task cycle (S14), the n-th sub-task cycle is started (S11) and the first main task cycle is started. (S12)

이에, 제 1 주태스크 주기 중 일부인 실행기간(PT1, PT; Performing Term) 동안, 글로벌변수(GV)에 저장된 정보, 즉 이전결과값(RP)에 기초하여, 제 1 주태스크 주기에 대응하는 제 1 주태스크를 수행한다. (S13)Accordingly, based on the information stored in the global variable (GV), that is, the previous result value (RP), during the execution period (PT1, PT) as a part of the first main task cycle, 1 Perform the main task. (S13)

제 1 주태스크를 수행 완료하고, 글로벌변수(GV)에 대응하는 제 1 결과값(R1)을 생성한다. (S20) 이때, 제 1 결과값(R1)이 글로벌변수(GV)에 저장된 정보와 상이하면, 제 1 결과값(R1)으로 글로벌변수(GV)를 업데이트한다. (S30)Completes the first main task, and generates a first result value R1 corresponding to the global variable GV. (S20) At this time, if the first result value R1 differs from the information stored in the global variable GV, the global variable GV is updated with the first result value R1. (S30)

제 1 주태스크는 n번째 부태스크 주기 중 첫번째로 수행되는 주태스크로서, 제 1 주태스크를 수행하기 의해 유예된 부태스크가 존재하지 않는다. 이에, 유예된 부태스크가 존재하지 않음을 확인하면(S40), 글로벌변수(GV)에 저장된 정보, 즉 제 1 결과값(R1)에 기초하여 n번째 부태스크 주기에 대응하는 n번째 부태스크를 수행 시작한다. (S42) The first main task is the first main task executed in the n-th sub-task cycle, and there is no deferred task by performing the first main task. If it is confirmed that there is no deferred sub-task (S40), the information stored in the global variable GV, i.e., the n-th sub-task corresponding to the n-th sub-task cycle based on the first result value R1 Start running. (S42)

즉, 제 1 주태스크 주기의 실행기간(PT1)을 제외한 나머지 여분기간(RT1, RT; Reminder Term) 동안, 글로벌변수(GV)에 저장된 정보에 기초하여 n번째 부태스크(ST(n)) 중 초기의 일부 영역(ST_F)을 수행한다. That is, during the remaining spare periods RT1 and RT except for the execution period PT1 of the first main task cycle, among the n-th sub-task ST (n), based on the information stored in the global variable GV, And performs an initial partial area ST_F.

이때, n번째 부태스크(ST(n))가 수행 완료되지 않은 상태에서(S50), 제 1 주태스크 주기가 종료된다. 이에, 제 2 주태스크 주기에 대응하는 제 2 주태스크를 수행하기 위해, n번째 부태스크(ST(n))는 초기의 일부 영역(ST_F)만이 수행된 상태로 유예된다. (S51) At this time, in a state where the n-th auxiliary task ST (n) is not completed (S50), the first main task cycle is terminated. Thus, in order to perform the second main task corresponding to the second main task cycle, the n-th sub task ST (n) is suspended in the state where only the initial partial area ST_F is performed. (S51)

여기서, n번째 부태스크(ST(n)) 중 초기의 일부 영역(ST_F)이 수행됨에 따라, 글로벌변수(GV)에 저장된 정보와 상이한 유예결과값이 발생되더라도, 유예결과값으로 글로벌변수(GV)를 업데이트하는 것은 배제된다. Here, even if a grace result value different from the information stored in the global variable GV is generated as the initial portion ST_F of the n-th subtotal task ST (n) is executed, the global variable GV ) Is excluded from updating.

이어서, 제 2 주태스크 주기가 시작된다. (S12) 이에, 제 2 주태스크 주기 중 실행기간(PT2) 동안, 글로벌변수(GV)에 저장된 정보, 즉 제 1 결과값(R1)에 기초하여 제 2 주태스크 주기에 대응하는 제 2 주태스크를 수행한다. (S13)Then, the second main task cycle is started. (S12). Therefore, during the execution period PT2 of the second main task cycle, information stored in the global variable GV, i.e., the second main task corresponding to the second main task cycle based on the first result value R1 . (S13)

제 2 주태스크를 수행 완료하여 글로벌변수(GV)에 저장된 정보와 상이한 제 2 결과값(R2)가 생성되면(S20), 제 2 주태스크의 수행 완료에 따른 제 2 결과값(R2)으로 글로벌변수(GV)를 업데이트한다. (S30)When the second main task is completed and a second result R2 different from the information stored in the global variable GV is generated in step S20, Update the variable (GV). (S30)

그리고, 제 2 주태스크(MT2)를 수행하기 위해, 초기의 일부 영역(ST_F)만이 수행된 상태로 유예된 부태스크(ST(n))가 존재하는 것을 확인한다. (S40) 이에, 제 2 주태스크 주기 중 여분기간(RT2) 동안 글로벌변수(GV)에 저장된 정보를 배제한 상태에서 유예된 n번째 부태스크(ST(n))를 이어서 수행한다. (S41) In order to perform the second main task MT2, it is confirmed that there exists a suspended negative task ST (n) in the state where only the initial partial area ST_F is executed. (S40). Then, the n-th auxiliary task ST (n) is executed in a state where the information stored in the global variable GV is excluded during the extra period RT2 of the second main task cycle. (S41)

이후, 제 2 주태스크 주기 중 여분기간(RT2) 동안, 유예된 n번째 부태스크(ST(n)) 중 중기의 일부 영역(ST_M)까지 수행된다. 이 상태에서, 제 2 주태스크 주기가 종료된다. Thereafter, during an extra period RT2 of the second main task cycle, a partial region ST_M of the mid-stage of the n-th auxiliary task ST (n) is executed. In this state, the second main task cycle ends.

다음, 제 3 주태스크 주기(MTP3)에 대응하는 제 3 태스크(MT3)를 수행하기 위해, n번째 부태스크(ST(n))는 중기의 일부 영역(ST(n)_M)까지 수행된 상태로 유예된다. (S51) Next, in order to perform the third task MT3 corresponding to the third main task cycle MTP3, the n-th sub-task ST (n) is in a state of being performed up to the middle area ST (n) _M . (S51)

여기서, n번째 부태스크(ST(n)) 중 중기의 일부 영역(ST(n)_M)이 수행됨에 따라, 글로벌변수(GV)에 저장된 정보와 상이한 유예결과값이 발생되더라도, 유예결과값으로 글로벌변수(GV)를 업데이트하는 것은 배제된다.Here, even if a grace result value different from the information stored in the global variable GV is generated as a part of the middle stage ST (n) _M of the n-th subtotal task ST (n) is executed, Updating the global variable (GV) is excluded.

이어서, 제 3 주태스크 주기가 시작되고 (S12), 제 3 주태스크 주기 중 실행기간(PT3) 동안, 글로벌변수(GV)에 저장된 정보, 즉 제 2 결과값(R2)에 기초하여 제 3 주태스크 주기에 대응하는 제 3 주태스크를 수행한다. (S13)Subsequently, the third main task cycle is started (S12) and during the execution period PT3 of the third main task cycle, the information stored in the global variable GV, i.e., the third week The third main task corresponding to the task cycle is performed. (S13)

제 3 주태스크가 수행 완료하면, 제 3 주태스크의 수행 완료에 따른 제 3 결과값(R3)으로 글로벌변수(GV)를 업데이트한다. (S30)When the third main task is completed, the global variable (GV) is updated to the third result value (R3) according to the execution completion of the third main task. (S30)

제 3 주태스크를 수행하기 위해, 중기의 일부 영역(ST_M)까지 수행된 상태로 유예된 부태스크(ST(n))가 존재하므로(S40), 제 3 주태스크 주기 중 여분기간(RT3) 동안 글로벌변수(GV)에 저장된 정보를 배제한 상태에서 유예된 n번째 부태스크(ST(n))를 이어서 수행한다. (S41)Since there is a delayed subtask ST (n) that has been executed up to the partial region ST_M of the middle stage in order to perform the third main task (S40), during the extra period RT3 of the third main task cycle The n th auxiliary task ST (n) is executed in a state in which information stored in the global variable GV is excluded. (S41)

이때, 제 3 주태스크 주기가 종료되기 전에(S51), n번째 부태스크(ST(n))가 최종 영역(ST_L)까지 수행 완료하여, 제 4 결과값(R4)를 생성한다. (S50) 이에, n 번째 부태스크(ST(n))의 수행 완료에 따른 제 4 결과값(R4)으로 글로벌변수(GV)를 업데이트한다. (S52) At this time, before the third main task cycle ends (S51), the n-th subsidiary task ST (n) completes execution to the final region ST_L and generates the fourth result value R4. (S50), and updates the global variable GV with the fourth result R4 according to the completion of the execution of the n-th sub-task ST (n). (S52)

이후, n번째 부태스크 주기(STP(n))가 종료되고(S14), n+1번째 부태스크 주기가 시작된다. (S11) 이에, 글로벌변수(GV)에 저장된 정보, 즉 제 4 결과값(R4)에 기초하여, n+1번째 부태스크 주기 중 제 1 주태스크 주기에 대응하는 제 1 주태스크를 수행한다. (S13)Thereafter, the n-th auxiliary task cycle STP (n) is ended (S14), and the (n + 1) th auxiliary task cycle is started. (S11), the first main task corresponding to the first main task cycle of the (n + 1) th sub-task cycle is executed based on the information stored in the global variable GV, i.e., the fourth result value R4. (S13)

이상과 같이, 본 발명의 일 실시예에 따른 태스크 수행방법은 주태스크(MT)의 수행 완료에 따른 주결과값(R1, R2, R3)으로 글로벌변수(GV)를 업데이트하는 단계(S30)와, 주태스크(MT)를 수행하기 위해 유예된 부태스크(ST)가 존재하는 경우(S40), 글로벌변수(GV)에 저장된 정보를 배제한 상태에서 유예된 부태스크(ST)를 수행하는 단계(S41)를 포함한다. As described above, the task execution method according to an embodiment of the present invention includes a step S30 of updating the global variable GV with the main result values R1, R2 and R3 according to completion of the main task MT, If there is a deferred task ST to perform the main task MT in step S40, executing the deferred subtask ST in a state in which information stored in the global variable GV is excluded S41 ).

이와 같이, 부태스크(ST)는 수행 시작 시에만 글로벌변수(GV)의 정보를 참조하고, 유예된 부태스크(ST)를 수행 재개 시에는, 글로벌변수(GV)를 참조하지 않는다. 이로써, 부태스크(ST)가 동시성이 유지된 글로벌변수(GV)의 정보를 참조하여 수행될 수 있다. 이에 따라, 부태스크(ST)의 수행 결과가 사용자의 설계로부터 예측되는 결과와 동일 또는 유사해짐으로써, 부태스크(ST)의 수행 결과에 대한 신뢰도가 향상될 수 있다.Thus, the secondary task ST refers to the information of the global variable GV only at the start of execution, and does not refer to the global variable GV at the time of restarting the deferred secondary task ST. Thus, the subtask (ST) can be executed with reference to the information of the global variable (GV) in which the concurrency is maintained. Accordingly, the result of the execution of the secondary task ST becomes the same as or similar to the result predicted from the design of the user, so that the reliability of the execution result of the secondary task ST can be improved.

그리고, 본 발명의 일 실시예에 따르면, 주태스크 주기가 종료되어 부태스크(ST)를 유예 시에, 유예된 부태스크(ST)에 따른 유예결과값으로 글로벌변수(GV)를 업데이트하지 않는다. 반면, 부태스크(ST)가 수행 완료되면, 부태스크(ST)의 수행 완료에 따른 부결과값으로 글로벌변수(GV)를 업데이트한다. (S52)According to an embodiment of the present invention, when the main task cycle is terminated and the secondary task ST is deferred, the global variable GV is not updated to the deferred result value according to the deferred secondary task ST. On the other hand, when the subtask (ST) is completed, the global variable (GV) is updated with the subtraction result according to completion of the subtask (ST). (S52)

즉, 주태스크(MT)의 수행 완료에 따른 주결과값으로 글로벌변수(GV)를 업데이트하는 것과 마찬가지로, 부태스크(ST)의 수행 완료에 따른 부결과값으로만 글로벌변수(GV)를 업데이트하고, 유예된 부태스크(ST)에 의한 유예결과값으로 글로벌변수(GV)를 업데이트하는 것은 차단된다. 이로써, 유예된 부태스크(ST) 이후에 개시되는 주태스크(MT)의 수행 시, 불완전한 유예결과값으로 업데이트된 글로벌변수(GV)를 참조하지 않으므로, 주태스크(MT)의 수행 결과에 대한 신뢰도가 향상될 수 있다. That is, just as the global variable GV is updated to the main result value according to completion of the main task MT, the global variable GV is updated only with the negative result value according to the completion of the execution of the subtask ST , Updating the global variable (GV) with the deferred result value by the deferred auxiliary task (ST) is blocked. Thus, since the global variable GV updated with the incomplete grace result value is not referred to when performing the main task MT started after the graceful secondary task ST, the reliability of the execution result of the main task MT Can be improved.

따라서, 본 발명의 일 실시예에 따른 태스크 수행방법은 감시제어장치의 제어 확정성과 신뢰도를 향상시킬 수 있다.Therefore, the task performing method according to the embodiment of the present invention can improve the control determination and reliability of the monitoring control apparatus.

한편, 본 발명의 일 실시예에 따른 태스크 수행방법은 주태스크의 수행 완료에 따른 결과값 또는 부태스크의 수행 완료에 따른 결과값으로 글로벌변수(GV)를 업데이트한다. Meanwhile, a task execution method according to an embodiment of the present invention updates a global variable (GV) with a result value according to completion of execution of a main task or a result value according to completion of a subtask.

이와 달리, 주태스크 중 사용자의 설계에 의해 실시간성을 높일 필요가 있는 어느 하나가 글로벌변수에 대한 변경 권한을 소유하도록 지정될 수 있다. 그리고, 이와 같이 지정된 주태스크를 수행 중에, 글로벌변수(GV)에 저장된 정보와 상이한 결과값을 생성 시마다, 글로벌변수(GV)를 업데이트한다.Alternatively, any one of the main tasks that needs to increase real-time performance by the user's design may be designated to possess change authority to the global variable. During execution of the main task designated in this way, the global variable (GV) is updated each time a result value different from the information stored in the global variable (GV) is generated.

도 4는 본 발명의 다른 일 실시예에 따른 태스크 수행방법을 설명하기 위한 일 예시이다.FIG. 4 is an illustration for explaining a task performing method according to another embodiment of the present invention.

도 4에 도시한 바와 같이, 본 발명의 다른 일 실시예에 따른 태스크 수행 방법은 글로벌변수에 대한 변경 권한을 소유하도록 지정된 제 1 주태스크(S_MT1)를 수행 중에 글로벌변수(GV)에 저장된 정보와 상이한 중간결과값(MR1, MR2)이 발생 시마다, 글로벌변수(GV)를 업데이트하는 점을 제외하면, 도 3에 도시된 바와 동일하므로, 이하에서 중복 설명을 생략한다.4, a task execution method according to another exemplary embodiment of the present invention includes: storing information stored in a global variable (GV) during execution of a first main task (S_MT1) 3 except that the different intermediate result values MR1 and MR2 are updated whenever the global variable GV is updated. Therefore, redundant description will be omitted below.

본 발명의 다른 일 실시예에 따르면, 하나의 부태스크 주기(STP(n)) 동안 수행되는 복수의 주태스크 중 사용자의 설계에 의해 어느 하나의 주태스크(도 4에서 제 1 주태스크(S_MT1)임)가 글로벌변수에 대한 변경 권한을 소유하는 것으로 지정된다. According to another embodiment of the present invention, a task of a main task (the first main task S_MT1 in Fig. 4) is selected by a design of a user among a plurality of main tasks performed during one sub-task period STP (n) ) Is designated to have the authority to change the global variable.

그리고, 태스크 수행부(도 1의 110)는 글로벌변수에 대한 변경 권한을 소유하는 제 1 주태스크(S_MT1)를 수행하는 경우, 제 1 주태스크(S_MT1)를 수행 완료 하기 이전이라도, 글로벌변수에 대응하고 글로벌변수에 저장된 정보와 상이한 중간결과값이 생성되면, 중간결과값을 글로벌변수 관리부(도 1의 130)로 전달한다. 이에, 글로벌변수 관리부(130)는 전달된 중간결과값으로 글로벌변수를 업데이트한다.When performing the first main task S_MT1 having the authority to change the global variable, the task execution unit 110 of FIG. 1 may execute the first main task S_MT1 even before completing the first main task S_MT1 And generates an intermediate result value different from the information stored in the global variable, the intermediate result value is transferred to the global variable management unit (130 in FIG. 1). The global variable management unit 130 updates the global variable with the delivered intermediate result value.

구체적으로, 도 4의 도시와 같이, 제 1 주태스크 주기(MTP1) 중 실행기간(PT1) 동안 글로벌변수에 대한 변경 권한을 소유하는 제 1 주태스크(S_MT1)의 수행 중에, 글로벌변수(GV)에 저장된 정보와 상이한 제 1 중간결과값(MR1)이 발생하면, 제 1 중간결과값(MR1)으로 글로벌변수(GV)를 업데이트한다. 이후 다시 글로벌변수(GV)에 저장된 정보, 즉 제 1 중간결과값(MR1)과 상이한 제 2 중간결과값(MR1)이 발생하면, 제 2 중간결과값(MR2)으로 글로벌변수(GV)를 업데이트한다. 이어서, 지정된 제 1 주태스크(S_MT1)의 수행 완료 시에, 다시 글로벌변수(GV)에 저장된 정보, 즉 제 2 중간결과값(MR2)과 상이한 최종결과값(FR)이 발생하면, 최종결과값(FR)으로 글로벌변수(GV)를 업데이트한다. Specifically, as shown in FIG. 4, during the execution of the first main task S_MT1 having the authority to change global variables during the execution period PT1 of the first main task cycle MTP1, the global variables GV, The first intermediate result value MR1 is updated with the global variable GV when the first intermediate result value MR1 is different from the first intermediate result value MR1. Then, when the information stored in the global variable GV, i.e., the second intermediate result value MR1 different from the first intermediate result value MR1 is generated, the global variable GV is updated with the second intermediate result value MR2 do. Subsequently, upon completion of the execution of the designated first main task (S_MT1), when the information stored in the global variable (GV), i.e., the final result value (FR) different from the second intermediate result value MR2 is generated, (FR) to update the global variable (GV).

이와 같은 태스크 수행방법은, 다른 주태스크에 비해, 실시간성을 높일 필요가 있는 주태스크를 수행해야 하는 경우에도 적용 가능해질 수 있으므로, 적용 범위가 넓어질 수 있다.Such a task execution method can be applied to a case where a main task that needs to increase the real-time property is required to be performed as compared with other main tasks, and thus the scope of application can be extended.

전술한 본 발명은, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에게 있어 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니다.While the present invention has been described in connection with what is presently considered to be practical exemplary embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but, on the contrary, But the present invention is not limited thereto.

100: 감시제어장치 110: 태스크 수행부
130: 글로벌변수 관리부 STP: 부태스크 주기
MTP: 주태스크 주기 PT: 실행기간
RT: 여분기간 MT: 주태스크
ST: 부태스크 GV: 글로벌변수
RP, R1, R2, R3, R4: 결과값
100: monitoring control apparatus 110: task performing section
130: Global variable management unit STP: Sub task cycle
MTP: Main task cycle PT: Execution period
RT: Extra period MT: Main task
ST: Sub task GV: Global variable
RP, R1, R2, R3, R4: Result Value

Claims (6)

소정의 주태스크 주기에서 주태스크를 먼저 수행하고, 상기 주태스크 주기 중 상기 주태스크를 수행하고 남는 여분기간 동안 부태스크를 수행하는 태스크 수행부;
상기 태스크 수행부에 글로벌변수에 저장된 정보를 제공하고, 상기 태스크 수행부에 의한 태스크 수행 결과에 따라 상기 글로벌변수를 업데이트하는 글로벌변수 관리부를 포함하고,
상기 태스크 수행부는 상기 주태스크에 의해 유예된 상태의 부태스크가 존재하는 경우, 상기 소정의 주태스크 주기의 상기 여분기간 동안 상기 글로벌변수에 저장된 정보를 배제한 상태에서 상기 유예된 부태스크를 수행하고, 상기 부태스크를 수행 완료하기 전에 상기 소정의 주태스크 주기가 종료되면 상기 수행중인 부태스크를 유예하는 감시제어장치.
A task performing unit that first performs a main task in a predetermined main task cycle and performs a subtask during a spare period remaining after performing the main task in the main task cycle;
And a global variable manager for providing the information stored in the global variable to the task performing unit and for updating the global variable according to a task execution result by the task performing unit,
Wherein the task execution unit performs the suspended secondary task in a state where information stored in the global variable is excluded during the spare period of the predetermined main task cycle when a secondary task in a state of being suspended by the primary task exists, And suspends the sub-task being executed when the predetermined main task cycle ends before completion of the sub-task.
제 1 항에 있어서,
상기 태스크 수행부는
상기 소정의 주태스크 주기에서, 상기 글로벌변수에 저장된 정보에 기초하여 상기 주태스크를 수행하고, 상기 주태스크를 수행 완료하여 주결과값을 생성하며, 상기 주결과값을 상기 글로벌변수 관리부에 전달하고,
상기 글로벌변수 관리부는 상기 전달된 주결과값으로 상기 글로벌변수를 업데이트하는 감시제어장치.
The method according to claim 1,
The task performing unit
In the predetermined main task cycle, the main task is executed based on information stored in the global variable, the main task is completed to generate a main result value, and the main result value is transmitted to the global variable management unit ,
And the global variable management unit updates the global variable with the delivered main result value.
제 1 항에 있어서,
상기 태스크 수행부는 상기 주태스크에 의해 유예된 상태의 부태스크가 존재하지 않는 경우, 상기 소정의 주태스크 주기의 상기 여분기간 동안 상기 글로벌변수에 저장된 정보에 기초하여 상기 부태스크의 수행을 시작하는 감시제어장치.
The method according to claim 1,
Wherein the task execution unit is configured to perform monitoring of the secondary task based on the information stored in the global variable during the spare period of the predetermined main task cycle when the secondary task is not suspended by the main task, Control device.
제 1 항에 있어서,
상기 태스크 수행부는 상기 소정의 주태스크 주기의 상기 여분기간 동안 상기 부태스크를 수행 완료하여 상기 글로벌변수에 대응하는 부결과값을 생성하는 경우, 상기 부결과값을 상기 글로벌변수 관리부에 전달하고,
상기 글로벌변수 관리부는 상기 전달된 부결과값으로 상기 글로벌변수를 업데이트하는 감시제어장치.
The method according to claim 1,
Wherein the task execution unit transmits the negative resultant value to the global variable management unit when the task execution unit completes the subtask during the spare period of the predetermined main task cycle and generates a negative result value corresponding to the global variable,
And the global variable management unit updates the global variable with the delivered negative result value.
제 1 항에 있어서,
상기 태스크 수행부는 상기 수행중인 부태스크를 유예하는 경우, 상기 부태스크에 의해 상기 글로벌변수에 대응하고 상기 글로벌변수에 저장된 정보와 상이한 유예결과값을 상기 글로벌변수 관리부에 전달하지 않는 감시제어장치.
The method according to claim 1,
Wherein the task execution unit does not deliver to the global variable management unit a grace result value that corresponds to the global variable and differs from information stored in the global variable by the secondary task when the executing secondary task is deferred.
제 1 항에 있어서,
상기 태스크 수행부는 상기 글로벌변수에 대한 변경 권한을 소유하는 주태스크를 수행하는 경우, 상기 글로벌변수에 대응하고 상기 글로벌변수에 저장된 정보와 상이한 중간결과값이 생성되면, 상기 중간결과값을 상기 글로벌변수 관리부에 전달하고,
상기 글로벌변수 관리부는 상기 전달된 중간결과값으로 상기 글로벌변수를 업데이트하는 감시제어장치.
The method according to claim 1,
When the task execution unit executes a main task having a right to change the global variable, if the task execution unit generates an intermediate result value corresponding to the global variable and different from the information stored in the global variable, To the management unit,
And the global variable management unit updates the global variable with the delivered intermediate result value.
KR1020160095641A 2016-07-27 2016-07-27 Apparatus for monitoring and controlling KR102492399B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160095641A KR102492399B1 (en) 2016-07-27 2016-07-27 Apparatus for monitoring and controlling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160095641A KR102492399B1 (en) 2016-07-27 2016-07-27 Apparatus for monitoring and controlling

Publications (2)

Publication Number Publication Date
KR20180012600A true KR20180012600A (en) 2018-02-06
KR102492399B1 KR102492399B1 (en) 2023-01-26

Family

ID=61228196

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160095641A KR102492399B1 (en) 2016-07-27 2016-07-27 Apparatus for monitoring and controlling

Country Status (1)

Country Link
KR (1) KR102492399B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130979A (en) * 2020-09-29 2020-12-25 展讯通信(上海)有限公司 Method, device, terminal and medium for scheduling task and training neural network model

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002099434A (en) * 2000-09-25 2002-04-05 Matsushita Electric Ind Co Ltd Control apparatus
JP2002149421A (en) * 2000-11-15 2002-05-24 Denso Corp Information processor
JP2008226023A (en) * 2007-03-14 2008-09-25 Kansai Electric Power Co Inc:The Job allocating device and job allocating method
JP2012108582A (en) * 2010-11-15 2012-06-07 Denso Corp Information processing device
JP2012194683A (en) * 2011-03-15 2012-10-11 Omron Corp Control device and system program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002099434A (en) * 2000-09-25 2002-04-05 Matsushita Electric Ind Co Ltd Control apparatus
JP2002149421A (en) * 2000-11-15 2002-05-24 Denso Corp Information processor
JP2008226023A (en) * 2007-03-14 2008-09-25 Kansai Electric Power Co Inc:The Job allocating device and job allocating method
JP2012108582A (en) * 2010-11-15 2012-06-07 Denso Corp Information processing device
JP2012194683A (en) * 2011-03-15 2012-10-11 Omron Corp Control device and system program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130979A (en) * 2020-09-29 2020-12-25 展讯通信(上海)有限公司 Method, device, terminal and medium for scheduling task and training neural network model
CN112130979B (en) * 2020-09-29 2022-08-09 展讯通信(上海)有限公司 Method, device, terminal and medium for scheduling task and training neural network model

Also Published As

Publication number Publication date
KR102492399B1 (en) 2023-01-26

Similar Documents

Publication Publication Date Title
US6779176B1 (en) Methods and apparatus for updating electronic system programs and program blocks during substantially continued system execution
US20060218558A1 (en) Schedulability determination method and real-time system
US20070168082A1 (en) Task-based robot control system for multi-tasking
Freed Managing multiple tasks in complex, dynamic environments
JPH08235004A (en) Control method for control software execution system
EP1004061A2 (en) Architecture for a hybrid real-time control system and method of operation thereof
CN106325992A (en) Method for calculating progress of long tasks in distributed type environment
CN110291474B (en) Controller
EP0880094B1 (en) Control system
KR20180012600A (en) Apparatus for monitoring and controlling
JP5834935B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
US20050050541A1 (en) Method of and apparatus for task control, and computer product
EP0239054A1 (en) Process control system and method
CN112823337A (en) Method and programmable control device for data processing
CA2650347C (en) Control apparatus for process input-output device
JP2636722B2 (en) Multitask execution management method
RU2678469C1 (en) Method for composing and executing real-time task-sequencing plan
JP2008234276A (en) Operation test system for job schedule
JP2005071171A (en) Method for controlling batch job execution
JP2021189885A (en) Job scheduling program, information processing apparatus, and job scheduling method
JPH04171538A (en) Repetitive data processing scheduling system
WO2023157145A1 (en) Memory management assistance device and computer-readable storage medium
EP4239543A1 (en) Project management system and respective method of operation
US11579594B2 (en) Method and engineering system for modifying a program of an industrial automation component
CN117632206A (en) Basic algorithm and control logic program online updating method and system of industrial controller

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant