JP2020091540A - Information processing device - Google Patents
Information processing device Download PDFInfo
- Publication number
- JP2020091540A JP2020091540A JP2018226709A JP2018226709A JP2020091540A JP 2020091540 A JP2020091540 A JP 2020091540A JP 2018226709 A JP2018226709 A JP 2018226709A JP 2018226709 A JP2018226709 A JP 2018226709A JP 2020091540 A JP2020091540 A JP 2020091540A
- Authority
- JP
- Japan
- Prior art keywords
- task
- priority
- frequency
- execution
- unit
- 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.)
- Granted
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 26
- 230000008859 change Effects 0.000 claims description 28
- 238000012545 processing Methods 0.000 claims description 7
- 238000012423 maintenance Methods 0.000 claims description 4
- 230000000593 degrading effect Effects 0.000 abstract 1
- 239000000446 fuel Substances 0.000 description 9
- 238000000034 method Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 7
- 238000002347 injection Methods 0.000 description 6
- 239000007924 injection Substances 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000009467 reduction Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Abstract
Description
本開示は、複数のタスクの実行順を優先度に従って管理する情報処理装置に関する。 The present disclosure relates to an information processing device that manages an execution order of a plurality of tasks according to a priority.
特許文献1には、複数のタスクの実行順を制御する情報処理装置が開示されている。特許文献1の情報処理装置では、実行待ちしているタスクは、各タスクに設定された優先度に従う実行順で実行される。情報処理装置は、処理抜け頻度が処理抜け許容率以上となったタスクについて、優先度を高める。
しかし、制御されるタスクには、関連タスクの実行結果に基づいて実行されるため、関連タスクの後での実行が望ましいタスクが含まれうる。こうしたタスクは、優先度を高められた場合、実行順の変化に伴い関連タスク以前に実行されうる。故に、優先度を高められたタスクの実行結果において、関連タスクの実行結果が反映されず、精度の低下が生じえた。 However, the controlled task may include a task that should be executed after the related task because it is executed based on the execution result of the related task. When the priority of these tasks is increased, the tasks may be executed before the related tasks as the execution order changes. Therefore, in the execution result of the task with the increased priority, the execution result of the related task is not reflected, and the accuracy may decrease.
本開示は、タスクの優先度を高める場合においても、実行結果の精度低下を抑制可能な情報処理装置の提供を目的とする。 An object of the present disclosure is to provide an information processing apparatus capable of suppressing a decrease in accuracy of execution results even when increasing the priority of tasks.
上記目的は独立請求項に記載の特徴の組み合わせにより達成され、また、下位請求項は、本開示の更なる有利な具体例を規定する。特許請求の範囲に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本開示の技術的範囲を限定するものではない。 The above objective is achieved by a combination of the features recited in independent claims, and the subclaims define further advantageous embodiments of the present disclosure. The reference numerals in parentheses in the claims indicate the correspondence with the specific means described in the embodiments described below as one aspect, and do not limit the technical scope of the present disclosure. ..
上記目的を達成するための本開示の情報処理装置は、タスクを順に実行する実行部(10)と、実行部による実行を待つ複数のタスクの実行予定順を、各タスクに設定された優先度に基づいて決定する順序決定部(121)と、各タスクについて、実行頻度の低下した頻度低下タスクであるか否かを判断する頻度判断部(122)と、頻度低下タスクの優先度を高める優先度変更部(123)と、頻度低下タスクが、関連づけられた関連タスクの実行結果に基づいて実行されるタスクである場合に、関連タスクの優先度を、頻度低下タスクに対する実行予定順を維持するように高める順序維持部(124)と、を備える。 An information processing apparatus according to an embodiment of the present disclosure for achieving the above-described object includes an execution unit (10) that sequentially executes tasks, and a scheduled execution order of a plurality of tasks waiting for execution by the execution units, with priorities set for each task. Based on the order determination unit (121), a frequency determination unit (122) for determining whether each task is a frequency-reduced task with a reduced execution frequency, and a priority for increasing the priority of the frequency-reduced task. When the frequency changing unit (123) and the frequency-reduced task are tasks that are executed based on the execution results of the related tasks associated with each other, the priority of the related task is maintained in the scheduled execution order for the frequency-reduced task. And an order maintaining unit (124).
以上の構成によれば、順序維持部は、頻度低下タスクの関連タスクを、頻度低下タスクに対する実行予定順を維持するように優先度を高める。この結果、頻度低下タスクは、優先度変更部により優先度を高められる場合においても、関連タスク以前となることなく実行される。故に、優先度の変更に伴い実行予定順が変化する場合においても、関連タスクの実行結果を反映してタスクを実行しうる。従って、タスクの優先度を高める場合においても、実行結果の精度低下が抑制される。 According to the above configuration, the order maintaining unit increases the priority of the related task of the frequency-reduced task so as to maintain the scheduled execution order for the frequency-reduced task. As a result, the frequency-reduced task is executed before the related task even when the priority is increased by the priority changing unit. Therefore, even when the execution schedule order changes with the change in priority, the task can be executed by reflecting the execution result of the related task. Therefore, even when the priority of the task is increased, the accuracy reduction of the execution result is suppressed.
図1に示す本開示の実施形態による情報処理装置1は、例えば車両において、エンジンの燃料噴射や点火時期を制御するエンジンECUとして用いられる電子制御装置である。情報処理装置1は、ソフトウェアを非一時的に記録した非遷移的かつ実体的な記憶媒体としてのメモリ、ソフトウェアを実行するプロセッサ、および入出力インターフェースなどを備えたマイクロコンピュータである。メモリには、リアルタイムオペレーティングシステム(以下、RTOS:Real-time operating system)のプログラムと、RTOS上で動作し、エンジンECUとしての機能を提供するアプリケーションプログラムとが格納されている。
The
情報処理装置1は、アプリケーションプログラムによる機能を実現するための種々の処理を、RTOSにより実行される複数のタスクとして動作させる。タスクは、RTOSにより規定されたひと纏まりの実行単位である。情報処理装置1は、各タスクの実行状態および実行順を管理し、各タスクを逐次的に実行する。情報処理装置1で実行されるタスクには、エンジンの各気筒に対する点火制御、クランク角の取得、空燃比の取得、アクセル開度の取得、燃料噴射量の算出、スロットルバルブの開度制御などに区分された処理が個別に設定されている。情報処理装置1は、各タスクの実行順を、各タスクに設定された優先度等に基づいて管理する。情報処理装置1は、プロセッサでRTOSのプログラムを実行することにより、実行部10、割り込みコントローラ20、およびタスク割当管理部100としての機能を発揮する。
The
実行部10は、プロセッサのうち各タスクを順に実行するために割り当てられた領域である。実行部10は、各タスクに係る算術演算や論理演算などを行う演算回路や、各タスクに係るデータなどを一時的に格納するためのレジスタなどを含んでいる。実行部10は、タスクの割り当て条件が成立すると、タスク割当管理部100にタスクの割り当てを要求する。タスクの割り当て条件は、例えば実行中のタスクの実行開始から所定時間の経過や、実行中のタスクに係る一サイクルの演算の終了などである。実行部10は、タスク割当管理部100により新たなタスクの割り当てを受けると、実行中であったタスクがあればそのタスクに係る演算の進行状況やデータなどを退避させ、割り当てられたタスクの実行を開始する。実行部10は、割り当てられた順に従って実行中のタスクを切り替えることにより、各タスクを見かけ上で並列して逐次的に実行する。
The
割り込みコントローラ20は、各タスクの割り込み発生条件が成立しているか否かに基づいて、各タスクの割り込み要求を出力するモジュールである。各タスクの割り込み条件には、例えば情報処理装置1への入力信号の立ち上がりや所定時間の経過、データの転送完了などが個別に設定されている。割り込みコントローラ20は、割り込み条件の成立したタスクについての割り込み要求を、タスク割当管理部100に出力する。
The
タスク割当管理部100は、例えばプロセッサのうち、実行部10に割り当てられるタスクを管理するために割り当てられた領域である。タスク割当管理部100は、割り込みコントローラ20から各タスクについての割り込み要求を受け、各タスクに設定された優先度および割り込み要求を受けたタイミングに従って各タスクを実行部10で実行されるタスクとして割り当てる。タスク割当管理部100は、状態管理部110およびタスク制御部120としての機能を有する。
The task
状態管理部110は、各タスクの実行状態を管理するための記憶領域である。状態管理部110は、レディキュー111、キュー管理部112、関連タスクテーブル113を含んでいる。
The
レディキュー111は、各タスクの割り込み要求を格納する領域である。各タスクの割り込み要求は、タスクに設定された優先度の一致する割り込み要求ごとに、割り込み要求を受けた順に従ってレディキュー111に格納される。格納された各タスクの割り込み要求は、実行部10からタスクの割り当て要求を受けるたびに一つ取り出される。取り出された割り込み要求に対応するタスクが、実行部10で次に実行されるタスクとして割り当てられる。従って、レディキュー111内の各割り込み要求の配列が、その時点における実行順の予定を示した「実行予定順」に相当する。
The
割り込み要求されたタスクの取り出しは、格納されている割り込み要求の中で、最も優先度の高いタスクの割り込み要求から順に行われる。本実施形態では、優先度として設定された数値が小さいほど、高い優先度であるとして扱う。最も優先度の高い割り込み要求が複数格納されている場合は、先に格納された割り込み要求のタスクから順に割り当てられる。従って実行予定順は、例えば格納された割り込み要求のいずれかよりも優先度の高い割り込み要求を新たに格納された場合など、実際に割り当てられるまでに変動しうる。 The task for which an interrupt request has been issued is taken out in order from the interrupt request of the task with the highest priority among the stored interrupt requests. In the present embodiment, the smaller the numerical value set as the priority, the higher the priority. When a plurality of interrupt requests having the highest priority are stored, the tasks of the interrupt request stored first are assigned in order. Therefore, the order of execution schedules may change until the interrupt request is actually allocated, for example, when an interrupt request having a higher priority than any of the stored interrupt requests is newly stored.
キュー管理部112は、レディキュー111に対する割り込み要求の格納を管理するためのデータを格納する領域である。キュー管理部112には、キューイング数、あらかじめ設定された優先度、および変更閾値が、タスク割当管理部100で管理されるタスクごとに格納されている。キューイング数は、各タスクについてのレディキュー111に現在格納されている割り込み要求の数である。キューイング数は、実行を待っている各タスクの割り込み要求の数であり、「実行待ち数」に相当する。
The
優先度は、レディキュー111内で割り込み要求をソートするために、各タスクにあらかじめ設定されたパラメータである。優先度は、割り込み要求発生から割り当てまでの時間が短いことが好ましいタスクほど高く設定される。本実施形態の優先度は、0から4までの5段階が設定されている。各タスクには、通常優先度および一時優先度の二つまで優先度が設定可能となっている。通常優先度は、レディキュー111への格納にあたって参照される優先度である。一時優先度は、レディキュー111に格納された状態のタスクの実行予定順を変更する場合に、実行予定順を変更するタスクの割り込み要求に一時的に適用される優先度である。一時優先度は、通常優先度よりも高い優先度に設定されている。
The priority is a parameter preset for each task in order to sort the interrupt requests in the
変更閾値は、各タスクの割り込み要求に一時優先度を適用することにより、実行予定順を変更する条件としてあらかじめ設定されたパラメータである。実行予定順の変更は、いずれかのタスクが、実行頻度の低下した頻度低下タスクとなった場合に実施される。ただし、実行頻度が低下しているとは、各タスクに設定された許容される実行頻度範囲を下回っている状態を示す。本実施形態の変更閾値は、各タスクのキューイング数の閾値として設定されている。変更閾値は、想定される割り込み要求の発生頻度と、許容される実行頻度の下限とに基づいて設定される。例えば、割り込み要求の発生頻度が高いほど大きく、実行頻度の下限が高いほど小さい値に設定される。 The change threshold is a parameter set in advance as a condition for changing the scheduled execution order by applying the temporary priority to the interrupt request of each task. The execution schedule order is changed when any of the tasks becomes a frequency-reduced task with a reduced execution frequency. However, the decrease in the execution frequency indicates a state where the execution frequency is below the allowable execution frequency range set for each task. The change threshold value of this embodiment is set as a threshold value of the queuing number of each task. The change threshold is set based on the expected frequency of interrupt requests and the lower limit of the allowable execution frequency. For example, it is set to a larger value as the occurrence frequency of interrupt requests is higher, and is set to a smaller value as the lower limit of execution frequency is higher.
本実施形態では、キュー管理部112には、タスクA、タスクB、およびタスクCの三つのタスクについてキューイング管理のためのデータが格納されている。タスクAは、現在のクランク角に基づいて、燃料噴射量を算出するタスクである。タスクAには、通常優先度として4が設定され、一時優先度として1が設定されている。またタスクAには、変更閾値として3が設定されている。
In this embodiment, the
タスクBは、クランク角を取得するタスクである。タスクBで取得された最新のクランク角に基づいて、タスクAが実行される。故にタスクBには、タスクAの直前に実行されるように、通常優先度としてタスクAの通常優先度より一段階高い3が設定されている。またタスクBには、一時優先度として0が設定され、変更閾値として4が設定されている。タスクAおよびタスクBの一時優先度の段階の差は、通常優先度の差と一致するように設定されている。すなわち、タスクAの一時優先度である1に対して、タスクBの一時優先度である0が一段階高く設定されている。タスクBの割り込み要求は、ノイズ抑制等のため、タスクAの割り込み要求よりも高い頻度で発生する。 Task B is a task for acquiring the crank angle. Task A is executed based on the latest crank angle acquired in task B. Therefore, the task B is set to have a normal priority of 3 which is one step higher than the normal priority of the task A so that it is executed immediately before the task A. Further, in the task B, 0 is set as the temporary priority and 4 is set as the change threshold. The difference between the temporary priority levels of task A and task B is set to match the difference between the normal priorities. That is, the temporary priority of task A is set to be one step higher than the temporary priority of task A to be 0. The interrupt request of the task B occurs more frequently than the interrupt request of the task A because of noise suppression and the like.
タスクCは、各気筒に対する点火処理を行うタスクである。タスクCには、通常優先度として2が設定されている。タスクCは、他のいずれのタスクよりも通常優先度が高く設定されており、実行頻度の低下を生じない。従って、タスクCには、一時優先度および変更閾値が設定されていない。またタスクAおよびタスクBの一時優先度は、いずれのタスクに設定された通常優先度よりも高く設定されている。 Task C is a task of performing ignition processing for each cylinder. The task C has a normal priority of 2. The task C has a higher normal priority than any other task, and thus the execution frequency does not decrease. Therefore, the task C is not set with the temporary priority and the change threshold. The temporary priorities of the tasks A and B are set higher than the normal priorities set for any of the tasks.
関連タスクテーブル113は、各タスクと、当該タスクにあらかじめ関連付けられた関連タスクとの関係を格納する領域である。関連タスクは、あるタスクに対する一時優先度の適用により実行予定順が変更される場合に、連動して優先度を変更されるタスクである。関連タスクとして設定されるタスクは、例えばそのタスクの実行結果に基づいて他のタスクが実行されるタスクである。具体的には、所定のタスクの実行にあたって他のタスクの実行結果として得られたデータを参照する場合に、データを参照される側のタスクが、データを参照する側のタスクに対する関連タスクとしてあらかじめ設定されている。 The related task table 113 is an area for storing a relationship between each task and a related task associated with the task in advance. A related task is a task whose priority is changed in conjunction when the execution schedule order is changed by applying a temporary priority to a certain task. The task set as the related task is, for example, a task in which another task is executed based on the execution result of the task. Specifically, when referring to the data obtained as the execution result of another task in executing a predetermined task, the task of the side that refers to the data is previously set as a related task to the task of the side that refers to the data. It is set.
例えば本実施形態においては、燃料噴射量を算出するタスクAに対して、算出に当たって参照するクランク角を取得するタスクBが関連タスクとして設定されている。タスクAは、関連タスクであるタスクBによる最新のクランク角に基づいて燃料噴射量を算出する。なお、本実施形態において関連タスクとして設定されているタスクには、上述した関係以外のタスクも含まれている。例えば本実施形態においては、タスクBに対して、タスクAが関連タスクとして設定されている。すなわち、データを参照する側のタスクについても、データを参照される側のタスクに対する関連タスクとして設定されている。関連タスクテーブル113は、キュー管理部112とは別に、テーブル形式で各タスクと関連タスクとの関係を格納している。
For example, in the present embodiment, the task A for calculating the fuel injection amount is set as the related task to the task B for acquiring the crank angle to be referred to in the calculation. Task A calculates the fuel injection amount based on the latest crank angle by task B, which is a related task. The tasks set as the related tasks in the present embodiment include tasks other than the above-mentioned relationships. For example, in this embodiment, task A is set as a related task with respect to task B. That is, the task that refers to the data is also set as a related task to the task that refers to the data. The related task table 113 stores the relationship between each task and related tasks in a table format separately from the
タスク制御部120は、状態管理部110に格納された各データに基づいて、割り込み要求の受付および実行部10へのタスクの割り当てを制御する制御回路である。タスク制御部120は、キューイング部121、頻度判断部122、優先度変更部123、順序維持部124としての機能を発揮する。
The
キューイング部121は、割り込みコントローラ20から出力された割り込み要求を受信した場合に、受信した割り込み要求をレディキュー111に格納する。キューイング部121は、割り込み要求を受信したタスクの通常優先度をキュー管理部112から読み出す。キューイング部121は、レディキュー111のうち、通常優先度に対応した範囲の最後尾に割り込み要求を格納する。すなわちキューイング部121は、実行予定順を、各タスクに設定された優先度のうち通常優先度に基づいて決定する「順序決定部」に相当する。キューイング部121は、割り込み要求を格納したタスクについて、キュー管理部112に格納されているキューイング数を格納完了時点の値に更新する。またキューイング部121は、レディキュー111から割り込み要求が取り出されて実行部10に割り当てられた場合にも、キューイング数を更新する。
When receiving the interrupt request output from the interrupt
頻度判断部122は、各タスクについて、実行頻度の低下した頻度低下タスクであるか否かを判断する。本実施形態の頻度判断部122では、各タスクについてキュー管理部112に格納されたキューイング数、および変更閾値に基づいて頻度低下タスクであると判断する。頻度判断部122は、例えばキューイング部121がいずれかのタスクについて割り込み要求の格納およびキューイング数の更新を実施した場合に、タスクの更新後のキューイング数、および変更閾値を読みだす。頻度判断部122は、キューイング数が変更閾値以上である場合、割り込み要求を格納したタスクが頻度低下タスクとなっていると判断する。
The
優先度変更部123は、頻度判断部122により頻度低下タスクと判断されたタスクの優先度を高める。優先度変更部123は、レディキュー111に格納された頻度低下タスクの優先度を、通常優先度よりも高い一時優先度に変更させる。優先度変更部123は、優先度の変更にあたり、頻度低下タスクのキューイング数を減少させる。例えば優先度変更部123は、キューイング数を1まで減少させる。具体的には、優先度変更部123は、通常優先度に従って格納されていた頻度低下タスクの割り込み要求をレディキュー111から全て削除し、一時優先度に従う割り込み要求を1つのみレディキュー111に改めて格納する。優先度変更部123は、一時優先度に従う割り込み要求を格納すると、キューイング数を更新して1とする。
The
順序維持部124は、頻度低下タスクに関連付けられた関連タスクについて、頻度低下タスクに対する実行予定順を維持するように優先度を高める。すなわち、頻度低下タスクの優先度を高める前における実行予定順の前後関係が、頻度低下タスクの優先度を高めた後においても維持されるように優先度を変更する。順序維持部124は、いずれかのタスクが頻度判断部122により頻度低下タスクであると判断されると、そのタスクの関連タスクを関連タスクテーブル113から読み出す。また順序維持部124は、関連タスクテーブル113から読み出した関連タスクについて、一時優先度をキュー管理部112から読み出す。順序維持部124は、関連タスクの優先度を、通常優先度よりも高い優先度である一時優先度に変更させる。
The
タスクAおよびタスクBに設定された一時優先度の差は、通常優先度の段階の差と一致するように設定されている。従って、タスクAおよびタスクBの一方が頻度低下タスクとなった場合、他方である関連タスクの優先度は、頻度低下タスクに対する関連タスクの相対的な実行予定順を維持されるように変更される。また、タスクAおよびタスクBの一時優先度は、いずれのタスクの通常優先度よりも高く、かつ優先度の差が一段階となるように設定されている。この結果、タスクAおよびタスクBの一方が頻度低下タスクとなった場合、他方である関連タスクは、頻度低下タスクと連続して実行されるように優先度を変更される。順序維持部124は、関連タスクの優先度の変更にあたり、関連タスクのキューイング数を減少させる。例えば順序維持部124は、関連タスクのキューイング数を1まで減少させる。
The difference between the temporary priorities set for the task A and the task B is set so as to match the difference between the normal priority stages. Therefore, when one of the task A and the task B becomes a frequency-reduced task, the priority of the other related task is changed so that the relative scheduled execution order of the related task with respect to the frequency-reduced task is maintained. .. Further, the temporary priorities of the tasks A and B are set higher than the normal priorities of any of the tasks, and the difference between the priorities is set to one step. As a result, when one of the task A and the task B becomes a frequency-reduced task, the priority of the other related task is changed so as to be executed continuously with the frequency-reduced task. The
[タスク制御部120の作動]
タスク制御部120の作動例を説明する。タスク制御部120は、割り込みコントローラ20から割り込み要求を受けた場合に、図2のフローチャートに示す処理をS1から順に実行する。
[Operation of task control unit 120]
An operation example of the
S1では、割り込み要求を受けたタスクについて通常優先度を取得し、取得した通常優先度に従ってタスクの割り込み要求をレディキュー111に格納する。S2では、S1で割り込み要求を格納したタスクのキューイング数を更新する。
In S1, the normal priority is acquired for the task that received the interrupt request, and the interrupt request of the task is stored in the
S3では、S2でキューイング数を更新したタスクが、頻度低下タスクであるか否かを判断する。すなわち、更新したタスクのキューイング数が変更閾値以上となっているか否かを判断する。変更閾値以上となっている場合には頻度低下タスクであるとしてS4に進み、変更閾値未満である場合は頻度低下タスクでないとして図2に示す処理を終了する。 In S3, it is determined whether or not the task whose queuing number has been updated in S2 is a reduced frequency task. That is, it is determined whether or not the queuing number of the updated task is equal to or larger than the change threshold. If it is equal to or greater than the change threshold, the process proceeds to S4 as a frequency lowering task, and if it is less than the change threshold, the process shown in FIG.
S4では、S3で頻度低下タスクであると判断されたタスクについて、関連タスクテーブル113に関連タスクが設定されているか否かを判断する。関連タスクが設定されている場合はS5に進み、設定されていない場合にはS7に進む。 In S4, it is determined whether or not a related task is set in the related task table 113 for the task that is determined to be the frequency-reduced task in S3. If the related task is set, the process proceeds to S5, and if it is not set, the process proceeds to S7.
S5では、通常優先度に従ってキューイングされた関連タスクの割り込み要求を削減し、一つの割り込み要求のみレディキュー111に残す。
In S5, the interrupt requests of the related tasks queued according to the normal priority are reduced, and only one interrupt request is left in the
S6では、関連タスクとして設定されたタスクの一時優先度を取得し、レディキュー111内に残された関連タスクに係る割り込み要求の優先度を、通常優先度から一時優先度に変更させる。優先度の変更に従って、関連タスクに係る割り込み要求の位置が移動し、実行予定順が更新される。
In S6, the temporary priority of the task set as the related task is acquired, and the priority of the interrupt request related to the related task remaining in the
S7では、通常優先度に従ってキューイングされた頻度低下タスクの割り込み要求を削減し、一つの割り込み要求のみレディキュー111に残す。
In S7, the interrupt requests of the frequency-reduced tasks queued according to the normal priority are reduced, and only one interrupt request is left in the
S8では、頻度低下タスクの一時優先度を取得し、レディキュー111内に残された頻度低下タスクに係る割り込み要求の優先度を、通常優先度から一時優先度に変更する。優先度の変更に従って頻度低下タスクに係る割り込み要求の位置が移動し、実行予定順が更新される。
In S8, the temporary priority of the frequency-reduced task is acquired, and the priority of the interrupt request related to the frequency-reduced task remaining in the
図2に示したタスク制御部120の作動に伴う、レディキュー111およびキュー管理部112の状態変化の例を説明する。図3には、タスクAのキューイング数が2となっていたレディキュー111に対して、タスクAの割り込み要求が更に格納される場合の挙動を示している。図2に示したS1およびS2により、レディキュー111内の優先度4の範囲の最後尾に、タスクAの割り込み要求が更に格納され、キュー管理部112に格納されたタスクAのキューイング数が2から3に更新される。この結果、S3でタスクAが頻度低下タスクであると判断され、またS4でタスクBが頻度低下タスクの関連タスクであると判断される。
An example of the state change of the
S5およびS6により、レディキュー111内の優先度3の範囲に格納されたタスクBの割り込み要求のうち、一つのみが優先度0の範囲に移動され、残りは全て削除される。また、タスクBのキューイング数は1に更新される。S7およびS8により、レディキュー111内の優先度4の範囲に格納されたタスクAの割り込み要求のうち、一つのみが優先度1の範囲に移動され、残りは全て削除される。また、タスクAのキューイング数は1に更新される。
Through S5 and S6, among the interrupt requests of task B stored in the range of
タスク制御部120の作動に伴う実行部10において実行されるタスクの時間変化の例を図4に沿って説明する。図4は、例えば車両の高速走行などにより、通常優先度の高いタスクCの割り込み要求頻度が高まった状態において、実行部10で実行されるタスクの切替わりを示す。通常優先度の高いタスクCの割り込み要求が増加することにより、通常優先度の最も低いタスクAは割り込み要求を受けているにも拘らず実行されない状態となっている。
An example of the change over time of the task executed by the
時刻t1に、タスクAの割り込み要求を受けてタスクAのキューイング数が3となったとする。この結果、タスクAが頻度低下タスクと判断され、またタスクBが頻度低下タスクに対する関連タスクであると判断される。タスクAおよびタスクBは一時優先度に従ってレディキュー111内の位置を変更される。時刻t2に実行部10に対するタスクの割り当てが発生し、一時優先度として優先度0となっているタスクBが割り当てられる。時刻t3にタスクCの割り込み要求が発生しているが、タスクCの通常優先度は、タスクAの一時優先度である優先度1より低い優先度2である。従って、時刻t4に再び実行部10に対するタスクの割り当てが発生すると、タスクAは、タスクBの直後にタスクCより優先して割り当てられる。
It is assumed that the queuing number of the task A becomes 3 at the time t1 in response to the interrupt request of the task A. As a result, it is determined that task A is a frequency-reduced task and task B is a related task to the frequency-reduced task. The positions of task A and task B in the
[実施形態のまとめ]
以上、説明した実施形態によれば、順序維持部124は、頻度低下タスクの関連タスクを、頻度低下タスクに対する実行予定順を維持するように優先度を高める。この結果、頻度低下タスクは、優先度変更部123により優先度を高められる場合においても、関連タスク以前の実行となることなく実行される。故に、優先度の変更に伴い実行予定順が変化する場合においても、関連タスクの実行結果を反映してタスクを実行しうる。従って、頻度低下タスクの優先度を高める場合においても、実行結果の精度低下が抑制される。
[Summary of Embodiments]
As described above, according to the embodiment described above, the
加えて本実施形態では、頻度判断部122は、キューイング数が変更閾値以上となったタスクを頻度低下タスクと判断する。こうした判断によれば、個々のタスクに対してタイマや抜け率の算出部などを新たに設けることなく、実行頻度の低下を判断可能となる。従って、実行頻度の判断に係るコストを抑制可能となる。
In addition, in the present embodiment, the
また本実施形態では、優先度変更部123は、頻度低下タスクの優先度を高めた場合に頻度低下タスクの実行待ち数を減少させる。実行待ち数の減少により、頻度低下タスクの実行待ち数が再び変更閾値以上となるまでの時間が延長される。故に、頻度低下タスクと判断されることに伴う優先度変更部123による優先度の変更の発生が抑制される。従って、頻度低下タスクよりも優先度の高いタスクの実行頻度低下が抑制される。
Further, in the present embodiment, the
さらに本実施形態では、優先度変更部123は、頻度低下タスクの優先度を、各タスクに設定された通常優先度よりも高い優先度に変更する。故に、頻度判断部122により頻度低下タスクが発生していると判断されてから、関係タスク以外のタスクの割り当てを待つことなく実行部10に割り当てられる。この結果、頻度低下タスクは、頻度低下タスクと判断されてから実行までの期間を短縮される。
Further, in this embodiment, the
また本実施形態では、順序維持部124は、頻度低下タスクの実行予定順を関連タスクの直後とするように関連タスクの優先度を高める。故に、頻度低下タスクは、関連タスクの割り当てから、他のタスクの割り当てを待つことなく実行部10に割り当てられる。この結果、頻度低下タスクは、より新しい関連タスクの実行結果に基づいて実行されうる。従って、頻度低下タスクの実行結果の精度をより向上しうる。
Further, in the present embodiment, the
<他の実施形態>
以上、本開示の実施形態を説明したが、本開示は上述の実施形態に限定されるものではなく、次の変形例も本開示の技術的範囲に含まれ、さらに、下記以外にも要旨を逸脱しない範囲内で種々変更して実施できる。なお、以下の説明において、それまでに使用した符号と同一番号の符号を有する要素は、特に言及する場合を除き、それ以前の実施形態における同一符号の要素と同一である。また、構成の一部のみを説明している場合、構成の他の部分については先に説明した実施形態を適用できる。
<Other Embodiments>
Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments, and the following modifications are also included in the technical scope of the present disclosure. Various modifications can be made without departing from the scope. In the following description, elements having the same reference numerals as those used up to now are the same as the elements having the same reference numerals in the previous embodiments, unless otherwise specified. Further, when only a part of the configuration is described, the above-described embodiments can be applied to other parts of the configuration.
上述の実施形態においては、頻度判断部122は、キューイング数に基づいて頻度低下タスクであるか否かを判断していた。しかし、各タスクの処理抜け率や待ち時間などを用いて判断する構成でもよい。またこの場合には、優先度を変更する場合においてキューイング数を削減しなくてもよい。
In the above-described embodiment, the
上述の実施形態においては、頻度低下タスクおよび関連タスクの一時優先度は、どのタスクの通常優先度よりも高く、かつ異なる優先度に設定されていた。しかし、頻度低下タスクの関連タスクに対する実行予定順が維持可能であれば、設定される一時優先度はこれに限られない。例えば、同じ一時優先度を設定し、通常優先度の差による元の実行予定順に従う順序で移動先の優先度に格納する構成でもよい。またこの場合、一時優先度がいずれかのタスクの通常優先度と一致していてもよい。 In the above-described embodiment, the temporary priority of the frequency-reduced task and the related task is set higher than the normal priority of any task and set to different priorities. However, the temporary priority to be set is not limited to this as long as the execution schedule order of the related task of the frequency-reduced task can be maintained. For example, the same temporary priority may be set, and the priorities of the movement destinations may be stored in the order according to the original execution schedule order based on the difference in the normal priorities. Further, in this case, the temporary priority may match the normal priority of any task.
上述の実施形態においては、タスク割当管理部100の管理するタスクとして三つのタスクが設定され、あるタスクに対して、関連タスクとして一つのタスクのみが設定されていた。しかし、タスクの数は三つ以上あってもよく、またその場合にはあるタスクに対して複数のタスクが関連タスクとして設定されていてもよい。例えば、タスク割当管理部100の管理するタスクとして、空燃比を取得するタスクやアクセル開度を取得するタスク、スロットル開度を算出するタスクなどが更に設定されていてもよい。
In the above-described embodiment, three tasks are set as tasks managed by the task
また燃料噴射量を算出するタスクに対する関連タスクとして、クランク角を取得するタスクに加えて、空燃比を取得するタスクが設定されていてもよい。複数の関連タスクが設定されている場合には、順序維持部124は、各関連タスクの間の実行予定順についても関係を維持するように、各関連タスクの優先度を変更すればよい。こうした構成によれば、一つのタスクに対して複数の関連タスクが設定されている構成においても、設計時に想定された実行順を維持して優先度を高めることが可能となる。また、関連タスクには、頻度低下タスクと実行予定順が連続していないタスクが含まれていてもよい。
As a related task to the task of calculating the fuel injection amount, a task of acquiring the air-fuel ratio may be set in addition to the task of acquiring the crank angle. When a plurality of related tasks are set, the
上述の実施形態においては、所定のタスクに対して、そのタスクの実行結果を参照するタスクも関連タスクとして設定されていた。しかし、こうしたタスクが関連タスクに設定されていなくてもよい。 In the above-described embodiment, for a predetermined task, a task that refers to the execution result of the task is also set as the related task. However, such a task does not have to be set as a related task.
上述の実施形態においては、順序維持部124は、頻度低下タスクに関連タスクが設定されている場合には、必ず関連タスクの優先度も変更していた。しかし、関連タスクの優先度を変更せず、頻度低下タスクの優先度のみを変更する場合があってもよい。例えば、関連タスクのキューイング数が十分小さい場合には、関連タスクは十分な実行頻度で周期的に実行されている可能性が高い。故に、関連タスクの優先度を変更することなく関連タスクの実行結果を参照して頻度低下タスクが実行可能であるとみなせる。従って順序維持部124は、関連タスクのキューイング数が所定の維持閾値未満である場合には、関連タスクの優先度を通常優先度のまま維持し、頻度低下タスクのみ優先度を変更する構成とすることもできる。こうした構成によれば、関連タスクよりも優先度の高いタスクの実行頻度低下を抑制して、頻度低下タスクの実行頻度を維持しうる。
In the above-described embodiment, the
上述の実施形態においては、情報処理装置1はエンジンECUとして用いられる電子制御装置であった。しかし、情報処理装置1の用途はこれに限られず、メモリに格納されるアプリケーションソフトウェアを適宜変更し、他の用途に利用可能である。
In the above-described embodiment, the
上述の実施形態においては、タスク割当管理部100による実行部10に対する割り当ては、所定時間の経過またはサイクルの終了時に実行されるとしていた。しかし、優先度に基づいた割り当て方法であれば、割り当ての判断タイミングなどはこれに限られず適宜変更可能である。一例として、所定の周期ごとに実行中のタスクよりも優先度の高いタスクがレディキュー111に格納されているか否かを判断し、優先度の高いタスクが格納されていればそのタスクに切り替える方法が採用可能である。こうした切替えが実施された場合には、実行中であったタスクは一連のサイクルの処理の進行状況などを退避させるとともに、レディキュー111の先頭に割り込み要求を格納される。
In the above-described embodiment, the task
1 情報処理装置、 10 実行部、 121 キューイング部(順序決定部)、 122 頻度判断部、 123 優先度変更部、 124 順序維持部 1 Information Processing Device, 10 Execution Unit, 121 Queuing Unit (Order Determining Unit), 122 Frequency Judgment Unit, 123 Priority Change Unit, 124 Order Maintenance Unit
Claims (6)
前記実行部による実行を待つ複数の前記タスクの実行予定順を、各前記タスクに設定された優先度に基づいて決定する順序決定部(121)と、
各前記タスクについて、実行頻度の低下した頻度低下タスクであるか否かを判断する頻度判断部(122)と、
前記頻度低下タスクの優先度を高める優先度変更部(123)と、
前記頻度低下タスクが、関連づけられた関連タスクの実行結果に基づいて実行される前記タスクである場合に、前記関連タスクの優先度を、前記頻度低下タスクに対する実行予定順を維持するように高める順序維持部(124)と、を備える情報処理装置。 An execution unit (10) for sequentially executing tasks,
An order determination unit (121) that determines the scheduled execution order of the plurality of tasks waiting for execution by the execution unit, based on the priority set for each task;
A frequency determination unit (122) that determines whether or not each of the tasks is a frequency-reduced task with a reduced execution frequency;
A priority change unit (123) for increasing the priority of the frequency-reduced task,
An order in which, when the frequency-reduced task is the task that is executed based on the execution result of the associated related task, the priority of the related task is increased to maintain the scheduled execution order for the frequency-reduced task. An information processing apparatus comprising: a maintenance unit (124).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018226709A JP7263746B2 (en) | 2018-12-03 | 2018-12-03 | Information processing equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018226709A JP7263746B2 (en) | 2018-12-03 | 2018-12-03 | Information processing equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020091540A true JP2020091540A (en) | 2020-06-11 |
JP7263746B2 JP7263746B2 (en) | 2023-04-25 |
Family
ID=71012824
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018226709A Active JP7263746B2 (en) | 2018-12-03 | 2018-12-03 | Information processing equipment |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7263746B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113688053A (en) * | 2021-09-01 | 2021-11-23 | 北京计算机技术及应用研究所 | Queuing use method and system for cloud testing tool |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6057441A (en) * | 1983-09-08 | 1985-04-03 | Fujitsu Ltd | Cue control system |
JPH01144131A (en) * | 1987-11-30 | 1989-06-06 | Nec Corp | Preference control system for execution of transaction |
JP2000215068A (en) * | 1999-01-21 | 2000-08-04 | Matsushita Electric Ind Co Ltd | Multitask scheduling device |
JP2009294712A (en) * | 2008-06-02 | 2009-12-17 | Panasonic Corp | Priority controller and priority control method |
JP2013088937A (en) * | 2011-10-14 | 2013-05-13 | Toyota Motor Corp | Information processing device |
JP2016206817A (en) * | 2015-04-20 | 2016-12-08 | 株式会社デンソー | Electronic controller |
CN106776395A (en) * | 2017-01-22 | 2017-05-31 | 中国人民解放军国防科学技术大学 | A kind of method for scheduling task and device of shared cluster |
-
2018
- 2018-12-03 JP JP2018226709A patent/JP7263746B2/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6057441A (en) * | 1983-09-08 | 1985-04-03 | Fujitsu Ltd | Cue control system |
JPH01144131A (en) * | 1987-11-30 | 1989-06-06 | Nec Corp | Preference control system for execution of transaction |
JP2000215068A (en) * | 1999-01-21 | 2000-08-04 | Matsushita Electric Ind Co Ltd | Multitask scheduling device |
JP2009294712A (en) * | 2008-06-02 | 2009-12-17 | Panasonic Corp | Priority controller and priority control method |
US20110072435A1 (en) * | 2008-06-02 | 2011-03-24 | Panasonic Corporation | Priority control apparatus and priority control method |
JP2013088937A (en) * | 2011-10-14 | 2013-05-13 | Toyota Motor Corp | Information processing device |
JP2016206817A (en) * | 2015-04-20 | 2016-12-08 | 株式会社デンソー | Electronic controller |
CN106776395A (en) * | 2017-01-22 | 2017-05-31 | 中国人民解放军国防科学技术大学 | A kind of method for scheduling task and device of shared cluster |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113688053A (en) * | 2021-09-01 | 2021-11-23 | 北京计算机技术及应用研究所 | Queuing use method and system for cloud testing tool |
Also Published As
Publication number | Publication date |
---|---|
JP7263746B2 (en) | 2023-04-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9959313B2 (en) | Database management system and method capable of dynamically issuing inputs/outputs and executing operations in parallel | |
US7302686B2 (en) | Task management system | |
JP5675840B2 (en) | Query management | |
US8924981B1 (en) | Calculating priority indicators for requests in a queue | |
JPH10502751A (en) | How to control a technical process or process | |
JP4241462B2 (en) | Control unit and microcomputer | |
US8954969B2 (en) | File system object node management | |
JPH0816410A (en) | Unit and method for schedule control | |
JP2020091540A (en) | Information processing device | |
JP4206653B2 (en) | Task scheduling system and method, program | |
US8555285B2 (en) | Executing a general-purpose operating system as a task under the control of a real-time operating system | |
US20050066093A1 (en) | Real-time processor system and control method | |
CN112659119A (en) | Control method and device of mechanical arm, electronic equipment and storage medium | |
CN113032119A (en) | Task scheduling method and device, storage medium and electronic equipment | |
JP2007280253A (en) | Information processor and information processing method | |
JP6365367B2 (en) | Electronic control unit | |
KR100981017B1 (en) | Method for re-defining priority and managing ready queue in system having static task define function and system for executing the method | |
JP2020135214A (en) | Task management apparatus | |
JPS62284437A (en) | Task control system | |
JP2014225137A (en) | Task scheduler, microprocessor, and task scheduling method | |
JP6729430B2 (en) | Electronic control unit | |
US11449502B1 (en) | Calculating a throttle limit for requests in a database system | |
JP5283675B2 (en) | Database management system and method | |
JP2001022601A (en) | Job execution control method and parallel computer system | |
KR102184136B1 (en) | Method and apparatus for determining the period of resource supply model in a hierarchical scheduling system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20211013 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20220818 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20221004 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20221202 |
|
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: 20230314 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230327 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 7263746 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |