KR102380175B1 - 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
KR102380175B1
KR102380175B1 KR1020200104127A KR20200104127A KR102380175B1 KR 102380175 B1 KR102380175 B1 KR 102380175B1 KR 1020200104127 A KR1020200104127 A KR 1020200104127A KR 20200104127 A KR20200104127 A KR 20200104127A KR 102380175 B1 KR102380175 B1 KR 102380175B1
Authority
KR
South Korea
Prior art keywords
task
offset
tasks
period
allocating
Prior art date
Application number
KR1020200104127A
Other languages
Korean (ko)
Other versions
KR20210022502A (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

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

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 load and an apparatus therefor

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

현재 자동차의 다기능화로 인해 하나의 ECU(Electronic Control Unit)에서 실행되는 태스크의 수가 많아졌고, 많아지는 태스크의 양만큼 ECU 내의 CPU(Central Processing Unit)에 걸리는 부하도 증가하게 되었다. 이로 인해 차량 개발자들은 급속도로 양적 증가를 보인 태스크들을 효율적으로 분배, 할당하여 CPU 부하를 줄일 수 있는 방법에 대해 연구를 활발히 진행 중이다. Due to the multifunctionality of the current automobile, the number of tasks executed in one ECU (Electronic Control Unit) has increased, and the load applied to the CPU (Central Processing Unit) within the ECU increases as the number of tasks increases. As a result, vehicle developers are actively researching ways to reduce 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 causes context switching, which incurs more time overhead than when preemption between tasks does not occur. Therefore, in order to avoid a situation in which these tasks are preempted from each other, a method of arranging them at regular time intervals (Offset) is required.

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

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

또한, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 단계는, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당하는 단계; 를 포함할 수 있다.In addition, the allocating the offset based on a result of comparing the execution time of the first task period and the second task may include: when the execution time of the second task is longer than the first task period, the second converting 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 that minimizes preemption with other tasks to the second task; may include

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

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

또한, 상기 태스크들의 배치 방법은, 상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당하는 단계; 를 더 포함할 수 있다.The method of arranging the tasks includes: allocating virtually all offsets to the tasks in the standby state, and allocating offsets having a minimum number of preemptions with other tasks as a result of the virtual assignment; may further include.

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

또한, 본 발명의 다른 실시예에 따른 태스크를 배치하는 ECU(Electronic Control Unit)에 있어서, 적어도 하나의 프로세서; 및 데이터를 저장하는 메모리; 를 포함하고, 상기 적어도 하나의 프로세서는, 상기 태스크들 중 기준 값 이상의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 오프셋을 순차적으로 할당하고, 상기 태스크들 중 상기 기준 값 미만의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하되, 상기 기준 값 미만의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하고, 상기 기준 값 미만의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당할 수 있다.In addition, in an ECU (Electronic Control Unit) for arranging tasks 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 to a task having a period equal to or greater than a reference value among the tasks, and assigns an offset to a task having a period less than the reference value among the tasks. In relation to, the offsets are sequentially allocated in ascending order from the task having the shortest period, and the smallest offset is allocated to the first task having the shortest period among tasks having a period less than the reference value, and less than the reference value. The offset may be allocated based on a result of comparing the execution time of the first task period and the second task with respect to the second task to be allocated the offset among the remaining tasks except the first task among the tasks having a period. there is.

또한, 상기 적어도 하나의 프로세서는, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 경우, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고, 상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당할 수 있다.In addition, when the at least one processor allocates the offset based on a result of comparing the first task period and the execution time of the second task, the execution time of the second task is longer than the first task period If it is long, the second task may be switched to a standby state, and if the execution time of the second task is shorter than the first task period, an offset that minimizes preemption with other tasks may be assigned 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 that of the second task and is associated with the other task. Among the candidate offsets having the minimum number of preemptions, the largest offset may be allocated to the second task.

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

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

또한, 상기 적어도 하나의 프로세서는, 상기 태스크들 중 상기 기준 값 이상의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 상기 오프셋을 순차적으로 할당하는 경우, 상기 기준 값 이상의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치할 수 있다.In addition, the at least one processor is configured to select a shorter period among tasks having a period equal to or greater than the reference value when sequentially allocating the offset in the load measurement unit to a task having a period equal to or greater than the reference value among the tasks. The offsets may be sequentially allocated in ascending order from the task having the offset, and the tasks may be arranged such that the allocated offset is located in the middle of the 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 all tasks is reduced. 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, there is an effect that the number of preemptions between tasks can be minimized.

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

도 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 can apply various changes and can have various embodiments, and specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the technology described below to specific embodiments, and it should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the technology described below.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 해당 구성요소들은 상기 용어들에 의해 한정되지는 않으며, 단지 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 이하 설명하는 기술의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.Terms such as first, second, A, and B 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 used only as For example, a first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component without departing from the scope of the present invention. and/or includes a combination of a plurality of related listed items or any of a plurality of related listed items.

본 명세서에서 사용되는 용어에서 단수의 표현은 문맥상 명백하게 다르게 해석되지 않는 한 복수의 표현을 포함하는 것으로 이해되어야 하고, "포함한다" 등의 용어는 설시된 특징, 개수 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함을 의미하는 것이지, 하나 또는 그 이상의 다른 특징들이나 개수, 단계 동작 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 배제하지 않는 것으로 이해되어야 한다.In terms of terms used herein, the singular expression should be understood to include the plural expression unless the context clearly dictates otherwise, and terms such as "comprises" refer to the described feature, number step, operation, component, It is to be understood that the presence of parts or combinations thereof does not exclude the possibility of the presence or addition of one or more other features or numbers, step operation components, parts or combinations thereof.

도면에 대한 상세한 설명을 하기에 앞서, 본 명세서에서의 구성부들에 대한 구분은 각 구성부가 담당하는 주기능 별로 구분한 것에 불과함을 명확히 하고자 한다. 즉, 이하에서 설명할 2개 이상의 구성부가 하나의 구성부로 합쳐지거나 또는 하나의 구성부가 보다 세분화된 기능별로 2개 이상으로 분화되어 구비될 수도 있다. 그리고 이하에서 설명할 구성부 각각은 자신이 담당하는 주기능 이외에도 다른 구성부가 담당하는 기능 중 일부 또는 전부의 기능을 추가적으로 수행할 수도 있으며, 구성부 각각이 담당하는 주기능 중 일부 기능이 다른 구성부에 의해 전담되어 수행될 수도 있음은 물론이다.Prior to a detailed description of the drawings, it is intended to clarify that the classification of the constituent parts in the present specification is merely a division according to the main function each constituent unit is responsible for. That is, two or more components to be described below may be combined into one component, or one component 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 the main function it is responsible for. Of course, it may be carried out by being dedicated to it.

또, 방법 또는 동작 방법을 수행함에 있어서, 상기 방법을 이루는 각 과정들은 문맥상 명백하게 특정 순서를 기재하지 않은 이상 명기된 순서와 다르게 일어날 수 있다. 즉, 각 과정들은 명기된 순서와 동일하게 일어날 수도 있고 실질적으로 동시에 수행될 수도 있으며 반대의 순서대로 수행될 수도 있다.In addition, in performing the method or method of operation, each process constituting the method may occur differently from the specified order unless a specific order is clearly described in context. That is, each process may occur in the same order as specified, 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, a processor and/or memory) to perform the task arrangement method described in this specification, and various embodiments may be performed using each component. can Accordingly, various operations/steps described with reference to the ECU in this specification may be understood to be performed using the at least one component without overlapping descriptions.

또한, 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 each task, so it is the most Load The result value of the load measured in the period/unit of the high task has a very important meaning. 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 are set at the offset that minimizes the number of preemptions. should be placed Hereinafter, a more efficient task arrangement method is proposed in consideration of the offset setting criteria.

도 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을 참조하여 태스크 배치 알고리즘에 대해 상세히 후술한다.At least one step in the flowchart of FIG. 1 may be deleted or a new step may be added, and the order between steps may be changed. Hereinafter, a task arrangement 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 equally arrange the task with the highest load among the tasks so that the load is similarly measured in the cycle/unit of the task with the highest load among the tasks ( S101 ). That is, in the task with the highest load among the tasks, the offset may be set so that the load value is equally measured in a cycle of "Tmax".

예를 들어, "Tmax" 단위/주기로 부하가 균등하게 측정 결과가 나오도록, "Tmax" 주기를 갖는 태스크의 중심에(또는 태스크 수행 시간 중심에) "Tmax" 단위의 오프셋이 배치되도록 오프셋 값이 설정될 수 있다. 즉, 태스크의 중심에 "Tmax"단위의 오프셋이 설정/배치되며, 이를 통해 태스크가(보다 정확하게는, 태스크의 수행 시간이) 오프셋을 중심으로 반으로 균등하게 분할되는 효과가 발생할 수 있다. 도 2를 참조하여 설명하면, "2×Tmax" 주기의 태스크에 Tmax 오프셋이 할당된 경우, 2×Tmax 주기 태스크는 중심에 Tmax 오프셋이 위치하도록 배치될 수 있다. For example, the offset value is set so that the offset in “Tmax” is placed at the center of the task with the “Tmax” cycle (or at the center of the task execution time) so that the load is evenly measured in units/cycle of “Tmax”. can be set. That is, an offset of "Tmax" unit is set/arranged at the center of the task, and through this, the effect of equally dividing the task (more precisely, the execution time of the task) in half based on the offset may occur. Referring to FIG. 2 , when a Tmax offset is assigned to a task of a “2×Tmax” period, the 2×Tmax periodic task may be arranged such that the Tmax offset is positioned 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, while avoiding preemption with other tasks, offsets may be sequentially allocated from a task having a small period, and allocated in an ascending order from a small offset. For example, when arranging a task with a period of 2 × Tmax / 4 × Tmax / 10 × Tmax as shown in Fig. 2, offsets are allocated to tasks in ascending order in the order of 2 × Tmax -> 4 × Tmax -> 10 × Tmax. 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 10xTmax periodic task, if a 3xTmax offset is allocated, a preemption problem with a 2xTmax periodic task occurs. Therefore, a 4xTmax offset, which is the minimum offset value among the offsets in which the preemption problem does not occur, may be allocated.

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

다음으로, ECU는 주기가 낮은 태스크부터 오름차순으로 오프셋 값을 조정을 시작할 수 있으며(S104), 오프셋 값 조정 방법은 다음과 같이 진행될 수 있다:Next, the ECU may start to adjust the offset value in an ascending order from a task having a low cycle ( 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 task to be assigned an offset is longer than the cycle of the task having the shortest cycle (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 the cycle 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 the cycle of the task with the shortest cycle, the ECU sets the target task to the previous task with a shorter cycle than the target task (for example, the task with an offset specified in the previous sequence of the target task). As it is 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/discovered values (S107).

상기 S102 단계 내지 S108 단계를 도 3의 예시를 참조하여 설명하면 다음과 같다.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 the task having the shortest period Tmin is the task having the highest priority in the arrangement, the offset 0 may be allocated and arranged. Next, the 2×Tmin periodic task with the shorter period may be arranged with an offset specified/adjusted so that it can be executed immediately after the Tmin task is executed. At this time, in order to reduce the number of preemptions for tasks having a period equal to or greater than Tmax, the highest offset (Tmin) among the candidate offsets (0ms, ×Tmin) in which the Tmin periodic task is located is allocated to the 2 × Tmin periodic task. can In this case, the 2×Tmin periodic task may be arranged to be executed immediately after the ×Tmin periodic task placed at the assigned offset “Tmin”. Similarly for the 5×Tmin periodic task, in consideration of the number of preemptions for the periodic task greater than or equal to Tmax, candidate offsets (Tmin, Tmin, 3xTmin), the highest offset (3xTmin) may be allocated. Because the task execution time is long (especially, the execution time is longer than the cycle of the Tmin periodic task, which is the shortest periodic task), the cycle in which the preemption occurs inevitably occurs when the Tmax task is switched to the standby state, and the preemption occurs the fewest times. It may be placed at an offset. This will be described later below.

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

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

상술한 본 발명을 참조해볼 때, 종래의 발명은 각 태스크별로 모든 오프셋을 가상 배치하여 나온 결과 중 최저 부하가 발생한 결과에서의 오프셋을 도출하는데, 이 경우 모든 경우의 수만큼 시뮬레이션을 돌려야 하기 때문에 시뮬레이션 시간 및 오버헤드가 크다는 문제를 갖는다. 이에 반해, 본 발명은, 특정 태스크의 오프셋은 미리 특정 오프셋으로 고정하고, 나머지 태스크에 대해서만 오프셋 도출 시뮬레이션을 수행하므로, 시뮬레이션 시간 및 오버헤드가 최소화된다는 효과가 발생한다. Referring to the present invention described above, the conventional invention derives the offset from the result with the lowest load among the results obtained by imagining all the offsets for each task. There is a problem that time and overhead are large. In contrast, in the present invention, since the offset of a specific task is fixed to a specific offset in advance, and offset derivation simulation is performed 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), 프로세서, 콘트롤러, 마이크로 콘트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.Embodiments 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 provides one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), FPGAs ( field programmable gate arrays), a processor, a controller, a microcontroller, a microprocessor, and the like.

