JP6252259B2 - Electronic control unit - Google Patents
Electronic control unit Download PDFInfo
- Publication number
- JP6252259B2 JP6252259B2 JP2014045155A JP2014045155A JP6252259B2 JP 6252259 B2 JP6252259 B2 JP 6252259B2 JP 2014045155 A JP2014045155 A JP 2014045155A JP 2014045155 A JP2014045155 A JP 2014045155A JP 6252259 B2 JP6252259 B2 JP 6252259B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- execution
- relationship
- executed
- cpu core
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5066—Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/506—Constraint
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Description
本発明は、複数のタスクを並列に実行可能な電子制御装置に関する。 The present invention relates to an electronic control device capable of executing a plurality of tasks in parallel.
従来、複数のタスクが共通データを参照および更新することが可能に構成されている場合において共通データの一貫性を保持するために、タスク割り込みを一時的に禁止する排他制御が行われている(例えば、特許文献1を参照)。 Conventionally, when a plurality of tasks are configured to be able to refer to and update common data, exclusive control for temporarily prohibiting task interruption has been performed in order to maintain consistency of common data ( For example, see Patent Document 1).
しかし、複数のタスクを並列に実行可能に構成されている場合において共通データの一貫性を保持するために、並列に実行可能な複数のタスクのうち少なくとも1つのタスクの実行を禁止すると、タスク実行効率が低下してしまうという問題があった。 However, if multiple tasks can be executed in parallel, in order to maintain the consistency of common data, if execution of at least one of the tasks that can be executed in parallel is prohibited, task execution There was a problem that the efficiency was lowered.
本発明は、こうした問題に鑑みてなされたものであり、タスク実行効率の低下を抑制する技術を提供することを目的とする。 The present invention has been made in view of these problems, and an object thereof is to provide a technique for suppressing a decrease in task execution efficiency.
上記目的を達成するためになされた本発明の電子制御装置は、第1タスク実行手段と、第2タスク実行手段と、実行順変更手段とを備える。
第1タスク実行手段は、予め設定された第1実行順で複数のタスクを順次実行する。第2タスク実行手段は、第1タスク実行手段と並列に、予め設定された第2実行順で複数のタスクを順次実行する。
An electronic control device of the present invention made to achieve the above object includes first task execution means, second task execution means, and execution order change means.
The first task execution means sequentially executes a plurality of tasks in a preset first execution order. The second task execution means sequentially executes a plurality of tasks in a preset second execution order in parallel with the first task execution means.
実行順変更手段は、第1タスク実行手段が実行するタスクを第1タスクとし、第2タスク実行手段が実行するタスクを第2タスクとし、第1タスク実行手段が第1タスクを実行している第1タスク実行期間と、第2タスク実行手段が第2タスクを実行している第2タスク実行期間とで重複している部分がある場合において、実行期間が互いに重複している第1タスクと第2タスクとが、互いに並列に実行されることを許可するように予め設定された実行許可関係を有するように、第1実行順と第2実行順を変更する。 The execution order change means sets the task executed by the first task execution means as the first task, sets the task executed by the second task execution means as the second task, and executes the first task by the first task execution means. In the case where there is an overlapping part between the first task execution period and the second task execution period in which the second task execution means executes the second task, the first task with the execution period overlapping with each other The first execution order and the second execution order are changed so that the second task has an execution permission relationship set in advance so as to allow the second task to be executed in parallel with each other.
このように構成された電子制御装置では、第1タスクの実行中において、実行中の第1タスクと並列に実行することが禁止されている第2タスクの代わりに、実行中の第1タスクと並列に実行することが許可されている第2タスクを実行することができる。同様に、第2タスクの実行中において、実行中の第2タスクと並列に実行することが禁止されている第1タスクの代わりに、実行中の第2タスクと並列に実行することが許可されている第1タスクを実行することができる。 In the electronic control device configured as described above, during execution of the first task, instead of the second task that is prohibited from being executed in parallel with the first task being executed, A second task that is allowed to execute in parallel may be executed. Similarly, during execution of the second task, execution in parallel with the second task being executed is permitted instead of the first task that is prohibited from being executed in parallel with the second task being executed. The first task can be executed.
このため、第1タスクの実行中において第2タスクが実行されていないという事態と、第2タスクの実行中において第1タスクが実行されていないという事態との少なくとも一方の発生を抑制することができ、タスク実行効率の低下を抑制することができる。 For this reason, suppressing occurrence of at least one of a situation in which the second task is not executed during the execution of the first task and a situation in which the first task is not executed during the execution of the second task. It is possible to suppress a decrease in task execution efficiency.
以下に本発明の実施形態について図面とともに説明する。
本実施形態の電子制御装置(Electronic Control Unit)1(以下、ECU1という)は、車両に搭載され、車両のエンジン(不図示)の制御を行う。
Embodiments of the present invention will be described below with reference to the drawings.
An electronic control unit (Electronic Control Unit) 1 (hereinafter referred to as ECU 1) according to the present embodiment is mounted on a vehicle and controls an engine (not shown) of the vehicle.
ECU1は、図1に示すように、マイクロコンピュータ2(以下、マイコン2という)を備える。
マイコン2は、エンジンを制御するための処理を実行し、車両に取り付けられた電気負荷(インジェクタ等)を制御するための制御信号を出力する。
The ECU 1 includes a microcomputer 2 (hereinafter referred to as a microcomputer 2) as shown in FIG.
The
またマイコン2は、CPU(Central Processing Unit)コア11,12、フラッシュROM13およびRAM14と、これらを相互に接続するバス15とを備える。
CPUコア11,12は、プログラムを実行するための演算ユニットとレジスタなどを備える。
The
The
フラッシュROM13は、データ書き換え可能な不揮発性メモリである。そしてフラッシュROM13は、リアルタイムオペレーティングシステム(以下、RTOSという)を制御するOSプログラム21と、車両に搭載されたエンジン等を制御する車両制御プログラム22とを記憶する。
The
RAM14は、揮発性メモリであり、CPUコア11,12の演算結果等を一時的に記憶する。またRAM14には、キュー格納部31、キュー格納部32、実行タスク情報格納部41および実行タスク情報格納部42が設けられている。
The
また車両制御プログラム22は、複数のタスク50を備える。そして各タスク50は、対応するタスクを実行するためのタスクプログラム51と、タスク依存関係(後述)を判断するために設定されるタスク依存関係識別番号52と、対応するタスクを実行するCPUコアが制約されているか否かを示す実行コア制約情報53とを備える。
The
なおタスク依存関係識別番号52は、タスク依存関係を有する複数のタスクに対して同一の番号が設定される。例えば、タスクAとタスクBとがタスク依存関係を有する場合には、タスクAとタスクBのタスク依存関係識別番号52が例えば「0x00001234」に設定される。また、タスクA,BとタスクCとがタスク依存関係を有していない場合には、タスクCのタスク依存関係識別番号52が例えば「0x00005678」に設定される。
The task dependency
またタスク依存関係は、複数のタスクが互いに共通のデータを参照および更新するか否かによって決定される。例えば、タスクAとタスクBが互いに共通のデータを参照および更新する場合には、タスクAとタスクBはタスク依存関係を有すると決定される。 The task dependency is determined by whether or not a plurality of tasks refer to and update data common to each other. For example, when task A and task B refer to and update data common to each other, task A and task B are determined to have a task dependency relationship.
また実行コア制約情報53は、対応するタスクを実行するCPUコアが制約されている場合には例えば「1」が設定され、制約されていない場合には例えば「0」が設定される。
The execution
そしてCPUコア11,12は、フラッシュROM13に記憶されているOSプログラム21を実行することにより、RTOSを動作させる。
RTOSは、車両制御プログラム22を構成するタスクの実行を要求するタスク処理要求が発生すると、このタスク処理要求に対応するタスクに予め設定されたタスク優先度に基づき、タスク優先度の高いタスクを優先して実行するようにタスクの実行順を決定するスケジューリングを行う。
The
When a task processing request for requesting execution of a task constituting the
具体的には、RTOSは、対応するタスクプログラム51が記憶されている先頭アドレスを示すタスクアドレス情報を、タスク優先度の高い順に配列して、キュー格納部31またはキュー格納部32に格納することにより、実行待ちタスクの実行順を決定する。このため、キュー格納部31またはキュー格納部32から、実行順が最も早いタスクアドレス情報を抽出することにより、RTOSにより決定された実行順で、タスクを実行することが可能となる。
Specifically, the RTOS arranges the task address information indicating the head address where the
このように構成されたECU1において、CPUコア11,12は、タスク実行処理を実行する。
ここで、CPUコア11(12)が実行するタスク実行処理の手順を説明する。タスク実行処理は、キュー格納部31(32)から、実行順が最も早いタスクアドレス情報が抽出される毎に実行される処理である。
In the ECU 1 configured as described above, the
Here, a procedure of task execution processing executed by the CPU core 11 (12) will be described. The task execution process is executed every time task address information having the earliest execution order is extracted from the queue storage unit 31 (32).
このタスク実行処理が実行されると、CPUコア11(12)は、図2に示すように、まずS10にて、抽出したタスクアドレス情報が示す先頭アドレス(以下、抽出タスクアドレスという)に基づいて、この抽出タスクアドレスに格納されているタスクプログラム51のタスク依存関係識別番号52をフラッシュROM13から読み出す。なおタスク依存関係識別番号52は、上記先頭アドレスの値と予め設定された識別番号検索値とを加算した加算値のアドレスに記憶されている。本実施形態では、この識別番号検索値は、車両制御プログラム22を構成する全てのタスク50について同一の値が設定されている。以下、フラッシュROM13から読み出したタスク依存関係識別番号52を、判断対象タスク識別番号52という。
When this task execution process is executed, the CPU core 11 (12), as shown in FIG. 2, first, in S10, based on the start address indicated by the extracted task address information (hereinafter referred to as the extracted task address). Then, the task dependency
次にS20にて、実行タスク情報格納部42(41)に格納されているタスク依存関係識別番号52を読み出す。以下、S20で読み出したタスク依存関係識別番号52を実行中タスク識別番号52という。
Next, in S20, the task dependency
そしてS30にて、フラッシュROM13から直近で読み出したタスク依存関係識別番号52(判断対象タスク識別番号52)と、S20で読み出したタスク依存関係識別番号52(実行中タスク識別番号52)とが一致しているか否かを判断する。
In S30, the task dependency identification number 52 (determination target task identification number 52) read most recently from the
ここで、直近の判断対象タスク識別番号52と実行中タスク識別番号52とが一致している場合には(S30:YES)、S40にて、直近の抽出タスクアドレスに基づいて、この先頭アドレスに格納されているタスクプログラム51の実行コア制約情報53をフラッシュROM13から読み出す。なお実行コア制約情報53は、先頭アドレスの値と予め設定された制約情報検索値とを加算した加算値のアドレスに記憶されている。本実施形態では、この制約情報検索値は、車両制御プログラム22を構成する全てのタスク50について互いに同一の値が設定されている。
Here, if the latest determination target
そしてS50にて、S40で読み出した実行コア制約情報53に基づいて、直近の抽出タスクアドレスに格納されているタスクプログラム51により実行されるタスク(以下、判断対象タスクという)を、CPUコア11(12)で実行する必要があるか否かを判断する。具体的には、読み出した実行コア制約情報53が1に設定されている場合には、CPUコア11(12)で実行する必要があると判断し、読み出した実行コア制約情報53が0に設定されている場合には、CPUコア11(12)で実行する必要がないと判断する。
In S50, based on the execution
ここで、判断対象タスクをCPUコア11(12)で実行する必要がない場合には(S50:NO)、S60にて、別コア格納指示値iをインクリメント(1加算)する。さらにS70にて、直近の抽出タスクアドレスを示すタスクアドレス情報を、対応するタスクが別コア格納指示値iが示す実行順で実行されるように、キュー格納部32(31)に格納することにより、CPUコア12(11)における実行待ちタスクの実行順を再決定し、S100に移行する。例えば、別コア格納指示値iが1である場合には、CPUコア12(11)における実行待ちタスクの中で実行順が1番となるように、直近の抽出タスクアドレスを示すタスクアドレス情報をキュー格納部32(31)に格納する。 Here, when it is not necessary to execute the determination target task in the CPU core 11 (12) (S50: NO), the other core storage instruction value i is incremented (added by 1) in S60. Further, in S70, the task address information indicating the latest extracted task address is stored in the queue storage unit 32 (31) so that the corresponding task is executed in the execution order indicated by the different core storage instruction value i. Then, the execution order of the execution waiting tasks in the CPU core 12 (11) is re-determined, and the process proceeds to S100. For example, when the separate core storage instruction value i is 1, the task address information indicating the latest extracted task address is set so that the execution order is the first among the execution waiting tasks in the CPU core 12 (11). Store in the queue storage unit 32 (31).
一方、判断対象タスクをCPUコア11(12)で実行する必要がある場合には(S50:YES)、S80にて、当コア格納指示値jをインクリメント(1加算)する。さらにS90にて、直近の抽出タスクアドレスを示すタスクアドレス情報を、対応するタスクが当コア格納指示値jが示す実行順の次に実行されるように、キュー格納部31(32)に格納することにより、CPUコア11(12)における実行待ちタスクの実行順を再決定し、S100に移行する。例えば、当コア格納指示値jが1である場合には、CPUコア11(12)における実行待ちタスクの中で実行順が2番となるように、直近の抽出タスクアドレスを示すタスクアドレス情報をキュー格納部31(32)に格納する。 On the other hand, if it is necessary to execute the determination target task by the CPU core 11 (12) (S50: YES), the core storage instruction value j is incremented (added by 1) in S80. Further, in S90, the task address information indicating the latest extracted task address is stored in the queue storage unit 31 (32) so that the corresponding task is executed next in the execution order indicated by the core storage instruction value j. As a result, the execution order of the execution waiting tasks in the CPU core 11 (12) is re-determined, and the process proceeds to S100. For example, when the core storage instruction value j is 1, the task address information indicating the latest extracted task address is set so that the execution order is second among the execution waiting tasks in the CPU core 11 (12). Store in the queue storage unit 31 (32).
そしてS100に移行すると、キュー格納部31(32)から、現時点で実行順が最も早いタスクアドレス情報を読み出し、S30に移行する。
またS30にて、直近の判断対象タスク識別番号52と実行中タスク識別番号52とが一致していない場合には(S30:NO)、S110にて、別コア格納指示値iと当コア格納指示値jを0に設定する。さらにS120にて、直近の判断対象タスク識別番号52を実行タスク情報格納部41(42)に格納することで、実行タスク情報格納部41(42)に格納される情報を上書きする。そしてS130にて、直近の抽出タスクアドレスに基づいて、フラッシュROM13からタスクプログラム51を読み出して、タスクを実行し、タスク実行処理を終了する。
When the process proceeds to S100, the task address information with the earliest execution order is read from the queue storage unit 31 (32), and the process proceeds to S30.
In S30, if the latest determination target
次に、タスクアドレス情報をキュー格納部31,32に格納する具体例を説明する。
例えば図3に示すように、キュー格納部31には、実行待ちタスクの実行が早い順に、タスクB、タスクCおよびタスクDのタスクアドレス情報が格納されているとする。また、キュー格納部32には、実行待ちタスクの実行が早い順に、タスクP、タスクQ、タスクR、タスクSおよびタスクTのタスクアドレス情報が格納されているとする。
Next, a specific example of storing task address information in the
For example, as shown in FIG. 3, it is assumed that task address information of task B, task C, and task D is stored in the
そして、CPUコア11においてタスクAを実行中であり、CPUコア12において新たなタスクの実行を開始するタイミングであるとする。
この場合にCPUコア12は、まず、キュー格納部32からタスクPのタスクアドレス情報を読み出す。ここで、タスクPは、タスクAとタスク依存関係があり且つCPUコア12で実行する必要がないとする。このため、タスクPのタスクアドレス情報は、CPUコア11における実行待ちタスクの中で実行順が1番となるように、キュー格納部31に格納される(矢印AL1を参照)。これにより、キュー格納部31には、実行待ちタスクの実行が早い順に、タスクP、タスクB、タスクCおよびタスクDのタスクアドレス情報が格納される(矢印AL11を参照)。また、キュー格納部32には、実行待ちタスクの実行が早い順に、タスクQ、タスクR、タスクSおよびタスクTのタスクアドレス情報が格納される(矢印AL11を参照)。
Then, it is assumed that the task A is being executed in the
In this case, the
そしてCPUコア12は、次に、キュー格納部32からタスクQのタスクアドレス情報を読み出す。ここで、タスクQは、タスクAとタスク依存関係があり且つCPUコア12で実行する必要がないとする。このため、タスクQのタスクアドレス情報は、CPUコア11における実行待ちタスクの中で実行順が2番となるように、キュー格納部31に格納される(矢印AL2を参照)。これにより、キュー格納部31には、実行待ちタスクの実行が早い順に、タスクP、タスクQ、タスクB、タスクCおよびタスクDのタスクアドレス情報が格納される(矢印AL12を参照)。また、キュー格納部32には、実行待ちタスクの実行が早い順に、タスクR、タスクSおよびタスクTのタスクアドレス情報が格納される(矢印AL12を参照)。
Next, the
そしてCPUコア12は、次に、キュー格納部32からタスクRのタスクアドレス情報を読み出す。ここで、タスクRは、タスクAとタスク依存関係があり且つCPUコア12で実行する必要があるとする。このため、タスクRのタスクアドレス情報は、CPUコア12における実行待ちタスクの中で実行順が2番となるように、キュー格納部32に格納される(矢印AL3を参照)。これにより、キュー格納部32には、実行待ちタスクの実行が早い順に、タスクS、タスクRおよびタスクTのタスクアドレス情報が格納される(矢印AL13を参照)。
Next, the
そしてCPUコア12は、次に、キュー格納部32からタスクSのタスクアドレス情報を読み出す。ここで、タスクSは、タスクAとタスク依存関係があり且つCPUコア12で実行する必要があるとする。このため、タスクSのタスクアドレス情報は、CPUコア12における実行待ちタスクの中で実行順が3番となるように、キュー格納部32に格納される(矢印AL4を参照)。これにより、キュー格納部32には、実行待ちタスクの実行が早い順に、タスクT、タスクRおよびタスクSのタスクアドレス情報が格納される(矢印AL13を参照)。
Next, the
そしてCPUコア12は、次に、キュー格納部32からタスクTのタスクアドレス情報を読み出す。ここで、タスクTは、タスクAとタスク依存関係がないとする。このため、CPUコア12は、フラッシュROM13からタスクTのタスクプログラム51を読み出して、タスクTを実行する。
Next, the
このように構成されたECU1では、CPUコア11が、キュー格納部31で設定された実行順(以下、第1実行順という)で複数のタスクを順次実行する(S130)。またCPUコア12が、キュー格納部32で設定された実行順(以下、第2実行順という)で複数のタスクを順次実行する(S130)。
In the ECU 1 configured as described above, the
そしてECU1は、CPUコア11がタスクを実行している実行期間と、CPUコア12がタスクを実行している実行期間とで重複している部分がある場合において、CPUコア11が実行しているタスクと、CPUコア12が実行しているタスクとがタスク依存関係を有しないように、第1実行順と第2実行順を変更する(S10〜S100)。
The ECU 1 executes the ECU 1 when there is an overlapping portion between the execution period in which the
これにより、CPUコア11によるタスクの実行中において、CPUコア11が実行中のタスクと並列に実行することが禁止されているタスクの代わりに、CPUコア11が実行中のタスクと並列に実行することが許可されているタスクをCPUコア12が実行することができる。同様に、CPUコア12によるタスクの実行中において、CPUコア12が実行中のタスクと並列に実行することが禁止されているタスクの代わりに、CPUコア12が実行中のタスクと並列に実行することが許可されているタスクをCPUコア11が実行することができる。
Thereby, during the execution of the task by the
このため、CPUコア11によるタスクの実行中においてCPUコア12でタスクが実行されていないという事態の発生と、CPUコア12によるタスクの実行中においてCPUコア11でタスクが実行されていないという事態の発生を抑制することができ、タスク実行効率の低下を抑制することができる。
For this reason, the situation where the task is not executed by the
またCPUコア11は、第1実行順で1番目のタスクが、CPUコア12が実行中のタスクとの間でタスク依存関係を有しているか否かを判断する(S30)。そしてCPUコア11は、タスク依存関係を有していると判断した場合に(S30:YES)、判断対象となったタスクの実行順が1番目より遅くなるように第1実行順を変更する(S90)。同様にCPUコア12は、第2実行順で1番目のタスクが、CPUコア11が実行中のタスクとの間でタスク依存関係を有しているか否かを判断する(S30)。そしてCPUコア12は、タスク依存関係を有していると判断した場合に(S30:YES)、判断対象となったタスクの実行順が1番目より遅くなるように第2実行順を変更する(S90)。
The
これによりECU1は、CPUコア12で実行中であったタスクが終了した後に、CPUコア12で実行中であったタスクとの間でタスク依存関係を有しているタスクをCPUコア11で実行させることができる。同様にECU1は、CPUコア11で実行中であったタスクが終了した後に、CPUコア11で実行中であったタスクとの間でタスク依存関係を有しているタスクをCPUコア12で実行させることができる。
Thereby, the ECU 1 causes the
例えば図4に示すように、CPUコア11においてタスクAを実行中であり、CPUコア12において新たなタスクの実行を開始するタイミングであるとする。この場合にCPUコア12は、タスクAとタスク依存関係のあるタスクFの代わりに、タスクAとタスク依存関係のないタスクGを実行し、タスクAとタスクGの実行が終了した後に、タスクFを実行することができる。
For example, as shown in FIG. 4, it is assumed that the task A is being executed in the
またCPUコア11は、第1実行順で1番目のタスクが、CPUコア12が実行中のタスクとの間でタスク依存関係を有しているか否かを判断する(S30)。そしてCPUコア11は、タスク依存関係を有していると判断した場合に(S30:YES)、判断対象となったタスクをCPUコア12が実行するように第1実行順と第2実行順を変更する(S70)。同様にCPUコア12は、第2実行順で1番目のタスクが、CPUコア11が実行中のタスクとの間でタスク依存関係を有しているか否かを判断する(S30)。そしてCPUコア12は、タスク依存関係を有していると判断した場合に(S30:YES)、判断対象となったタスクをCPUコア11が実行するように第1実行順と第2実行順を変更する(S70)。
The
これによりECU1は、CPUコア12で実行中であったタスクが終了した後に、CPUコア12で実行中であったタスクとの間でタスク依存関係を有しているタスクをCPUコア12で実行させることができる。同様にECU1は、CPUコア11で実行中であったタスクが終了した後に、CPUコア11で実行中であったタスクとの間でタスク依存関係を有しているタスクをCPUコア11で実行させることができる。
Thereby, the ECU 1 causes the
例えば図5に示すように、CPUコア11においてタスクAを実行中であり、CPUコア12において新たなタスクの実行を開始するタイミングであるとする。この場合にCPUコア12は、タスクAとタスク依存関係のあるタスクFの代わりに、タスクAとタスク依存関係のないタスクGを実行し、CPUコア11は、タスクAの実行が終了した後に、タスクFを実行することができる。
For example, as shown in FIG. 5, it is assumed that the task A is being executed in the
またCPUコア11は、第1実行順で1番目のタスクが、CPUコア12が実行中のタスクとの間でタスク依存関係を有していると判断した場合に(S30:YES)、判断対象となったタスクがCPUコア12での実行を禁止されているか否かを判断する(S50)。そしてCPUコア11は、CPUコア12での実行を禁止されていると判断した場合に(S50:YES)、判断対象となったタスクの実行順が1番目より遅くなるように第1実行順を変更する(S90)。またCPUコア11は、CPUコア12での実行を禁止されていないと判断した場合に(S50:NO)、判断対象となったタスクをCPUコア12が実行するように第1実行順と第2実行順を変更する(S70)。
If the
同様にCPUコア12は、第2実行順で1番目のタスクが、CPUコア11が実行中のタスクとの間でタスク依存関係を有していると判断した場合に(S30:YES)、判断対象となったタスクがCPUコア11での実行を禁止されているか否かを判断する(S50)。そしてCPUコア12は、CPUコア11での実行を禁止されていると判断した場合に(S50:YES)、判断対象となったタスクの実行順が1番目より遅くなるように第2実行順を変更する(S90)。またCPUコア12は、CPUコア11での実行を禁止されていないと判断した場合に(S50:NO)、判断対象となったタスクをCPUコア11が実行するように第1実行順と第2実行順を変更する(S70)。
Similarly, the
これによりECU1は、CPUコア12での実行を禁止されているタスクを確実にCPUコア11で実行させることができる。同様にECU1は、CPUコア11での実行を禁止されているタスクを確実にCPUコア12で実行させることができる。
As a result, the ECU 1 can reliably cause the
また、互いにタスク依存関係を有していない複数のタスクには互いに異なるタスク依存関係識別番号52が設定される。そしてECU1は、CPUコア11で実行されるタスクに設定されたタスク依存関係識別番号52と、CPUコア12で実行されるタスクに設定されたタスク依存関係識別番号52とを比較することにより、タスク依存関係を有するか否かを判断する(S30)。
Also, different task
これによりECU1は、タスク依存関係識別番号52が一致しているか否かという簡便な方法で、タスク依存関係を有するか否かを判断することができる。
以上説明した実施形態において、CPUコア11によるS130の処理は本発明における第1タスク実行手段、CPUコア12によるS130の処理は本発明における第2タスク実行手段、CPUコア11,12によるS10〜S100の処理は本発明における実行順変更手段である。
Thereby, ECU1 can judge whether it has a task dependence by the simple method of whether the task dependence
In the embodiment described above, the processing of S130 by the
また、CPUコア11によるS30の処理は本発明における第1関係判断手段、CPUコア11によるS90の処理は本発明における第1変更手段、CPUコア12によるS30の処理は本発明における第2関係判断手段、CPUコア12によるS90の処理は本発明における第2変更手段、CPUコア11によるS70の処理は本発明における第3変更手段、CPUコア12によるS70の処理は本発明における第4変更手段である。
Further, the processing at S30 by the
また、CPUコア11によるS50の処理は本発明における第1禁止判断手段、CPUコア11によるS90の処理は本発明における第1実行順変更手段、CPUコア11によるS70の処理は本発明における第2実行順変更手段、CPUコア12によるS50の処理は本発明における第2禁止判断手段、CPUコア12によるS90の処理は本発明における第3実行順変更手段、CPUコア12によるS70の処理は本発明における第4実行順変更手段である。
The processing of S50 by the
以上、本発明の一実施形態について説明したが、本発明は上記実施形態に限定されるものではなく、本発明の技術的範囲に属する限り種々の形態を採ることができる。
例えば上記実施形態では、マイコンが2個のCPUコアを備えるものを示したが、3個以上のCPUコアを備えるようにしてもよい。
As mentioned above, although one Embodiment of this invention was described, this invention is not limited to the said embodiment, As long as it belongs to the technical scope of this invention, a various form can be taken.
For example, in the above embodiment, the microcomputer includes two CPU cores. However, the microcomputer may include three or more CPU cores.
また上記実施形態では、マイコンが複数のCPUコアを備えるものを示した。しかし、マイコンが1個のCPUコアを備え、1個のCPUコアのリソースを時分割して使用することで仮想的に複数のCPUコアが存在しているように動作するものであってもよい。 In the above embodiment, the microcomputer includes a plurality of CPU cores. However, the microcomputer may be provided with one CPU core and operate as if there are virtually a plurality of CPU cores by using time-division resources of one CPU core. .
1…ECU、11,12…CPUコア、31,32…キュー格納部、50…タスク DESCRIPTION OF SYMBOLS 1 ... ECU, 11, 12 ... CPU core, 31, 32 ... Queue storage part, 50 ... Task
Claims (2)
前記第1タスク実行手段と並列に、予め設定された第2実行順で待機している複数の第2待機タスクを順次実行する第2タスク実行手段(12,S130)と、
前記第1タスク実行手段が実行しているタスクを第1実行中タスクとし、前記第2タスク実行手段が実行しているタスクを第2実行中タスクとし、前記第1タスク実行手段が前記第1実行中タスクを実行している第1タスク実行期間と、前記第2タスク実行手段が前記第2実行中タスクを実行している第2タスク実行期間とで重複している部分がある場合において、実行期間が互いに重複している前記第1実行中タスクと前記第2実行中タスクとが、互いに並列に実行されることを許可するように予め設定された実行許可関係を有するように、前記第1実行順と前記第2実行順を変更する実行順変更手段(11,12,S10〜S100)とを備え、
前記実行順変更手段は、
前記第1実行順で1番目の前記第1待機タスクが、前記第2タスク実行手段が実行中の前記第2実行中タスクとの間で前記実行許可関係を有するか否かを判断する第1関係判断手段(11,S30)と、
前記第2実行順で1番目の前記第2待機タスクが、前記第1タスク実行手段が実行中の前記第1実行中タスクとの間で前記実行許可関係を有するか否かを判断する第2関係判断手段(12,S30)と、
前記実行許可関係を有しないと前記第1関係判断手段が判断した場合に、前記第1関係判断手段において判断対象となった前記第1待機タスクが前記第2タスク実行手段での実行を禁止されているか否かを判断する第1禁止判断手段(11,S50)と、
前記第1待機タスクが前記第2タスク実行手段での実行を禁止されていると前記第1禁止判断手段が判断した場合に、前記第1関係判断手段において判断対象となった前記第1待機タスクの実行順が1番目より遅くなるように前記第1実行順を変更する第1実行順変更手段(11,S90)と、
前記第1待機タスクが前記第2タスク実行手段での実行を禁止されていないと前記第1禁止判断手段が判断した場合に、前記第1関係判断手段において判断対象となった前記第1待機タスクを前記第2タスク実行手段が実行するように前記第1実行順と前記第2実行順を変更する第2実行順変更手段(11,S70)と、
前記実行許可関係を有しないと前記第2関係判断手段が判断した場合に、前記第2関係判断手段において判断対象となった前記第2待機タスクが前記第1タスク実行手段での実行を禁止されているか否かを判断する第2禁止判断手段(12,S50)と、
前記第2待機タスクが前記第1タスク実行手段での実行を禁止されていると前記第2禁止判断手段が判断した場合に、前記第2関係判断手段において判断対象となった前記第2待機タスクの実行順が1番目より遅くなるように前記第2実行順を変更する第3実行順変更手段(12,S90)と、
前記第2待機タスクが前記第1タスク実行手段での実行を禁止されていないと前記第2禁止判断手段が判断した場合に、前記第2関係判断手段において判断対象となった前記第2待機タスクを前記第1タスク実行手段が実行するように前記第1実行順と前記第2実行順を変更する第4実行順変更手段(12,S70)とを備える
ことを特徴とする電子制御装置(1)。 First task execution means (11, S130) for sequentially executing a plurality of first standby tasks (50) waiting in a preset first execution order;
In parallel with the first task execution means, second task execution means (12, S130) for sequentially executing a plurality of second standby tasks waiting in a preset second execution order;
The task of the first task performing device is executing a first task running, the second task the task execution unit is executing a second task running, the first task performing device is the first when there is a first task execution period running running task, the portion where the second task performing device is duplicated by a second task execution period running the second executing task, The first execution task and the second execution task, whose execution periods overlap each other, have an execution permission relationship set in advance so as to allow execution in parallel with each other. Execution order changing means (11, 12, S10 to S100) for changing the first execution order and the second execution order;
The execution order changing means includes
First determining whether the first first waiting task in the first execution order has the execution permission relationship with the second execution task being executed by the second task execution means. Relationship determination means (11, S30);
Determining whether the first second waiting task in the second execution order has the execution permission relationship with the first execution task being executed by the first task execution unit; Relationship determination means (12, S30) ;
When the first relationship determination unit determines that the execution permission relationship is not established, the first standby task that is the determination target in the first relationship determination unit is prohibited from being executed by the second task execution unit. First prohibition judging means (11, S50) for judging whether or not
When the first prohibition determination unit determines that the first standby task is prohibited from being executed by the second task execution unit, the first standby task that is a determination target in the first relationship determination unit First execution order changing means (11, S90) for changing the first execution order so that the execution order of
When the first prohibition determining unit determines that the first standby task is not prohibited from being executed by the second task executing unit, the first standby task that is a determination target in the first relationship determining unit Second execution order changing means (11, S70) for changing the first execution order and the second execution order so that the second task execution means executes
When the second relationship determination unit determines that the execution permission relationship is not established, the second standby task that is the determination target in the second relationship determination unit is prohibited from being executed by the first task execution unit. Second prohibition judging means (12, S50) for judging whether or not
When the second prohibition determination unit determines that the second standby task is prohibited from being executed by the first task execution unit, the second standby task that is a determination target in the second relationship determination unit Third execution order changing means (12, S90) for changing the second execution order so that the execution order of
When the second prohibition determining unit determines that the second standby task is not prohibited from being executed by the first task executing unit, the second standby task that is a determination target in the second relationship determining unit An electronic control device (1 ), comprising: a fourth execution order changing means (12, S70) for changing the first execution order and the second execution order so that the first task execution means executes ).
前記第1関係判断手段は、前記第1待機タスクに設定された前記許可関係識別情報と、前記第2実行中タスクに設定された前記許可関係識別情報とを比較することにより、前記実行許可関係を有するか否かを判断し、
前記第2関係判断手段は、前記第2待機タスクに設定された前記許可関係識別情報と、前記第1実行中タスクに設定された前記許可関係識別情報とを比較することにより、前記実行許可関係を有するか否かを判断する
ことを特徴とする請求項1に記載の電子制御装置。 Different permission relationship identification information is set for a plurality of tasks having the execution permission relationship,
The first relationship determination unit compares the permission relationship identification information set for the first waiting task with the permission relationship identification information set for the second task being executed, thereby executing the execution permission relationship. it is determined whether having,
The second relationship determination means compares the permission relationship identification information set in the second waiting task with the permission relationship identification information set in the first execution task, thereby executing the execution permission relationship. The electronic control device according to claim 1 , wherein it is determined whether or not the electronic control device is included.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014045155A JP6252259B2 (en) | 2014-03-07 | 2014-03-07 | Electronic control unit |
DE102015203695.2A DE102015203695A1 (en) | 2014-03-07 | 2015-03-02 | ELECTRONIC CONTROL UNIT |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014045155A JP6252259B2 (en) | 2014-03-07 | 2014-03-07 | Electronic control unit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015170180A JP2015170180A (en) | 2015-09-28 |
JP6252259B2 true JP6252259B2 (en) | 2017-12-27 |
Family
ID=53884180
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014045155A Active JP6252259B2 (en) | 2014-03-07 | 2014-03-07 | Electronic control unit |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP6252259B2 (en) |
DE (1) | DE102015203695A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020080119A (en) * | 2018-11-14 | 2020-05-28 | 日本電信電話株式会社 | Processing request management device, processing request management method, and program |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1185543A (en) * | 1997-08-30 | 1999-03-30 | Nec Corp | Exclusive control method and machine-readable recording medium recorded with program |
JP2003131893A (en) | 2001-10-23 | 2003-05-09 | Sony Corp | Arithmetic processing system, task control method in a computer system and storage medium |
JP4039145B2 (en) * | 2002-07-03 | 2008-01-30 | 日本電気株式会社 | Multiprocessor system, load balancing control method used therefor, and program thereof |
JP5347451B2 (en) * | 2008-11-26 | 2013-11-20 | 富士通株式会社 | Multiprocessor system, conflict avoidance program, and conflict avoidance method |
JP2011161830A (en) * | 2010-02-10 | 2011-08-25 | Bridgestone Corp | Method of manufacturing bladder for manufacturing tire |
-
2014
- 2014-03-07 JP JP2014045155A patent/JP6252259B2/en active Active
-
2015
- 2015-03-02 DE DE102015203695.2A patent/DE102015203695A1/en active Pending
Also Published As
Publication number | Publication date |
---|---|
DE102015203695A1 (en) | 2015-09-10 |
JP2015170180A (en) | 2015-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8996811B2 (en) | Scheduler, multi-core processor system, and scheduling method | |
JP2011258119A5 (en) | ||
US8782643B2 (en) | Device and method for controlling communication between BIOS and BMC | |
JP2010211696A5 (en) | Program and information processing apparatus | |
JP4983919B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
US20090113439A1 (en) | Method and Apparatus for Processing Data | |
US9513969B2 (en) | Method for the management of task execution in a computer system | |
JP6252259B2 (en) | Electronic control unit | |
JP6512087B2 (en) | Vehicle control device | |
JP6365387B2 (en) | Electronic control unit | |
JP5676664B2 (en) | Resource management apparatus, resource management method, and program | |
US9710313B2 (en) | Method and system for ensuring integrity of critical data | |
JP2017204083A (en) | Memory protection system | |
JP2013117910A5 (en) | Image forming apparatus, control method thereof, and program | |
JP5561241B2 (en) | Microcomputer | |
JPWO2020261365A5 (en) | Semiconductor devices, control flow inspection methods, control flow inspection programs and electronic devices | |
JP2017023246A5 (en) | ||
CN110737533A (en) | task scheduling method and device, electronic equipment and storage medium | |
JP6289197B2 (en) | Plant control equipment engineering tool | |
JP6222354B2 (en) | Information processing apparatus, control method, and control program | |
JP5561294B2 (en) | Microcomputer | |
JP2020004133A5 (en) | ||
JP6596455B2 (en) | Electronic control unit for automobile | |
JP2021004031A (en) | Automotive electronic control device | |
JP6690570B2 (en) | Parallelization method, parallelization tool, in-vehicle control device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160420 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170131 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170228 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170403 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170905 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20171018 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20171031 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20171113 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6252259 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |