JP4009602B2 - Task processing method, apparatus, and program using real-time OS - Google Patents
Task processing method, apparatus, and program using real-time OS Download PDFInfo
- Publication number
- JP4009602B2 JP4009602B2 JP2004057684A JP2004057684A JP4009602B2 JP 4009602 B2 JP4009602 B2 JP 4009602B2 JP 2004057684 A JP2004057684 A JP 2004057684A JP 2004057684 A JP2004057684 A JP 2004057684A JP 4009602 B2 JP4009602 B2 JP 4009602B2
- Authority
- JP
- Japan
- Prior art keywords
- event
- level
- deadline
- time
- identification information
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、リアルタイムOSを用いたタスク処理方法、装置、及びプログラムに係り、特にリアルタイムOS上で認識されるイベントに応じて該当するイベント処理を実行するためのタスク処理方法、装置、及びプログラムに関する。 The present invention relates to a task processing method, apparatus, and program using a real-time OS, and more particularly, to a task processing method, apparatus, and program for executing event processing corresponding to an event recognized on the real-time OS. .
監視制御装置等のリアルタイム制御が要求されるコンピュータを用いた制御装置やシステムでは、プロセッサ(CPU)により実行されるオペレーティングシステム(OS)として、処理効率の高いリアルタイムOSが望まれている。リアルタイムOSでは、次に実行すべきタスクを決定するための処理、即ちタスクスケジューリングの機能(アルゴリズム)が採用され、優先度が同一又は異なる複数のタスクを時分割で切り替えながら、それぞれのタスクを並列実行可能となっている。 In a control device or system using a computer that requires real-time control, such as a monitoring control device, a real-time OS with high processing efficiency is desired as an operating system (OS) executed by a processor (CPU). The real-time OS employs a process (algorithm) for determining a task to be executed next, that is, a task scheduling function (algorithm), and switches tasks with the same priority level or different priority levels in a time-sharing manner. It is executable.
このようなリアルタイムOSのタスクスケジューリング方法では、処理効率向上のため、採用されるアルゴリズムの改善が図られてきた。 In such a task scheduling method of the real-time OS, improvement of an algorithm employed has been attempted in order to improve processing efficiency.
例えば、特許文献1によれば、優先度の小さいタスクの実行開始を次の割り込み発生時まで遅延させることが可能な場合、現在実行中のタスクの実行を継続することにより、タスクの切替回数を低減し、優先度の小さいタスクで発生しやすいデッドライン違反(デッドライン異常)を低減するようにしたリアルタイムOSのタスク制御装置およびそのタスクスケジューリング方法が記載されている。
For example, according to
また、特許文献2によれば、周期的マルチメディアタスクをスケジューリングするためのソフトリアルタイムにおけるスケジューリング方法として、新しいタスク到着時点でのCPUの負荷状態に応じてスケジューリング可能かどうかを判断し、スケジューリング可能である場合にスケジューリング対象のすべてのタスクを実行し、すべてのタスクを実行した結果から得られる各タスクの通信待ち時間に応じて各タスクの適応デッドラインを設定するものが記載されている。
しかしながら、上述した従来技術では、タスクスケジューリング方法のアルゴリズム改善により処理効率が向上する反面、CPUが過負荷状態となった場合やその負荷状態が継続して輻輳状態となった場合、処理遅延によるデッドライン異常が一旦発生すると、このデッドライン異常をタスク側で認識した場合でも、負荷状態はすぐには解消されず、そのデッドライン異常が継続して発生し続け、同じ異常対応処理を繰り返し実行してしまうことがあった。 However, in the above-described prior art, the processing efficiency is improved by improving the algorithm of the task scheduling method, but on the other hand, if the CPU is overloaded or the loaded state is continuously congested, dead due to processing delay Once a line error occurs, even if the task recognizes this deadline error, the load condition will not be resolved immediately, the deadline error will continue to occur, and the same error handling process will be repeated. There was a case.
本発明は、このような従来の事情を考慮してなされたもので、リアルタイムOSのタスク処理において、デッドライン異常が発生した場合に負荷状態が継続して同じ異常対応処理を繰り返し実行するという事態を回避することを目的とする。 The present invention has been made in consideration of such conventional circumstances, and in the task processing of the real-time OS, when a deadline abnormality occurs, the load state continues and the same abnormality handling process is repeatedly executed. The purpose is to avoid.
上記目的を達成するため、本発明に係るリアルタイムOSを用いたタスク処理方法は、リアルタイムOS上で認識されるイベントに応じて該当するイベント処理を実行するタスク処理方法であって、前記リアルタイムOSからのイベント通知時に、イベント識別情報に加え、前記イベント発生時からの遅延時間を受け取るステップと、前記イベント識別情報で識別されるイベント毎に前記遅延時間に基づいて予め設定されたデッドライン異常レベルを判定するレベル判定ステップと、前記イベント毎に前記デッドライン異常レベルの継続発生回数を計数する計数ステップと、前記イベント毎に前記デッドライン異常レベルの継続発生回数に基づいて、予め設定されたイベント処理を決定する処理決定ステップと、決定された前記イベント処理を実行するステップとを有し、前記レベル判定ステップは、前記イベント識別情報と前記遅延時間のしきい値から前記デッドライン異常レベルを判定するレベル判定用しきい値判定テーブルを使用し、前記計数ステップは、前記イベント識別情報と前記デッドライン異常レベル毎に前記デッドライン異常レベルの継続発生回数を計数する継続発生回数カウントテーブルを使用し、前記処理決定ステップは、前記イベント識別情報、前記デッドライン異常レベル、及び前記デッドライン異常レベルの継続発生回数のしきい値に関連付けてイベント処理を決定する処理決定テーブルを使用することを特徴とする。 In order to achieve the above object, a task processing method using a real-time OS according to the present invention is a task processing method for executing event processing corresponding to an event recognized on the real-time OS. A step of receiving a delay time from the event occurrence time in addition to the event identification information, and a deadline abnormality level set in advance based on the delay time for each event identified by the event identification information A level determination step for determining, a counting step for counting the number of continuous occurrences of the deadline abnormal level for each event, and a preset event process based on the number of continuous occurrences of the deadline abnormal level for each event A process determining step for determining the event process and the determined event process Possess and executing, said level determination step, using the level determining threshold value determination table determines the deadline abnormal level from the threshold of the event identification information and the delay time, the counting step Uses a continuous occurrence count table that counts the number of continuous occurrences of the deadline abnormality level for each of the event identification information and the deadline abnormality level, and the process determining step includes the event identification information, the deadline abnormality A process determination table that determines an event process in association with a level and a threshold value of the number of continuous occurrences of the deadline abnormality level is used .
本発明に係るリアルタイムOSを用いたタスク処理方法において、前記イベント処理は、前記イベント毎に同一の前記デッドライン異常レベル内で前記継続発生回数によって割り当てられる複数段階の処理を含み、前記複数段階の処理は、複数段階の準正常処理、及び複数段階の異常処理を含んでもよい。 In task processing method using the real time OS according to the present invention, pre-Symbol event processing includes processing a plurality of steps to be assigned by the continuous occurrences of the same the deadline abnormal level in each said event, said plurality of stages This process may include a plurality of stages of quasi-normal processes and a plurality of stages of abnormal processes.
本発明に係るタスク処理装置は、リアルタイムOS上で認識されるイベントに応じて該当するイベント処理を実行するタスク処理装置であって、前記リアルタイムOSからのイベント通知時に、イベント識別情報に加え、前記イベント発生時からの遅延時間を受け取る手段と、前記イベント識別情報で識別されるイベント毎に前記遅延時間に基づいて予め設定されたデッドライン異常レベルを判定するレベル判定手段と、前記イベント毎に前記デッドライン異常レベルの継続発生回数を計数する計数手段と、前記イベント毎に前記デッドライン異常レベルの継続発生回数に基づいて、予め設定されたイベント処理を決定する処理決定手段と、決定された前記イベント処理を実行する手段とを有し、前記レベル判定手段は、前記イベント識別情報と前記遅延時間のしきい値から前記デッドライン異常レベルを判定するレベル判定用しきい値判定テーブルを有し、前記計数手段は、前記イベント識別情報と前記デッドライン異常レベル毎に前記デッドライン異常レベルの継続発生回数を計数する継続発生回数カウントテーブルを有し、前記処理決定手段は、前記イベント識別情報、前記デッドライン異常レベル、及び前記デッドライン異常レベルの継続発生回数のしきい値に関連付けてイベント処理を決定する処理決定テーブルを有することを特徴とする。 A task processing device according to the present invention is a task processing device that executes event processing corresponding to an event recognized on a real-time OS, and in addition to event identification information at the time of event notification from the real-time OS, Means for receiving a delay time from the occurrence of an event; level determining means for determining a preset deadline abnormality level based on the delay time for each event identified by the event identification information; and Counting means for counting the number of continuous occurrences of the deadline abnormal level, processing determining means for determining a preset event process based on the number of continuous occurrences of the deadline abnormal level for each event, and the determined have a means for executing the event process, the level determining means, said event identification information And a threshold determination table for level determination for determining the deadline abnormality level from the delay time threshold, and the counting means includes the deadline abnormality for each of the event identification information and the deadline abnormality level. A continuous occurrence count table that counts the number of continuous occurrences of a level, wherein the process determining means associates with the event identification information, the deadline abnormal level, and a threshold of the number of continuous occurrences of the deadline abnormal level And a process determination table for determining event processes .
本発明に係るプログラムは、リアルタイムOS上で認識されるイベントに応じて該当するイベント処理を実行するタスク処理装置で用いる制御プログラムであって、コンピュータに、前記リアルタイムOSからのイベント通知時に、イベント識別情報に加え、前記イベント発生時からの遅延時間を受け取るステップと、前記イベント識別情報で識別されるイベント毎に前記遅延時間に基づいて予め設定されたデッドライン異常レベルを判定するレベル判定ステップと、前記イベント毎に前記デッドライン異常レベルの継続発生回数を計数する計数ステップと、前記イベント毎に前記デッドライン異常レベルの継続発生回数に基づいて、予め設定されたイベント処理を決定する処理決定ステップと、決定された前記イベント処理を実行するステップとを実行させるためのものであり、前記レベル判定ステップは、前記イベント識別情報と前記遅延時間のしきい値から前記デッドライン異常レベルを判定するレベル判定用しきい値判定テーブルを使用し、前記計数ステップは、前記イベント識別情報と前記デッドライン異常レベル毎に前記デッドライン異常レベルの継続発生回数を計数する継続発生回数カウントテーブルを使用し、前記処理決定ステップは、前記イベント識別情報、前記デッドライン異常レベル、及び前記デッドライン異常レベルの継続発生回数のしきい値に関連付けてイベント処理を決定する処理決定テーブルを使用することを特徴とする。 The program according to the present invention is a control program used in a task processing device that executes event processing corresponding to an event recognized on the real-time OS, and is configured to identify an event when an event is notified to the computer from the real-time OS. In addition to information, a step of receiving a delay time from the time of the event occurrence, a level determination step of determining a preset deadline abnormality level based on the delay time for each event identified by the event identification information, A counting step for counting the number of continuous occurrences of the deadline abnormal level for each event; a process determining step for determining a preset event process based on the number of continuous occurrences of the deadline abnormal level for each event; A step for executing the determined event processing. All SANYO for executing the flop, said level determination step, using the level determining threshold value determination table determines the deadline abnormal level from the threshold of the event identification information and the delay time The counting step uses a continuous occurrence count table that counts the event identification information and the number of continuous occurrences of the deadline abnormal level for each deadline abnormal level, and the process determining step includes the event identification information, A process determination table for determining event processing in association with the threshold of the deadline abnormal level and the number of continuous occurrences of the deadline abnormal level is used .
本発明によれば、イベント発生時刻からタスク側へのイベント実行遅延時間と、デッドライン異常の発生した回数とに応じて、正常処理、準正常処理、異常処理等のイベント処理のデッドライン異常に対する異常対応処理の段階を細かく設定して実行することができ、これによりデッドライン異常が発生した場合、タスク側で負荷状態が継続して同じ異常対応処理のタスクを繰り返し実行する事態を回避することができる。 According to the present invention, depending on the event execution delay time from the event occurrence time to the task side and the number of times the deadline abnormality has occurred, the deadline abnormality of event processing such as normal processing, semi-normal processing, abnormal processing, etc. It is possible to execute by setting the stage of the error handling process in detail, and when a deadline error occurs, avoid the situation where the task continues to load and the task of the same error handling process is repeated Can do.
次に、本発明に係るリアルタイムOSを用いたタスク処理方法、装置、及びプログラムを実施するための最良の形態について、図面を参照して詳細に説明する。 Next, the best mode for carrying out a task processing method, apparatus, and program using a real-time OS according to the present invention will be described in detail with reference to the drawings.
本実施例のタスク処理装置は、例えば監視制御装置等のリアルタイム制御が要求される制御装置に適用されるものである。 The task processing device according to the present embodiment is applied to a control device that requires real-time control, such as a monitoring control device.
図1は、本実施例のタスク処理装置の構成例を示す。図1に示すタスク処理装置1は、ハードウェア構成上、プログラム制御で動作するCPU(プロセッサ)11と、CPU11により実行されるソフトウェア14が格納されるメモリ(RAM/RAM)12と、入力器や表示器等のI/O(入出力)機器2に接続されるI/Oポート13とを有する。
FIG. 1 shows a configuration example of a task processing apparatus according to this embodiment. A
図2は、ソフトウェア14の構成例を概念的に示す。図2に示すソフトウェア14には、リアルタイムOS15と、このリアルタイムOS15上で動作する制御プログラム16と、リアルタイムOS15上で認識される各種イベント1〜yに応じてこれに該当するイベント1〜y処理を実行するためのイベント処理用プログラム17の実行単位として、リアルタイムOS15の管理下で起動(生成)されるタスク18(図中の例では複数のタスク1〜yが起動している場合を例示している。)と、このタスク18側で実行されるイベント実行準備処理(後述参照)時に参照される参照テーブル19とを有する。
FIG. 2 conceptually shows a configuration example of the
リアルタイムOS15には、機能上、タスク18側で実行されるイベント処理を制御するタスク制御部21が含まれる。タスク制御部21には、タスク18に与えられる優先度レベル(優先順位)に基づいて次に実行すべきタスク18を決定するためのタスクスケジューリングの機能として、イベント1〜yの発生を認識する機能、イベント1〜yの発生を、そのイベントを識別可能なイベント識別情報(以下、説明の都合上、「イベント番号(イベントID)1〜y」と呼ぶ)と共にタスク18側に通知するイベント通知機能が含まれる。リアルタイムOS15では、イベント発生からタスク18側へのイベント通知までの間、優先度レベルの低いタスク18の実行待ち時間や、優先度レベルが同一のタスク17間での競合における実行待ち時間、同一タスク18内での待ちイベントの連続発生におけるイベント通知待ち時間が発生し、これら待ち時間がイベント発生時刻からイベント通知時刻の間の「イベント通知遅延時間」Tとなる。そこで、本実施例のイベント通知機能は、そのイベント通知遅延時間Tを計測し、計測されたイベント通知遅延時間Tをイベント番号1〜yに付加してイベント通知を行うようになっている。
The real-
イベント処理用プログラム17は、ソフトウェア14(リアルタイムOS15及び制御プログラム16等)を成すプログラム部品(モジュール)で構成され、本実施例ではイベント1〜yに応じたイベント1〜y処理用プログラムIV1〜IVyから構成される。
The
図3は、イベント処理用プログラム17の構成例を示す。図3に示すイベント1処理用プログラムIV1には、後述のデッドラインレベル(デッドライン異常レベル)毎に割り当てられる複数の処理プログラム、即ちレベル1用正常処理プログラム(EV1_1)、レベル2用準正常処理1プログラム(EV1_2_1)、レベル2用準正常処理2プログラム(EV1_2_2)、レベル3用異常処理1プログラム(EV1_3_1)、レベル3用異常処理2プログラム(EV1_3_2)、レベル3用異常処理3プログラム(EV1_3_3)、レベルx用異常処理1プログラム(EV1_x_1)、レベルx用異常処理2プログラム(EV1_x_1)が含まれる。図3の例では、イベント1処理用プログラムIV1のみ例示するが、その他のイベント2〜イベントy処理用プログラムIV2〜IVyについても同様である。
FIG. 3 shows a configuration example of the
図4は、参照テーブル19の構成例を示す。図4に示すように、参照テーブル19には、レベル判定用しきい値テーブル31、同一レベル継続発生回数カウントテーブル32、及び同一レベル継続発生回数マトリクステーブル(イベント実行処理マトリクステーブル)33が含まれる。 FIG. 4 shows a configuration example of the reference table 19. As shown in FIG. 4, the reference table 19 includes a level determination threshold table 31, the same level continuous occurrence count table 32, and the same level continuous occurrence count matrix table (event execution processing matrix table) 33. .
図5は、レベル判定用しきい値テーブル31のデータ構造を示す。図5の例では、イベントを識別するイベント番号1〜yと、イベント処理のタスク実行に関するデッドラインレベルのレベル1〜xとを互いに関連付けるマトリクステーブルのマトリクス位置に、イベント通知遅延時間Tのしきい値が設定される。
FIG. 5 shows the data structure of the level determination threshold table 31. In the example of FIG. 5, the threshold of the event notification delay time T is set at the matrix position of the matrix table that associates the
例えば、イベント1に対し、イベント通知遅延時間Tが「0ms(ミリ秒)から10ms以内」の範囲を「レベル1」と定義する場合は、「イベント1」と「レベル1」とのマトリクス位置に、しきい値として「10ms」が設定される。同様に、イベント通知遅延時間Tが「11msから20ms以内」の範囲を「レベル2」と定義する場合は、「イベント1」と「レベル2」とのマトリクス位置に、しきい値として「20ms」が設定される。また、デッドラインレベルの最高レベルとなる「レベルx」については、本実施例ではイベント通知遅延時間Tが「1000ms」より大きい場合全てというように上限値を設けない条件で設定する。その他、レベル2を設定せずにレベル1からレベル3と続く場合等は、該当するレベル2のしきい値は、レベル1と同値を設定する等し、レベル判定の際は、レベルの低い方から判定に用いる(図中の例では、イベント2のレベル1及び2の関係参照)。
For example, for
これにより、イベント通知遅延時間Tのしきい値に基づいて、イベント1〜y毎にデッドラインレベルのレベル1〜xが判定可能となっている。
Thereby, based on the threshold value of the event notification delay time T, the
図6は、同一レベル継続発生回数カウントテーブル32のデータ構造を示す。図6の例では、イベント番号1〜yと、デッドラインレベルのレベル1〜xとを互いに関連付けるマトリクステーブルのマトリクス位置がカウンタとして設定され、そのマトリクス位置に、図5のレベル判定用しきい値テーブル31で判定されたイベント1〜y毎のデッドラインレベルのレベル1〜xと同一レベルが継続して発生する場合の継続発生回数Xが更新(カウントアップ及びリセット)可能に記憶される。これにより、同じイベントでデッドラインレベルが判定される度に該当するマトリクス位置の継続発生回数Xを1回カウントアップし、前回のレベルから変化があった場合は該当するマトリクス位置の継続発生回数Xを0回にリセットすることが可能となっている。
FIG. 6 shows the data structure of the same level continuous occurrence count table 32. In the example of FIG. 6, the matrix position of the matrix table that correlates the
図7及び図8は、同一レベル継続発生回数マトリクステーブル33のデータ構造を示す。図7の例では、イベント番号1〜yと、デッドラインレベルのレベル1〜xとを互いに関連付けるマトリクステーブルのマトリクス位置に、図6の同一レベル継続発生回数カウントテーブル32でカウントされた継続発生回数Xに応じて「イベント処理名」を設定可能となっている。図8の例では、図7と同様の関係を、各イベント1〜yの各レベル1〜x毎に個別に分けて示したものである。
7 and 8 show the data structure of the same level continuous occurrence frequency matrix table 33. FIG. In the example of FIG. 7, the number of continuous occurrences counted in the same level continuous occurrence count count table 32 in FIG. 6 at the matrix position of the matrix table that associates the
例えば、各イベント1〜yと各レベル1〜x毎に継続発生回数Xによって処理を分けるため、初回の場合(X=1)、2回目以降(X>1)の場合、a回目以降(X>a、例えばa=10又は20等)の場合等、継続発生回数X毎に同一レベル継続発生回数マトリクステーブル33にて該当する「イベント処理名」が設定される。イベント処理名は、前述したイベント1〜y処理用プログラムIV1〜IVy(図3参照)に対応する。
For example, since the processing is divided according to the number of continuous occurrences X for each
図9及び図10は、タスク18側のイベント実行準備処理を説明するものである。図9及び図10に示すイベント実行準備処理は、CPU11がメモリ12上の処理プログラム(リアルタイムOS15及び制御プログラム16の少なくとも一方)を実行することにより、行われる。
9 and 10 explain the event execution preparation process on the task 18 side. The event execution preparation process shown in FIGS. 9 and 10 is performed by the CPU 11 executing a processing program (at least one of the real-
図9に示すように、タスク18側では、タスク制御部21からイベント通知を受けると、イベント実行準備処理を実行する(ステップSt10)。この処理実行に際し、イベント番号1〜y及びイベント通知遅延時間Tを入力すると(ステップSt21)、レベル判定用しきい値テーブル31を参照して(ステップSt22)、イベント番号1〜yで認識されるイベント1〜y毎にイベント通知遅延時間Tに基づいてデッドラインレベルを判定する(ステップSt23)。
As shown in FIG. 9, when an event notification is received from the
これにより、図10の例に示すように、イベント1〜y毎に、0≦T≦Tr1(しきい値1)の場合は遅延時間Tとして実質的に問題の無い「レベル1」、Tr1<T≦Tr2(しきい値2)の場合は遅延と認識し再処理を行っても実質的に問題の無い「レベル2」、Tr2<T≦Tr3(しきい値3)のときは処理的にデッドタイムとする「レベル3」とし、以下同様にTrx−2(しきい値x−2)<T≦Trx−1(しきい値x−1)の場合は「レベルx−1」とし、最後にTrx−1(しきい値x−1)<Tの場合は「レベルx」となるよう判定される。
As a result, as shown in the example of FIG. 10, for each
次いで、同一レベル継続発生回数カウントテーブル32を参照して(ステップSt24)、イベント1〜yに応じて判定されたデッドラインレベルが前回と同一レベルの場合は(ステップSt25、YES)、該当するマトリクス位置の継続発生回数Xをカウントアップし(ステップSt26)、前回と同一レベルでなく、即ちレベルが変化した場合は(ステップSt25、NO)、前回のレベルに該当するマトリクス位置の継続発生回数Xをクリアし(ステップSt27)、今回判定されたレベルに該当するマトリクス位置の継続発生回数Xをカウントアップする(ステップSt28)。
Next, referring to the same level continuation occurrence count table 32 (step St24), if the deadline level determined according to
次いで、カウントされた継続発生回数Xを入力すると(ステップSt29)、同一レベル継続発生回数マトリクステーブル33を参照して(ステップSt30)、イベント処理名、即ち実行すべきイベント処理を決定する(ステップSt31)。 Next, when the counted number X of continuous occurrences is input (step St29), the event process name, that is, the event process to be executed is determined with reference to the same level continuous occurrence number matrix table 33 (step St30) (step St31). ).
これにより、図10の例に示すように、「レベル1」の場合はXに関係なく「正常処理」、「レベル2」の場合はX=1(1回目)のときに「準正常処理1」、X>1(2回目以降)のときに「準正常処理2」、「レベル3」の場合はX=1のときに「異常処理1」、X>1のときに「異常処理2」、X>a(例えば、a=10又は20)のときに「異常処理3」、「レベルx」の場合はX=1のときに「異常処理1」、X>1のときに「異常処理2」となるよう決定される。具体的には、同一レベル継続発生回数マトリクステーブル33内のイベント番号1〜y、レベル1〜x、及び継続発生回数Xで決まるマトリクス位置に設定されたイベント処理名、即ちイベント処理用プログラム17がコールされる。
As a result, as shown in the example of FIG. 10, “
上記イベント処理については、使用されるシステムに応じて異なる場合もあるが、本実施例では、イベント通知遅延時間Tとして実質的に問題の無い「レベル1」では、通常の「正常処理」を行い、遅延と認識し再処理(リトライ処理)を行っても実質的に問題の無い「レベル2」では、継続発生回数Xが初回の場合は「準正常処理1」を行い、2回目以降も継続して発生する場合は「準正常処理2」を行い、処理的にデッドタイムとする「レベル3」では、継続発生回数Xが初回であれば異常警報を発して処理を中止する「異常処理1」を行い、発生回数が2回目以降であれば処理を行わない等の異常停止を行う「異常処理2」等、遅延時間T及び継続発生回数Xによって段階的に処理が区分される。
The above event processing may differ depending on the system used, but in this embodiment, normal “normal processing” is performed at “
次いで、上記イベント実行準備処理で決定されたイベント処理、即ち正常処理、準正常処理1、2、及びレベル3以降の各レベルにおける異常処理1、2、3のいずれかに該当するイベント処理用プログラム17が実行される(ステップSt20)。
Next, the event processing program corresponding to any of the event processing determined in the event execution preparation processing, that is, normal processing,
これにより、例えば、デッドラインレベルが「レベル2」の場合、初回発生時の「準正常処理2」では、再処理(リトライ処理)、2回目以降の「準正常処理2」では処理中断、またデッドラインレベルがレベル3の場合、初回発生時の「異常処理2」ではCPUの輻輳状態や半暴走状態が考えられ回復できない状態と判断し、他装置等の外部へ処理できなかったことを通知する処理、2回目以降の「異常処理2」では全処理を中断しアラーム(ALM)を通知する処理など、イベント処理を分離して実行できる。また、デッドラインレベルの高い時には、ソフトウェア自ら暴走検出(ウォッチドックタイマ・タイムアウト)機能を持つこととなり、さらにどのイベントでそれが発生したのか、何回その状態を継続しているかを把握することが可能となる。
Thus, for example, when the deadline level is “
次に、図11及び図12を参照して、本実施例の全体動作を説明する。 Next, the overall operation of the present embodiment will be described with reference to FIGS.
まず、図11に示すように、時刻t1にて、リアルタイムOS15内でイベント1が発生したとする。このイベント発生に際し、タスク制御部21にて、イベント発生からタスク18側へのイベント通知までの間、優先度レベルの低いタスク18の実行待ち、優先度レベルの同一タスク18での競合における実行待ち、同一タスク18内での待ちイベントの連続発生におけるイベントの通知待ち時間が計測され、タスク18側へのイベント通知時t2にイベント通知遅延時間T1(例えば、T1=20ms)を付加したイベント通知が行われる(ステップSt11)。
First, as shown in FIG. 11, it is assumed that
これにより、タスク18側では、図12に示すイベント実行準備処理(ステップSt10)が実行される。即ち、タスク制御部21よりイベント通知時間T1が付加されたイベント通知を受けると(ステップSt11)、レベル判定用しきい値テーブル31を参照して、イベント番号とイベント通知遅延時間T1とで求まるマトリクス位置によりデッドラインレベルが判定される(ステップSt12)。図12の例では、イベント1及びT1=20msから、「レベル3」と判定された場合を示す。
Thereby, on the task 18 side, the event execution preparation process (step St10) shown in FIG. 12 is executed. That is, when an event notification to which the event notification time T1 is added is received from the task control unit 21 (step St11), the matrix obtained by the event number and the event notification delay time T1 is referred to the level determination threshold table 31. The deadline level is determined based on the position (step St12). The example of FIG. 12 shows a case where “
次いで、同一レベル継続発生カウントテーブル32を参照して、同じイベントで同じレベルが繰り返し発生する場合は、該当するマトリクス位置(カウンタ)の継続発生回数Xのカウント値を1回アップし、レベル変化が発生した場合には前回のレベルのカウント値をクリアする(ステップSt13)。図12の例では、同一レベル、即ちレベル3内で、X=6からX=7にカウントアップされた場合を示す。
Next, referring to the same level continuous occurrence count table 32, if the same level is repeatedly generated in the same event, the count value of the continuous occurrence count X of the corresponding matrix position (counter) is increased by 1 to change the level. If it occurs, the count value of the previous level is cleared (step St13). The example of FIG. 12 shows a case where the count is increased from X = 6 to X = 7 within the same level, that is,
次いで、同一レベル継続発生カウントテーブル33を参照して、判定されたレベルと、そのレベルでの継続発生回数X(カウント値)に基づいて、該当するイベント処理名のプログラムが決定され、イベント処理用プログラム17側にコールされる(ステップSt14)。図12の例では、イベント1、レベル3、及びX=7に基づいて、イベント1処理用プログラムEV1のレベル3用異常処理2プログラム(EV1_3_2)が決定された場合を示す。
Next, with reference to the same level continuous occurrence count table 33, the program of the corresponding event processing name is determined based on the determined level and the number of continuous occurrences X (count value) at that level, and for event processing Called to the
最後に、上記イベント実行準備処理によりコールされたイベント処理名のプログラムが実行される(ステップSt20)。図12の例では、イベント1処理用プログラムEV1のレベル3用異常処理2プログラム(EV1_3_2)が実行された場合を示す。
Finally, the program with the event process name called by the event execution preparation process is executed (step St20). The example of FIG. 12 shows a case where the
以下同様に、図11に戻り、上記イベント1処理が実行中の時刻t3にてリアルタイムOS15内で発生したイベント2に対しては、イベント1処理終了後の時刻t5にてイベント通知遅延時間T2が付加されたイベント通知が行われ、これにより、タスク18側にて上記処理にて決定されるイベント2処理が実行され、このイベント2処理が実行中の時刻t4にて発生したイベント3に対しては、イベント1処理終了後の時刻t5にて時刻t6イベント通知遅延時間T3が付加されたイベント通知が行われ、これにより、タスク18側にて上記処理にて決定されるイベント3処理が実行される。
Similarly, returning to FIG. 11, for
従って、本実施例によれば、実際のイベント発生時刻からタスク18側でイベント処理を行うまでにリアルタイムOS15上のタスク制御で発生するイベント通知遅延時間Tを通知することで、タスク18側にて遅延時間のデッドラインレベル判定を行いそのレベルに応じた処理を実行できる。例えば、イベント発生からのイベント通知遅延時間Tがしきい値2以内、即ち「レベル1」であれば、通常処理、またしきい値1より大きくしきい値2以内、即ち「レベル2」であれば、準正常処理で、同一レベルの継続発生回数Xが初回の場合は準正常処理1、2回目以降の場合は準正常処理2、さらにしきい値2より大きい「レベル3」であれば、異常処理等、処理を細かく分けることが可能となり、タスク側で準正常処理、異常処理、デッドライン異常処理等を行うことができる。
Therefore, according to this embodiment, by notifying the event notification delay time T generated by the task control on the real-
これによれば、イベント通知遅延時間に加え、同一レベルが繰り返し発生する場合の継続発生回数を考慮に入れてイベント処理を実行するため、イベント通知遅延時間のみのでデッドライン異常レベルの振り分けを行なう場合と比べ、次の利点がある。 According to this, in addition to the event notification delay time, event processing is performed taking into account the number of continuous occurrences when the same level occurs repeatedly. Has the following advantages:
即ち、イベント通知遅延時間のみを考慮に入れたイベント処理の場合は、イベントの発生から実際にタスク側で処理されるまで、優先度レベルが同一のタスクで同時にイベント発生した場合や、高優先度タスク内でイベント発生が多発した場合などにリアルタイムOS上のタスク側へのイベント待ち時間が発生した場合、デッドライン異常においてデッドライン異常レベルに応じた該当イベント処理を行なっても、デッドライン異常に応じたイベント処理は発生した回数を意識しないため、負荷状態が継続した場合に同様のイベント処理が継続され何度も実行される事態が生じるが、本実施例のようにイベント通知遅延時間に加え同一レベルの継続発生回数を考慮に入れたイベント処理の場合は、このような事態を回避できる。 In other words, in the event processing that takes into account only the event notification delay time, from the occurrence of an event until the task is actually processed on the task side, when an event occurs at the same time at the same priority level, or high priority If an event waiting time to the task side on the real-time OS occurs when events occur frequently in the task, even if the corresponding event processing corresponding to the deadline abnormality level is performed in the deadline abnormality, the deadline abnormality will occur. Since the corresponding event processing is not aware of the number of occurrences, if the load state continues, the same event processing will continue and will be executed many times, but in addition to the event notification delay time as in this example Such a situation can be avoided in the case of event processing that takes into account the number of continuous occurrences of the same level.
さらに、本実施例では、イベント通知遅延時間、及びデッドラインの各レベル発生回数を外部ソフトウェアや他装置に通知することにより、イベント発生からの遅延時間を考慮した処理を行え、デバッグ機能的にCPUの負荷状況の把握することができる。 Furthermore, in this embodiment, the event notification delay time and the number of occurrences of each level of the deadline are notified to external software and other devices, so that processing considering the delay time from the event occurrence can be performed, and the CPU is functionally debugged. It is possible to grasp the load situation.
1 タスク処理装置
2 I/O機器
11 CPU
12 メモリ(ROM/RAM)
13 I/Oポート
14 ソフトウェア
15 リアルタイムOS
16 制御プログラム
17 イベント通知用プログラム
18 タスク
19 参照テーブル
31 レベル判定用しきい値テーブル
32 同一レベル継続発生回数カウントテーブル
33 同一レベル継続発生回数マトリクステーブル
1 Task processing device 2 I / O device 11 CPU
12 Memory (ROM / RAM)
13 I /
16
Claims (9)
前記リアルタイムOSからのイベント通知時に、イベント識別情報に加え、前記イベント発生時からの遅延時間を受け取るステップと、
前記イベント識別情報で識別されるイベント毎に前記遅延時間に基づいて予め設定されたデッドライン異常レベルを判定するレベル判定ステップと、
前記イベント毎に前記デッドライン異常レベルの継続発生回数を計数する計数ステップと、
前記イベント毎に前記デッドライン異常レベルの継続発生回数に基づいて、予め設定されたイベント処理を決定する処理決定ステップと、
決定された前記イベント処理を実行するステップとを有し、
前記レベル判定ステップは、前記イベント識別情報と前記遅延時間のしきい値から前記デッドライン異常レベルを判定するレベル判定用しきい値判定テーブルを使用し、
前記計数ステップは、前記イベント識別情報と前記デッドライン異常レベル毎に前記デッドライン異常レベルの継続発生回数を計数する継続発生回数カウントテーブルを使用し、
前記処理決定ステップは、前記イベント識別情報、前記デッドライン異常レベル、及び前記デッドライン異常レベルの継続発生回数のしきい値に関連付けてイベント処理を決定する処理決定テーブルを使用することを特徴とするリアルタイムOSを用いたタスク処理方法。 A task processing method for executing event processing corresponding to an event recognized on a real-time OS,
Receiving a delay time from the occurrence of the event in addition to the event identification information at the time of event notification from the real-time OS;
A level determination step for determining a preset deadline abnormality level based on the delay time for each event identified by the event identification information;
A counting step for counting the number of continuous occurrences of the deadline abnormal level for each event;
A process determination step for determining a preset event process based on the number of continuous occurrences of the deadline abnormality level for each event,
It was determined to have a and executing the event process,
The level determination step uses a threshold determination table for level determination that determines the deadline abnormality level from the threshold value of the event identification information and the delay time,
The counting step uses a continuous occurrence count table that counts the number of continuous occurrences of the deadline abnormal level for each event identification information and the deadline abnormal level,
The process determination step uses a process determination table that determines an event process in association with a threshold value of the event identification information, the deadline abnormal level, and the number of continuous occurrences of the deadline abnormal level. Task processing method using a real-time OS.
前記リアルタイムOSからのイベント通知時に、イベント識別情報に加え、前記イベント発生時からの遅延時間を受け取る手段と、
前記イベント識別情報で識別されるイベント毎に前記遅延時間に基づいて予め設定されたデッドライン異常レベルを判定するレベル判定手段と、
前記イベント毎に前記デッドライン異常レベルの継続発生回数を計数する計数手段と、
前記イベント毎に前記デッドライン異常レベルの継続発生回数に基づいて、予め設定されたイベント処理を決定する処理決定手段と、
決定された前記イベント処理を実行する手段とを有し、
前記レベル判定手段は、前記イベント識別情報と前記遅延時間のしきい値から前記デッドライン異常レベルを判定するレベル判定用しきい値判定テーブルを有し、
前記計数手段は、前記イベント識別情報と前記デッドライン異常レベル毎に前記デッドライン異常レベルの継続発生回数を計数する継続発生回数カウントテーブルを有し、
前記処理決定手段は、前記イベント識別情報、前記デッドライン異常レベル、及び前記デッドライン異常レベルの継続発生回数のしきい値に関連付けてイベント処理を決定する処理決定テーブルを有することを特徴とするリアルタイムOSを用いたタスク処理装置。 A task processing device that executes event processing corresponding to an event recognized on a real-time OS,
Means for receiving a delay time from the event occurrence time in addition to the event identification information at the time of event notification from the real-time OS;
Level determination means for determining a preset deadline abnormality level based on the delay time for each event identified by the event identification information;
Counting means for counting the number of continuous occurrences of the deadline abnormal level for each event,
A process determining means for determining a preset event process based on the number of continuous occurrences of the deadline abnormality level for each event,
It was determined to have a means for executing the event process,
The level determination means has a threshold determination table for level determination that determines the deadline abnormality level from the threshold value of the event identification information and the delay time,
The counting means has a continuous occurrence count table for counting the number of continuous occurrences of the deadline abnormal level for each event identification information and the deadline abnormal level,
The process determination means includes a process determination table that determines an event process in association with the threshold value of the event identification information, the deadline abnormal level, and the number of continuous occurrences of the deadline abnormal level. A task processing device using an OS.
コンピュータに、
前記リアルタイムOSからのイベント通知時に、イベント識別情報に加え、前記イベント発生時からの遅延時間を受け取るステップと、
前記イベント識別情報で識別されるイベント毎に前記遅延時間に基づいて予め設定されたデッドライン異常レベルを判定するレベル判定ステップと、
前記イベント毎に前記デッドライン異常レベルの継続発生回数を計数する計数ステップと、
前記イベント毎に前記デッドライン異常レベルの継続発生回数に基づいて、予め設定されたイベント処理を決定する処理決定ステップと、
決定された前記イベント処理を実行するステップとを実行させるためのものであり、
前記レベル判定ステップは、前記イベント識別情報と前記遅延時間のしきい値から前記デッドライン異常レベルを判定するレベル判定用しきい値判定テーブルを使用し、
前記計数ステップは、前記イベント識別情報と前記デッドライン異常レベル毎に前記デッドライン異常レベルの継続発生回数を計数する継続発生回数カウントテーブルを使用し、
前記処理決定ステップは、前記イベント識別情報、前記デッドライン異常レベル、及び前記デッドライン異常レベルの継続発生回数のしきい値に関連付けてイベント処理を決定する処理決定テーブルを使用することを特徴とするプログラム。 A control program used in a task processing device that executes event processing corresponding to an event recognized on a real-time OS,
On the computer,
Receiving a delay time from the occurrence of the event in addition to the event identification information at the time of event notification from the real-time OS;
A level determination step for determining a preset deadline abnormality level based on the delay time for each event identified by the event identification information;
A counting step for counting the number of continuous occurrences of the deadline abnormal level for each event;
A process determination step for determining a preset event process based on the number of continuous occurrences of the deadline abnormality level for each event,
And executing the determined event processing step ,
The level determination step uses a threshold determination table for level determination that determines the deadline abnormality level from the threshold value of the event identification information and the delay time,
The counting step uses a continuous occurrence count table that counts the number of continuous occurrences of the deadline abnormal level for each event identification information and the deadline abnormal level,
The process determination step uses a process determination table that determines an event process in association with a threshold value of the event identification information, the deadline abnormal level, and the number of continuous occurrences of the deadline abnormal level. Program .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004057684A JP4009602B2 (en) | 2004-03-02 | 2004-03-02 | Task processing method, apparatus, and program using real-time OS |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004057684A JP4009602B2 (en) | 2004-03-02 | 2004-03-02 | Task processing method, apparatus, and program using real-time OS |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2005250659A JP2005250659A (en) | 2005-09-15 |
JP4009602B2 true JP4009602B2 (en) | 2007-11-21 |
Family
ID=35031102
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004057684A Expired - Fee Related JP4009602B2 (en) | 2004-03-02 | 2004-03-02 | Task processing method, apparatus, and program using real-time OS |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4009602B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4609381B2 (en) | 2006-06-14 | 2011-01-12 | 株式会社デンソー | Abnormality monitoring program, recording medium, and electronic device |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0537721B1 (en) * | 1991-10-15 | 1998-11-25 | Hewlett-Packard Company | Hardware-configured operating system kernel for a multitasking processor |
JPH08272627A (en) * | 1995-03-30 | 1996-10-18 | Ricoh Co Ltd | Real-time task controller |
JPH09244984A (en) * | 1996-03-08 | 1997-09-19 | Nippon Telegr & Teleph Corp <Ntt> | Event order correction method |
JP3663950B2 (en) * | 1999-01-20 | 2005-06-22 | 株式会社デンソー | Electronic control unit for automobile |
JP2002073354A (en) * | 2000-08-29 | 2002-03-12 | Ricoh Co Ltd | Task control device and task contol method |
JP3859564B2 (en) * | 2002-08-05 | 2006-12-20 | 日本電気株式会社 | Event notification task control processing method and method, and program |
JP2004078665A (en) * | 2002-08-20 | 2004-03-11 | Nec Corp | Task control apparatus and task control method |
JP2004207821A (en) * | 2002-12-24 | 2004-07-22 | Nippon Hoso Kyokai <Nhk> | Subtitle broadcast receiver, subtitle broadcast receiving method, and subtitle broadcast receiving program |
JP2004289683A (en) * | 2003-03-24 | 2004-10-14 | Sharp Corp | Data receiver, data reception method, data reception program, and computer-readable record medium having the program recorded thereon |
JP3952992B2 (en) * | 2003-06-03 | 2007-08-01 | ソニー株式会社 | Information processing apparatus, process control method, and computer program |
JP2005039738A (en) * | 2003-07-18 | 2005-02-10 | Sony Corp | Moving picture cluster processing system |
-
2004
- 2004-03-02 JP JP2004057684A patent/JP4009602B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2005250659A (en) | 2005-09-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8230430B2 (en) | Scheduling threads in a multiprocessor computer | |
US20090044060A1 (en) | Method for Supervising Task-Based Data Processing | |
US6434591B1 (en) | Thread control system and method in a computer system | |
EP2983086A1 (en) | System fault detection and processing method, device, and computer readable storage medium | |
CN111897637B (en) | Job scheduling method, device, host and storage medium | |
JP4610322B2 (en) | Interrupt processing control method and apparatus | |
JP4009602B2 (en) | Task processing method, apparatus, and program using real-time OS | |
US20080098404A1 (en) | Information processing apparatus, control method for information processing apparatus and program | |
JP3859564B2 (en) | Event notification task control processing method and method, and program | |
JP2965075B2 (en) | Program execution status monitoring method | |
JP4516898B2 (en) | Task controller | |
CN115269158A (en) | Method for software defined interrupt management controller | |
JP2006227962A (en) | System and method for monitoring application task | |
JP2008204013A (en) | Thread operation failure detecting method and multi-thread system | |
JP4297796B2 (en) | Plant monitoring and operation device | |
JP2008204011A (en) | Multi-thread system and thread operation failure detecting method | |
JPH10269110A (en) | Method for avoiding hang-up of computer system, and computer system using the same method | |
CN111880915B (en) | Processing method, device, equipment and storage medium for thread task | |
JPH11282725A (en) | Computer | |
JP2004078665A (en) | Task control apparatus and task control method | |
CN106776202B (en) | Method and system for monitoring tasks of embedded operating system | |
JP2000259433A (en) | Device and method for detecting deadlock | |
CN114911703A (en) | Detection method of real-time operation system and computing equipment | |
CN112783626A (en) | Interrupt processing method and device, electronic equipment and storage medium | |
CN117806803A (en) | Task enqueuing method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A711 Effective date: 20060412 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070130 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070206 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070404 |
|
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: 20070821 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070903 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100907 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110907 Year of fee payment: 4 |
|
LAPS | Cancellation because of no payment of annual fees |