또한, 펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 일 실시예는 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차, 함수 등의 형태로 구현되어, 다양한 컴퓨터 수단을 통하여 판독 가능한 기록매체에 기록될 수 있다. 여기서, 기록매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 기록매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 예컨대 기록매체는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(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 a module, procedure, function, etc. that performs the functions or operations described above, and is stored in a recording medium readable through various computer means. can be recorded. Here, the recording medium may include a program command, a data file, a data structure, etc. alone or in combination. The program instructions recorded on the recording medium may be specially designed and configured for the present invention, or may be known and available to those skilled in the art of computer software. For example, the recording medium includes a magnetic medium such as a hard disk, a floppy disk, and a magnetic tape, an optical recording medium such as a compact disk read only memory (CD-ROM), a digital video disk (DVD), and a floppy disk. Magneto-Optical Media, such as a disk, and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions may include high-level language codes that can be executed by a computer using an interpreter or the like as well as machine language codes such as those generated by a compiler. Such hardware devices may be configured to operate as one or more software modules to perform the operations 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 to cause one or more processors to perform the functions and processes described above. For example, such instructions may include interpreted instructions, such as script instructions, such as JavaScript or ECMAScript instructions, or executable code or other instructions stored on a computer-readable medium. Furthermore, the device according to the present invention may be implemented in a distributed manner across a network, such as a server farm, or may be implemented in a single computer device.

또한, 본 발명에 따른 장치에 탑재되고 본 발명에 따른 방법을 실행하는 컴퓨터 프로그램(프로그램, 소프트웨어, 소프트웨어 어플리케이션, 스크립트 혹은 코드로도 알려져 있음)은 컴파일 되거나 해석된 언어나 선험적 혹은 절차적 언어를 포함하는 프로그래밍 언어의 어떠한 형태로도 작성될 수 있으며, 독립형 프로그램이나 모듈, 컴포넌트, 서브루틴 혹은 컴퓨터 환경에서 사용하기에 적합한 다른 유닛을 포함하여 어떠한 형태로도 전개될 수 있다. 컴퓨터 프로그램은 파일 시스템의 파일에 반드시 대응하는 것은 아니다. 프로그램은 요청된 프로그램에 제공되는 단일 파일 내에, 혹은 다중의 상호 작용하는 파일(예컨대, 하나 이상의 모듈, 하위 프로그램 혹은 코드의 일부를 저장하는 파일) 내에, 혹은 다른 프로그램이나 데이터를 보유하는 파일의 일부(예컨대, 마크업 언어 문서 내에 저장되는 하나 이상의 스크립트) 내에 저장될 수 있다. 컴퓨터 프로그램은 하나의 사이트에 위치하거나 복수의 사이트에 걸쳐서 분산되어 통신 네트워크에 의해 상호 접속된 다중 컴퓨터나 하나의 컴퓨터 상에서 실행되도록 전개될 수 있다.Further, a computer program (also known as a program, software, software application, script or code) mounted on the device according to the invention and executing the method according to the invention includes 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. A computer program does not necessarily correspond to a file in a file system. A program may be in a single file provided to the requested program, or in multiple interacting files (eg, files that store one or more modules, subprograms, or portions of code), or portions 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 be executed on a single computer or multiple computers located at one site or distributed over a plurality of sites and interconnected by a communication network.

설명의 편의를 위하여 각 도면을 나누어 설명하였으나, 각 도면에 서술되어 있는 실시예들을 병합하여 새로운 실시예를 구현하도록 설계하는 것도 가능하다. 또한, 본 발명은 상술한 바와 같이 설명된 실시예들의 구성과 방법이 한정되게 적용될 수 있는 것이 아니라, 상술한 실시예들은 다양한 변형이 이루어질 수 있도록 각 실시 예들의 전부 또는 일부가 선택적으로 조합되어 구성될 수도 있다.Although each drawing is described separately for convenience of description, it is also possible to design to implement a new embodiment by merging the embodiments described in each drawing. In addition, the present invention is not limited to the configuration and method of the described embodiments as described above, but the above-described embodiments are configured by selectively combining all or part of each embodiment so that various modifications can be made. it might 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 those of ordinary skill in the art to which the specification belongs without departing from the gist of the claims Various modifications are possible by a person, of course, and these modifications should not be individually understood from the technical spirit or perspective of the present specification.

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

Claims (16)

ECU(Electronic Control Unit)에 의해 수행되는 태스크들의 배치 방법에 있어서,
상기 ECU가 상기 태스크들 중 기준 값 초과의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 부하가 균등하게 배치되도록 오프셋을 순차적으로 할당하는 단계;
상기 ECU가 상기 태스크들 중 상기 기준 값 이하의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하는 단계로서,
상기 ECU가 상기 기준 값 이하의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하는 단계; 및
상기 ECU가 상기 기준 값 이하의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 단계; 를 포함하고,
상기 기준 값 및 상기 부하 측정 단위는 태스크들 중에서 OEM(Original Equipment Manufacturer)에 의한 부하 측정의 대상인 가장 부하가 높은 태스크의 주기인, 태스크 배치 방법.
A method of arranging tasks performed by an Electronic Control Unit (ECU), the method comprising:
sequentially allocating, by the ECU, an offset to a task having a period exceeding a reference value, among the tasks, such that loads are evenly distributed in a load measurement unit;
sequentially allocating, by the ECU, the offset to a task having a period less than or equal to the reference value among the tasks in ascending order from a task having the shortest period;
allocating, by the ECU, a smallest offset to a first task having a shortest period among tasks having a period equal to or less than the reference value; and
The ECU compares the first task period and the execution time of the second task with respect to the second task to be the offset assignment among the remaining tasks except for the first task among the tasks having a period less than or equal to the reference value. allocating the offset based on; including,
The reference value and the load measurement unit are a period of a task with the highest load that is a target of load measurement by an original equipment manufacturer (OEM) among tasks.
제 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 comprises:
When the execution time of the second task is longer than the first task period, the second task is switched to a standby state,
allocating an offset that minimizes preemption with other tasks to the second task when the execution time of the second task is shorter than the first task period; Including, task placement method.
제 2 항에 있어서,
상기 다른 태스크와의 선점이 최소화되도록 상기 제2 태스크에 상기 오프셋을 할당하는 단계는,
상기 제2 태스크보다 주기가 짧은 제3 태스크에 기할당되고 상기 다른 태스크와의 최소 선점 횟수를 갖는 후보 오프셋 중, 가장 큰 오프셋을 상기 제2 태스크에 할당하는 단계; 를 포함하는, 태스크 배치 방법.
3. The method of claim 2,
Allocating the offset to the second task so that preemption with the other task is minimized comprises:
allocating a largest offset to the second task among candidate offsets previously assigned to a third task having a shorter period than the second task and having a minimum number of preemptions with the other tasks; Including, task placement method.
제 3 항에 있어서,
상기 제3 태스크는 상기 제2 태스크 바로 이전 순서에 상기 오프셋의 할당이 완료된 태스크이며,
상기 제2 태스크는, 상기 제2 태스크에 할당된 오프셋에 배치되어 있는 상기 제3 태스크 바로 뒤에 배치되는, 태스크 배치 방법.
4. The method of claim 3,
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 assigned to the second task.
제 2 항에 있어서,
상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당하는 단계; 를 더 포함하는, 태스크 배치 방법.
3. The method of claim 2,
virtually allocating all offsets to the tasks in the standby state, and allocating offsets having a minimum number of preemptions with other tasks as a result of the virtual assignment; Further comprising, task placement method.
제 2 항에 있어서,
상기 태스크들 중 상기 기준 값 초과의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 부하가 균등하게 배치되도록 상기 오프셋을 순차적으로 할당하는 단계는,
상기 기준 값 초과의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치하는 단계; 를 포함하는, 태스크 배치 방법.
3. The method of claim 2,
The step of sequentially allocating the offset so that the load is evenly distributed in the load measurement unit with respect to the task having a period exceeding the reference value among the tasks,
arranging the task so that the offset is sequentially allocated in ascending order from among the tasks having a period exceeding the reference value, from a task having a shorter period, and the allocated offset is located in the middle of the execution time of the task to which the offset is allocated ; Including, task placement method.
삭제delete 삭제delete 태스크를 배치하는 ECU(Electronic Control Unit)에 있어서,
적어도 하나의 프로세서; 및
데이터를 저장하는 메모리; 를 포함하고,
상기 적어도 하나의 프로세서는,
상기 태스크들 중 기준 값 초과의 주기를 갖는 태스크에 대하여, 부하 측정 단위로 부하가 균등하게 배치되도록 오프셋을 순차적으로 할당하고,
상기 태스크들 중 상기 기준 값 이하의 주기를 갖는 태스크에 대하여, 가장 짧은 주기를 가지는 태스크부터 오름차순으로 상기 오프셋을 순차적으로 할당하되,
상기 기준 값 이하의 주기를 갖는 태스크 중 가장 짧은 주기를 갖는 제1 태스크에 가장 작은 오프셋을 할당하고,
상기 기준 값 이하의 주기를 갖는 태스크 중 상기 제1 태스크를 제외한 나머지 태스크 중 상기 오프셋 할당 대상인 제2 태스크에 대하여, 상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하며,
상기 기준 값 및 상기 부하 측정 단위는 태스크들 중에서 OEM(Original Equipment Manufacturer)에 의한 부하 측정의 대상인 가장 부하가 높은 태스크의 주기인, ECU.
In an ECU (Electronic Control Unit) for arranging a task,
at least one processor; and
memory for storing data; including,
The at least one processor,
Among the tasks, offsets are sequentially allocated so that loads are evenly distributed in a unit of load measurement with respect to a task having a period exceeding the reference value,
Among the tasks, the offset is sequentially allocated in ascending order from the task having the shortest period to a task having a period less than or equal to the reference value,
Allocating the smallest offset to the first task having the shortest period among the tasks having a period less than or equal to 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 the offset allocation among the remaining tasks except for the first task among the tasks having a period equal to or less than the reference value, the first task period and the execution time of the second task Allocate an offset,
The reference value and the load measurement unit are a cycle of a task with the highest load that is a target of load measurement by an original equipment manufacturer (OEM) among tasks.
제 9 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 제1 태스크 주기 및 상기 제2 태스크의 수행 시간을 비교한 결과를 기초로 상기 오프셋을 할당하는 경우,
상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 긴 경우, 상기 제2 태스크를 대기 상태로 전환하고,
상기 제2 태스크의 수행 시간이 상기 제1 태스크 주기보다 짧은 경우, 다른 태스크와의 선점이 최소화되는 오프셋을 상기 제2 태스크에 할당하는, ECU.
10. 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, the second task is switched to a standby state,
and when the execution time of the second task is shorter than the first task period, an offset at which preemption with other tasks is minimized is allocated to the second task.
제 10 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 다른 태스크와의 선점이 최소화되도록 상기 제2 태스크에 상기 오프셋을 할당하는 경우,
상기 제2 태스크보다 주기가 짧은 제3 태스크에 기할당되고 상기 다른 태스크와의 최소 선점 횟수를 갖는 후보 오프셋 중, 가장 큰 오프셋을 상기 제2 태스크에 할당하는, ECU.
11. 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,
and assigning a largest offset to the second task among candidate offsets previously assigned to a third task having a shorter period than the second task and having a minimum number of preemptions with the other tasks.
제 11 항에 있어서,
상기 제3 태스크는 상기 제2 태스크 바로 이전 순서에 상기 오프셋의 할당이 완료된 태스크이며,
상기 제2 태스크는, 상기 제2 태스크에 할당된 오프셋에 배치되어 있는 상기 제3 태스크 바로 뒤에 배치되는, ECU.
12. The method of claim 11,
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 assigned to the second task.
제 10 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 대기 상태의 태스크에 대하여 모든 오프셋을 가상 할당하고, 상기 가상 할당한 결과 다른 태스크와의 최소 선점 횟수를 갖는 오프셋을 할당하는, ECU.
11. The method of claim 10,
The at least one processor,
Virtually allocating all offsets to the task in the standby state, and assigning an offset having a minimum number of preemptions with other tasks as a result of the virtual assignment.
제 10 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 태스크들 중 상기 기준 값 초과의 주기를 갖는 태스크에 대하여, 상기 부하 측정 단위로 부하가 균등하게 배치되도록 상기 오프셋을 순차적으로 할당하는 경우,
상기 기준 값 초과의 주기를 갖는 태스크 중 짧은 주기를 갖는 태스크부터 순차적으로 상기 오프셋이 오름차순으로 할당되되, 상기 오프셋이 할당되는 태스크의 수행 시간 중간에 상기 할당된 오프셋이 위치하도록 상기 태스크를 배치하는, ECU.
11. The method of claim 10,
The at least one processor,
Among the tasks, when the offset is sequentially allocated to a task having a period exceeding the reference value, so that the load is evenly distributed in the load measurement unit,
Disposing the task so that the offset is sequentially allocated in ascending order, starting with a task having a shorter period among tasks having a period exceeding the reference value, and the allocated offset is located in the middle of the execution time of the task to which the offset is allocated, ECU.
삭제delete 삭제delete
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 KR20210022502A (en) 2021-03-03
KR102380175B1 true 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 (2)

* Cited by examiner, † Cited by third party
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
US20130055276A1 (en) 2011-08-26 2013-02-28 Knu-Industry Cooperation Foundation Task scheduling method and apparatus

Family Cites Families (2)

* 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
KR101567795B1 (en) * 2013-11-08 2015-11-11 숭실대학교산학협력단 Apparatus and method for pipeline scheduling of motion control software on multi-processors

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
US20130055276A1 (en) 2011-08-26 2013-02-28 Knu-Industry Cooperation Foundation Task scheduling method and apparatus

Also Published As

Publication number Publication date
KR20210022502A (en) 2021-03-03
KR102380175B9 (en) 2023-02-23

Similar Documents

Publication Publication Date Title
CN106775977B (en) Task scheduling method, device and system
JP2550864B2 (en) Decentralized control method and apparatus for job execution
CN106293893B (en) Job scheduling method and device and distributed system
US8875151B2 (en) Load balancing method and apparatus in symmetric multi-processor system
US20090025004A1 (en) Scheduling by Growing and Shrinking Resource Allocation
US9588818B2 (en) Parallel computer system and method for allocating jobs to calculation nodes
CN111596927B (en) Service deployment method and device and electronic equipment
US20180219794A1 (en) Deploying a cloud service with capacity reservation followed by activation
US20170039091A1 (en) Vehicle Control Apparatus
US9152457B2 (en) Processing request management
CN106775975B (en) Process scheduling method and device
KR20130137503A (en) Apparatus for dynamic data processing using resource monitoring and method thereof
KR102380175B1 (en) A method for deriving an offset of a task for minimizing the load and an apparatus therefor
US8510529B2 (en) Method for generating program and method for operating system
US9740530B2 (en) Decreasing the priority of a user based on an allocation ratio
JP5146134B2 (en) Compile processing device, access pattern change processing method, and processing program
KR20170023280A (en) Multi-core system and Method for managing a shared cache in the same system
US20190079972A1 (en) System and method for parallel query processing based on jit compilation
US9170839B2 (en) Method for job scheduling with prediction of upcoming job combinations
CN104700255B (en) Multi-process processing method, device and system
CN105373430A (en) System for dynamic allocation of compiler and method thereof
KR101867960B1 (en) Dynamically reconfigurable apparatus for operating system in manycore system and method of the same
US11822967B2 (en) Task distribution method for minimizing preemption between tasks and apparatus for performing the same
KR101998278B1 (en) Scheduling apparatus and method for dynamically setting rotating register size
KR101869325B1 (en) Core allocation apparatus in different multi-core

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]