KR101271854B1 - Apparatus and method for scheduling task period - Google Patents
Apparatus and method for scheduling task period Download PDFInfo
- Publication number
- KR101271854B1 KR101271854B1 KR1020110087754A KR20110087754A KR101271854B1 KR 101271854 B1 KR101271854 B1 KR 101271854B1 KR 1020110087754 A KR1020110087754 A KR 1020110087754A KR 20110087754 A KR20110087754 A KR 20110087754A KR 101271854 B1 KR101271854 B1 KR 101271854B1
- Authority
- KR
- South Korea
- Prior art keywords
- tasks
- task
- period
- violation probability
- deadline violation
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/461—Saving or restoring of program or task context
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
태스크 주기 스케쥴링 장치 및 방법이 개시된다. 개시된 태스크 주기 스케쥴링 장치는 주기적으로 실행되는 복수의 태스크들을 중 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 주기 설정부를 포함하되, 상기 복수의 태스크들은 미리 선정된 M(1 이상의 정수임)개의 태스크 및 상기 M개의 태스크를 제외한 나머지 태스크로 분류되고, 상기 주기 설정부는 상기 미리 선정된 M개의 태스크의 주기 중 최대값이 상기 나머지 태스크의 주기 중 최소값보다 크지 않도록 상기 적어도 하나의 태스크의 주기를 증가 또는 감소시킨다. 본 발명에 따르면, 주기적으로 실행되는 복수의 태스크들이 마감시간을 위반할 확률을 낮추면서 시스템 자원의 이용률을 최대화할 수 있도록 복수의 태스크들의 주기를 설정할 수 있게 된다. Disclosed are a task cycle scheduling apparatus and method. The disclosed task period scheduling apparatus includes a period setting unit that increases or decreases the period of at least one task among a plurality of tasks that are periodically executed, wherein the plurality of tasks include a predetermined M task (an integer of 1 or more) and the task. The period setting unit increases or decreases the period of the at least one task so that the maximum value of the periods of the M tasks selected in advance is not greater than the minimum value of the periods of the remaining tasks. . According to the present invention, it is possible to set a cycle of a plurality of tasks to maximize the utilization of system resources while lowering the probability that a plurality of periodically executed tasks violate deadlines.
Description
본 발명의 실시예들은 태스크 주기 스케쥴링 장치 및 방법에 관한 것으로서, 더욱 상세하게는 임베디드 시스템(Embedded System) 등에서 주기적으로 실행되는 복수의 태스크(Task)들의 주기를 설정할 수 있는 태스크 주기 스케쥴링 장치 및 방법에 관한 것이다. Embodiments of the present invention relate to an apparatus and method for scheduling a task cycle, and more particularly, to an apparatus and method for scheduling a task cycle capable of setting a cycle of a plurality of tasks periodically executed in an embedded system or the like. It is about.
임베디드 시스템(Embedded System)은 시스템을 동작시키는 소프트웨어를 하드웨어에 내장하여 특수한 기능만을 수행하도록 한 컴퓨터 시스템을 의미한다. 이러한 임베디드 시스템은 개인용 컴퓨터와는 달리 특정한 요구 사항을 가지고 있으며, 미리 정의된 태스크(Task)만을 수행한다. 이 때, 태스크는 하나 이상일 수 있으며, 하나 이상의 태스크는 주기적으로 반복되어 수행될 수 있다. An embedded system refers to a computer system that incorporates software for operating the system in hardware and performs only specific functions. Unlike personal computers, these embedded systems have specific requirements and perform only predefined tasks. At this time, the task may be one or more, and one or more tasks may be executed periodically and repeatedly.
이러한 임베디드 시스템에서는 보다 적은 시스템 자원을 소모하면서 빠른 속도로 태스크를 수행할 수 있도록 태스크들의 실행 시간 내지 주기들을 스케쥴링하는 것이 중요하다. In such an embedded system, it is important to schedule the execution time or cycles of tasks so that tasks can be performed at a high speed while consuming less system resources.
이와 관련하여, RTSS '09 Proceedings of the 2009 30th IEEE Real-Time Systems Symposium에서 발표된 "A Generic Framework for Soft Real-Time Program Executions on NAND Flash Memory in Multi-Tasking Embedded Systems"에서는 각 태스크마다 요구되는 마감시간 위반확률(Deadline Miss Probability)의 임계치를 넘지 않으면서 복수의 태스크들의 실행 시 요구되는 시스템 자원의 이용량(일례로, 메모리 사용량)을 최소화하는 알고리즘(태스크 스케쥴링 방법)을 제안하였다.In this regard, the "A Generic Framework for Soft Real-Time Program Executions on NAND Flash Memory in Multi-Tasking Embedded Systems" presented at RTSS '09 Proceedings of the 2009 30th IEEE Real-Time Systems Symposium, requires a deadline for each task. We proposed an algorithm (task scheduling method) that minimizes the amount of system resources (eg, memory usage) required to execute a plurality of tasks without exceeding the threshold of Deadline Miss Probability.
상기의 종래의 태스크 스케쥴링 방법은 모든 태스크들이 고정된 주기를 갖는 것으로 가정하고, 시스템 자원의 사용량을 감소시키는 경우 태스크들의 평균 실행 시간이 증가한다는 사실에 기초하여, 각 태스크가 기 설정된 임계 마감시간 위반확률을 넘지 않는 조건에서 평균 실행 시간을 얼마나 증가시킬 수 있는지를 판단하고, 판단 결과에 따라 각 태스크의 평균 실행 시간을 결정한다. 이 과정에서 각 태스크의 실행 시간은 실행 시간 분포로서 확률적 응답 시간 분석기(Probabilistic Response Time Analyzer)에 입력되며, 확률적 응답 시간 분석기는 각 태스크의 응답 시간 분포를 계산하여 각 태스크에 대한 마감시간 위반확률을 연산한다. 따라서 상기한 태스크 스케쥴링 방법은 각 태스크의 계산된 마감시간 위반확률이 임계 마감시간 위반확률을 넘지 않는다는 조건을 만족하는지 확인하면서 평균 실행 시간을 점차적으로 증가시켜서 각 태스크가 가질 수 있는 최대의 평균 실행 시간을 해당 태스크의 실행 시간으로 결정함으로써 태스크 스케쥴링을 수행한다. In the conventional task scheduling method, it is assumed that all the tasks have a fixed cycle. On the basis of the fact that the average execution time of the tasks increases when the usage amount of the system resources is reduced, It is determined how much the average execution time can be increased under the condition that the probability does not exceed, and the average execution time of each task is determined according to the determination result. In this process, the execution time of each task is input to the probabilistic response time analyzer as the execution time distribution, and the probabilistic response time analyzer calculates the response time distribution of each task, Calculate the probability. Therefore, the task scheduling method described above satisfies the condition that the calculated deadline violation probability of each task does not exceed the critical deadline violation probability, while gradually increasing the average execution time to maximize the maximum average execution time of each task. Task scheduling is performed by determining the execution time of the task.
한편, 임베디드 시스템은 센서 입력 또는 기타 외부 입력을 받아들이는 태스크들이 얼마나 자주 입력을 받아들일 수 있는가가 해당 임베디드 시스템의 정밀도를 결정하는 요소가 될 수 있다. 예를 들어, 고정밀 다축 모터 시스템의 경우 모터 제어 명령을 얼마나 짧은 주기에 받아들일 수 있는가에 따라 시스템의 제어 정밀도가 결정될 수 있다. 다시 말해, 모터 제어 명령을 수신하고 처리하는 태스크의 주기가 짧을수록 모터 제어 명령에 대한 고정밀 다축 모터 시스템의 반응 시간이 더 짧아지므로, 보다 정밀하게 모터를 제어할 수 있게 된다. Meanwhile, in an embedded system, how often a task that accepts a sensor input or other external input can accept an input may be a factor in determining the precision of the embedded system. For example, in a high precision multi-axis motor system, the control accuracy of the system can be determined according to how short the motor control command can be received. In other words, the shorter the cycle of the task of receiving and processing the motor control command, the shorter the response time of the high-precision multi-axis motor system to the motor control command becomes, so that the motor can be controlled more precisely.
그런데, 일반적으로 태스크의 주기가 짧아지면 시스템 자원 이용률이 높아져서 각 태스크가 마감시간을 위반할 확률이 높아진다. 따라서 임베디드 시스템의 정밀도를 높이기 위해서는 각 태스크에게 허용되는 마감시간 위반확률의 임계치(임계 마감시간 위반확률)를 넘지 않는 조건에서 태스크의 주기를 최소로 결정할 수 있어야 한다. However, in general, when the cycle of the task is shortened, the utilization rate of the system resource becomes high, and the probability that each task violates the deadline increases. Therefore, in order to increase the precision of the embedded system, it is necessary to determine the cycle of the task to a minimum under the condition that the threshold of the probability of violation of the deadline violation (probability of violation of the critical deadline violation)
그러나, 앞서 설명한 종래의 태스크 스케쥴링 방법은 태스크들의 주기가 고정되어 있는 것으로 가정하고 있으므로, 센서 입력 또는 기타 외부 입력에 빠른 시간에 반응해야 하는 임베디드 시스템에서의 태스크들의 주기를 결정하는 방법으로 사용될 수 없는바, 임베디드 시스템의 제어 정밀도를 높이고자 하는 경우에는 활용될 수 없다는 문제점이 있었다. However, since the conventional task scheduling method described above assumes that the cycles of tasks are fixed, it can not be used as a method of determining the cycle of tasks in an embedded system that must respond quickly to sensor input or other external input Bar, and embedded system in order to improve the control precision.
상기한 바와 같은 종래기술의 문제점을 해결하기 위해, 본 발명에서는 주기적으로 실행되는 복수의 태스크(Task)들이 마감시간을 위반할 확률을 낮추면서 시스템 자원의 이용률을 최대화할 수 있도록 복수의 태스크들의 주기를 설정하기 위한 태스크 주기 스케쥴링 장치 및 방법을 제안하고자 한다.In order to solve the problems of the prior art as described above, in the present invention, a plurality of tasks to be periodically executed to reduce the probability of violating the deadline while maximizing the utilization of system resources The present invention proposes an apparatus and method for scheduling a task cycle for setting.
또한, 본 발명에서는 복수의 태스크들이 주기적으로 실행되는 임베디드 시스템의 제어 정밀도를 높일 수 있도록 하는 태스크 주기 스케쥴링 장치 및 방법을 제안하고자 한다. In addition, the present invention is to propose a task cycle scheduling apparatus and method for increasing the control accuracy of the embedded system in which a plurality of tasks are periodically executed.
본 발명의 다른 목적들은 하기의 실시예를 통해 당업자에 의해 도출될 수 있을 것이다.Other objects of the present invention may be derived by those skilled in the art through the following examples.
상기한 목적을 달성하기 위해 본 발명의 바람직한 일실시예에 따르면, 주기적으로 실행되는 복수의 태스크들을 중 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 주기 설정부를 포함하되, 상기 복수의 태스크들은 미리 선정된 M(1 이상의 정수임)개의 태스크 및 상기 M개의 태스크를 제외한 나머지 태스크로 분류되고, 상기 주기 설정부는 상기 미리 선정된 M개의 태스크의 주기 중 최대값이 상기 나머지 태스크의 주기 중 최소값보다 크지 않도록 상기 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 것을 특징으로 하는 태스크 주기 스케쥴링 장치가 제공된다. According to a preferred embodiment of the present invention to achieve the above object, including a period setting unit for increasing or decreasing the period of at least one of a plurality of tasks to be executed periodically, the plurality of tasks are pre-selected Classified into M (an integer greater than or equal to 1) tasks and the remaining tasks except for the M tasks, and the period setting unit is configured such that the maximum value of the periods of the M tasks selected in advance is not greater than the minimum value of the remaining tasks. Provided is a task period scheduling apparatus for increasing or decreasing a period of at least one task.
상기 복수의 태스크는 전기/전자 장치의 동작 제어를 위한 태스크이고, 상기 미리 선정된 M개의 태스크는 상기 복수의 태스크들 중 주기 변경에 따른 상기 동작 제어의 정밀도의 변화가 큰 상위 M개의 태스크일 수 있다. The plurality of tasks may be tasks for operation control of an electric / electronic device, and the M predetermined tasks may be upper M tasks having a large change in the precision of the operation control according to a change in a period among the plurality of tasks. have.
상기 태스크 주기 스케쥴링 장치는 상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부; 및 상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N1(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중 선택하거나 또는 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N1개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부를 더 포함하되, 상기 주기 설정부는 상기 상위 N1개의 태스크 또는 상기 하위 N1개의 태스크의 주기를 증가시킬 수 있다. The task period scheduling apparatus may include: a deadline violation probability calculation unit configured to calculate a deadline violation probability of each of the plurality of tasks; And comparing a deadline violation probability of each of the computed plurality of tasks with a preset threshold, and when there is a task having a deadline violation probability greater than the threshold value, the system resource utilization rate at the time of executing the task according to the increase in the period. Selecting a lower N 1 task having a large reduction amount (an integer greater than or equal to 1) from among the plurality of tasks or a lower N 1 task having a small increase in system resource utilization when the task is executed according to a decrease in a period of the plurality of tasks. The apparatus may further include a task selection unit for selecting from among the plurality of cycles, wherein the period setting unit may increase a period of the upper N 1 tasks or the lower N 1 tasks.
상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부; 및 상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N2(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중에서 선택하거나 또는 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N2개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부를 더 포함하되, 상기 주기 설정부는 상기 하위 N2개의 태스크 또는 상기 상위 N2개의 태스크의 주기를 감소시킬 수 있다. A deadline violation probability calculator for calculating a deadline violation probability of each of the plurality of tasks; And comparing a deadline violation probability of each of the computed plurality of tasks with a preset threshold and presenting a task having a deadline violation probability smaller than the threshold value. increase a little lower N 2 (1 or more integer) of selecting a task from among the plurality of tasks or cycle the amount of reduction of the system resource utilization at the time of task execution in accordance with the increase big Top N 2 of tasks of the plurality of tasks of The apparatus may further include a task selector configured to select from among the plurality of cycles, wherein the period setting unit may reduce a period of the lower N 2 tasks or the upper N 2 tasks.
또한, 본 발명의 다른 실시예에 따르면, 주기적으로 실행되는 복수의 태스크들을 스케쥴링하는 장치에 있어서, 상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부; 상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N1(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부; 및 상기 하위 N1개의 태스크의 주기를 증가시키는 주기 설정부를 포함하는 것을 특징으로 하는 태스크 주기 스케쥴링 장치가 제공된다. In addition, according to another embodiment of the present invention, an apparatus for scheduling a plurality of tasks to be executed periodically, a deadline violation probability calculation unit for calculating a deadline violation probability of each of the plurality of tasks; When a task having a deadline violation probability greater than the threshold exists by comparing a deadline violation probability of each of the calculated plurality of tasks with a preset threshold, the amount of increase in system resource utilization when the task is executed according to a decrease in the period A task selecting unit for selecting the small lower N 1 tasks (which are integers of 1 or more) from the plurality of tasks; And a period setting unit for increasing a period of the lower N 1 tasks.
또한, 본 발명의 또 다른 실시예에 따르면, 주기적으로 실행되는 복수의 태스크들을 스케쥴링하는 장치에 있어서, 상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부; 상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N2(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부; 및 상기 상위 N1개의 태스크의 주기를 증가시키는 주기 설정부를 포함하는 것을 특징으로 하는 태스크 주기 스케쥴링 장치가 제공된다. In addition, according to another embodiment of the present invention, an apparatus for scheduling a plurality of tasks to be executed periodically, a dead time violation probability calculation unit for calculating a probability of violation of the dead time of each of the plurality of tasks; When there is a task having a deadline violation probability smaller than the threshold by comparing a deadline violation probability of each of the calculated plurality of tasks with a preset threshold, the amount of decrease in system resource utilization when the task is executed according to an increase in the period A task selection unit for selecting the large upper N 2 (which is an integer of 1 or more) tasks from the plurality of tasks; And a periodic task scheduling apparatus comprising: period setting portion for increasing the period of the higher-N 1 of the task is provided.
또한, 본 발명의 또 다른 실시예에 따르면, 주기적으로 실행되는 복수의 태스크들을 중 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 단계를 포함하되, 상기 복수의 태스크들은 미리 선정된 M(1 이상의 정수임)개의 태스크 및 상기 M개의 태스크를 제외한 나머지 태스크로 분류되고, 상기 주기 설정부는 상기 미리 선정된 M개의 태스크의 주기 중 최대값이 상기 나머지 태스크의 주기 중 최소값보다 크지 않도록 상기 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 것을 특징으로 하는 태스크 주기 스케쥴링 방법이 제공된다. Further, according to another embodiment of the present invention, the step of increasing or decreasing the period of at least one of the plurality of tasks to be executed periodically, wherein the plurality of tasks are a predetermined M (an integer equal to or greater than 1) ) Task and the remaining tasks other than the M tasks, and the period setting unit performs a period of the at least one task such that the maximum value of the periods of the M tasks selected in advance is not greater than the minimum value of the periods of the remaining tasks. Provided is a task cycle scheduling method which increases or decreases.
본 발명에 따르면, 주기적으로 실행되는 복수의 태스크들이 마감시간을 위반할 확률을 낮추면서 시스템 자원의 이용률을 최대화할 수 있도록 복수의 태스크들의 주기를 설정할 수 있게 된다. According to the present invention, it is possible to set a cycle of a plurality of tasks to maximize the utilization of system resources while lowering the probability that a plurality of periodically executed tasks violate deadlines.
또한, 본 발명에 따르면, 복수의 태스크들이 주기적으로 실행되는 임베디드 시스템의 제어 정밀도를 높일 수 있게 된다. In addition, according to the present invention, it is possible to increase the control accuracy of the embedded system in which a plurality of tasks are executed periodically.
도 1은 본 발명의 일 실시예에 따른 태스크 주기 스케쥴링 장치의 상세한 구성을 도시한 블록도이다.
도 2는 본 발명의 제1 실시예에 따른 태스크 주기 스케쥴링 방법의 전체적인 흐름을 도시한 순서도이다.
도 3은 본 발명의 제2 실시예에 따른 태스크 주기 스케쥴링 방법의 전체적인 흐름을 도시한 순서도이다.1 is a block diagram showing a detailed configuration of a task period scheduling apparatus according to an embodiment of the present invention.
2 is a flowchart illustrating the overall flow of the task cycle scheduling method according to the first embodiment of the present invention.
3 is a flowchart illustrating an overall flow of a task cycle scheduling method according to a second embodiment of the present invention.
본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.
이하에서, 본 발명에 따른 실시예들을 첨부된 도면을 참조하여 상세하게 설명한다.
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 1은 본 발명의 일 실시예에 따른 태스크 주기 스케쥴링 장치의 상세한 구성을 도시한 블록도이다. 1 is a block diagram showing a detailed configuration of a task period scheduling apparatus according to an embodiment of the present invention.
도 1에 도시된 태스크 주기 스케쥴링 장치(100)는 임베디드 시스템 등과 같이 주기적으로 복수의 태스크를 수행하는 장치에 적용되어 복수의 태스크의 주기를 설정하는데 이용될 수 있는 장치로서, 도 1을 참조하면 태스크 주기 스케쥴링 장치(100)는 주기 설정부(110), 마감시간 위반확률 연산부(120), 및 태스크 선택부(130)를 포함할 수 있다. 이하, 각 구성 요소 별로 그 기능을 상술하기로 한다. The task
주기 설정부(110)는 특정 시점 간격으로 복수의 태스크들의 주기를 설정한다. 이 때, 주기 설정부(110)는 시작 시점에서 복수의 태스크들의 초기 주기를 설정하고(즉, 복수의 태스크들의 주기를 초기화하고), 시작 시점의 이후 시점부터는 아래에서 설명하는 바와 같이 매 시점 마다 복수의 태스크들 중 하나 이상의 태스크의 주기를 갱신(증가 또는 감소)하고, 나머지 태스크의 주기를 이전 시점에서의 해당 태스크 주기로 유지함으로써 복수의 태스크들의 주기를 설정할 수 있다. The period setting
본 발명의 일 실시예에 따르면, 복수의 태스크들은 미리 선정된 M(1 이상의 정수임)개의 태스크 및 M개의 태스크를 제외한 나머지 태스크로 분류되고, 주기 설정부(110)는 미리 선정된 M개의 태스크의 주기 중 최대값이 나머지 태스크의 주기 중 최소값보다 크지 않도록 적어도 하나의 태스크의 주기를 증가 또는 감소시킬 수 있다. 이는 태스크 주기 스케쥴링 장치(100)에 의해 주기가 설정되는 태스크들이 전기/전자 장치의 동작을 제어하는데 이용되는 경우의 동작 제어의 정밀도를 일정 수준 이상 유지시키기 위함이다. 일례로서, 복수의 태스크는 전기/전자 장치의 동작 제어를 위한 태스크이고, 미리 선정된 M개의 태스크는 복수의 태스크들 중 주기 변경에 따른 동작 제어의 정밀도의 변화가 큰 상위 M개의 태스크일 수 있다. According to an embodiment of the present invention, the plurality of tasks are classified into M tasks (which are integers greater than or equal to 1) and M tasks other than M tasks, and the
예를 들어, 태스크 주기 스케쥴링 장치(100)가 적용되는 시스템이 모터 제어 시스템의 경우, 복수의 태스크들은 모터의 움직임을 제어하는데 핵심적인 태스크(주요 태스크) 및 그 외의 태스크(기타 태스크)로 분류될 수 있다. 일례로 정밀 모터 제어 시스템의 경우, 모터 액츄에이션 태스크(Motor Actuation Task), 모션 제어기(Motion Controller)로부터 모터 제어 명령을 실시간으로 수신하는 실시간 메시지 수신 태스크(Real-time Message Receive Task)등이 주요 태스크에 해당하며, 기타태스크는 비실시간 데이터 통신을 위한 비실시간 메시지 수신 태스크(Non-real-time Message Receive Task) 등이 기타 태스크에 해당할 수 있다. For example, when the system to which the task period scheduling
이 때 기타 태스크의 주기가 주요 태스크의 주기보다 짧아지게 되면 기타 태스크가 주요 태스크보다 더욱 짧은 시간 단위로 반복 수행되게 되어 모터 제어의 정밀도가 감소되게 되는 문제점이 발생할 수 있다. At this time, if the cycle of the other task becomes shorter than the cycle of the main task, the other task may be repeatedly performed in a shorter time unit than the main task, thereby reducing the precision of the motor control.
따라서, 상기와 같은 제어 정밀도의 감소를 최소화하기 위해 주기 설정부(110)는 주요 태스크를 M개의 태스크로 미리 선정하고, 주요 태스크(M개의 태스크)의 주기가 기타 태스크(나머지 태스크)의 주기보다 커지지 않도록 적어도 하나의 태스크의 주기를 변경할 수 있다. 여기서, 주기가 변경되는 적어도 하나의 태스크는 주요 태스크일 수도 있고 기타 태스크일 수도 있다. Therefore, in order to minimize the reduction in the control accuracy as described above, the
일례로서, 복수의 태스크의 개수가 4개(제1 태스크, 제2 태스크, 제3 태스크, 제4 태스크)이고, 현재 시점에서의 4개의 태스크의 주기가 [100, 200, 300, 400](μs)로 설정되어 있고, 제1 태스크가 주요 태스크이고, 제2 태스크 내지 제4 태스크가 기타 태스크인 경우에 있어, 제3 태스크의 주기를 변경하고자 하는 경우, 주기 설정부(110)는 제3 태스크의 주기가 제1 태스크의 주기(=100)보다 작아지지 않는 범위 내에서 제3 태스크의 주기를 감소시킬 수 있다. 즉, 주기 설정부(110)는 100을 하한선으로 하여 제3 태스크의 주기를 감소시킬 수 있다. As an example, the number of the plurality of tasks is four (first task, second task, third task, fourth task), and the period of four tasks at the present time is [100, 200, 300, 400] ( μs), the first task is the main task, and the second task to the fourth task is the other task, and when the period of the third task is to be changed, the
다른 일례로서, 복수의 태스크가 상기의 일례와 같이 설정되는 경우에 있어, 제1 태스크의 주기를 변경하고자 하는 경우, 주기 설정부(110)는 제1 태스크의 주기가 제2 태스크 주기 내지 제4 태스크의 주기 중 최소값(=200)보다 커지지 않는 범위 내에서 제1 태스크의 주기를 증가시킬 수 있다. 즉, 주기 설정부(110)는 200을 상한선으로 하여 제1 태스크의 주기를 증가시킬 수 있다.As another example, in the case where a plurality of tasks are set as in the above example, when the period of the first task is to be changed, the
또 다른 일례로서, 복수의 태스크가 상기의 일례와 같이 설정되는 경우에 있어, 제1 태스크 및 제2 태스크의 주기를 변경하고자 하는 경우, 주기 설정부(110)는 제1 태스크의 주기가 제2 태스크 주기 내지 제4 태스크의 주기 중 최소값보다 커지지 않는 범위 내에서 제1 태스크의 주기를 증가시킬 수 있다. 즉, 주기 설정부(110)는 100과 200 사이의 임의의 주기(일례로, 150)를 상한선으로 하여 제1 태스크의 주기를 증가시키고, 상기 100과 200 사이의 임의의 주기를 하한선으로 하여 제2 태스크의 주기를 감소시킬 수 있다. As another example, in the case where a plurality of tasks are set as in the above example, and the period of the first task and the second task is to be changed, the
마감시간 위반확률(Deadline Miss Probability) 연산부(120)는 복수의 태스크 각각에 대한 마감시간의 위반확률을 연산한다. 여기서, 마감시간이란 복수의 태스크 각각이 완료되어야 하는 최종 완료 시간을 의미하고, 마감시간 위반확률은 소정의 태스크가 수행되는 경우, 해당 태스크의 완료시간이 마감시간을 넘길 확률을 의미한다. Deadline Miss
주기 설정부(110)의 주기 설정에 따라 복수의 태스크들이 수행된다고 가정하면, 마감시간 위반확률 연산부(120)는 이전 시점에서 주기 설정부(110)에 의해 설정된 복수의 태스크들의 주기, 복수의 태스크들 각각에 대해 설정된 우선순위 및 복수의 태스크들 각각의 실행시간에 대한 확률질량함수(Probability Mass Function)에 기초하여 복수의 태스크들 각각에 대한 마감시간 위반확률을 연산할 수 있다. Assuming a plurality of tasks are performed according to the period setting of the
보다 상세하게, 마감시간 위반확률 연산부(120)는 주기적으로 실행되는 복수의 태스크들 각각의 응답 시간 분포를 정확히 계산할 수 있는 "확률적 응답 시간 분석기(Probabilistic Response Time Analyzer)"를 이용하여 복수의 태스크들의 주기, 우선순위, 및 실행시간에 대한 확률질량함수를 토대로 각 태스크의 마감시간 위반확률을 연산할 수 있다. 여기서, 확률적 응답 시간 분석기는 여러 가지가 있을 수 있으며, 일례로 2005년 11월에 IEEE Transactions on Computers 저널에 발표된 "An exact stochastic analysis of priority-driven periodic real-time systems and its approximations" 논문에서 제시된 방법에 따른 확률적 응답 시간 분석기가 사용될 수 있다. 상기의 논문에 따른 확률적 응답 시간 분석기는 각 태스크에 대해 우선순위를 부여하고 우선순위가 높은 태스크를 우선적으로 서비스하는 우선순위 스케줄링을 사용할 때, 각 태스크의 정확한 응답 시간 분포를 계산해 준다. In more detail, the deadline
그러나, 마감시간 위반확률 연산부(120)에서 이용되는 확률적 응답 시간 분석기는 이에 한정되지 않으며, 본 발명의 일 실시예에 따른 태스크 주기 스케쥴링 장치(100)가 적용되는 시스템의 태스크 모델과 스케줄링 알고리즘에 따라서 적합한 확률적 응답 시간 분석기가 이용될 수 있다. 즉, 본 발명은 확률적 응답 시간 분석기에 제한을 두지 않는다.However, the probabilistic response time analyzer used in the deadline
태스크 선택부(130)는 연산된 복수의 태스크들 각각의 마감시간 위반확률이 기 설정된 기준 마감시간 위반확률 범위에 포함되는지를 판단한다.The
그리고, 태스크 선택부(130)는 기준 마감시간 위반확률 범위에 포함되는 마감시간 위반확률을 가지는 태스크가 하나 이상 존재하는 경우, 주기를 변경할 태스크를 하나 이상 선택한다. 여기서, 주기를 변경할 태스크는 주기의 변경에 따른 태스크 실행 시의 시스템 자원 이용률의 변경 정도에 따라 선택될 수 있다. The
즉, 소정 태스크의 주기가 변경되는 경우, 전체 시스템 자원 이용률은 변경되는데, 태스크 선택부(130)는 복수의 태스크 각각의 주기 변경에 따라 다른 태스크들의 이용 가능한 시스템 자원양이 어떻게 변화하는지를 파악하고, 이용 가능한 시스템 자원양이 최대가 되도록 하기 위해 주기를 변경할 태스크를 적어도 하나 이상 선택한다. That is, when the period of a predetermined task is changed, the overall system resource utilization rate is changed, the
이 경우, 주기 설정부(110)는 선정된 하나 이상의 태스크의 주기를 변경(증가 또는 감소)시킨다. In this case, the
이하에서는 도 2 및 도 3을 참조하여 본 발명의 일 실시예에 따른 태스크 주기 스케쥴링 장치(100)의 태스크 주기 스케쥴링 동작(태스크 주기 스케쥴링 방법)을 보다 상세히 설명하기로 한다.
Hereinafter, a task cycle scheduling operation (task cycle scheduling method) of the task
먼저, 도 2는 본 발명의 제1 실시예에 따른 태스크 주기 스케쥴링 방법의 전체적인 흐름을 도시한 순서도이다. 이하, 각 단계 별로 수행되는 과정을 상술하기로 한다. First, FIG. 2 is a flowchart illustrating the overall flow of the task cycle scheduling method according to the first embodiment of the present invention. Hereinafter, a process performed in each step will be described in detail.
먼저, 단계(S210)에서 주기 설정부(110)는 복수의 태스크들의 주기를 초기화한다. First, in step S210, the
여기서, 주기 설정부(110)는 복수의 태스크에 할당 가능한 최소의 주기를 복수의 태스크들의 초기 주기로 설정할 수 있다. 즉, 주기 설정부(110)는 각 태스크가 마감시간 위반확률을 무시하고 주기로서 가질 수 있는 최소의 주기를 복수의 태스크들 각각의 초기 주기로 설정할 수 있다. Here, the
일례로서, 본 발명의 일 실시예에 따른 태스크 주기 스케쥴링 장치(100)가 적용되는 시스템이 주기적인 타이머 인터럽트에 의해서 태스크들을 깨우고 실행시키는 임베디드 시스템인 경우, 하나의 태스크의 주기는 타이머 인터럽트의 주기보다 작아질 수 없으므로, 이러한 시스템에서 주기 설정부(110)는 타이머 인터럽트의 주기와 동일하도록 복수의 태스크들 각각의 초기 주기를 설정할 수 있다. As an example, when the system to which the task
다른 일례로서, 본 발명의 일 실시예에 따른 태스크 주기 스케쥴링 장치(100)가 적용되는 시스템이 모터 제어 시스템의 경우 모터 제어 주기는 모터의 물리적인 제약 사항으로 인해 소정의 임계치보다 작아질 수 없으므로, 이러한 시스템에서 주기 설정부(110)는 물리적 제약에 따른 상기의 소정 임계치를 복수의 태스크들 각각의 초기 주기로 설정할 수 있다. As another example, when the system to which the task
다음으로, 단계(S220)에서 마감시간 위반확률 연산부(120)는 주기 설정부(110)에서 설정된 복수의 태스크들 각각의 주기, 복수의 태스크들 각각의 우선 순위 및 복수의 태스크들 각각의 실행시간의 확률질량함수에 기초하여 복수의 태스크들 각각의 마감시간 위반확률을 연산한다. 이 경우, 앞서 설명한 바와 같이 다양한 종류의 확률적 응답 시간 분석기가 마감시간 위반확률의 연산을 위해 사용될 수 있다. Next, in step S220, the deadline
계속하여, 단계(S230)에서 태스크 선택부(130)는 복수의 태스크들 각각에 대해 연산된 마감시간 위반확률과 기 설정된 임계치를 비교하여 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하는지를 판단한다. 즉, 단계(S230)에서는 0보다 크고 임계치보다 작은 범위로 설정되는 기준 마감시간 위반확률 범위에 포함되는 마감시간 위반확률을 가지는 태스크가 존재하는지를 판단한다. Subsequently, in step S230, the
만약, 단계(S230)에서 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하지 않는 것으로 판단된 경우, 이전 시점(즉, 초기 시점)에 설정된 복수의 태스크들 각각의 주기가 현재 시점의 복수의 태스크들 각각의 주기로서 그대로 유지된다. 즉, 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하지 않는 경우, 이전에 설정된 태스크들의 주기가 그대로 유지되고, 태스크 주기 스케쥴링은 종료된다. If it is determined in step S230 that there is no task having a probability of exceeding a deadline exceeding a threshold, the period of each of a plurality of tasks set at a previous time point (ie, an initial time point) is a plurality of tasks at the current time point. It is maintained as it is each cycle. In other words, when there is no task having a probability of exceeding a deadline exceeding a threshold, a period of previously set tasks is maintained and task period scheduling is terminated.
즉, 상기의 경우는 복수의 태스크들의 주기가 최소로 설정되어 이용 가능한 시스템 자원량이 최대임에도 각 태스크들이 마감시간을 위반할 확률이 기준값보다 낮음을 의미(다시 말해, 주기가 작으면서도 최대 시스템 자원 이용량을 확보할 수 있음을 의미)하므로, 해당 시스템의 제어 정밀도를 충분히 높일 수 있게 되는바, 주기 설정부(110)는 복수의 태스크들 각각의 주기를 변경시키지 않는다. That is, in the above case, even though the period of the plurality of tasks is set to the minimum, the amount of available system resources is the maximum, but the probability that each task violates the deadline is lower than the reference value (that is, the maximum system resource usage while the period is small. In this case, the control accuracy of the system can be sufficiently increased, and the
반대로, 단계(S230)에서 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하는 것으로 판단된 경우, 단계(S240)에서 태스크 선택부(130)는 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N1(1 이상의 정수임)개의 태스크(일례로서, 주기의 증가에 따른 태스크 실행시의 시스템 자원 이용률의 감소량이 최대인 하나의 태스크)를 복수의 태스크들 중에서 선택하거나 또는 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N1개의 태스크(일례로서, 주기의 감소에 따른 태스크 실행시의 시스템 자원 이용률의 증가량이 최소인 하나의 태스크)를 복수의 태스크들 중에서 선택한다. On the contrary, when it is determined in step S230 that a task having a probability of exceeding a deadline violation is greater than a threshold value, in step S240, the
계속하여, 단계(S250)에서는 선택된 N1개의 태스크들의 주기를 증가시키고 나머지 태스크들의 주기를 그대로 유지한다.In operation S250, the period of the selected N 1 tasks is increased and the period of the remaining tasks is maintained as it is.
이 때, 앞서 설명한 바와 같이 단계(S250)에서는 충분한 수준의 제어 정밀도를 보장하기 위해 미리 선정된 M개의 태스크의 주기 중 최대값이 나머지 태스크의 주기 중 최소값보다 크지 않도록 N1개의 태스크들의 주기를 증가시킬 수 있다. At this time, as described above, in step S250, the period of the N 1 tasks is increased so that the maximum value of the periods of the M predetermined tasks is not greater than the minimum value of the remaining tasks in order to ensure a sufficient level of control precision. You can.
본 발명의 일 실시예에 따르면, 시스템 자원 이용률의 감소량은 아래의 수학식 1에 따라 결정될 수 있다.
According to an embodiment of the present invention, the amount of reduction in system resource utilization may be determined according to Equation 1 below.
여기서, 는 복수의 태스크들 중에서 k번째 태스크의 시스템 자원 이용률의 감소량, 는 k번째 태스크의 주기, 는 k번째 태스크의 실행시간에 대한 확률함수의 평균(즉, 상기 k번째 태스크의 평균 실행시간), 는 k번째 태스크의 주기의 변경량(0보다 큼)을 각각 의미한다. here, Is a reduction amount of system resource utilization rate of the k th task among the plurality of tasks, Is the period of the kth task, Is the average of the probability functions for the execution time of the k th task (ie, the average execution time of the k th task), Denotes the amount of change (greater than zero) of the period of the k-th task, respectively.
그리고, 특정 태스크는 물리적인 제약으로 인해 주기를 변경할 수 없을 수 있는데, 이러한 태스크는 상기 수학식 1과 상관없이 시스템 자원 이용률의 감소량이 0으로 강제 설정될 수 있다. 따라서, 주기의 변경이 불가능한 태스크는 주기를 변경시킬 태스크로 선정될 가능성이 없게 된다. In addition, the specific task may not be able to change the period due to physical constraints. For this task, the amount of reduction in system resource utilization may be forced to 0 regardless of Equation 1 above. Therefore, a task whose cycle can not be changed is not likely to be selected as a task to change the cycle.
한편, 위와 같이 시스템 자원 이용률이 설정되는 경우, 단계(S260)에서는 만큼 k번째 태스크의 주기를 증가시킬 수 있다. On the other hand, if the system resource utilization rate is set as described above, in step S260 The period of the kth task can be increased by.
이 후, 다시 단계(S220) 및 단계(S230)가 수행되고, 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하지 않는 것으로 판단된 경우, 단계(S240) 및 단계(S250)가 반복되어 수행된다. 즉, 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하지 않는 시점까지 단계(S220) 내지 단계(S250)가 반복되어 수행된다. Thereafter, steps S220 and S230 are performed again, and if it is determined that there is no task having a probability of exceeding a deadline exceeding a threshold, steps S240 and S250 are repeatedly performed. . That is, steps S220 to S250 are repeatedly performed until a task having a deadline violation probability greater than a threshold does not exist.
요컨대, 본 발명의 제1 실시예에 따른 태스크 주기 스케쥴링 방법은 모든 태스크에 대한 마감시간 위반확률이 임계치보다 작도록 하기 위한 각 태스크의 최소 주기를 찾기 위해, 역설적으로 각 태스크가 마감시간 위반확률을 무시할 때 가질 수 있는 최소의 주기를 갖는다는 가정에서 출발하여 주기를 증가시킬 때 수반되는 시스템 자원 이용률의 감소(저하)가 가장 큰 태스크를 매번 선택하여 그 주기를 증가시킴으로써, 각 태스크의 주기 증가 횟수를 최소화한다. 선택된 태스크의 시스템 자원 이용률의 저하가 크면 클수록 다른 태스크들의 마감시간 위반확률은 더 빨리 개선되기 때문에 각 태스크가 마감시간 위반확률이 임계치보다 작아지는 순간이 보다 빨리 도래하게 되어 각 태스크의 주기 증가 횟수는 최소화되는 것이다. 결과적으로 본 발명의 제1 실시예에 따른 태스크 주기 스케쥴링 방법은 주어진 마감시간 위반확률의 임계치를 만족시키는 각 태스크의 최소 주기값을 항상 찾아낸다는 장점이 있다.
In short, the task cycle scheduling method according to the first embodiment of the present invention, paradoxically, each task has a deadline violation probability in order to find the minimum period of each task so that the deadline violation probability for all tasks is less than the threshold. Starting with the assumption that there is a minimum period that can be ignored, increasing the period each time by selecting the task with the largest decrease (decrease) in system resource utilization when increasing the period, increasing the number of periods for each task Minimize. The greater the drop in system resource utilization of the selected task, the faster the deadline violation probability of other tasks improves faster, so that each task arrives at the moment when the deadline violation probability is less than the threshold, increasing the frequency of each task. It is to be minimized. As a result, the task period scheduling method according to the first embodiment of the present invention has an advantage of always finding a minimum period value of each task satisfying a threshold of a given deadline violation probability.
다음으로, 도 3은 본 발명의 제2 실시예에 따른 태스크 주기 스케쥴링 방법의 전체적인 흐름을 도시한 순서도이다. 이하, 각 단계 별로 수행되는 과정을 상술하기로 한다. Next, FIG. 3 is a flowchart illustrating the overall flow of the task cycle scheduling method according to the second embodiment of the present invention. Hereinafter, a process performed in each step will be described in detail.
먼저, 단계(S310)에서 주기 설정부(110)는 복수의 태스크들의 주기를 초기화한다. First, in step S310, the
여기서, 주기 설정부(110)는 복수의 태스크에 할당 가능한 최대의 주기를 복수의 태스크들의 초기 주기로 설정할 수 있다. Here, the
다음으로, 단계(S320)에서 마감시간 위반확률 연산부(120)는 주기 설정부(110)에서 설정된 복수의 태스크들 각각의 주기, 복수의 태스크들 각각의 우선 순위 및 복수의 태스크들 각각의 실행시간의 확률질량함수에 기초하여 복수의 태스크들 각각의 마감시간 위반확률을 연산한다. 이 경우에도 앞서 설명한 바와 같이 다양한 종류의 확률적 응답 시간 분석기가 사용될 수 있다. Next, in step S320, the deadline violation
계속하여, 단계(S330)에서 태스크 선택부(130)는 복수의 태스크들 각각에 대해 연산된 마감시간 위반확률과 기 설정된 임계치를 비교하여 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하는지를 판단한다. 즉, 단계(S330)에서는 임계치보다 크고 1보다 작은 범위로 설정되는 기준 마감시간 위반확률 범위에 포함되는 마감시간 위반확률을 가지는 태스크가 존재하는지를 판단한다. In operation S330, the
만약, 단계(S330)에서 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하지 않는 것으로 판단된 경우, 이전 시점(즉, 초기 시점)에 설정된 복수의 태스크들 각각의 주기가 현재 시점의 복수의 태스크들 각각의 주기로서 그대로 유지되고, 태스크 주기 스케쥴링은 종료된다. If it is determined in step S330 that there is no task having a probability of violation of a deadline smaller than the threshold, the period of each of the tasks set at the previous time point (ie, the initial time point) is a plurality of tasks at the current time point. They remain intact as each period, and task period scheduling ends.
반대로, 단계(S330)에서 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하는 것으로 판단된 경우, 단계(S340)에서 태스크 선택부(130)는 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N2(1 이상의 정수임)개의 태스크(일례로서, 주기의 감소에 따른 태스크 실행시의 시스템 자원 이용률의 증가량이 최소인 하나의 태스크)를 복수의 태스크들 중에서 선택하거나 또는 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N2개의 태스크를 복수의 태스크들 중에서 선택한다. On the contrary, when it is determined in step S330 that there is a task having a probability of violation of a deadline smaller than a threshold value, in step S340, the
계속하여, 단계(S350)에서는 선택된 N2개의 태스크들의 주기를 감소시키고 나머지 태스크들의 주기를 그대로 유지한다. Subsequently, in step S350, the period of the selected N 2 tasks is decreased and the period of the remaining tasks is maintained as it is.
이 경우에도, 단계(S250)에서는 충분한 수준의 제어 정밀도를 보장하기 위해 미리 선정된 M개의 태스크의 주기 중 최대값이 나머지 태스크의 주기 중 최소값보다 크지 않도록 N2개의 태스크들의 주기를 감소시킬 수 있다. Also in this case, step (S250) in it in advance a maximum value of the cycles of the selected M number of tasks can be reduced to periods of N 2 of the task are not larger than the minimum value of the period of the remaining tasks in order to ensure a sufficient level of control precision .
본 발명의 일 실시예에 따르면, 시스템 자원 이용률의 증가량은 아래의 수학식 2에 따라 결정될 수 있다.
According to one embodiment of the present invention, the amount of increase in system resource utilization may be determined according to Equation 2 below.
여기서, 는 복수의 태스크들 중에서 k번째 태스크의 시스템 자원 이용률의 증가량, 는 k번째 태스크의 주기의 변경량(0보다 큼)을 각각 의미한다. here, Is the increase in system resource utilization of the k th task among the plurality of tasks, Denotes the amount of change (greater than zero) of the period of the k-th task, respectively.
그리고, 특정 태스크는 물리적인 제약으로 인해 주기를 변경할 수 없을 수 있는데, 이러한 태스크는 상기 수학식 2와 상관없이 시스템 자원 이용률의 감소량이 0으로 강제 설정될 수 있다. In addition, the specific task may not be able to change the period due to physical constraints. Such a task may be forced to a reduced amount of system resource utilization to 0 regardless of Equation 2 above.
한편, 위와 같이 시스템 자원 이용률이 설정되는 경우, 단계(S360)에서는 만큼 k번째 태스크의 주기를 감소시킬 수 있다. On the other hand, if the system resource utilization is set as described above, in step S360 The period of the k th task can be reduced by.
이 후, 다시 단계(S320) 및 단계(S330)이 수행되고, 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하지 않는 것으로 판단된 경우, 단계(S340) 및 단계(S350)가 반복되어 수행된다. 즉, 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하지 않는 시점까지 단계(S320) 내지 단계(S350)가 반복되어 수행된다. After that, if step S320 and step S330 are performed again, and it is determined that there is no task having a probability of violation of a deadline smaller than a threshold, steps S340 and S350 are repeated. . That is, steps S320 to S350 are repeatedly performed until there is no task having a deadline violation probability smaller than a threshold.
지금까지 본 발명에 제2 실시예에 따른 태스크 주기 스케쥴링 방법에 대하여 설명하였고, 이에 대해서는 앞서 도 2에서 설명한 본 발명의 제1 실시예에 따른 태스크 주기 스케쥴링 방법에 대한 구성이 대응되어 적용될 수 있다. 즉, 도 2에서 설명한 제1 실시예는 각 태스크가 최초 주기값을 매우 작은 값으로 갖는다는 가정에서 출발하여 각 태스크의 주기를 증가시킬 때 수반되는 시스템 자원 이용률의 저하가 가장 큰 태스크를 매번 선택하는 방식으로 동작하고, 도 3에서 설명한 제2 실시예는 각 태스크가 최초 주기값을 매우 큰 값으로 갖는다는 가정에서 출발하여 각 태스크의 주기를 감소시킬 때 수반되는 시스템 자원 이용률의 상승이 가장 작은 태스크를 매번 선택하는 방식으로 동작한다. 이에, 본 제2 실시예의 상세한 동작은 앞서 설명한 제1 실시예로부터 유추 가능하므로 보다 상세한 설명은 생략하기로 한다.The task cycle scheduling method according to the second embodiment of the present invention has been described so far, and the configuration of the task cycle scheduling method according to the first embodiment of the present invention described above with reference to FIG. 2 may be correspondingly applied. That is, the first embodiment described with reference to FIG. 2 starts from the assumption that each task has a very small initial period value, and selects a task each time that the decrease in system resource utilization is greatest when increasing the period of each task. The second embodiment described with reference to FIG. 3 starts with the assumption that each task has a very large initial period value and decreases the period of each task with the smallest increase in system resource utilization. It works by selecting a task every time. Therefore, the detailed operation of the second embodiment can be inferred from the first embodiment described above, so that a detailed description thereof will be omitted.
또한, 본 발명의 실시예들은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical), 및 롬(ROM), 램(RAM), 플래시 메모리 등을 포함하며 같은 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 본 발명의 일실시예들의 동작을 수행하기 위해 적어도 하나의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.In addition, embodiments of the present invention may be implemented in the form of program instructions that can be executed through various computer means and recorded on a computer readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be those specially designed and constructed for the present invention or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Examples of such program instructions include, but are not limited to, machine code, such as those made by a compiler, as well as an interpreter, etc., to a computer, such as a magneto-optical, magneto-optical and ROM, RAM Lt; RTI ID = 0.0 > language code. ≪ / RTI > The hardware devices described above may be configured to operate as at least one software module to perform operations of one embodiment of the present invention, and vice versa.
이상과 같이 본 발명에서는 구체적인 구성 요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나 이는 본 발명의 보다 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. 따라서, 본 발명의 사상은 설명된 실시예에 국한되어 정해져서는 아니되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등하거나 등가적 변형이 있는 모든 것들은 본 발명 사상의 범주에 속한다고 할 것이다.In the present invention as described above has been described by the specific embodiments, such as specific components and limited embodiments and drawings, but this is provided to help a more general understanding of the present invention, the present invention is not limited to the above embodiments. For those skilled in the art, various modifications and variations are possible from these descriptions. Accordingly, the spirit of the present invention should not be construed as being limited to the embodiments described, and all of the equivalents or equivalents of the claims, as well as the following claims, belong to the scope of the present invention .
100: 태스크 주기 스케쥴링 장치
110: 주기 설정부
120: 마감시간 위반확률 연산부
130: 태스크 선택부100: task cycle scheduling device
110: cycle setting unit
120: deadline violation probability calculation unit
130: task selection unit
Claims (9)
상기 복수의 태스크들은 미리 선정된 M(1 이상의 정수임)개의 태스크 및 상기 M개의 태스크를 제외한 나머지 태스크로 분류되고,
상기 주기 설정부는 상기 미리 선정된 M개의 태스크의 주기 중 최대값이 상기 나머지 태스크의 주기 중 최소값보다 크지 않도록 상기 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 것을 특징으로 하는 태스크 주기 스케쥴링 장치.Including a period setting unit for increasing or decreasing the period of at least one of the plurality of tasks to be executed periodically,
The plurality of tasks are classified into M tasks (which are integers greater than or equal to 1) and predetermined tasks other than the M tasks,
And the period setting unit increases or decreases the period of the at least one task such that a maximum value of the periods of the M tasks is not greater than a minimum value of the remaining periods of the remaining tasks.
상기 복수의 태스크는 전기/전자 장치의 동작 제어를 위한 태스크이고,
상기 미리 선정된 M개의 태스크는 상기 복수의 태스크들 중 주기 변경에 따른 상기 동작 제어의 정밀도의 변화가 큰 상위 M개의 태스크인 것을 특징으로 하는 태스크 주기 스케쥴링 장치. The method of claim 1,
The plurality of tasks is a task for controlling the operation of the electrical / electronic device,
And said M tasks selected in advance are upper M tasks with a large change in the precision of said operation control according to a change of a period among said plurality of tasks.
상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부; 및
상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N1(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중 선택하거나 또는 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N1개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부를 더 포함하되,
상기 주기 설정부는 상기 상위 N1개의 태스크 또는 상기 하위 N1개의 태스크의 주기를 증가시키는 것을 특징으로 하는 태스크 주기 스케쥴링 장치.The method of claim 1,
A deadline violation probability calculator for calculating a deadline violation probability of each of the plurality of tasks; And
When a task having a deadline violation probability greater than the threshold exists by comparing a deadline violation probability of each of the calculated plurality of tasks with a preset threshold, the amount of decrease in system resource utilization when the task is executed according to an increase in the period among the large upper N 1 (1 or more integer) of a task selection of the plurality of tasks or the amount of increase in system resource utilization at the time of task execution in accordance with the decrease in the cycle a small subset N 1 of tasks of the multiple tasks It further includes a task selection unit for selecting,
And the period setting unit increases a period of the upper N 1 tasks or the lower N 1 tasks.
상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부; 및
상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N2(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중에서 선택하거나 또는 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N2개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부를 더 포함하되,
상기 주기 설정부는 상기 하위 N2개의 태스크 또는 상기 상위 N2개의 태스크의 주기를 감소시키는 것을 특징으로 하는 태스크 주기 스케쥴링 장치.The method of claim 1,
A deadline violation probability calculator for calculating a deadline violation probability of each of the plurality of tasks; And
When a task having a deadline violation probability smaller than the threshold exists by comparing a deadline violation probability of each of the calculated plurality of tasks with a preset threshold, the amount of increase in system resource utilization when the task is executed according to a decrease in the period of these small sub-N 2 (1 or more integer) of selecting a task from among the plurality of tasks or cycle the amount of reduction of the system resource utilization at the time of task execution in accordance with the increase big Top N 2 of tasks of the plurality of tasks of It further includes a task selection unit for selecting,
And the period setting unit reduces a period of the lower N 2 tasks or the upper N 2 tasks.
상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부;
상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 큰 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 감소에 따른 태스크 실행 시의 시스템 자원 이용률의 증가량이 작은 하위 N1(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부; 및
상기 하위 N1개의 태스크의 주기를 증가시키는 주기 설정부
를 포함하는 것을 특징으로 하는 태스크 주기 스케쥴링 장치. An apparatus for scheduling a plurality of tasks that are executed periodically,
A deadline violation probability calculator for calculating a deadline violation probability of each of the plurality of tasks;
When a task having a deadline violation probability greater than the threshold exists by comparing a deadline violation probability of each of the calculated plurality of tasks with a preset threshold, the amount of increase in system resource utilization when the task is executed according to a decrease in the period A task selecting unit for selecting the small lower N 1 tasks (which are integers of 1 or more) from the plurality of tasks; And
Period setting section for increasing the period of the lower of tasks N 1
Task cycle scheduling apparatus comprising a.
상기 복수의 태스크들 각각의 마감시간 위반확률을 연산하는 마감시간 위반확률 연산부;
상기 연산된 복수의 태스크들 각각의 마감시간 위반확률과 기 설정된 임계치를 비교하여 상기 임계치보다 작은 마감시간 위반확률을 가지는 태스크가 존재하는 경우, 주기의 증가에 따른 태스크 실행 시의 시스템 자원 이용률의 감소량이 큰 상위 N2(1 이상의 정수임)개의 태스크를 상기 복수의 태스크들 중에서 선택하는 태스크 선택부; 및
상기 상위 N2개의 태스크의 주기를 증가시키는 주기 설정부
를 포함하는 것을 특징으로 하는 태스크 주기 스케쥴링 장치.An apparatus for scheduling a plurality of tasks that are executed periodically,
A deadline violation probability calculator for calculating a deadline violation probability of each of the plurality of tasks;
When there is a task having a deadline violation probability smaller than the threshold by comparing a deadline violation probability of each of the calculated plurality of tasks with a preset threshold, the amount of decrease in system resource utilization when the task is executed according to an increase in the period A task selection unit for selecting the large upper N 2 (which is an integer of 1 or more) tasks from the plurality of tasks; And
Period setting section for increasing the period of the higher N 2 of tasks
Task cycle scheduling apparatus comprising a.
상기 복수의 태스크들은 미리 선정된 M(1 이상의 정수임)개의 태스크 및 상기 M개의 태스크를 제외한 나머지 태스크로 분류되고,
상기 주기 설정부는 상기 미리 선정된 M개의 태스크의 주기 중 최대값이 상기 나머지 태스크의 주기 중 최소값보다 크지 않도록 상기 적어도 하나의 태스크의 주기를 증가 또는 감소시키는 것을 특징으로 하는 태스크 주기 스케쥴링 방법.Increasing or decreasing a period of at least one of the plurality of tasks that are executed periodically,
The plurality of tasks are classified into M tasks (which are integers greater than or equal to 1) and predetermined tasks other than the M tasks,
And the period setting unit increases or decreases the period of the at least one task such that a maximum value of periods of the M tasks is not greater than a minimum value of the remaining periods of the remaining tasks.
상기 복수의 태스크는 전기/전자 장치의 동작 제어를 위한 태스크이고,
상기 미리 선정된 M개의 태스크는 상기 복수의 태스크들 중 주기 변경에 따른 상기 동작 제어의 정밀도의 변화가 큰 상위 M개의 태스크인 것을 특징으로 하는 태스크 주기 스케쥴링 방법. The method of claim 7, wherein
The plurality of tasks is a task for controlling the operation of the electrical / electronic device,
The predetermined M task is a task cycle scheduling method, characterized in that the higher M tasks of the greater change in the precision of the operation control according to the change of the period of the plurality of tasks.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020110087754A KR101271854B1 (en) | 2011-08-31 | 2011-08-31 | Apparatus and method for scheduling task period |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020110087754A KR101271854B1 (en) | 2011-08-31 | 2011-08-31 | Apparatus and method for scheduling task period |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20130024352A KR20130024352A (en) | 2013-03-08 |
KR101271854B1 true KR101271854B1 (en) | 2013-06-07 |
Family
ID=48176435
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020110087754A KR101271854B1 (en) | 2011-08-31 | 2011-08-31 | Apparatus and method for scheduling task period |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101271854B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10394213B2 (en) | 2015-10-20 | 2019-08-27 | Lsis Co., Ltd. | Method of independent control period allocation of axis in the PLC positioning system |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101674324B1 (en) * | 2015-11-30 | 2016-11-22 | 숭실대학교산학협력단 | Task scheduling device and method for real-time control applications |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002342097A (en) * | 2001-05-17 | 2002-11-29 | Matsushita Electric Ind Co Ltd | Task allocatable time deciding device and task allocatable time deciding method |
JP2006268754A (en) * | 2005-03-25 | 2006-10-05 | Toshiba Corp | Scheduling possibility determination method, real-time system and program |
-
2011
- 2011-08-31 KR KR1020110087754A patent/KR101271854B1/en not_active IP Right Cessation
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002342097A (en) * | 2001-05-17 | 2002-11-29 | Matsushita Electric Ind Co Ltd | Task allocatable time deciding device and task allocatable time deciding method |
JP2006268754A (en) * | 2005-03-25 | 2006-10-05 | Toshiba Corp | Scheduling possibility determination method, real-time system and program |
Non-Patent Citations (2)
Title |
---|
논문1:정보과학회논문지 * |
논문2:정보과학회논문지 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10394213B2 (en) | 2015-10-20 | 2019-08-27 | Lsis Co., Ltd. | Method of independent control period allocation of axis in the PLC positioning system |
Also Published As
Publication number | Publication date |
---|---|
KR20130024352A (en) | 2013-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113254178B (en) | Task scheduling method and device, electronic equipment and readable storage medium | |
EP3438821B1 (en) | Task-resource scheduling method and device | |
CN108829521B (en) | Task processing method and device, computer equipment and storage medium | |
JP5120061B2 (en) | Priority control program, priority control apparatus, and priority control method | |
US20150295970A1 (en) | Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system | |
KR101812583B1 (en) | Apparatus or task assignment, method for task assignment and a computer-readable storage medium | |
CN102081555B (en) | Method and device for adjusting clock interrupt cycle | |
JPWO2005106623A1 (en) | CPU clock control device, CPU clock control method, CPU clock control program, recording medium, and transmission medium | |
US20170206111A1 (en) | Managing processing capacity provided to threads based upon load prediction | |
Wan et al. | Fuzzy feedback scheduling algorithm based on central processing unit utilization for a software-based computer numerical control system | |
WO2015066979A1 (en) | Machine learning method for mapreduce task resource configuration parameters | |
JP6211272B2 (en) | Kernel execution order scheduling method and apparatus | |
KR102585591B1 (en) | Slo-aware artificial intelligence inference scheduler for heterogeneous processors in edge platforms | |
CN105955809B (en) | Thread scheduling method and system | |
KR101770736B1 (en) | Method for reducing power consumption of system software using query scheduling of application and apparatus for reducing power consumption using said method | |
CN110795238B (en) | Load calculation method and device, storage medium and electronic equipment | |
CN110221909B (en) | Hadoop calculation task speculative execution method based on load prediction | |
US9588811B2 (en) | Method and apparatus for analysis of thread latency | |
JP2014521131A (en) | Multiprocessor system and energy saving method thereof | |
CN113515382A (en) | Cloud resource allocation method and device, electronic equipment and program product | |
KR101271854B1 (en) | Apparatus and method for scheduling task period | |
CN105045648A (en) | Physical host resource state forecasting method under IaaS cloud environment | |
CN103218219A (en) | Compact function trace | |
US20180217875A1 (en) | Data processing system and data processing method | |
US10846086B2 (en) | Method for managing computation tasks on a functionally asymmetric multi-core processor |
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 | ||
FPAY | Annual fee payment |
Payment date: 20170410 Year of fee payment: 5 |
|
FPAY | Annual fee payment |
Payment date: 20180409 Year of fee payment: 6 |
|
LAPS | Lapse due to unpaid annual fee |