KR102222939B1 - Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks - Google Patents

Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks Download PDF

Info

Publication number
KR102222939B1
KR102222939B1 KR1020190101913A KR20190101913A KR102222939B1 KR 102222939 B1 KR102222939 B1 KR 102222939B1 KR 1020190101913 A KR1020190101913 A KR 1020190101913A KR 20190101913 A KR20190101913 A KR 20190101913A KR 102222939 B1 KR102222939 B1 KR 102222939B1
Authority
KR
South Korea
Prior art keywords
preemption
task
specific task
ecu
section
Prior art date
Application number
KR1020190101913A
Other languages
Korean (ko)
Other versions
KR102222939B9 (en
KR20210022426A (en
Inventor
전재욱
문준영
김도연
조민희
박재완
Original Assignee
성균관대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 성균관대학교산학협력단 filed Critical 성균관대학교산학협력단
Priority to KR1020190101913A priority Critical patent/KR102222939B1/en
Priority to US16/998,372 priority patent/US11822967B2/en
Publication of KR20210022426A publication Critical patent/KR20210022426A/en
Application granted granted Critical
Publication of KR102222939B1 publication Critical patent/KR102222939B1/en
Publication of KR102222939B9 publication Critical patent/KR102222939B9/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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition

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)
  • Mobile Radio Communication Systems (AREA)

Abstract

본 발명의 일 실시예에 따른 태스크 배치 방법에 있어서, 주기가 짧은 태스크부터 순차적으로 최소 오프셋에 가상 배치하는 단계; 특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생한 경우, 선점 횟수를 제1 선점 횟수로서 저장하고, 상기 특정 태스크를 태스크가 배치되지 않은 미배치 구간에 오프셋 오름차순으로 가상 배치하여 선점 미발생 구간을 탐색하는 단계; 상기 탐색 결과 상기 선점 미발생 구간이 탐색된 경우, 상기 특정 태스크를 분할하지 않고, 상기 선점 미발생 구간에 상기 특정 태스크를 배치하는 단계; 상기 탐색 결과 상기 선점 미발생 구간이 탐색되지 않은 경우: 상기 특정 태스크를 분할하지 않고 상기 미배치 구간에 오프셋 오름차순으로 가상 배치한 결과 획득한 최소 선점 횟수를 제2 선점 횟수로서 저장하고, 상기 태스크를 더 작은 단위인 러너블(runnable) 단위로 분할하여 가상 배치한 결과 획득한 최소 선점 횟수를 제3 선점 횟수로서 저장하는 단계; 및 상기 제3 선점 횟수와 상기 제1 및 제2 선점 횟수를 비교하고, 상기 비교 결과에 기초하여 상기 특정 태스크를 배치하는 단계; 를 포함할 수 있다.In the task arrangement method according to an embodiment of the present invention, the step of virtually placing the task at a minimum offset sequentially from the task having a short period; If preemption occurs for another task during virtual arrangement for a specific task, the number of preemption is stored as the first preemption number, and the specific task is virtually placed in an unplaced section in which the task is not placed in an ascending offset to the preemption non-occurrence section. Searching for; If the search result of the search for the preemption non-occurrence section, not dividing the specific task and placing the specific task in the preemption non-occurrence section; When the search result of the search result of the non-preemption section not being searched: The minimum number of preemption obtained as a result of virtually placing the specific task in an ascending offset order without dividing the specific task is stored as a second preemption number, and the task is Dividing into a smaller unit, a runnable unit, and storing the minimum number of preemption obtained as a result of virtual placement as a third preemption number; And comparing the third preemption count with the first and second preemption counts, and arranging the specific task based on the comparison result. It may include.

Figure R1020190101913
Figure R1020190101913

Description

태스크의 러너블 그룹 단위 분할을 통한 선점 최소화 방법 및 이를 위한 장치{Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks}Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks}

본 명세서는 태스크 배치 성능 향상을 위해 태스크간 선점을 최소화하기 위한 태스크 분배 방법 및 이를 수행하는 장치를 제안한다. The present specification proposes a task distribution method for minimizing preemption between tasks in order to improve task placement performance and an apparatus for performing the same.

최근 차량내의 기능 증가로 인해 자동차 전자 제어기(ECU: Electronic Control Unit)가 수행하는 태스크의 수가 많아짐에 따라, 태스크를 효율적으로 분배, 할당하는 기술의 필요성이 대두되고 있다. 그 결과, 제한된 ECU 자원과 환경으로 많은 수의 태스크를 처리하기 위해 멀티 코어 ECU의 도입 등이 논의되고 있다.In recent years, as the number of tasks performed by an electronic control unit (ECU) increases due to an increase in in-vehicle functions, the need for a technology for efficiently distributing and allocating tasks has emerged. As a result, the introduction of multi-core ECUs to handle a large number of tasks with limited ECU resources and environments is being discussed.

특히, 차량 ECU의 경우, 처리 주기, 실행 시간, 우선 순위가 서로 상이한 태스크들을 가장 최적화되도록 분배할 필요가 있다. 이러한 상황에서 실행 시간이 긴 태스크는 우선 순위가 높은 태스크에 의해 선점되는 경우가 발생할 수 있으며, 이러한 선점 현상으로 인해 Context Switching이 발생하고, 그에 따른 오버헤드에 유발되어 CPU(Central Processing Unit) 부하 증가로 인한 비효율적인 ECU 사용이 발생된다.In particular, in the case of a vehicle ECU, it is necessary to distribute tasks having different processing cycles, execution times, and priorities to be most optimized. In this situation, a task with a long execution time may be preempted by a task with a higher priority. Context switching occurs due to this preemption, and the overhead is caused to increase the CPU (Central Processing Unit) load. This results in inefficient ECU use.

기존 멀티 코어 시스템에서의 우선 순위 관계에 기초한 태스크 스케쥴링은, 태스크의 상호 실행순서 관계에 기반하여 각 태스크의 대한 데드라인을 수정하고, 이에 따른 태스크의 실제 실행 순서를 결정하여 멀티코어 환경에서 분할하여 배치한다. 이는, 멀티 코어 환경에서 태스크 단위의 배치로는 최적화된 알고리즘이라고 볼 수 있지만, 태스크 이하의 단위, 즉 러너블(runnable) 단위까지 고려한 디테일한 알고리즘이라고 보기는 어렵다. 따라서 수행시간이 긴 태스크의 경우 필연적으로 다른 태스크에 의해 선점 현상이 발생할 수밖에 없고, 이에 따른 Context Switching 오버헤드가 발생하여 비효율적인 ECU 사용을 초래한다. Task scheduling based on the priority relationship in the existing multi-core system is divided in a multi-core environment by modifying the deadline for each task based on the relationship of the mutual execution order of the tasks, and determining the actual execution order of the tasks accordingly. To place. In a multi-core environment, this can be viewed as an optimized algorithm in terms of task unit arrangement, but it is difficult to regard it as a detailed algorithm that considers a unit below a task, that is, a runnable unit. Therefore, in the case of a task with a long execution time, preemption occurs by other tasks inevitably, resulting in context switching overhead, resulting in inefficient ECU use.

상술한 기존 기술의 문제점을 해결하고자, 본 발명에서는 태스크간 선점을 최소화하기 위하여, 각 태스크의 우선 순위, 수행 시간을 고려하여 태스크를 분배할 뿐 아니라, 수행 시간이 긴 태스크를 러너블(runnable) 그룹 단위로 분할 및 재배치하여 새로운 태스크를 생성, 재분배하는 알고리즘을 제시한다.In order to solve the problems of the existing technology described above, in the present invention, in order to minimize preemption between tasks, not only tasks are distributed in consideration of the priority and execution time of each task, but also tasks with a long execution time are runnable. We propose an algorithm that creates and redistributes new tasks by dividing and rearranging them in groups.

본 발명의 일 실시예에 따른 태스크 배치 방법에 있어서, 주기가 짧은 태스크부터 순차적으로 최소 오프셋에 가상 배치하는 단계; 특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생한 경우, 선점 횟수를 제1 선점 횟수로서 저장하고, 상기 특정 태스크를 태스크가 배치되지 않은 미배치 구간에 오프셋 오름차순으로 가상 배치하여 선점 미발생 구간을 탐색하는 단계; 상기 탐색 결과 상기 선점 미발생 구간이 탐색된 경우, 상기 특정 태스크를 분할하지 않고, 상기 선점 미발생 구간에 상기 특정 태스크를 배치하는 단계; 상기 탐색 결과 상기 선점 미발생 구간이 탐색되지 않은 경우: 상기 특정 태스크를 분할하지 않고 상기 미배치 구간에 오프셋 오름차순으로 가상 배치한 결과 획득한 최소 선점 횟수를 제2 선점 횟수로서 저장하고, 상기 태스크를 더 작은 단위인 러너블(runnable) 단위로 분할하여 가상 배치한 결과 획득한 최소 선점 횟수를 제3 선점 횟수로서 저장하는 단계; 및 상기 제3 선점 횟수와 상기 제1 및 제2 선점 횟수를 비교하고, 상기 비교 결과에 기초하여 상기 특정 태스크를 배치하는 단계; 를 포함할 수 있다.In the task arrangement method according to an embodiment of the present invention, the step of virtually placing the task at a minimum offset sequentially from the task having a short period; If preemption occurs for another task during virtual arrangement for a specific task, the number of preemption is stored as the first preemption number, and the specific task is virtually placed in an unplaced section in which the task is not placed in an ascending offset to the preemption non-occurrence section. Searching for; If the search result of the search for the preemption non-occurrence section, not dividing the specific task and placing the specific task in the preemption non-occurrence section; When the search result of the search result of the non-preemption section not being searched: The minimum number of preemption obtained as a result of virtually placing the specific task in an ascending offset order without dividing the specific task is stored as a second preemption number, and the task is Dividing into a smaller unit, a runnable unit, and storing the minimum number of preemption obtained as a result of virtual placement as a third preemption number; And comparing the third preemption count with the first and second preemption counts, and arranging the specific task based on the comparison result. It may include.

또한, 상기 비교 결과에 기초하여 상기 특정 태스크를 배치하는 단계는, 상기 제3 선점 횟수가 상기 제1 및 제2 선점 횟수보다 적은 경우, 상기 제3 선점 횟수를 획득했던 가상 배치 방식으로 상기 특정 태스크를 상기 러너블 단위로 분할하여 배치하는 단계; 및 상기 제3 선점 횟수가 상기 제1 또는 제2 선점 횟수와 차이가 없거나 상기 제1 또는 제2 선점 횟수보다 큰 경우, 상기 제1 또는 제2 선점 횟수 중 작은 선점 횟수를 획득했던 가상 배치 방식으로 상기 특정 태스크를 배치하는 단계; 를 포함할 수 있다.In addition, the step of arranging the specific task based on the comparison result may include, when the number of third preemption is less than the number of first and second preemption, the specific task is a virtual arrangement method in which the third number of preemption is acquired. Dividing and arranging them into the runnable units; And when the third preemption number is not different from the first or second preemption number or is greater than the first or second preemption number, a virtual arrangement method in which a smaller number of preemption among the first or second preemption times is obtained. Placing the specific task; It may include.

또한, 상기 특정 태스크는, GGP(Global graph partitioning) 알고리즘을 기반으로 상기 러너블 단위로 분할될 수 있다.In addition, the specific task may be divided into the runable unit based on a global graph partitioning (GGP) algorithm.

또한, 상기 특정 태스크가 상기 러너블 단위로 분할되어 생성된 복수의 러너블 그룹들 간에는 상호 연관성이 존재하지 않고 독립적일 수 있다.In addition, a plurality of runable groups generated by dividing the specific task into the runable unit may not have a mutual relationship and may be independent.

또한, 상기 러너블 단위로 분할하여 가상 배치를 수행하는 단계는, 상기 복수의 러너블 그룹들 중 가장 수행 시간이 긴 러너블 그룹부터 순차적으로 가상 배치를 수행하는 단계; 를 포함할 수 있다.In addition, the step of performing the virtual arrangement by dividing into the runable units may include sequentially performing the virtual arrangement from the runable group having the longest execution time among the plurality of runable groups; It may include.

또한, 상기 태스크 배치 방법은, 특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생하지 않은 경우, 상기 특정 태스크가 가상 배치된 구간 중 가장 긴 구간에 상기 특정 태스크를 배치하는 단계; 를 더 포함할 수 있다.In addition, the task arrangement method may include, when preemption for another task does not occur among virtual arrangements for a specific task, placing the specific task in a longest section among sections in which the specific task is virtually arranged; It may further include.

또한, 상기 주기가 짧을수록 태스크의 우선 순위가 높게 설정될 수 있다.In addition, the shorter the period, the higher the priority of the task may be set.

또한, 본 발명의 다른 실시예에 따른 태스크를 배치하는 ECU(Electronic Control Unit)에 있어서, 적어도 하나의 프로세서; 및 데이터를 저장하는 메모리; 를 포함하고, 상기 적어도 하나의 프로세서는, 주기가 짧은 태스크부터 순차적으로 최소 오프셋에 가상 배치하고, 특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생한 경우, 선점 횟수를 상기 메모리에 제1 선점 횟수로서 저장하고, 상기 특정 태스크를 태스크가 배치되지 않은 미배치 구간에 오프셋 오름차순으로 가상 배치하여 선점 미발생 구간을 탐색하고, 상기 탐색 결과 상기 선점 미발생 구간이 탐색된 경우, 상기 특정 태스크를 분할하지 않고, 상기 선점 미발생 구간에 상기 특정 태스크를 배치하고, 상기 탐색 결과 상기 선점 미발생 구간이 탐색되지 않은 경우: 상기 특정 태스크를 분할하지 않고 상기 미배치 구간에 오프셋 오름차순으로 가상 배치한 결과 획득한 최소 선점 횟수를 상기 메모리에 제2 선점 횟수로서 저장하고, 상기 태스크를 더 작은 단위인 러너블(runnable) 단위로 분할하여 가상 배치한 결과 획득한 최소 선점 횟수를 상기 메모리에 제3 선점 횟수로서 저장하고, 상기 제3 선점 횟수와 상기 제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, the virtually arranged at the minimum offset sequentially from a task having a short period, and when preemption occurs for another task among virtual arrangements for a specific task, the number of preemption is first preempted in the memory. Stored as a number of times, the specific task is virtually placed in an unplaced section in which a task is not placed in an ascending order of offset to search for a preemption non-occurring section, and if the preemptive non-occurring section is searched, the specific task is divided In case the specific task is placed in the preemption non-occurrence section and the search result is not found in the preemption non-occurrence section: Obtains the result of virtually placing the specific task in the unplaced section in ascending offset order without dividing the specific task One minimum number of preemption is stored in the memory as a second preemption number, and the minimum number of preemption obtained as a result of virtually placing the task by dividing the task into a smaller unit, a runnable unit, is used as the third number of preemption in the memory. Store, compare the third preemption count with the first and second preemption times, and place the specific task based on the comparison result.

또한, 상기 적어도 하나의 프로세서는, 상기 비교 결과에 기초하여 상기 특정 태스크를 배치하는 경우, 상기 제3 선점 횟수가 상기 제1 및 제2 선점 횟수보다 적으면, 상기 제3 선점 횟수를 획득했던 가상 배치 방식으로 상기 특정 태스크를 상기 러너블 단위로 분할하여 배치하고, 상기 제3 선점 횟수가 상기 제1 또는 제2 선점 횟수와 차이가 없거나 상기 제1 또는 제2 선점 횟수보다 크면, 상기 제1 또는 제2 선점 횟수 중 작은 선점 횟수를 획득했던 가상 배치 방식으로 상기 특정 태스크를 배치할 수 있다.In addition, the at least one processor, when arranging the specific task based on the comparison result, if the third preemption count is less than the first and second preemption counts, the virtual If the specific task is divided and arranged in an arrangement method by the runnable unit, and the third preemption count is not different from the first or second preemption count or is greater than the first or second preemption count, the first or The specific task may be arranged in a virtual arrangement method in which a small number of preemption is obtained among the second preemption number.

또한, 상기 특정 태스크는, GGP(Global graph partitioning) 알고리즘을 기반으로 상기 러너블 단위로 분할될 수 있다.In addition, the specific task may be divided into the runable unit based on a global graph partitioning (GGP) algorithm.

또한, 상기 특정 태스크가 상기 러너블 단위로 분할되어 생성된 복수의 러너블 그룹들 간에는 상호 연관성이 존재하지 않고 독립적일 수 있다.In addition, a plurality of runable groups generated by dividing the specific task into the runable unit may not have a mutual relationship and may be independent.

또한, 상기 적어도 하나의 프로세서는, 상기 러너블 단위로 분할하여 가상 배치를 수행하는 경우, 상기 복수의 러너블 그룹들 중 가장 수행 시간이 긴 러너블 그룹부터 순차적으로 가상 배치를 수행할 수 있다.In addition, when performing virtual placement by dividing the at least one processor into the runable unit, the virtual placement may be sequentially performed from a runable group having a longest execution time among the plurality of runable groups.

또한, 상기 적어도 하나의 프로세서는, 특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생하지 않은 경우, 상기 특정 태스크가 가상 배치된 구간 중 가장 긴 구간에 상기 특정 태스크를 배치할 수 있다.In addition, the at least one processor may place the specific task in the longest section of the section in which the particular task is virtually placed, when preemption for another task does not occur among the virtual arrangements for the specific task.

또한, 상기 주기가 짧을수록 태스크의 우선 순위가 높게 설정될 수 있다.In addition, the shorter the period, the higher the priority of the task may be set.

본 발명의 일 실시예에 따르면, 서로 다른 주기, 수행 시간, 우선 순위를 가진 태스크들 간의 상호 선점 횟수를 최소화하여 이로 인해 유발되는 Context Switching에 따른 오버헤드를 최소화할 수 있다. According to an embodiment of the present invention, it is possible to minimize the overhead caused by context switching caused by minimizing the number of mutual preemption between tasks having different periods, execution times, and priorities.

또한, 본 발명의 일 실시예에 따르면, 태스크 단위의 선점 최소화 배치뿐 아니라 태스크를 구성하는 러너블 그룹들을 GGP(Global graph partitioning) 알고리즘으로 분할하여 다른 태스크로 재배치할 수 있어 태스크 배치를 최적화할 수 있다. In addition, according to an embodiment of the present invention, not only the preemption minimization arrangement of the task unit, but also the runnable groups constituting the task can be divided by the GGP (Global Graph Partitioning) algorithm and rearranged into other tasks, thereby optimizing the task arrangement. have.

또한, 본 발명의 일 실시예에 따르면, 러너블 단위의 분할에도 선점 횟수 감소 효과가 없을 경우, 기존의 태스크 단위의 배치 방법을 다시 채택 가능하여 보다 유연한 알고리즘을 제공할 수 있다는 효과를 가진다. In addition, according to an embodiment of the present invention, when there is no effect of reducing the number of preemption even in division of the runnable unit, the existing task unit arrangement method can be re-adopted, thereby providing a more flexible algorithm.

또한, 본 발명의 일 실시예에 따르면, ECU 내에서 태스크들 상호간의 선점으로 인한 오버헤드의 최소화가 가능하므로, 한정된 ECU 자원을 효과적으로 사용할 수 있다는 효과를 가진다.In addition, according to an embodiment of the present invention, since it is possible to minimize overhead due to preemption between tasks in the ECU, limited ECU resources can be effectively used.

도 1은 본 발명의 일 실시예에 따른 태스크 배치 알고리즘을 예시한 순서도이다.
도 2 내지 도 7은 도 1의 태스크 배치 알고리즘에 따른 태스크 배치 알고리즘의 실시예를 도시한 도면이다.
1 is a flowchart illustrating a task placement algorithm according to an embodiment of the present invention.
2 to 7 are diagrams illustrating an embodiment of a task placement algorithm according to the task placement algorithm 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.

도 1은 본 발명의 일 실시예에 따른 태스크 배치 알고리즘을 예시한 순서도이며, 도 2 내지 도 5는 도 1의 태스크 배치 알고리즘에 따른 태스크 배치 알고리즘의 실시예를 도시한 도면이다. 1 is a flowchart illustrating a task placement algorithm according to an embodiment of the present invention, and FIGS. 2 to 5 are diagrams illustrating an embodiment of a task placement algorithm according to the task placement algorithm of FIG. 1.

도 1의 순서도에서 적어도 하나의 단계가 삭제되거나, 새로운 단계가 추가될 수 있으며, 단계 사이의 순서가 변경될 수 있다. 이하에서는, 도 1을 중심으로 도 2 내지 도 5를 참조하여 태스크 배치 알고리즘에 대해 상세히 후술한다.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 arrangement algorithm will be described in detail with reference to FIGS. 2 to 5 centering on FIG. 1.

도 1을 참조하면, 우선 ECU는 각 태스크 주기 및 수행 시간에 관한 정보를 입력할 수 있다(S101). Referring to FIG. 1, first, the ECU may input information on each task period and execution time (S101).

다음으로, ECU는 주기가 짧은 태스크부터 순차적으로 오프셋을 최소화하면서 가상으로 배치할 수 있다(S102). 보다 상세하게는, ECU는 수행 주기가 짧은 태스크일수록 우선 순위가 높음을 전제로 태스크를 가상 배치할 수 있다(Rate-monotonic 방식). 이에 따라, ECU는 주기가 짧은 태스크부터 순차적으로(즉, 우선 순위에 따라) 작은 오프셋(예를 들어, ms 단위)부터 가상 배치를 시작한다. Next, the ECU can be placed virtually while minimizing the offset sequentially from the task with a short period (S102). In more detail, the ECU may virtually place the task on the premise that the task with a shorter execution cycle has a higher priority (Rate-monotonic method). Accordingly, the ECU starts virtual placement from a small offset (eg, in ms) sequentially (ie, according to priority) from a task with a short period.

ECU는 가상 배치를 수행하면서 선점이 발생하는지 여부를 판단할 수 있다(S103). The ECU may determine whether preemption occurs while performing the virtual arrangement (S103).

만일, 태스크를 순차적으로 가상 배치하는 도중 선점이 발생하지 않으면, ECU는 태스크를 더 작은 단위인 러너블 단위로 분할하지 않는 미분할 할당 방법을 선택(S114)하여 태스크 배치를 계속하여 배치할 수 있다(S115). 이때, ECU는 오프셋을 최소화하여 태스크를 배치하는데, 이는 후속으로 배치될 다른 태스크의 배치 공간을 최대한 확보하기 위함이다. 모든 태스크의 배치가 완료되면, ECU는 태스크 배치 절차를 종료할 수 있다(S116).If preemption does not occur while tasks are sequentially virtually arranged, the ECU may select a differential allocation method that does not divide the tasks into smaller units, such as runable units (S114), and can continue to arrange tasks. (S115). At this time, the ECU arranges the task by minimizing the offset, in order to secure as much space as possible for the other tasks to be placed subsequently. When all tasks are arranged, the ECU may end the task arrangement procedure (S116).

반대로 특정 태스크 배치 도중 선점이 발생한 경우, 해당 태스크에 대한 선점 횟수를 (메모리에) 저장할 수 있다(S104). 예를 들어, 도 2에 도시한 바와 같이, 10ms 주기 태스크(201)의 0ms 오프셋 가상 배치 시, 2개의 1ms 주기 태스크(202) 및 1개의 2ms 주기 태스크(203)에 의한 선점이 발생한 경우, ECU는 N1=3을 저장할 수 있다. 나아가, ECU는 태스크가 미배치된 모든 구간의 정보(T1 내지 T5)를 도 2와 같이 저장/입력하고, 저장/입력된 구간 정보를 기초로 해당 태스크를 모든 구간에 가상 배치할 수 있다(S104). 즉, ECU는 오프셋을 재설정하여(예를 들어, 태스크가 배치되는 오프셋을 기설정된 길이만큼 증가시켜) 가상 배치를 수행할 수 있다. Conversely, when preemption occurs during a specific task arrangement, the number of preemption for the task may be stored (in a memory) (S104). For example, as shown in FIG. 2, when preemption occurs by two 1ms periodic tasks 202 and one 2ms periodic task 203, when the 0ms offset virtual arrangement of the 10ms periodic task 201 occurs, the ECU Can store N1=3. Furthermore, the ECU may store/input information (T1 to T5) of all sections in which a task is not placed as shown in FIG. 2, and virtually place the task in all sections based on the stored/input section information (S104). ). That is, the ECU may perform virtual placement by resetting the offset (eg, increasing the offset at which the task is disposed by a preset length).

다음으로, ECU는 가상 배치 결과, 태스크에 대한 선점이 발생하는지 여부를 판단할 수 있으며(S105), 판단 결과를 기초로 태스크를 더 작은 단위인 러너블 단위로 분할하여 할당할지(S106 내지 S116) 또는 분할하지 않고 할당할지(S114 내지 S116) 여부를 결정할 수 있다.Next, the ECU can determine whether the virtual arrangement result and preemption for the task occurs (S105), and whether to divide and allocate the task into smaller units, which are runable units, based on the determination result (S106 to S116). Alternatively, it may be determined whether to allocate without dividing (S114 to S116).

예를 들어, 도 4에 도시한 바와 같이, 특정 태스크(401)를 다른 태스크의 선점을 회피하여 최소 오프셋인 1ms에 배치 시, 해당 특정 태스크(401)에 대하여 1ms 주기 태스크 및 2ms 태스크에 의한 2회의 선점이 발생할 수 있다. 이때, ECU는 선점 횟수를 저장(N1=2)할 수 있으며, 다른 태스크가 미배치된 구간의 정보를 저장할 수 있다. 또한, ECU는 저장한 미배치 구간들에 대하여 해당 특정 태스크(401)의 가상 배치를 수행하여 미선점 구간이 있는지 여부를 판단할 수 있다. 가상 배치의 결과로 선점이 발생하지 않은 경우가 발견되는 경우, ECU는 해당 특정 태스크(401)가 미선점으로 배치될 수 있는 구간 중 가장 짧은 구간을 선택하여 배치를 결정/완료할 수 있다. 이는, 후속으로 배치될 태스크의 여유 공간을 충분히 확보하기 위함이다. 본 도면의 경우, 2ms 오프셋의 미배치 구간에 해당 특정 태스크 배치 시 다른 태스크에 의한 선점이 발생하지 않으므로, ECU는 이 미배치 구간에 대한 해당 특정 태스크(401)의 배치를 결정/완료할 수 있다. For example, as shown in FIG. 4, when a specific task 401 is placed at the minimum offset of 1 ms by avoiding preemption of other tasks, the specific task 401 is subjected to a period of 1 ms and a 2 ms task. Conference preemption may occur. At this time, the ECU may store the number of preemption (N1 = 2), and may store information of a section in which other tasks are not assigned. In addition, the ECU may determine whether there is an unpreempted section by performing virtual placement of the corresponding specific task 401 with respect to the stored unplaced sections. When it is found that the preemption has not occurred as a result of the virtual arrangement, the ECU may determine/complete the arrangement by selecting the shortest section among sections in which the specific task 401 can be placed as an unpreempted location. This is to secure enough free space for tasks to be deployed subsequently. In the case of this drawing, when the specific task is placed in the unplaced section of the 2 ms offset, preemption by other tasks does not occur, so the ECU can determine/complete the placement of the specific task 401 in the unplaced section. .

이 경우, 선점 현상이 없어졌기 때문에, ECU는 해당 특정 태스크 배치 후 바로 다음 태스크(즉, 다음 우선 순위의 태스크)의 배치 작업을 수행할 수 있다(S115). In this case, since the preemption phenomenon has disappeared, the ECU may perform a batch job of the next task (that is, the task of the next priority) immediately after the specific task is placed (S115).

반대로, 도 5에 도시한 바와 같이, 특정 태스크(501)에 대한 가상 배치 결과 미선점이 발생하는 경우는 존재하지 않으나 선점 횟수가 최소 오프셋 가상 배치 시 저장했던 N1(도 5의 경우 N1=2)에 비해 감소한 경우, ECU는 감소된 선점 횟수를 N2(도 5의 경우 N2=1)로 저장할 수 있다(S106). 이와 달리, 가상 배치 결과 선점횟수 N1에 변화가 없을 경우, ECU는 추가 작업 없이 다음 단계를 수행할 수 있다. On the contrary, as shown in FIG. 5, there is no case where non-preemption occurs as a result of the virtual arrangement for a specific task 501, but the number of preemption is in N1 (N1=2 in FIG. 5) stored at the time of the minimum offset virtual arrangement. If the number is reduced compared to that, the ECU may store the reduced number of preemption as N2 (N2 = 1 in FIG. 5) (S106). In contrast, if there is no change in the number of preemption N1 as a result of the virtual arrangement, the ECU can perform the next step without additional work.

다음으로, ECU는 도 6에 예시한 바와 같이, 태스크를 GGP 알고리즘을 기반으로 더 작은 단위인 러너블 그룹으로 분할할 수 있다(S107). 이때, ECU는 러너블 그룹간에 서로 연관성이 존재하지 않도록 태스크를 분할할 수 있다. 다음으로, ECU는 분할한 러너블 그룹들 중 수행 시간이 긴 러너블 그룹부터 순차적으로 가상 배치를 수행할 수 있다(S108). 이를 통해, ECU는 태스크간 선점을 최소화할 수 있는 구간을 우선적으로 선택하여 최적의 배치 위치를 검색한다(S109). ECU는 이러한 절차를 통해 모든 러너블 그룹을 최적으로 가상 배치하고(S110), 최적으로 가상 배치된 경우의 러너블 그룹들의 총 선점 횟수(N3)를 저장할 수 있다(S111). Next, as illustrated in FIG. 6, the ECU may divide the task into smaller units of runable groups based on the GGP algorithm (S107). In this case, the ECU may divide the task so that there is no correlation between the runnable groups. Next, the ECU may sequentially perform virtual placement from a runable group having a long execution time among the divided runnable groups (S108). Through this, the ECU preferentially selects a section in which the preemption between tasks can be minimized and searches for an optimal arrangement position (S109). Through this procedure, the ECU can optimally virtually place all the runnable groups (S110) and store the total number of preemption (N3) of the runnable groups in the case of optimally virtually disposed (S111).

다음으로, ECU는 태스크의 러너블 그룹 단위 가상 배치의 결과로 도출한 총 선점 횟수(N3)와, 태스크 단위 가상 배치의 결과로 도출한 선점 횟수(N1, N2)를 상호 비교할 수 있다(S112). 만약 N3의 값이 N1 및 N2보다 적을 경우, 기존의 태스크 단위의 배치 방법보다 선점 횟수 감소에 효과가 있다는 의미이므로, ECU는 태스크 분할 할당 방법을 적용하여 태스크를 러너블 그룹 단위로 분할한 뒤 실제 배치를 수행하고 다음 태스크 배치 작업으로 넘어갈 수 있다. 반대로 N3의 값이 N1 또는 N2와 차이가 없거나, N1 또는 N2보다 큰 경우, 태스크 분할 할당 방법에 선점 횟수 감소 효과가 없다는 의미이므로, 태스크 미분할 할당 방법으로 태스크를 실제 배치 후 다음 태스크 배치 작업으로 넘어갈 수 있다. Next, the ECU may compare the total number of preemption (N3) derived as a result of the virtual arrangement of the task unit of the runnable group and the number of preemption (N1, N2) derived from the result of the virtual arrangement of the task unit (S112). . If the value of N3 is less than N1 and N2, it means that it is more effective in reducing the number of preemptions than the existing task unit arrangement method. You can do the batch and move on to the next task batch job. Conversely, if the value of N3 is not different from N1 or N2, or is greater than N1 or N2, it means that the task division allocation method has no effect of reducing the number of preemption. I can go over it.

정리하자면, 본 발명의 일 실시예에 따른 ECU는, 주기가 짧은 태스크부터 배치하되, 배치 중 태스크간 선점이 발생한 경우, 태스크가 할당/배치되지 않은 모든 미할당/미배치 구간을 오프셋 변화(예를 들어, 오름차순으로)를 주며 탐색하여 태스크간 선점 회피 가능 구간을 검색한다. 선점을 회피할 수 없는 경우에 ECU는, 태스크를 러너블 단위로 분할하여 가상 배치를 수행한 뒤 선점을 최소화할 수 있는 구간을 탐색한다. 만일 러너블 단위의 가상 배치로 총 선점 횟수가 감소한 경우 태스크 분할 할당 방법이 채택될 수 있으며, 선점 횟수의 변화가 없거나 증가 시 태스크 미분할 할당 방법이 채택되어 태스크가 배치될 수 있다.In summary, in the ECU according to an embodiment of the present invention, a task having a short period is first arranged, but when preemption between tasks occurs during deployment, all unassigned/unplaced sections in which tasks are not allocated/distributed are offset change (e.g. For example, in ascending order), it searches for a section that can avoid preemption between tasks. When preemption cannot be avoided, the ECU divides the task into runnable units and performs virtual arrangement, and then searches for a section that can minimize preemption. If the total number of preemption decreases due to the virtual arrangement of the runnable unit, the task division allocation method may be adopted, and when the number of preemption does not change or increases, the task differential allocation method may be adopted and the task may be placed.

도 7은 본 발명의 일 실시예에 따른 태스크 분할 방식을 채택하여 도 2의 10ms 주기 태스크를 배치한 결과를 예시한 도면이다. FIG. 7 is a diagram illustrating a result of arranging a 10 ms periodic task of FIG. 2 by adopting a task division method according to an embodiment of the present invention.

도 7을 참조하면, 태스크 분할 방식에 따라 10ms 주기 태스크는 4개의 러너블 그룹으로 분할될 수 있으며, 이러한 러너블 그룹 단위의 재배치를 통해 10ms 주기 태스크의 선점 횟수가 3회(도 2 참조)에서 2회(도 7 참조)로 줄어들 수 있다.Referring to FIG. 7, the 10ms periodic task can be divided into 4 runable groups according to the task division method, and the number of preemption of the 10ms periodic task is 3 times (refer to FIG. 2) through the rearrangement of such a runable group unit. It can be reduced to two times (see Fig. 7).

본 발명에 따른 실시예는 다양한 수단, 예를 들어, 하드웨어, 펌웨어(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.

201: 10ms 주기 태스크
202: 1ms 주기 태스크
203: 2ms 주기 태스크
201: 10ms periodic task
202: 1ms periodic task
203: 2ms periodic task

Claims (14)

삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 태스크를 배치하는 ECU(Electronic Control Unit)에 있어서,
적어도 하나의 프로세서; 및
데이터를 저장하는 메모리; 를 포함하고,
상기 적어도 하나의 프로세서는,
주기가 짧은 태스크부터 순차적으로 기 설정된 오프셋 중에서 작은 오프셋부터 가상 배치하고,
특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생한 경우, 선점 횟수를 상기 메모리에 제1 선점 횟수로서 저장하고, 상기 특정 태스크를 태스크가 배치되지 않은 미배치 구간에
오프셋을 기 설정된 길이만큼 증가시켜 가상 배치를 수행하고, 가상 배치에 대한 선점 미발생 구간을 탐색하고,
상기 탐색 결과 상기 선점 미발생 구간이 탐색된 경우,
상기 특정 태스크를 분할하지 않고, 상기 선점 미발생 구간에 상기 특정 태스크를 배치하고,
상기 탐색 결과 상기 선점 미발생 구간이 탐색되지 않은 경우:
상기 특정 태스크를 분할하지 않고 상기 미배치 구간에 오프셋 오름차순으로 가상 배치한 결과 획득한 최소 선점 횟수를 상기 메모리에 제2 선점 횟수로서 저장하고, 상기 태스크를 더 작은 단위인 러너블(runnable) 단위로 분할하여 가상 배치한 결과 획득한 최소 선점 횟수를 상기 메모리에 제3 선점 횟수로서 저장하고,
상기 제3 선점 횟수와 상기 제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,
From tasks with short cycles, virtually arrange them from the smallest among preset offsets sequentially,
If preemption occurs for another task during virtual arrangement for a specific task, the number of preemption is stored in the memory as the first preemption number, and the specific task is stored in an unplaced section in which no task is placed.
Perform a virtual batch by increasing the offset by a preset length, search for a section where no preemption occurs for the virtual batch,
When the section where the preemption does not occur is searched as a result of the search,
Without dividing the specific task, arranging the specific task in the preemption non-occurrence section,
If the preemption non-occurrence section is not searched as a result of the search:
The minimum number of preemption obtained as a result of virtually placing the specific task in an ascending offset order without dividing the specific task is stored in the memory as a second preemption number, and the task is stored in a smaller unit, a runnable unit. The minimum number of preemption obtained as a result of dividing and virtually placing is stored in the memory as the third preemption number,
The ECU, which compares the third preemption count with the first and second preemption times, and places the specific task based on the comparison result.
제 8 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 비교 결과에 기초하여 상기 특정 태스크를 배치하는 경우,
상기 제3 선점 횟수가 상기 제1 및 제2 선점 횟수보다 적으면, 상기 제3 선점 횟수를 획득했던 가상 배치 방식으로 상기 특정 태스크를 상기 러너블 단위로 분할하여 배치하고,
상기 제3 선점 횟수가 상기 제1 또는 제2 선점 횟수와 차이가 없거나 상기 제1 또는 제2 선점 횟수보다 크면, 상기 제1 또는 제2 선점 횟수 중 작은 선점 횟수를 획득했던 가상 배치 방식으로 상기 특정 태스크를 배치하는, ECU.
The method of claim 8,
The at least one processor,
When placing the specific task based on the comparison result,
If the third preemption count is less than the first and second preemption counts, the specific task is divided and placed in the runable unit in a virtual arrangement method in which the third preemption count is obtained, and
If the third preemption count is not different from the first or second preemption count or is greater than the first or second preemption count, the specified Deploying tasks, ECU.
제 9 항에 있어서,
상기 특정 태스크는, GGP(Global graph partitioning) 알고리즘을 기반으로 상기 러너블 단위로 분할되는, ECU.
The method of claim 9,
The specific task is divided into the runable unit based on a global graph partitioning (GGP) algorithm.
제 10 항에 있어서,
상기 특정 태스크가 상기 러너블 단위로 분할되어 생성된 복수의 러너블 그룹들 간에는 상호 연관성이 존재하지 않고 독립적인, ECU.
The method of claim 10,
The ECU, wherein the specific task is divided into the runnable unit and there is no correlation between the plurality of runable groups generated and is independent.
제 11 항에 있어서,
상기 적어도 하나의 프로세서는,
상기 러너블 단위로 분할하여 가상 배치를 수행하는 경우,
상기 복수의 러너블 그룹들 중 가장 수행 시간이 긴 러너블 그룹부터 순차적으로 가상 배치를 수행하는, ECU.
The method of claim 11,
The at least one processor,
In the case of performing virtual placement by dividing into the runnable unit,
An ECU that sequentially performs virtual arrangement from a runable group having a longest execution time among the plurality of runable groups.
제 8 항에 있어서,
상기 적어도 하나의 프로세서는,
특정 태스크에 대한 가상 배치 중 다른 태스크에 대한 선점이 발생하지 않은 경우, 상기 특정 태스크가 가상 배치된 구간 중 가장 긴 구간에 상기 특정 태스크를 배치하는, ECU.
The method of claim 8,
The at least one processor,
The ECU for placing the specific task in the longest section of the section in which the specific task is virtually placed, when preemption for another task does not occur during virtual placement for a specific task.
제 8 항에 있어서,
상기 주기가 짧을수록 태스크의 우선 순위가 높게 설정되는, ECU.
The method of claim 8,
The shorter the period, the higher the priority of the task is set.
KR1020190101913A 2019-08-20 2019-08-20 Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks KR102222939B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020190101913A KR102222939B1 (en) 2019-08-20 2019-08-20 Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks
US16/998,372 US11822967B2 (en) 2019-08-20 2020-08-20 Task distribution method for minimizing preemption between tasks and apparatus for performing the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190101913A KR102222939B1 (en) 2019-08-20 2019-08-20 Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks

Publications (3)

Publication Number Publication Date
KR20210022426A KR20210022426A (en) 2021-03-03
KR102222939B1 true KR102222939B1 (en) 2021-03-04
KR102222939B9 KR102222939B9 (en) 2022-04-11

Family

ID=75151229

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190101913A KR102222939B1 (en) 2019-08-20 2019-08-20 Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks

Country Status (1)

Country Link
KR (1) KR102222939B1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6567840B1 (en) * 1999-05-14 2003-05-20 Honeywell Inc. Task scheduling and message passing
KR101073428B1 (en) * 2008-11-27 2011-10-17 학교법인 동의학원 Method for scheduling task in embedded operating system of automobile
US20140282572A1 (en) * 2013-03-14 2014-09-18 Samsung Electronics Co., Ltd. Task scheduling with precedence relationships in multicore systems

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
B. Andersson 외 1명. 'Multiprocessor Scheduling with Few Preemptions'. IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, 2006.08.
Shinpei Kato 외 1명. 'Real-Time Scheduling with Task Splitting on Multiprocessors'. IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, 2007.08.

Also Published As

Publication number Publication date
KR102222939B9 (en) 2022-04-11
KR20210022426A (en) 2021-03-03

Similar Documents

Publication Publication Date Title
US9417935B2 (en) Many-core process scheduling to maximize cache usage
US11010199B2 (en) Efficient critical thread scheduling for non-privileged thread requests
US9047196B2 (en) Usage aware NUMA process scheduling
US20120317389A1 (en) Allocating Heaps in NUMA Systems
US8707326B2 (en) Pattern matching process scheduler in message passing environment
US8650570B2 (en) Method of assigning instructions in a process to a plurality of scheduler instances based on the instruction, in which each scheduler instance is allocated a set of negoitaited processor resources
US20120324454A1 (en) Control Flow Graph Driven Operating System
US20150058858A1 (en) Dynamic task prioritization for in-memory databases
US20150135186A1 (en) Computer system, method and computer-readable storage medium for tasks scheduling
US8997071B2 (en) Optimized division of work among processors in a heterogeneous processing system
JP2007529833A (en) Techniques for setting command order in an out-of-order DMA command queue
CN106569887B (en) Fine-grained task scheduling method in cloud environment
KR20120055353A (en) Apparatus and method for optimizing data processing over the heterogeneous multi-processor environment
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
KR102222939B1 (en) Method and Apparatus for Minimizing Preemption by Splitting Runnable Group of Tasks
KR101867960B1 (en) Dynamically reconfigurable apparatus for operating system in manycore system and method of the same
KR101869325B1 (en) Core allocation apparatus in different multi-core
CN108027727A (en) Dispatching method, device and the computer system of internal storage access instruction
US11822967B2 (en) Task distribution method for minimizing preemption between tasks and apparatus for performing the same
JP6428557B2 (en) Parallelization method, parallelization tool
US20110185365A1 (en) Data processing system, method for processing data and computer program product
KR102380175B1 (en) A method for deriving an offset of a task for minimizing the load and an apparatus therefor
KR101378058B1 (en) Dynamic memory managing methof in embedded system
KR101952221B1 (en) Efficient Multitasking GPU with Latency Minimization and Cache boosting

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
G170 Re-publication after modification of scope of protection [patent]
G170 Re-publication after modification of scope of protection [patent]