KR20210022502A - A method for deriving an offset of a task for minimizing the load and an apparatus therefor - Google Patents

A method for deriving an offset of a task for minimizing the load and an apparatus therefor Download PDF

Info

Publication number
KR20210022502A
KR20210022502A KR1020200104127A KR20200104127A KR20210022502A KR 20210022502 A KR20210022502 A KR 20210022502A KR 1020200104127 A KR1020200104127 A KR 1020200104127A KR 20200104127 A KR20200104127 A KR 20200104127A KR 20210022502 A KR20210022502 A KR 20210022502A
Authority
KR
South Korea
Prior art keywords
task
offset
tasks
period
allocated
Prior art date
Application number
KR1020200104127A
Other languages
Korean (ko)
Other versions
KR102380175B1 (en
KR102380175B9 (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 성균관대학교산학협력단
Publication of KR20210022502A publication Critical patent/KR20210022502A/en
Application granted granted Critical
Publication of KR102380175B1 publication Critical patent/KR102380175B1/en
Publication of KR102380175B9 publication Critical patent/KR102380175B9/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
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

According to one embodiment of the present invention, a method for arranging tasks according to one embodiment of the present invention may comprise the steps of: sequentially allocating offsets in a load measurement unit to tasks having a period equal to or greater than a reference value among tasks; allocating the offsets sequentially in ascending order from the tasks having the shortest period to the tasks having a period less than the reference value among the tasks, wherein the smallest offset is allocated to a first task having the shortest period among the tasks having the period less than the reference value; and allocating the offsets based on a result of comparing the execution time of the first task period and the execution time of the second task to a second task to be allocated with the offset among the remaining tasks except for the first task of the tasks having the period less than the reference value. Therefore, the method has the effect of minimizing the number of preemptions between the tasks.

Description

부하 최소화를 위한 태스크의 오프셋 도출 방법 및 이를 위한 장치{A method for deriving an offset of a task for minimizing the load and an apparatus therefor}A method for deriving an offset of a task for minimizing the load and an apparatus therefor.

본 명세서는 태스크간 선점을 최소화하기 위해 각 태스크의 주기를 고려하여 태스크를 배치하는 방법 및 이를 위한 장치를 제안한다. The present specification proposes a method and an apparatus for arranging tasks in consideration of the period of each task in order to minimize preemption between tasks.

현재 자동차의 다기능화로 인해 하나의 ECU(Electronic Control Unit)에서 실행되는 태스크의 수가 많아졌고, 많아지는 태스크의 양만큼 ECU 내의 CPU(Central Processing Unit)에 걸리는 부하도 증가하게 되었다. 이로 인해 차량 개발자들은 급속도로 양적 증가를 보인 태스크들을 효율적으로 분배, 할당하여 CPU 부하를 줄일 수 있는 방법에 대해 연구를 활발히 진행 중이다. The number of tasks executed in one ECU (Electronic Control Unit) has increased due to the multifunctionalization of automobiles, and the load on the CPU (Central Processing Unit) in the ECU increases as the amount of tasks increases. For this reason, vehicle developers are actively researching how to reduce the CPU load by efficiently distributing and allocating tasks that have rapidly increased in quantity.

태스크 수가 많아짐에 따라 우선 순위에 따른 태스크간 선점이 발생하는데, 이는 Context Switching을 유발하여 태스크간 선점이 발생되지 않았을 때보다 많은 시간적 오버헤드를 유발한다. 따라서 이러한 태스크들이 서로 선점되는 상황을 피하기 위해 일정한 시간 간격(Offset)으로 배치하는 방법을 요구된다. As the number of tasks increases, preemption between tasks according to priority occurs, which induces Context Switching and causes more temporal overhead than when preemption between tasks does not occur. Therefore, there is a need for a method of arranging these tasks at regular time intervals (Offset) in order to avoid preemptive situations.

상술한 문제점을 해결하기 위해, 본 명세서는, 태스크간에 선점을 최소화하여 ECU의 전체 CPU 부하를 감소시켜 효율적인 사용을 가능케 하는 태스크 오프셋 설정 알고리즘을 제안한다.In order to solve the above-described problem, the present specification proposes a task offset setting algorithm that minimizes preemption between tasks and reduces the overall CPU load of the ECU, thereby enabling efficient use.

본 발명의 일 실시예에 따른 태스크들의 배치 방법에 있어서, 상기 태스크들 중 기준 값 이상의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 오프셋을 순차적으로 할당하는 단계; 상기 태스크들 중 상기 기준 값 미만의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하는 단계로서, 상기 기준 값 미만의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하는 단계; 및 상기 기준 값 미만의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 단계; 를 포함할 수 있다.A method for arranging tasks according to an embodiment of the present invention, comprising: sequentially allocating an offset in a load measurement unit to a task having a period greater than or equal to a reference value among the tasks; A step of sequentially allocating the offsets in ascending order from a task having a shortest period to a task having a period less than the reference value among the tasks, and having the shortest period among tasks having a period less than the reference value. Allocating the smallest offset to the first task; And a comparison result of the first task period and the execution time of the second task with respect to the second task to be allocated to the offset among tasks other than the first task among tasks having a period less than the reference value. Allocating the offset; It may include.

또한, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 단계는, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당하는 단계; 를 포함할 수 있다.In addition, the step of allocating the offset based on a result of comparing the execution time of the first task and the execution time of the second task, when the execution time of the second task is longer than the first task period, the second Switching a task to a standby state, and when the execution time of the second task is shorter than the first task period, allocating an offset to the second task at which preemption with another task is minimized; It may include.

또한, 상기 다른 태스크와의 선점이 최소화되도록 상기 제2 태스크에 상기 오프셋을 할당하는 단계는, 상기 제2 태스크보다 주기가 짧은 제3 태스크에 기할당되고 상기 다른 태스크와의 최소 선점 횟수를 갖는 후보 오프셋 중, 가장 큰 오프셋을 상기 제2 태스크에 할당하는 단계; 를 포함할 수 있다.In addition, the step of allocating the offset to the second task so that preemption with the other task is minimized, a candidate that is pre-allocated to a third task having a shorter period than the second task and has a minimum number of preemption with the other task Allocating a largest offset among offsets to the second task; It may include.

또한, 상기 제3 태스크는 상기 제2 태스크 바로 이전 순서에 상기 오프셋의 할당이 완료된 태스크이며, 상기 제2 태스크는, 상기 제2 태스크에 할당된 오프셋에 배치되어 있는 상기 제3 태스크 바로 뒤에 배치될 수 있다.In addition, the third task is a task in which the allocation of the offset is completed in an order immediately preceding the second task, and the second task is disposed immediately after the third task disposed at an offset allocated to the second task. I can.

또한, 상기 태스크들의 배치 방법은, 상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당하는 단계; 를 더 포함할 수 있다.In addition, the task arrangement method includes the steps of virtually allocating all offsets to the waiting state task, and allocating an offset having a minimum number of preemption with another task as a result of the virtual assignment; It may further include.

또한, 상기 태스크들 중 상기 기준 값 이상의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 상기 오프셋을 순차적으로 할당하는 단계는, 상기 기준 값 이상의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치하는 단계; 를 포함할 수 있다.In addition, the step of sequentially allocating the offset in the load measurement unit with respect to the tasks having a period greater than or equal to the reference value among the tasks, from among tasks having a period greater than or equal to the reference value, sequentially Arranging the task so that the offsets are allocated in ascending order, and the allocated offset is located in the middle of an execution time of the task to which the offset is allocated; It may include.

또한, 상기 기준 값은 상기 부하 측정 단위에 기초하여 결정될 수 있다.Also, the reference value may be determined based on the load measurement unit.

또한, 상기 기준 값 및 상기 부하 측정 단위는 가장 부하가 높은 태스크의 주기일 수 있다.In addition, the reference value and the load measurement unit may be a period of a task having the highest load.

또한, 본 발명의 다른 실시예에 따른 태스크를 배치하는 ECU(Electronic Control Unit)에 있어서, 적어도 하나의 프로세서; 및 데이터를 저장하는 메모리; 를 포함하고, 상기 적어도 하나의 프로세서는, 상기 태스크들 중 기준 값 이상의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 오프셋을 순차적으로 할당하고, 상기 태스크들 중 상기 기준 값 미만의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하되, 상기 기준 값 미만의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하고, 상기 기준 값 미만의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당할 수 있다.In addition, in the ECU (Electronic Control Unit) for arranging a task according to another embodiment of the present invention, at least one processor; And a memory for storing data. Including, wherein the at least one processor sequentially allocates an offset in a load measurement unit with respect to a task having a period greater than or equal to a reference value among the tasks, and to a task having a period less than the reference value among the tasks On the other hand, the offsets are sequentially allocated in ascending order from the task having the shortest period, but the smallest offset is allocated to the first task having the shortest period among the tasks having a period less than the reference value, and the offset is less than the reference value. Among tasks having a period, the offset may be allocated based on a result of comparing the first task period and the execution time of the second task with respect to a second task to be allocated to the offset among other tasks other than the first task. have.

또한, 상기 적어도 하나의 프로세서는, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 경우, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당할 수 있다.In addition, when allocating the offset based on a result of comparing the first task period and the execution time of the second task, the at least one processor, the execution time of the second task is less than the first task period If it is long, the second task is switched to a standby state, and if the execution time of the second task is shorter than the first task period, an offset at which preemption with other tasks is minimized may be allocated to the second task. .

또한, 상기 적어도 하나의 프로세서는, 상기 다른 태스크와의 선점이 최소화되도록 상기 제2 태스크에 상기 오프셋을 할당하는 경우, 상기 제2 태스크보다 주기가 짧은 제3 태스크에 기할당되고 상기 다른 태스크와의 최소 선점 횟수를 갖는 후보 오프셋 중, 가장 큰 오프셋을 상기 제2 태스크에 할당할 수 있다.In addition, when allocating the offset to the second task so that preemption with the other task is minimized, the at least one processor is pre-allocated to a third task having a shorter period than the second task, and Among the candidate offsets having the minimum number of preemption, the largest offset may be allocated to the second task.

또한, 상기 제3 태스크는 상기 제2 태스크 바로 이전 순서에 상기 오프셋의 할당이 완료된 태스크이며, 상기 제2 태스크는, 상기 제2 태스크에 할당된 오프셋에 배치되어 있는 상기 제3 태스크 바로 뒤에 배치될 수 있다.In addition, the third task is a task in which the allocation of the offset is completed in an order immediately preceding the second task, and the second task is disposed immediately after the third task disposed at an offset allocated to the second task. I can.

또한, 상기 적어도 하나의 프로세서는, 상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당할 수 있다.In addition, the at least one processor may virtually allocate all offsets to the waiting state task, and allocate an offset having a minimum number of preemption with another task as a result of the virtual allocation.

또한, 상기 적어도 하나의 프로세서는, 상기 태스크들 중 상기 기준 값 이상의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 상기 오프셋을 순차적으로 할당하는 경우, 상기 기준 값 이상의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치할 수 있다.In addition, when the offset is sequentially allocated in the load measurement unit to a task having a period greater than or equal to the reference value among the tasks, the at least one processor determines a shorter period among tasks having a period greater than or equal to the reference value. The offsets are sequentially allocated from a task to have in ascending order, and the tasks may be arranged so that the allocated offset is located in the middle of an execution time of the task to which the offset is allocated.

또한, 상기 기준 값은 상기 부하 측정 단위에 기초하여 결정될 수 있다.Also, the reference value may be determined based on the load measurement unit.

또한, 상기 기준 값 및 상기 부하 측정 단위는 태스크들 중에서 가장 부하가 높은 태스크의 주기일 수 있다.In addition, the reference value and the load measurement unit may be a period of a task having the highest load among tasks.

본 발명의 일 실시예에 따르면, CPU 부하가 가장 부하가 높은 태스크의 주기의 간격으로 측정되는 경우에 있어서 전체 태스크의 선점 횟수가 감소되므로 코어의 가장 부하가 높은 태스크의 주기순간 부하율 및 태스크의 응답 시간이 감소할 수 있다는 효과가 있다. According to an embodiment of the present invention, when the CPU load is measured at the interval of the cycle of the task with the highest load, the number of preemption of the entire task is reduced, so the periodic instantaneous load ratio of the task with the highest load of the core and the response of the task It has the effect that time can be reduced.

또한, 본 발명의 일 실시예에 따르면, 서로 다른 주기와 수행 시간, 우선 순위를 가진 태스크들에 대한 최적의 오프셋을 도출하므로, 태스크들간의 선점 횟수를 최소화할 수 있다는 효과가 있다.In addition, according to an embodiment of the present invention, since optimal offsets for tasks having different periods, execution times, and priorities are derived, it is possible to minimize the number of preemption between tasks.

또한, 본 발명의 일 실시예에 따르면, Context Switching Overhead 및 각 CPU core의 부하율을 감소시켜, 한정된 ECU 자원을 효율적으로 사용함으로써, 태스크를 효율적으로 분배 및 할당하여 ECU 자원을 절약할 수 있다는 효과가 있다.In addition, according to an embodiment of the present invention, it is possible to save ECU resources by efficiently distributing and allocating tasks by efficiently using limited ECU resources by reducing the context switching overhead and the load ratio of each CPU core. have.

도 1은 본 발명의 일 실시예에 따른 ECU의 태스크 배치 방법을 예시한 순서도이다.
도 2 및 3은 도 1의 태스크 배치 방법에 따른 태스크 배치 실시예를 예시한 도면이다.
1 is a flowchart illustrating a task arrangement method of an ECU according to an embodiment of the present invention.
2 and 3 are diagrams illustrating a task arrangement embodiment according to the task arrangement method of FIG. 1.

이하 설명하는 기술은 다양한 변경을 가할 수 있고 여러 가지 실시례를 가질 수 있는 바, 특정 실시례들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 이하 설명하는 기술을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 이하 설명하는 기술의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.The technology to be described below may be modified in various ways and may have various embodiments, and specific embodiments will be illustrated in the drawings and described in detail. However, this is not intended to limit the technology to be described below with respect to a specific embodiment, and it should be understood to include all changes, equivalents, or substitutes included in the spirit and scope of the technology to be described below.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 해당 구성요소들은 상기 용어들에 의해 한정되지는 않으며, 단지 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 이하 설명하는 기술의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as 1st, 2nd, A, B, etc. may be used to describe various components, but the components are not limited by the above terms, and only for the purpose of distinguishing one component from other components. Is only used. For example, a first component may be referred to as a second component, and similarly, a second component may be referred to as a first component without departing from the scope of the rights of the technology described below. The term and/or includes a combination of a plurality of related listed items or any of a plurality of related listed items.

본 명세서에서 사용되는 용어에서 단수의 표현은 문맥상 명백하게 다르게 해석되지 않는 한 복수의 표현을 포함하는 것으로 이해되어야 하고, "포함한다" 등의 용어는 설시된 특징, 개수 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함을 의미하는 것이지, 하나 또는 그 이상의 다른 특징들이나 개수, 단계 동작 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 배제하지 않는 것으로 이해되어야 한다.In terms of the terms used in the present specification, expressions in the singular should be understood as including plural expressions unless clearly interpreted differently in context, and terms such as "includes" are specified features, number steps, actions, components, It is to be understood that the presence or addition of a part or a combination thereof is meant to be present and does not preclude the possibility of the presence or addition of one or more other features or numbers, step-operating components, parts, or combinations thereof.

도면에 대한 상세한 설명을 하기에 앞서, 본 명세서에서의 구성부들에 대한 구분은 각 구성부가 담당하는 주기능 별로 구분한 것에 불과함을 명확히 하고자 한다. 즉, 이하에서 설명할 2개 이상의 구성부가 하나의 구성부로 합쳐지거나 또는 하나의 구성부가 보다 세분화된 기능별로 2개 이상으로 분화되어 구비될 수도 있다. 그리고 이하에서 설명할 구성부 각각은 자신이 담당하는 주기능 이외에도 다른 구성부가 담당하는 기능 중 일부 또는 전부의 기능을 추가적으로 수행할 수도 있으며, 구성부 각각이 담당하는 주기능 중 일부 기능이 다른 구성부에 의해 전담되어 수행될 수도 있음은 물론이다.Prior to the detailed description of the drawings, it is intended to clarify that the division of the constituent parts in the present specification is merely divided by the main function that each constituent part is responsible for. That is, two or more constituent parts to be described below may be combined into one constituent part, or one constituent part may be divided into two or more for each more subdivided function. In addition, each of the constituent units to be described below may additionally perform some or all of the functions of other constituent units in addition to its own main function, and some of the main functions of each constituent unit are different. It goes without saying that it can also be performed exclusively by.

또, 방법 또는 동작 방법을 수행함에 있어서, 상기 방법을 이루는 각 과정들은 문맥상 명백하게 특정 순서를 기재하지 않은 이상 명기된 순서와 다르게 일어날 수 있다. 즉, 각 과정들은 명기된 순서와 동일하게 일어날 수도 있고 실질적으로 동시에 수행될 수도 있으며 반대의 순서대로 수행될 수도 있다.In addition, in performing the method or operation method, each of the processes constituting the method may occur differently from the specified order unless a specific order is clearly stated in the context. That is, each of the processes may occur in the same order as the specified order, may be performed substantially simultaneously, or may be performed in the reverse order.

본 명세서는 선점을 최소화하는 효율적인 태스크 배치 방법을 수행하는 ECU에 대해 서술한다. ECU는 본 명세서에서 서술하는 태스크 배치 방법을 수행하기 위해 적어도 하나의 하드웨어적인 구성 요소(예를 들어, 프로세서 및/또는 메모리)를 포함할 수 있으며, 각 구성 요소를 이용하여 다양한 실시예를 수행할 수 있다. 따라서, 본 명세서에서 ECU를 기준으로 서술된 다양한 동작/단계들은 중복하여 서술하지 않아도 상기 적어도 하나의 구성 요소를 사용하여 수행되는 것으로 이해될 수 있다. This specification describes an ECU that performs an efficient task arrangement method that minimizes preemption. The ECU may include at least one hardware component (eg, processor and/or memory) to perform the task arrangement method described in this specification, and perform various embodiments using each component. I can. Accordingly, it may be understood that various operations/steps described on the basis of the ECU in the present specification are performed using the at least one component without being repeatedly described.

또한, OEM(Original Equipment Manufacturer)에서는 태스크들 중에서 가장 부하가 높은 태스크의 주기/단위로 부하를 측정하여, 각 태스크들 중에서 가장 부하가 높은 태스크의 주기 당 Peak 부하 수치를 판별하므로, 태스크들 중에서 가장 부가하 높은 태스크의 주기/단위로 측정되는 부하 결과값은 매우 중요한 의미를 지닌다. 따라서, 태스크들 중에서 가장 부하가 높은 태스크의 주기 당 부하율을 낮추기 위해서는 태스크들 중에서 가장 부하가 높은 태스크는 고정된 위치에서 동작되도록 오프셋이 조정되어야 하고, 그 이외의 태스크는 선점 횟수가 최소화되는 오프셋에 배치되어야 한다. 이하에서는, 이러한 오프셋 설정 기준을 고려하여 보다 효율적인 태스크 배치 방법에 대해 제안한다. In addition, the OEM (Original Equipment Manufacturer) measures the load in the cycle/unit of the task with the highest load among the tasks, and determines the peak load value per cycle of the task with the highest load among the tasks. The load result measured in the period/unit of the additional high task is very important. Therefore, in order to lower the load rate per cycle of the task with the highest load among the tasks, the offset must be adjusted so that the task with the highest load among the tasks operates at a fixed position, and the other tasks must be adjusted to the offset where the number of preemption is minimized. Should be deployed. In the following, a more efficient task arrangement method is proposed in consideration of such an offset setting criterion.

도 1은 본 발명의 일 실시예에 따른 ECU의 태스크 배치 방법을 예시한 순서도이며, 도 2 및 3은 도 1의 태스크 배치 방법에 따른 태스크 배치 실시예를 예시한 도면이다.1 is a flowchart illustrating a task arrangement method of an ECU according to an embodiment of the present invention, and FIGS. 2 and 3 are diagrams illustrating a task arrangement embodiment according to the task arrangement method of FIG. 1.

도 1의 순서도에서 적어도 하나의 단계가 삭제되거나, 새로운 단계가 추가될 수 있으며, 단계 사이의 순서가 변경될 수 있다. 이하에서는, 도 1을 중심으로 도 2 및 3을 참조하여 태스크 배치 알고리즘에 대해 상세히 후술한다.In the flowchart of FIG. 1, at least one step may be deleted or a new step may be added, and the order between steps may be changed. Hereinafter, a task placement algorithm will be described in detail with reference to FIGS. 2 and 3 with a focus on FIG. 1.

우선, ECU는 태스크들 중에서 가장 부하가 높은 태스크는, 태스크들 중에서 가장 부하가 높은 태스크의 주기/단위로 부하가 유사하게 측정되도록 균등하게 배치할 수 있다(S101). 즉, 태스크들 중에서 가장 부하가 높은 태스크는, "Tmax"의 주기로 부하 값이 균등하게 측정되도록 오프셋이 설정될 수 있다. First, the ECU may evenly arrange a task having the highest load among tasks so that the load is similarly measured in a cycle/unit of the task having the highest load among tasks (S101). That is, for the task with the highest load among the tasks, the offset may be set so that the load value is equally measured with a period of "Tmax".

예를 들어, "Tmax" 단위/주기로 부하가 균등하게 측정 결과가 나오도록, "Tmax" 주기를 갖는 태스크의 중심에(또는 태스크 수행 시간 중심에) "Tmax" 단위의 오프셋이 배치되도록 오프셋 값이 설정될 수 있다. 즉, 태스크의 중심에 "Tmax"단위의 오프셋이 설정/배치되며, 이를 통해 태스크가(보다 정확하게는, 태스크의 수행 시간이) 오프셋을 중심으로 반으로 균등하게 분할되는 효과가 발생할 수 있다. 도 2를 참조하여 설명하면, "2×Tmax" 주기의 태스크에 Tmax 오프셋이 할당된 경우, 2×Tmax 주기 태스크는 중심에 Tmax 오프셋이 위치하도록 배치될 수 있다. For example, the offset value is arranged in the center of the task with the period of "Tmax" (or the center of the task execution time) in the center of the task with the "Tmax" unit/cycle so that the measurement result is evenly measured. Can be set. That is, an offset in the unit of "Tmax" is set/arranged at the center of the task, and through this, the task (more precisely, the execution time of the task) may be equally divided in half around the offset. Referring to FIG. 2, when a Tmax offset is allocated to a task of a “2×Tmax” period, the 2×Tmax periodic task may be arranged such that a Tmax offset is located at the center.

이때, 다른 태스크와의 선점을 회피하며 주기가 작은 태스크부터 오프셋이 순차적으로 할당되되, 작은 오프셋부터 오름차순으로 할당될 수 있다. 예를 들어, 도 2와 같이 2×Tmax / 4×Tmax / 10×Tmax 주기의 태스크를 배치하는 경우, 2×Tmax -> 4×Tmax -> 10×Tmax 순서로 태스크에 오프셋이 오름차순으로 할당될 수 있다. 따라서, 2×Tmax 주기 태스크에는 Tmax 오프셋이, 4×Tmax 주기 태스크에는 Tmax 오프셋이 각각 할당될 수 있다. 10×Tmax 주기 태스크의 경우, 3×Tmax 오프셋이 할당되면 2×Tmax 주기 태스크와의 선점 문제가 발생하므로, 선점 문제가 발생하지 않는 오프셋 중 최소 오프셋 값인 4×Tmax 오프셋이 할당될 수 있다. In this case, preemption with other tasks is avoided, and offsets are sequentially allocated from tasks having a small period, but may be allocated from small offsets in ascending order. For example, in the case of arranging a task with a cycle of 2 × Tmax / 4 × Tmax / 10 × Tmax as shown in Fig. 2, the offsets will be allocated to the task in the order of 2 × Tmax -> 4 × Tmax -> 10 × Tmax. I can. Accordingly, a Tmax offset may be allocated to a 2×Tmax periodic task and a Tmax offset may be allocated to a 4×Tmax periodic task. In the case of a 10×Tmax periodic task, if a 3×Tmax offset is allocated, a preemption problem with a 2×Tmax periodic task occurs, and thus a 4×Tmax offset, which is a minimum offset value among offsets in which the preemption problem does not occur, may be allocated.

다음으로, ECU는 주기가 Tmax 이하인 태스크를 오름차순으로 배열하여, 주기가 짧은 태스크부터 오프셋을 순차적으로 지정할 수 있다(S102). 이때, ECU는 주기가 가장 짧은 태스크의 오프셋을 0으로 조정할 수 있다(S103). Next, the ECU may arrange tasks having a period of Tmax or less in ascending order, and sequentially designate an offset from a task having a short period (S102). At this time, the ECU may adjust the offset of the task with the shortest period to 0 (S103).

다음으로, ECU는 주기가 낮은 태스크부터 오름차순으로 오프셋 값을 조정을 시작할 수 있으며(S104), 오프셋 값 조정 방법은 다음과 같이 진행될 수 있다:Next, the ECU may start adjusting the offset value in ascending order from the task with a low period (S104), and the offset value adjustment method may proceed as follows:

우선, ECU는 오프셋 지정 대상 태스크의 수행 시간이 가장 주기가 짧은(즉, S103 단계에서 오프셋이 0으로 지정된) 태스크의 주기보다 긴지 여부를 판단할 수 있다(S105). First, the ECU may determine whether the execution time of the offset designation target task is longer than the period of the task having the shortest period (ie, the offset is designated as 0 in step S103) (S105).

만일, 대상 태스크의 수행 시간이 가장 주기가 짧은 태스크의 주기보다 길다고 판단된 경우, ECU는 대상 태스크를 대기 상태로 전환할 수 있다(S108). If it is determined that the execution time of the target task is longer than that of the shortest task, the ECU may switch the target task to a standby state (S108).

반대로, 대상 태스크의 수행 시간이 가장 주기가 짧은 태스크의 주기보다 짧다고 판단된 경우, ECU는 대상 태스크를 대상 태스크보다 주기가 짧은 이전 태스크(예를 들어, 대상 태스크 이전 순서에 오프셋 지정 완료된 태스크) 바로 뒤에 실행되면서, 선점이 발생되지 않는 오프셋을 검출/탐색할 수 있다(S106). 다음으로, ECU는 검출/탐색된 값 중 가장 높은 오프셋을 채택할 수 있다(S107). Conversely, if it is determined that the execution time of the target task is shorter than that of the task with the shortest period, the ECU immediately transfers the target task to the previous task with a shorter period than the target task (for example, a task that has been offset in the order before the target task) As executed later, it is possible to detect/search for an offset in which preemption does not occur (S106). Next, the ECU may adopt the highest offset among the detected/searched values (S107).

상기 S102 단계 내지 S108 단계를 도 3의 예시를 참조하여 설명하면 다음과 같다.The steps S102 to S108 will be described with reference to the example of FIG. 3 as follows.

도 3을 참조하면, 가장 짧은 주기(Tmin)를 갖는 태스크는 배치에 있어 가장 높은 우선순위를 가지는 태스크이므로, 오프셋 0이 할당되어 배치될 수 있다. 그 다음으로 주기가 짧은 2×Tmin 주기 태스크는 Tmin 태스크가 실행된 뒤 바로 실행될 수 있도록 오프셋이 지정/조정되어 배치될 수 있다. 이때, 균등하게 배치된 Tmax 이상의 주기를 지니는 태스크에 대한 선점 횟수를 줄이고자, Tmin 주기 태스크가 위치한 후보 오프셋들(0ms, ×Tmin) 중 가장 높은 오프셋(Tmin)이 2×Tmin 주기 태스크에 할당될 수 있다. 이 경우, 2×Tmin 주기 태스크는 할당된 오프셋 "Tmin" 에 배치된 ×Tmin 주기 태스크 바로 뒤에 실행될 수 있도록 배치될 수 있다. 5×Tmin 주기 태스크도 마찬가지로, Tmax 이상의 주기 태스크에 대한 선점 횟수를 고려하여, 자신보다 주기가 짧은 태스크("2×Tmin"의 주기 태스크)의 바로 뒤쪽에 배치될 수 있는 후보 오프셋들(Tmin, 3×Tmin) 중 가장 높은 오프셋(3×Tmin)이 할당될 수 있다. 태스크 실행 시간이 길어(특히, 가장 짧은 주기 태스크인 Tmin 주기 태스크의 주기보다 실행 시간이 길어) 불가피하게 선점이 발생하는 주기가 Tmax 태스크는 대기 상태로 전환되었다가, 가장 선점이 적은 횟수로 발생하는 오프셋에 배치될 수 있다. 이에 관하여는 이하에서 후술한다.Referring to FIG. 3, since a task having the shortest period Tmin is a task having the highest priority in placement, an offset 0 may be allocated and disposed. Then, the 2×Tmin periodic task, which has a short period, can be arranged with an offset specified/adjusted so that the Tmin task can be executed immediately after execution. At this time, in order to reduce the number of preemption for tasks having a period equal to or greater than Tmax, the highest offset (Tmin) among the candidate offsets (0ms, ×Tmin) where the Tmin periodic task is located will be allocated to the 2×Tmin periodic task. I can. In this case, the 2×Tmin periodic task may be arranged to be executed immediately after the×Tmin periodic task placed at the allocated offset “Tmin”. Likewise for a 5×Tmin periodic task, candidate offsets (Tmin, Tmin, which can be placed immediately behind a task with a shorter period than itself (a periodic task of “2×Tmin”)), taking into account the number of preemption for a periodic task greater than or equal to Tmax. The highest offset (3×Tmin) among 3×Tmin) may be allocated. The task execution time is long (especially, the execution time is longer than that of the Tmin periodic task, which is the shortest periodic task). Can be placed at an offset. This will be described later.

다시 도 1을 참조하면, 다음으로, ECU는 대기 상태로 전환된 태스크 외의 모든 태스크에 대한 배치(즉, 오프셋 지정/할당/조정)가 완료되었는지 판단할 수 있다(S109). 배치가 완료되지 않았다면, ECU는 다시 S104 단계로 회귀하여, 나머지 태스크들에 대한 배치를 계속하여 수행할 수 있다. 배치가 완료되었다면, ECU는 대기 상태 태스크 각각에 대해 모든 오프셋을 배치/할당하여 각 배치된/할당된 오프셋별 선점 횟수를 확인할 수 있다(즉, 최소 선점 횟수를 갖는 오프셋을 탐색)(S110). Referring back to FIG. 1, next, the ECU may determine whether all tasks other than the task switched to the standby state (ie, offset designation/allocation/adjustment) have been completed (S109). If the arrangement is not completed, the ECU may return to step S104 again and continue to perform the arrangement for the remaining tasks. If the arrangement is complete, the ECU can check the number of preemption for each assigned/allocated offset by placing/allocating all offsets for each of the standby tasks (ie, searching for an offset having the minimum preemption number) (S110).

마지막으로, 탐색 결과에 따라 각 대기 상태 태스크별로 선점 횟수가 가장 적게 오프셋을 선택/할당하여, 모든 대기 상태 태스크의 스케줄링까지 완료할 수 있다.Finally, by selecting/allocating the offset with the least number of preemption for each waiting state task according to the search result, it is possible to complete scheduling of all waiting state tasks.

상술한 본 발명을 참조해볼 때, 종래의 발명은 각 태스크별로 모든 오프셋을 가상 배치하여 나온 결과 중 최저 부하가 발생한 결과에서의 오프셋을 도출하는데, 이 경우 모든 경우의 수만큼 시뮬레이션을 돌려야 하기 때문에 시뮬레이션 시간 및 오버헤드가 크다는 문제를 갖는다. 이에 반해, 본 발명은, 특정 태스크의 오프셋은 미리 특정 오프셋으로 고정하고, 나머지 태스크에 대해서만 오프셋 도출 시뮬레이션을 수행하므로, 시뮬레이션 시간 및 오버헤드가 최소화된다는 효과가 발생한다. Referring to the present invention described above, the conventional invention derives the offset from the result of the lowest load among the results obtained by virtually arranging all offsets for each task. In this case, simulations must be performed as many times as the number of all cases. It has a problem that time and overhead are large. On the other hand, in the present invention, since the offset of a specific task is fixed to a specific offset in advance and simulation is performed for deriving the offset only for the remaining tasks, the simulation time and overhead are minimized.

본 발명에 따른 실시예는 다양한 수단, 예를 들어, 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다. 하드웨어에 의한 구현의 경우, 본 발명의 일 실시예는 하나 또는 그 이상의 ASICs(application specific integrated circuits), DSPs(digital signal processors), DSPDs(digital signal processing devices), PLDs(programmable logic devices), FPGAs(field programmable gate arrays), 프로세서, 콘트롤러, 마이크로 콘트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.The embodiment according to the present invention may be implemented by various means, for example, hardware, firmware, software, or a combination thereof. In the case of implementation by hardware, an embodiment of the present invention is one or more ASICs (application specific integrated circuits), DSPs (digital signal processors), DSPDs (digital signal processing devices), PLDs (programmable logic devices), FPGAs ( field programmable gate arrays), processors, controllers, microcontrollers, microprocessors, etc.

또한, 펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 일 실시예는 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차, 함수 등의 형태로 구현되어, 다양한 컴퓨터 수단을 통하여 판독 가능한 기록매체에 기록될 수 있다. 여기서, 기록매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 기록매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 예컨대 기록매체는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(Magnetic Media), CD-ROM(Compact Disk Read Only Memory), DVD(Digital Video Disk)와 같은 광 기록 매체(Optical Media), 플롭티컬 디스크(Floptical Disk)와 같은 자기-광 매체(Magneto-Optical Media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치를 포함한다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함할 수 있다. 이러한 하드웨어 장치는 본 발명의 동작을 수행하기 위해 하나 이상의 소프트웨어 모로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.In addition, in the case of implementation by firmware or software, an embodiment of the present invention is implemented in the form of modules, procedures, functions, etc. that perform the functions or operations described above, and is stored in a recording medium that can be read through various computer means. Can be recorded. Here, the recording medium may include a program command, a data file, a data structure, or the like alone or in combination. The program instructions recorded on the recording medium may be specially designed and constructed for the present invention, or may be known and usable to those skilled in computer software. For example, the recording medium is a magnetic medium such as a hard disk, a floppy disk, and a magnetic tape, an optical medium such as a compact disk read only memory (CD-ROM), a digital video disk (DVD), and a floppy disk. Magnetic-Optical Media such as a floptical disk, and a hardware device specially configured to store and execute program commands such as ROM, RAM, flash memory, and the like. Examples of the program instructions may include not only machine language codes such as those produced by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like. Such a hardware device may be configured to operate as one or more software modules to perform the operation of the present invention, and vice versa.

아울러, 본 발명에 따른 장치나 단말은 하나 이상의 프로세서로 하여금 앞서 설명한 기능들과 프로세스를 수행하도록 하는 명령에 의하여 구동될 수 있다. 예를 들어 그러한 명령으로는, 예컨대 JavaScript나 ECMAScript 명령 등의 스크립트 명령과 같은 해석되는 명령이나 실행 가능한 코드 혹은 컴퓨터로 판독 가능한 매체에 저장되는 기타의 명령이 포함될 수 있다. 나아가 본 발명에 따른 장치는 서버 팜(Server Farm)과 같이 네트워크에 걸쳐서 분산형으로 구현될 수 있으며, 혹은 단일의 컴퓨터 장치에서 구현될 수도 있다.In addition, the device or terminal according to the present invention may be driven by a command that causes one or more processors to perform the functions and processes described above. For example, such commands may include interpreted commands such as script commands such as JavaScript or ECMAScript commands, executable code, or other commands stored in a computer-readable medium. Furthermore, the device according to the present invention may be implemented in a distributed manner over a network, such as a server farm, or may be implemented in a single computer device.

또한, 본 발명에 따른 장치에 탑재되고 본 발명에 따른 방법을 실행하는 컴퓨터 프로그램(프로그램, 소프트웨어, 소프트웨어 어플리케이션, 스크립트 혹은 코드로도 알려져 있음)은 컴파일 되거나 해석된 언어나 선험적 혹은 절차적 언어를 포함하는 프로그래밍 언어의 어떠한 형태로도 작성될 수 있으며, 독립형 프로그램이나 모듈, 컴포넌트, 서브루틴 혹은 컴퓨터 환경에서 사용하기에 적합한 다른 유닛을 포함하여 어떠한 형태로도 전개될 수 있다. 컴퓨터 프로그램은 파일 시스템의 파일에 반드시 대응하는 것은 아니다. 프로그램은 요청된 프로그램에 제공되는 단일 파일 내에, 혹은 다중의 상호 작용하는 파일(예컨대, 하나 이상의 모듈, 하위 프로그램 혹은 코드의 일부를 저장하는 파일) 내에, 혹은 다른 프로그램이나 데이터를 보유하는 파일의 일부(예컨대, 마크업 언어 문서 내에 저장되는 하나 이상의 스크립트) 내에 저장될 수 있다. 컴퓨터 프로그램은 하나의 사이트에 위치하거나 복수의 사이트에 걸쳐서 분산되어 통신 네트워크에 의해 상호 접속된 다중 컴퓨터나 하나의 컴퓨터 상에서 실행되도록 전개될 수 있다.In addition, a computer program (also known as a program, software, software application, script or code) mounted on the device according to the present invention and executing the method according to the present invention includes a compiled or interpreted language or a priori or procedural language. It can be written in any form of programming language, and can be deployed in any form, including stand-alone programs, modules, components, subroutines, or other units suitable for use in a computer environment. Computer programs do not necessarily correspond to files in the file system. A program may be within a single file provided to the requested program, or within multiple interactive files (e.g., files that store one or more modules, subprograms, or portions of code), or parts of files that hold other programs or data. (Eg, one or more scripts stored within a markup language document). The computer program may be deployed to run on one computer or multiple computers located at one site or distributed across a plurality of sites and interconnected by a communication network.

설명의 편의를 위하여 각 도면을 나누어 설명하였으나, 각 도면에 서술되어 있는 실시예들을 병합하여 새로운 실시예를 구현하도록 설계하는 것도 가능하다. 또한, 본 발명은 상술한 바와 같이 설명된 실시예들의 구성과 방법이 한정되게 적용될 수 있는 것이 아니라, 상술한 실시예들은 다양한 변형이 이루어질 수 있도록 각 실시 예들의 전부 또는 일부가 선택적으로 조합되어 구성될 수도 있다.For convenience of explanation, each drawing has been described separately, but it is also possible to design a new embodiment by merging the embodiments described in each drawing. In addition, the present invention is not limitedly applicable to the configuration and method of the embodiments described as described above, but the above-described embodiments are configured by selectively combining all or part of each of the embodiments so that various modifications can be made. It could be.

또한, 이상에서는 바람직한 실시예에 대하여 도시하고 설명하였지만, 본 명세서는 상술한 특정의 실시예에 한정되지 아니하며, 청구 범위에서 청구하는 요지를 벗어남이 없이 당해 명세서가 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형 실시들은 본 명세서의 기술적 사상이나 전망으로부터 개별적으로 이해되어서는 안될 것이다.In addition, although preferred embodiments have been illustrated and described above, the present specification is not limited to the specific embodiments described above, and without departing from the subject matter claimed in the claims, those having ordinary knowledge in the technical field to which the specification belongs. Various modifications are possible by the person, and these modifications should not be individually understood from the technical idea or perspective of the present specification.

S101~S111: 태스크 오프셋 할당 방법S101~S111: task offset allocation method

Claims (16)

태스크들의 배치 방법에 있어서,
상기 태스크들 중 기준 값 이상의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 오프셋을 순차적으로 할당하는 단계;
상기 태스크들 중 상기 기준 값 미만의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하는 단계로서,
상기 기준 값 미만의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하는 단계; 및
상기 기준 값 미만의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 단계; 를 포함하는, 태스크 배치 방법.
In the method of arranging tasks,
Sequentially allocating offsets in units of load measurement for tasks having a period greater than or equal to a reference value among the tasks;
A step of sequentially allocating the offsets in ascending order from a task having a shortest period to a task having a period less than the reference value among the tasks,
Allocating a smallest offset to a first task having a shortest period among tasks having a period less than the reference value; And
Based on a result of comparing the first task period and the execution time of the second task with respect to the second task to be allocated to the offset among tasks other than the first task among tasks having a period less than the reference value, the Allocating an offset; Containing, task placement method.
제 1 항에 있어서,
상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 단계는,
상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고,
상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당하는 단계; 를 포함하는, 태스크 배치 방법.
The method of claim 1,
Allocating the offset based on a result of comparing the first task period and the execution time of the second task,
When the execution time of the second task is longer than the first task period, switching the second task to a standby state,
If the execution time of the second task is shorter than the first task period, allocating an offset from which preemption with other tasks is minimized to the second task; Containing, task placement method.
제 2 항에 있어서,
상기 다른 태스크와의 선점이 최소화되도록 상기 제2 태스크에 상기 오프셋을 할당하는 단계는,
상기 제2 태스크보다 주기가 짧은 제3 태스크에 기할당되고 상기 다른 태스크와의 최소 선점 횟수를 갖는 후보 오프셋 중, 가장 큰 오프셋을 상기 제2 태스크에 할당하는 단계; 를 포함하는, 태스크 배치 방법.
The method of claim 2,
Allocating the offset to the second task so that preemption with the other task is minimized,
Allocating a largest offset to the second task from among candidate offsets pre-allocated to a third task having a shorter period than the second task and having a minimum number of preemption with the other task; Containing, task placement method.
제 3 항에 있어서,
상기 제3 태스크는 상기 제2 태스크 바로 이전 순서에 상기 오프셋의 할당이 완료된 태스크이며,
상기 제2 태스크는, 상기 제2 태스크에 할당된 오프셋에 배치되어 있는 상기 제3 태스크 바로 뒤에 배치되는, 태스크 배치 방법.
The method of claim 3,
The third task is a task in which the allocation of the offset has been completed in an order immediately before the second task,
The second task is disposed immediately after the third task disposed at an offset allocated to the second task.
제 2 항에 있어서,
상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당하는 단계; 를 더 포함하는, 태스크 배치 방법.
The method of claim 2,
Virtually allocating all offsets to the waiting state task, and allocating an offset having a minimum number of preemption with another task as a result of the virtual allocation; Further comprising a, task placement method.
제 2 항에 있어서,
상기 태스크들 중 상기 기준 값 이상의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 상기 오프셋을 순차적으로 할당하는 단계는,
상기 기준 값 이상의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치하는 단계; 를 포함하는, 태스크 배치 방법.
The method of claim 2,
The step of sequentially allocating the offset in the load measurement unit for a task having a period greater than or equal to the reference value among the tasks,
Arranging the task so that the offsets are sequentially allocated in ascending order from tasks having a shorter period among tasks having a period greater than or equal to the reference value, and the allocated offset is located in the middle of an execution time of the task to which the offset is allocated; Containing, task placement method.
제 1 항에 있어서,
상기 기준 값은 상기 부하 측정 단위에 기초하여 결정되는, 태스크 배치 방법.
The method of claim 1,
The reference value is determined based on the load measurement unit.
제 2 항에 있어서,
상기 기준 값 및 상기 부하 측정 단위는 태스크들 중에서 가장 부하가 높은 태스크의 주기인, 태스크 배치 방법.
The method of claim 2,
The reference value and the load measurement unit are a period of a task having the highest load among tasks.
태스크를 배치하는 ECU(Electronic Control Unit)에 있어서,
적어도 하나의 프로세서; 및
데이터를 저장하는 메모리; 를 포함하고,
상기 적어도 하나의 프로세서는,
상기 태스크들 중 기준 값 이상의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 오프셋을 순차적으로 할당하고,
상기 태스크들 중 상기 기준 값 미만의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하되,
상기 기준 값 미만의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하고,
상기 기준 값 미만의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는, ECU.
In the ECU (Electronic Control Unit) to place the task,
At least one processor; And
A memory for storing data; Including,
The at least one processor,
For tasks having a period greater than or equal to the reference value among the tasks, offsets are sequentially allocated in units of load measurement
For tasks having a period less than the reference value among the tasks, the offsets are sequentially allocated from the task having the shortest period in ascending order,
Allocating the smallest offset to the first task having the shortest period among the tasks having a period less than the reference value,
Based on a result of comparing the first task period and the execution time of the second task with respect to the second task to be allocated to the offset among tasks other than the first task among tasks having a period less than the reference value, the Allocating the offset, ECU.
제 9 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 경우,
상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고,
상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당하는, ECU.
The method of claim 9,
The at least one processor,
When allocating the offset based on a result of comparing the first task period and the execution time of the second task,
When the execution time of the second task is longer than the first task period, switching the second task to a standby state,
When the execution time of the second task is shorter than the first task period, an offset at which preemption with another task is minimized is allocated to the second task.
제 10 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 다른 태스크와의 선점이 최소화되도록 상기 제2 태스크에 상기 오프셋을 할당하는 경우,
상기 제2 태스크보다 주기가 짧은 제3 태스크에 기할당되고 상기 다른 태스크와의 최소 선점 횟수를 갖는 후보 오프셋 중, 가장 큰 오프셋을 상기 제2 태스크에 할당하는, ECU.
The method of claim 10,
The at least one processor,
When allocating the offset to the second task so that preemption with the other task is minimized,
An ECU that allocates a largest offset to the second task among candidate offsets that are pre-allocated to a third task having a shorter period than the second task and have a minimum number of preemption with the other task.
제 11 항에 있어서,
상기 제3 태스크는 상기 제2 태스크 바로 이전 순서에 상기 오프셋의 할당이 완료된 태스크이며,
상기 제2 태스크는, 상기 제2 태스크에 할당된 오프셋에 배치되어 있는 상기 제3 태스크 바로 뒤에 배치되는, ECU.
The method of claim 11,
The third task is a task in which the allocation of the offset has been completed in an order immediately before the second task,
The second task is disposed immediately after the third task disposed at an offset allocated to the second task.
제 10 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당하는, ECU.
The method of claim 10,
The at least one processor,
All offsets are virtually allocated to the task in the standby state, and as a result of the virtual allocation, an offset having a minimum number of preemption with another task is allocated.
제 10 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 태스크들 중 상기 기준 값 이상의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 상기 오프셋을 순차적으로 할당하는 경우,
상기 기준 값 이상의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치하는, ECU.
The method of claim 10,
The at least one processor,
In the case of sequentially allocating the offset in the load measurement unit for a task having a period greater than or equal to the reference value among the tasks,
ECU, wherein the offsets are sequentially allocated in ascending order from a task having a shorter period among tasks having a period greater than or equal to the reference value, and the task is arranged so that the allocated offset is located in the middle of an execution time of the task to which the offset is allocated. .
제 9 항에 있어서,
상기 기준 값은 상기 부하 측정 단위에 기초하여 결정되는, ECU.
The method of claim 9,
The reference value is determined based on the load measurement unit.
제 9 항에 있어서,
상기 기준 값 및 상기 부하 측정 단위는 태스크들 중에서 가장 부하가 높은 태스크의 주기인, ECU.
The method of claim 9,
The reference value and the load measurement unit are a period of a task having the highest load among tasks, the ECU.
KR1020200104127A 2019-08-20 2020-08-19 A method for deriving an offset of a task for minimizing the load and an apparatus therefor KR102380175B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20190101914 2019-08-20
KR1020190101914 2019-08-20

Publications (3)

Publication Number Publication Date
KR20210022502A true KR20210022502A (en) 2021-03-03
KR102380175B1 KR102380175B1 (en) 2022-03-30
KR102380175B9 KR102380175B9 (en) 2023-02-23

Family

ID=75151243

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200104127A KR102380175B1 (en) 2019-08-20 2020-08-19 A method for deriving an offset of a task for minimizing the load and an apparatus therefor

Country Status (1)

Country Link
KR (1) KR102380175B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09282184A (en) * 1996-02-14 1997-10-31 Matsushita Electric Ind Co Ltd Task management device capable of absorbing fluctuation of execution probability accompanying rapid increase of same priority task
JP2002342097A (en) * 2001-05-17 2002-11-29 Matsushita Electric Ind Co Ltd Task allocatable time deciding device and task allocatable time deciding method
US20130055276A1 (en) * 2011-08-26 2013-02-28 Knu-Industry Cooperation Foundation Task scheduling method and apparatus
KR20150053672A (en) * 2013-11-08 2015-05-18 숭실대학교산학협력단 Apparatus and method for pipeline scheduling of motion control software on multi-processors

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09282184A (en) * 1996-02-14 1997-10-31 Matsushita Electric Ind Co Ltd Task management device capable of absorbing fluctuation of execution probability accompanying rapid increase of same priority task
JP2002342097A (en) * 2001-05-17 2002-11-29 Matsushita Electric Ind Co Ltd Task allocatable time deciding device and task allocatable time deciding method
US20130055276A1 (en) * 2011-08-26 2013-02-28 Knu-Industry Cooperation Foundation Task scheduling method and apparatus
KR20150053672A (en) * 2013-11-08 2015-05-18 숭실대학교산학협력단 Apparatus and method for pipeline scheduling of motion control software on multi-processors

Also Published As

Publication number Publication date
KR102380175B1 (en) 2022-03-30
KR102380175B9 (en) 2023-02-23

Similar Documents

Publication Publication Date Title
Viswanathan et al. {CLARINET}:{WAN-Aware} Optimization for Analytics Queries
US9513962B2 (en) Migrating a running, preempted workload in a grid computing system
CN106293893B (en) Job scheduling method and device and distributed system
US9513835B2 (en) Impact-based migration scheduling from a first tier at a source to a second tier at a destination
US8997071B2 (en) Optimized division of work among processors in a heterogeneous processing system
US9229765B2 (en) Guarantee real time processing of soft real-time operating system by instructing core to enter a waiting period prior to transferring a high priority task
JPWO2012026034A1 (en) Scheduler, multi-core processor system, and scheduling method
KR20110106716A (en) Program compiler, program installer, and program install method
EP2420930A2 (en) Apparatus and method for thread scheduling and lock acquisition order control based on deterministic progress index
US9158470B2 (en) Managing CPU resources for high availability micro-partitions
CN101065728A (en) Efficient switching between prioritized tasks
KR20130137503A (en) Apparatus for dynamic data processing using resource monitoring and method thereof
US8510529B2 (en) Method for generating program and method for operating system
KR20170023280A (en) Multi-core system and Method for managing a shared cache in the same system
KR20210022502A (en) A method for deriving an offset of a task for minimizing the load and an apparatus therefor
KR20130051076A (en) Method and apparatus for scheduling application program
US9678752B2 (en) Scheduling apparatus and method of dynamically setting the size of a rotating register
JP5776813B2 (en) Multi-core processor system, control method and control program for multi-core processor system
US11822967B2 (en) Task distribution method for minimizing preemption between tasks and apparatus for performing the same
Hahn et al. Improving user experience of android smartphones using foreground app-aware I/O management
KR102222939B1 (en) Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks
KR101674324B1 (en) Task scheduling device and method for real-time control applications
JP5187944B2 (en) Apparatus and method for executing computer usable code
US20110185365A1 (en) Data processing system, method for processing data and computer program product
US9396044B2 (en) Memory efficient thread-level speculation

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
G170 Re-publication after modification of scope of protection [patent]