JP2004070582A - Event notification task control processing system and method and its program - Google Patents
Event notification task control processing system and method and its program Download PDFInfo
- Publication number
- JP2004070582A JP2004070582A JP2002227480A JP2002227480A JP2004070582A JP 2004070582 A JP2004070582 A JP 2004070582A JP 2002227480 A JP2002227480 A JP 2002227480A JP 2002227480 A JP2002227480 A JP 2002227480A JP 2004070582 A JP2004070582 A JP 2004070582A
- Authority
- JP
- Japan
- Prior art keywords
- event
- processing
- task
- level
- delay time
- 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
Images
Abstract
Description
【0001】
【発明の属する技術分野】
本発明はイベント通知タスク制御処理方式及び方法並びにプログラムに関し、特に、リアルタイムOSにおけるイベント発生からの遅延時間をタスク側へ通知し、タスク側では遅延時間に応じた適切な処理を実行することを可能とする、イベント通知タスク制御処理方式及び方法並びにプログラムに関する。
【0002】
【従来の技術】
一般に、実時間処理が要求される監視制御装置などのOS(Operating System:オペレーティングシステム)としては、実時間制御での割込み処理や汎用周辺装置との入出力インタフェース機能などを実現するリアルタイムOSが用いられている。
【0003】
リアルタイムOS上で各種の制御処理を実行するプログラムであるところのタスク(task)についても、当然のことながら実時間処理が要求されるようになってきており、リアルタイムOS上の全てのタスクを限られた時間内で処理することが必要となってきている。この要求を満たすために、タスクのスケジューリングアルゴリズムなどの改善が図られ、処理効率が向上するようになってきている。
【0004】
このような、リアルタイムOS上でのタスクの動作を限られた時間内で処理させ得る方式の一例として、特開2001−236236号公報記載の「タスク制御装置およびそのタスクスケジューリング方法」が知られている。
【0005】
この公報では、一定時間間隔で繰り返し実行される定周期タスクをスケジューリングするリアルタイムOSにおいて、タスク切替頻度を低減し、タスクでの処理が限られた時間内に終了しない所謂デッドライン違反の発生を抑制する技術が記載されている。
【0006】
【発明が解決しようとする課題】
しかしながら、上述した従来のタスク制御方式においては、タスクでの処理が過負荷状態となった場合や、負荷状態が継続して輻輳状態となった場合においては、タスクでの処理遅延によるデッドライン異常が発生してしまう、という問題点を有している。
【0007】
この事は、例えば、実時間処理が要求される監視制御装置などにおいて、処理遅延により機器などの監視情報そのものが遅延してしまい、結果として現在の実際の機器状態とは異なる監視情報により無効な制御を行ってしまう、といった状況が発生し得るものとなっている。また、中継装置などにおいては、中継遅延が発生していることを認識できず、結果として遅延したままの無意味な処理を継続する、という状況も発生してしまう。
【0008】
タスクでの処理遅延によるデッドライン異常が発生してしまう要因の1つとして、デッドライン異常をタスク側で認識できていない、という点を挙げることができる。リアルタイムOSでは、或る事象が発生した場合に、これをイベント(event)として捉えており、イベントの処理は該当のタスクに行わせるようスケジューリングを行っている。しかし、優先度レベルが同一のタスクで同時に複数のイベント処理を行おうとする場合や、高優先度レベルのタスク内で処理すべきイベントが多発した場合などにおいては、リアルタイムOS上で認識したイベント発生時から実際にタスク側で該イベントの処理を行うまでの時間に、イベント処理の待ち時間が発生してしまい、該イベントの処理を行うタスクでは、この待ち時間の発生を検知できず、遅延したままでイベント処理を実行してしまうという事である。
【0009】
また、デッドライン異常とはならないまでも、例えば、監視制御装置などにおいて、機器などの状態変化の事象は不定期に発生する割込みイベントとして認識され、リアルタイムOSからタスク側へのイベント通知に遅延が発生してしまうが、タスク側ではこの遅延時間を認識できないため、遅延したままでのイベント処理を実行してしまう、という問題点を有している。
【0010】
そこで本発明の目的は、リアルタイムOSにおけるイベント発生時点からの遅延時間をタスク側へ通知し、タスク側では遅延時間に応じた適切な処理を選択して実行することにより、デッドライン異常をタスク側にて検知して遅延によるシステム障害を事前に回避することを可能とする、イベント通知タスク制御処理方式及び方法並びにプログラムを提供することにある。
【0011】
【課題を解決するための手段】
本発明のイベント通知タスク制御処理方式は、実時間制御での割込み処理や周辺装置との入出力インタフェース機能などを実現するリアルタイムOSと、前記リアルタイムOS上で前記リアルタイムOSが検知するイベントの処理を実行する複数のタスクと、を備えた情報処理装置において、前記タスクが、前記リアルタイムOSから通知されるイベントの発生時からの遅延時間により、前記遅延時間のデッドラインのレベルを判定し、前記レベルに応じた処理プログラムを選択して実行することにより、該イベントの処理を行うイベント処理手段を備える、ことを特徴とする。
【0012】
また、前記リアルタイムOSは、イベントの発生を検知すると該イベントの処理を行う何れかの前記タスクに対し、イベント通知を発行するタスク制御手段を備え、前記タスクの前記イベント処理手段は、前記イベント通知に付された該イベントの発生時からの遅延時間により、前記遅延時間のデッドラインのレベルを判定するレベル判定用しきい値テーブルと、前記レベルに応じた処理プログラムを選択するイベント実行処理マトリクステーブルと、を含む、ことを特徴とする。
【0013】
さらに、前記タスク制御手段は、イベントの発生を検知し該イベントにイベント番号を付す制御を行うイベント発生検知部と、該イベントの処理を担当する何れかの前記タスクを選択してスケジューリングし、該イベントの処理を前記タスクに実行させるためのイベント通知を、前記タスクに発行して前記タスクの起動を制御するイベント通知部と、前記イベント発生検知部にて該イベントの発生を検知した時間から、前記イベント通知部が前記イベント通知を発行する時間までの遅延時間を計測する遅延時間計測部と、から構成され、前記イベント通知には、該イベントの前記イベント番号と前記遅延時間が付される、ことを特徴とする。
【0014】
また、前記レベル判定用しきい値テーブルは、行方向に前記イベント番号が並べられ、列方向にデッドラインのレベルが並べられる構成を取り、各行と列との交点に、前記遅延時間に対する前記レベル毎のしきい値が定義されており、前記イベント実行処理マトリクステーブルは、行方向に前記イベント番号が並べられ、列方向にデッドラインのレベルが並べられる構成を取り、各行と列との交点に、前記イベント番号の前記レベルのイベント処理を実行する処理プログラムのモジュール名が定義されている、ことを特徴とする。
【0015】
さらに、前記イベント処理手段は、前記タスク制御手段から前記イベント通知を受けて前記イベント通知に付されている前記イベント番号のイベント処理を実行する何れかの前記タスクが起動されると、前記タスクが前記レベル判定用しきい値テーブルを参照して前記イベント番号の前記遅延時間のデッドラインのレベルを判定し、次に、前記タスクが前記イベント実行処理マトリクステーブルを参照して前記イベント番号の前記レベルに対応するモジュール名を選択し、前記モジュール名を有する処理プログラムに制御を渡して実行させることにより、前記イベント番号を付されたイベントの処理を行わせる、ことを特徴とする。
【0016】
本発明のイベント通知タスク制御処理方法は、実時間制御での割込み処理や周辺装置との入出力インタフェース機能などを実現するリアルタイムOSと、前記リアルタイムOS上で前記リアルタイムOSが検知するイベントの処理を実行する複数のタスクと、を備えた情報処理装置において、前記タスクが、前記リアルタイムOSから通知されるイベントの発生時からの遅延時間により、前記遅延時間のデッドラインのレベルを判定し、前記レベルに応じた処理プログラムを選択して実行することにより、該イベントの処理を行う、ことを特徴とする。
【0017】
また、前記リアルタイムOSは、イベントの発生を検知すると該イベントの処理を行う何れかの前記タスクに対し、イベント通知を発行し、前記イベント通知を受けた前記タスクは、前記イベント通知に付された該イベントの発生時からの遅延時間により、前記遅延時間のデッドラインのレベルを判定し、前記レベルに応じた処理プログラムを選択し、前記処理プログラムに制御を渡して実行させることにより該イベントの処理を行う、ことを特徴とする。
【0018】
さらに、前記リアルタイムOSは、イベントの発生を検知すると該イベントにイベント番号を付し、該イベントの発生時からイベント通知発行までの遅延時間を計測し、該イベントの処理を行う何れかの前記タスクを起動可能になると、前記イベント番号と前記遅延時間を付した前記イベント通知を前記タスクに対して発行し、前記タスクは、前記イベント番号の前記遅延時間のデッドラインのレベルを判定し、次に、前記タスクは、前記イベント番号の前記レベルに対応するモジュール名を選択し、前記モジュール名を有する処理プログラムに制御を渡して実行させることにより、該イベントの処理を行わせる、ことを特徴とする。
【0019】
本発明のプログラムは、コンピュータに、イベントの発生を検知し、該イベントの処理を行う何れかのタスクプログラムに対し、イベント通知を発行する手順と、前記イベント通知を受けた前記タスクプログラムに、前記イベント通知に付されたイベントの発生時からの遅延時間により、前記遅延時間のデッドラインのレベルを判定する手順と、前記レベルに応じた処理プログラムを選択させ、前記処理プログラムに制御を渡して実行させる手順と、を実行させることにより該イベントの処理を行わせることを特徴とする。
【0020】
また、コンピュータに、イベントの発生を検知すると該イベントにイベント番号を付す手順と、該イベントの発生時からイベント通知発行までの遅延時間を計測する手順と、該イベントの処理を行う何れかのタスクプログラムを起動可能になると、前記イベント番号と前記遅延時間を付した前記イベント通知を前記タスクプログラムに対して発行する手順と、前記タスクプログラムに、前記イベント番号の前記遅延時間のデッドラインのレベルを判定する手順と、前記イベント番号の前記レベルに対応するモジュール名を選択させる手順と、前記モジュール名を有する処理プログラムに制御を渡して実行させる手順と、を実行させることにより該イベントの処理を行わせる、ことを特徴とする。
【0021】
さらに、コンピュータに、イベントの発生を検知し該イベントのイベント通知を発行する手順と、前記イベント通知に付された該イベントの発生時からの遅延時間のデッドラインのレベルを判定する手順と、前記レベルに応じた処理プログラムを選択させ前記処理プログラムに制御を渡して実行させる手順と、を実行させることを特徴とする。
【0022】
また、コンピュータに、イベントの発生を検知すると該イベントにイベント番号を付す手順と、該イベントの発生時からイベント通知発行までの遅延時間を計測する手順と、前記イベント番号と前記遅延時間を付した前記イベント通知を発行する手順と、前記イベント番号の前記遅延時間のデッドラインのレベルを判定する手順と、前記イベント番号の前記レベルに対応するモジュール名を選択させる手順と、前記モジュール名を有する処理プログラムに制御を渡して実行させる手順と、を実行させることを特徴とする。
【0023】
【発明の実施の形態】
次に、本発明の実施の形態について図面を参照して説明する。
【0024】
図1は、本発明のイベント通知タスク制御処理方式の一実施形態を示すブロック図である。
【0025】
図1に示す本実施の形態は、通信機器などの監視・制御を行う監視制御装置など、CPU(Central Processing Unit:中央処理装置)と記憶装置、及びその他必要な周辺機器・周辺装置などによって構成される情報処理装置であるところの装置90を一例として示すものであるが、前述のハードウェアの図示は省略するものとし、ソフトウェアのみの構成を示すものである。
【0026】
図1において、装置90は、実時間制御での割込み処理や周辺装置との入出力インタフェース機能などを実現するリアルタイムOS(Operating System:オペレーティングシステム)80と、リアルタイムOS80上で監視制御の対象機器などから生ずるイベント(事象)の処理を実行するプログラムであるところの複数n個のタスク10と、タスク10が参照してタスク10自身の処理内容を決定するためのレベル判定用しきい値テーブル20と、イベント実行処理マトリクステーブル30と、から構成されている。
【0027】
リアルタイムOS80は、イベントの発生を検知し該イベントの処理を該当のタスク10に実行させるためのイベント通知70を発行するタスク制御部60を備えている。
【0028】
タスク制御部60は、イベントの発生を検知し該イベントにイベント番号を付す制御を行うイベント発生検知部61と、該イベントの処理を担当する該当タスク10を選択してスケジューリングし、該イベントの処理を該当タスク10に実行させるためのイベント通知70を、該当タスク10に発行して該当タスクの起動を制御するイベント通知部63と、イベント発生検知部61にてイベント発生を検知した時間から、イベント通知部63がイベント通知70を発行する時間までの遅延時間を計測する遅延時間計測部62と、から構成されている。イベント通知70には、該イベントのイベント番号と前記の遅延時間が付されるものとなる。
【0029】
タスク10は、タスク10−1からタスク10−n迄の複数n個で構成されており、それぞれイベント通知70で通知されるイベント番号に対応するイベント処理を行う。イベント通知70により起動されたタスク10は、イベント通知70に付されている遅延時間から、レベル判定用しきい値テーブル20を参照して該遅延時間のデッドラインのレベル判定を行い(図1のS0)、判定したレベルに応じた処理を、イベント実行処理マトリクステーブル30を参照して選択し、該イベントの処理(図1のS1〜Sxの何れかの処理)を行うようになっている。
【0030】
ここで、デッドラインとは、イベント発生時点からタスク10でのイベント処理完了迄の制限時間のことである。すなわち、或るイベントの発生時点から該イベントのイベント処理が終了するまでの時間には、該当装置や該当システムで定められる制限時間が存在し、イベント処理の終了が制限時間を超えてしまった場合にはデッドライン異常となる。本実施形態においては、上述の遅延時間がデッドライン異常を判定するために用いられることとなる。
【0031】
デッドラインは、イベントごとに該当装置や該当システムに応じて定められる値であるが、大凡、遅延時間として問題の無いレベルでは、レベル1と判定して通常の処理(図1のS1)を行い、遅延しているとの認識は成されるが再処理を行って問題の無いレベルでは、レベル2と判定してリトライ処理などの準正常処理(図1のS2)を行い、イベント処理的に見てデッドラインを超えていると判定されるレベルでは、レベル3と判定して、イベント処理をタイムアウトとして中止して、処理を中断するなどの異常処理1(図1のS3)を行い、該当装置や該当システムとしてデッドラインを超えていると判定されるレベルでは、レベル4と判定して処理を行わずに他装置など外部へデッドライン異常を報告するなどの異常処理2(図1のS4)を行う。なお、該当装置や該当システムの要求に応じて、更なる判定レベルと対応する処理(図1のSx)を付け加えたものであっても良い。
【0032】
次に、図2を参照して、図1に示したレベル判定用しきい値テーブル20について説明する。
【0033】
図2は、レベル判定用しきい値テーブルの構成の一例を説明する図である。
【0034】
図2のレベル判定用しきい値テーブル20は、遅延時間の付されたイベント通知70を受けたタスク10が、該遅延時間のデッドラインのレベル判定を行うためのテーブルである。レベル判定用しきい値テーブル20の、行方向にはイベント番号が、列方向にはデッドラインのレベルが並べられる構成となっており、各行と列との交点に、遅延時間に対するレベル毎のしきい値が定義されている。
【0035】
例えば、イベント番号がイベント1の行201において、遅延時間0ms(milliーsecond:ミリ秒)〜3ms以内をレベル1と定義する場合は、レベル1の列211のしきい値個所(行201と列211の交点)に「0〜3ms」と定義し、3ms〜12ms以内をレベル2と定義する場合は、レベル2の列212のしきい値個所(行201と列212の交点)に「3〜12ms」と定義する。同様にして、12ms〜30ms以内をレベル3と定義する場合は、レベル3の列213のしきい値個所(行201と列213の交点)に「12〜30ms」と定義する。なお、最高レベルのレベルx(列21x)では、200msより大きい場合は全てレベルxであると定義するため、レベルxの列21xのしきい値個所(行201と列21xの交点)には「200ms〜」と定義されている。
【0036】
イベント番号がイベント2の行202においても同様にしきい値が定義されているが、イベント2においては、レベル2が無くレベル1からレベル3と続くものとしているため、レベル2の列212のしきい値個所(行202と列212の交点)には、レベル1と同じ値、すなわち、「0〜3ms」が定義されている。また、イベント番号がイベントyの行20yにおいては、レベル1、2、3だけのしきい値が定義されており、レベル4以降は無いものとしている。なお、タスク10が遅延時間のデッドラインのレベル判定を行う際には、レベルの低い方から(レベル1の方から)レベル判定用しきい値テーブル20を用いるものとする。
【0037】
次に、図3を参照して、図1に示したイベント実行処理マトリクステーブル30について説明する。
【0038】
図3は、イベント実行処理マトリクステーブルの構成の一例を説明する図である。
【0039】
図3のイベント実行処理マトリクステーブル30は、遅延時間の付されたイベント通知70を受けたタスク10が、該遅延時間のデッドラインのレベル判定を行った後に、判定したレベルに応じた処理を選択するためのテーブルである。イベント実行処理マトリクステーブル30の構成は、レベル判定用しきい値テーブル20と同様のマトリクステーブルで、該当イベント番号の該当レベル毎に、対応するイベント処理を実行するプログラムのモジュール名、すなわち該プログラムのエントリーアドレスを定義しておくテーブルである。
【0040】
例えば、イベント番号がイベント1で、デッドラインのレベル判定を行った結果がレベル2であったとすると、タスク10は、イベント実行処理マトリクステーブル30の行301(イベント1)と列312(レベル2)の交点に定義されている「EVENT1_2」というモジュール名を有するプログラムを実行させることにより、イベント1のレベル2のイベント処理を行う。同様に、イベント番号がイベント2で、レベル判定の結果がレベル3であったとすると、タスク10は、行302(イベント2)と列313(レベル3)の交点に定義されている「EVENT2_3」というモジュール名を有するプログラムを実行させて、イベント2のレベル3のイベント処理を行う。
【0041】
なお、レベル判定用しきい値テーブル20及びイベント実行処理マトリクステーブル30は、タスク10の外部に存在するものとして説明を行ったが、この2つのテーブルを、タスク10の内部に存在させるようにしても良い。この場合には、タスク10の各々が処理するものとなっているイベント番号に関する部分だけのテーブルを、各タスク10が保持すればよい。
【0042】
次に、図4、図5を参照して、本実施形態の動作について詳細に説明する。なお、図4、図5において図1、図2、図3に示す構成要素に対応するものは同一の参照数字または符号を付し、その説明を省略する。
【0043】
図4は、本実施形態の動作の概観を説明する図である。
【0044】
図4において、時刻t1に、機器などの状態変化などの事象であるところの「イベント1」が発生し、これをタスク制御部60のイベント発生検知部61が検知したものとする。この時、「イベント1」のイベント処理を行うタスク10−1よりも高優先度或いは同一優先度のタスク10−mが実行中であるとすると、このタスク10−mの実行が終了するまでの待ち時間が生ずる。この待ち時間が時刻t2まで続いたものとすると、タスク制御部60の遅延時間計測部62は、t2−t1=T1を遅延時間として計測し、その後イベント通知部63がタスク10−1に対して、時刻t2にイベント通知70−1を発行し、タスク10−1を起動する。イベント通知70−1には、イベント番号として「イベント1」が、遅延時間として「T1」が付されている。
【0045】
イベント通知70−1の発行により、時刻t2にタスク10−1が起動され、「イベント1」に対するイベント処理が開始される。イベント処理を行うタスク10−1の動作について図5を参照して説明する。
【0046】
図5は、本実施形態のタスクの動作を説明する図である。
【0047】
図5において、タスク10は、タスク制御部60から「イベント番号」と「遅延時間」が付加されたイベント通知70を受けて、起動される(S10)。
【0048】
次に、タスク10は、レベル判定用しきい値テーブル20を参照し、イベント通知70に付されている「イベント番号」と「遅延時間」からデッドラインのレベル判定を行う(S11)。ここで、タスク10−1の動作として具体的に説明すると、タスク10−1に通知されたイベント通知70−1には、「イベント番号」として「イベント1」が付されているので、先ずレベル判定用しきい値テーブル20の行201(イベント番号=イベント1)を参照することとなる。次に「遅延時間」が行201のどの列に対応するかを判定する。「遅延時間」として「T1」が付されており、「T1」=5msであったとすると、5msは列212に対応するものであるため、そのレベルは「レベル2」であると判定される。
【0049】
次に、タスク10は、イベント実行処理マトリクステーブル30を参照し、ステップS11で求めたレベルに該当するイベント処理を行うモジュール名を求める(S12)。ここで、タスク10−1の動作として具体的に説明すると、「イベント番号」が「イベント1」で、かつ、そのレベルが「レベル2」と判定されたものであるため、イベント実行処理マトリクステーブル30の行301(イベント1)と列312(レベル2)の交点に記載の「EVENT1_2」が、求めるモジュール名となる。なお、今求めたイベント実行処理マトリクステーブル30のマトリクス位置(行301と列312の交点)は、レベル判定用しきい値テーブル20のマトリクス位置(行201と列212の交点)と全く同じ位置である。
【0050】
モジュール名が求まると、タスク10は該モジュール(プログラム)に制御を渡して実行させ、該モジュールがイベント処理を行う(S13)。タスク10−1の動作として具体的に説明すると、ステップS12で求めたモジュール名は「EVENT1_2」であるため、タスク10−1は該モジュール「EVENT1_2」に制御を渡して実行させ、該モジュール「EVENT1_2」が「イベント1」の「レベル2」のイベント処理を行う。「イベント1」の「レベル2」のイベント処理がリトライ処理であるとすれば、「EVENT1_2」のモジュールは、リトライ処理を行うようプログラミングされているモジュールである。
【0051】
上述したように、タスク10−1による「イベント1」のイベント処理は、図4の時刻t2に開始され、図4に示すように「イベント1処理」として時刻t5まで行われる。
【0052】
タスク10−1による「イベント1処理」が行われている間の時刻t3に「イベント2」が発生し、これをタスク制御部60のイベント発生検知部61が検知したものとする。この時、「イベント2」のイベント処理を行うタスク10−2の優先度よりも、「イベント1処理」を実行中のタスク10−1の優先度の方が高い(或いは同一)ものとすると、タスク10−1の実行が終了する時刻t5まで、タスク10−2の起動は待たされることとなり、この間の待ち時間、すなわちt5−t3=T2を、タスク制御部60の遅延時間計測部62が遅延時間として計測する。
【0053】
タスク10−1の「イベント1処理」が時刻t5に終了すると、タスク制御部60のイベント通知部63は、イベント番号が「イベント2」、遅延時間が「T2」のイベント通知70−2を、タスク10−2に対して時刻t5に発行し、タスク10−2を起動する。
【0054】
起動されたタスク10−2は、図5を参照して述べたと同様の動作により、「イベント2処理」を実行する。すなわち、タスク10−2は起動されると(図5のS10)、イベント通知70−2に付加されている「イベント番号=イベント2」と「遅延時間=T2」から、レベル判定用しきい値テーブル20を参照して、「イベント2」のデッドラインのレベル判定を行い(図5のS11)、次に、イベント実行処理マトリクステーブル30を参照して、求めたレベルに該当するイベント処理を行うモジュール名を求め(図5のS12)、求めたモジュール名のプログラムを実行させて、「イベント2処理」を行わせる(図5のS13)。
【0055】
タスク10−1による「イベント1処理」が実行されている間の時刻t4に、「イベント1」が再度検知された場合も同様に、この2度目の「イベント1」のイベント通知70−3は、タスク10−2による「イベント2処理」が終了する時刻t6まで待たされる。そして、時刻t6になった時に、タスク制御部60のイベント通知部63から、「イベント番号=イベント1」、「遅延時間=T3=t6−t4」のイベント通知70−3が、タスク10−1に対して発行され、上述と同様の動作により、時刻t6からタスク10−1による「イベント1処理」が再度実行される。
【0056】
【発明の効果】
以上説明したように、本発明のイベント通知タスク制御処理方式及び方法並びにプログラムは、リアルタイムOSにおけるイベント発生時点からの遅延時間をタスク側へイベント通知として通知し、タスク側では遅延時間のデッドラインレベルの判定を行い、判定レベルに応じた適切な処理(プログラムモジュール)を選択して実行させる事ができるので、デッドライン異常をタスク側で認識可能となり、タスク側でデッドライン異常の段階に応じた処理プログラムを作成可能となる、という効果を有している。従って、デッドライン異常によるシステム障害を事前に回避可能な処理プログラムを作成可能となる。
【0057】
また、タスク側でデッドライン異常の段階に応じた処理プログラムを作成できるので、例えば、遅延時間がデッドライン異常でない時は正常処理、遅延時間がデッドライン異常に近い時は、準正常処理としてリトライ処理、デッドラインを超えていると判定される時は、異常処理その1として処理中断或いは他装置等外部に対し処理不可能であった旨の通知処理、デッドラインを大幅に超えている時は、CPUの輻輳状態や半暴走状態が考えられるため、回復不可能な状態と判断し、異常処理その2として全処理を中断し他装置等外部へ異常事態を通知する処理、などのように処理内容を分離することが可能となると共に、ウォッチドッグタイマのタイムアウト時と同様に、処理プログラム自体の暴走検出機能を持つこととなり、さらに、どのイベントで暴走検出が成されたかを把握することが可能となる、という効果を有している。
【図面の簡単な説明】
【図1】本発明のイベント通知タスク制御処理方式の一実施形態を示すブロック図である。
【図2】レベル判定用しきい値テーブルの構成の一例を説明する図である。
【図3】イベント実行処理マトリクステーブルの構成の一例を説明する図である。
【図4】本実施形態の動作の概観を説明する図である。
【図5】本実施形態のタスクの動作を説明する図である。
【符号の説明】
10 タスク
20 レベル判定用しきい値テーブル
30 イベント実行処理マトリクステーブル
60 タスク制御部
61 イベント発生検知部
62 遅延時間計測部
63 イベント通知部
70 イベント通知
80 リアルタイムOS
90 装置[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an event notification task control processing method, method, and program, and in particular, notifies a task of a delay time from the occurrence of an event in a real-time OS, and allows the task to execute an appropriate process according to the delay time. And an event notification task control processing method and method.
[0002]
[Prior art]
Generally, as an OS (Operating System) such as a monitoring control device that requires real-time processing, a real-time OS that realizes interrupt processing in real-time control and an input / output interface function with a general-purpose peripheral device is used. Have been.
[0003]
Naturally, real-time processing is also required for tasks that are programs that execute various control processes on the real-time OS, and all tasks on the real-time OS are limited. It is becoming necessary to process within the allotted time. In order to satisfy this requirement, improvements have been made in the task scheduling algorithm and the like, and the processing efficiency has been improved.
[0004]
As an example of such a method capable of processing a task operation on a real-time OS within a limited time, a “task control device and a task scheduling method thereof” described in JP-A-2001-236236 is known. I have.
[0005]
In this publication, in a real-time OS that schedules periodic tasks that are repeatedly executed at fixed time intervals, the frequency of task switching is reduced, and the occurrence of a so-called deadline violation in which processing in a task is not completed within a limited time is suppressed. The technology to do this is described.
[0006]
[Problems to be solved by the invention]
However, in the conventional task control method described above, when processing in a task becomes overloaded or when the load state continues to become congested, deadline abnormality due to processing delay in the task occurs. Is generated.
[0007]
This is because, for example, in a monitoring control device or the like that requires real-time processing, monitoring information itself such as a device is delayed due to a processing delay, and as a result, invalid monitoring information is generated due to monitoring information different from the current actual device state. A situation such as control may occur. In addition, in a relay device or the like, it is not possible to recognize that a relay delay has occurred, and as a result, a situation occurs in which a meaningless process is continued with the delay.
[0008]
One of the factors that cause the deadline abnormality due to the processing delay in the task is that the task side cannot recognize the deadline abnormality. In the real-time OS, when a certain event occurs, the event is regarded as an event, and the processing of the event is scheduled to be performed by a corresponding task. However, when trying to process a plurality of events at the same task with the same priority level, or when there are many events to be processed in a task with a high priority level, the event recognized on the real-time OS A waiting time for event processing occurs between the time and the actual processing of the event on the task side, and the task for processing the event cannot detect the occurrence of the waiting time and is delayed. This means that event processing is executed as it is.
[0009]
Even if a deadline error does not occur, for example, in a monitoring control device, a status change event of a device or the like is recognized as an interrupt event that occurs irregularly, and a delay occurs in the event notification from the real-time OS to the task side. However, since the task cannot recognize the delay time, there is a problem that the event processing is executed with the delay.
[0010]
Therefore, an object of the present invention is to notify a task of a delay time from the time of occurrence of an event in a real-time OS to the task side, and select and execute an appropriate process according to the delay time, thereby preventing a deadline abnormality from occurring on the task side. It is an object of the present invention to provide an event notification task control processing method, method, and program, which can detect in advance and prevent a system failure due to delay in advance.
[0011]
[Means for Solving the Problems]
The event notification task control processing method according to the present invention includes a real-time OS that realizes an interrupt process in real-time control and an input / output interface function with peripheral devices, and a process of an event detected by the real-time OS on the real-time OS. A plurality of tasks to be executed, the task determines a deadline level of the delay time based on a delay time from the occurrence of an event notified from the real-time OS; And an event processing unit that processes the event by selecting and executing a processing program corresponding to the event.
[0012]
The real-time OS further includes a task control unit that issues an event notification to any of the tasks that perform processing of the event when the occurrence of the event is detected, and the event processing unit of the task includes the event notification unit. A threshold value table for determining a deadline level of the delay time based on the delay time from the occurrence of the event, and an event execution processing matrix table for selecting a processing program corresponding to the level And the following.
[0013]
Further, the task control means detects an occurrence of an event and performs control for assigning an event number to the event, and selects and schedules any one of the tasks in charge of processing of the event. An event notification for causing the task to execute event processing is issued to the task, an event notification unit that controls the activation of the task, and a time at which the occurrence of the event is detected by the event occurrence detection unit, A delay time measuring unit that measures a delay time until the event notification unit issues the event notification.The event notification includes the event number of the event and the delay time. It is characterized by the following.
[0014]
Further, the level determination threshold table has a configuration in which the event numbers are arranged in a row direction and deadline levels are arranged in a column direction. At the intersection of each row and column, the level with respect to the delay time is set. Each event threshold is defined, and the event execution processing matrix table has a configuration in which the event numbers are arranged in the row direction and deadline levels are arranged in the column direction, and at the intersection of each row and column. , A module name of a processing program for executing the event processing of the level of the event number is defined.
[0015]
Further, the event processing means receives the event notification from the task control means, and when any of the tasks for executing the event processing of the event number attached to the event notification is started, the task is executed. The task determines the level of the deadline of the delay time of the event number by referring to the threshold table for level determination, and then the task refers to the event execution processing matrix table to determine the level of the event number. Is selected, and control is passed to and executed by a processing program having the module name, whereby the event with the event number is processed.
[0016]
An event notification task control processing method according to the present invention includes a real-time OS realizing interrupt processing in real-time control and an input / output interface function with a peripheral device, and a process of an event detected by the real-time OS on the real-time OS. A plurality of tasks to be executed, the task determines a deadline level of the delay time based on a delay time from the occurrence of an event notified from the real-time OS; The processing of the event is performed by selecting and executing a processing program corresponding to the event.
[0017]
Further, the real-time OS issues an event notification to any of the tasks that perform the processing of the event when detecting the occurrence of the event, and the task that has received the event notification is attached to the event notification. The deadline level of the delay time is determined based on the delay time from the occurrence of the event, a processing program corresponding to the level is selected, and control is passed to the processing program to execute the event. Is performed.
[0018]
Further, when the real-time OS detects the occurrence of the event, the real-time OS assigns an event number to the event, measures a delay time from the occurrence of the event to the issuance of the event notification, and executes any one of the tasks for processing the event. When it becomes possible to start, the event notification with the event number and the delay time is issued to the task, the task determines the level of the deadline of the delay time of the event number, The task performs a process of the event by selecting a module name corresponding to the level of the event number and passing control to a processing program having the module name to execute the processing. .
[0019]
The program according to the present invention includes the steps of: issuing, to a computer, a task that detects the occurrence of an event and issuing an event notification to any task program that processes the event; and A procedure for determining the level of the deadline of the delay time based on the delay time from the occurrence of the event attached to the event notification, and selecting a processing program corresponding to the level, passing control to the processing program and executing the processing program And causing the event to be processed by executing the procedure.
[0020]
Further, the computer provides a procedure for assigning an event number to the event when the occurrence of the event is detected, a procedure for measuring a delay time from the occurrence of the event to the issuance of the event notification, and a task for processing the event. When the program can be started, a procedure for issuing the event notification with the event number and the delay time to the task program, and the task program sets a deadline level of the delay time of the event number to the task program. The processing of the event is performed by executing a determining procedure, a procedure of selecting a module name corresponding to the level of the event number, and a procedure of passing control to a processing program having the module name and executing the processing program. To be characterized.
[0021]
A step of detecting the occurrence of an event and issuing an event notification of the event to the computer; a step of determining a level of a deadline of a delay time from the occurrence of the event attached to the event notification; Selecting a processing program according to the level and passing control to the processing program to execute the processing program.
[0022]
Also, the computer has a procedure for attaching an event number to the event when the occurrence of the event is detected, a procedure for measuring a delay time from the occurrence of the event to the issuance of the event notification, and attaching the event number and the delay time. Issuing the event notification, determining a level of the deadline of the delay time of the event number, selecting a module name corresponding to the level of the event number, and processing having the module name And a step of giving control to the program and executing the program.
[0023]
BEST MODE FOR CARRYING OUT THE INVENTION
Next, embodiments of the present invention will be described with reference to the drawings.
[0024]
FIG. 1 is a block diagram showing an embodiment of the event notification task control processing method according to the present invention.
[0025]
The embodiment shown in FIG. 1 includes a CPU (Central Processing Unit), a storage device, and other necessary peripheral devices and peripheral devices, such as a supervisory control device for monitoring and controlling communication devices and the like. 1 shows an example of an information processing apparatus 90 which is an information processing apparatus to be executed, but the illustration of the above-mentioned hardware is omitted, and only the configuration of software is shown.
[0026]
In FIG. 1, a device 90 includes a real-time OS (Operating System) 80 for realizing interrupt processing in real-time control and an input / output interface function with peripheral devices, and a device to be monitored and controlled on the real-
[0027]
The real-
[0028]
The task control unit 60 selects and schedules an event
[0029]
The task 10 is composed of a plurality of n tasks 10-1 to 10-n, and performs an event process corresponding to the event number notified by the
[0030]
Here, the deadline is a time limit from the occurrence of the event to the completion of the event processing in the task 10. In other words, when the time from the occurrence of a certain event to the end of the event processing of the event has a time limit defined by the corresponding device or system, and the end of the event processing exceeds the time limit Will be deadline abnormal. In the present embodiment, the above-described delay time is used to determine a deadline abnormality.
[0031]
The deadline is a value determined according to the corresponding device or the corresponding system for each event. Generally, at a level where there is no problem in the delay time, it is determined to be
[0032]
Next, the level determination threshold value table 20 shown in FIG. 1 will be described with reference to FIG.
[0033]
FIG. 2 is a diagram illustrating an example of the configuration of a threshold value table for level determination.
[0034]
The threshold table 20 for level determination in FIG. 2 is a table for the task 10 receiving the
[0035]
For example, in the
[0036]
The threshold value is similarly defined in the
[0037]
Next, the event execution processing matrix table 30 shown in FIG. 1 will be described with reference to FIG.
[0038]
FIG. 3 is a diagram illustrating an example of the configuration of an event execution processing matrix table.
[0039]
The event execution processing matrix table 30 in FIG. 3 indicates that the task 10 having received the
[0040]
For example, assuming that the event number is
[0041]
The description has been given assuming that the level determination threshold table 20 and the event execution processing matrix table 30 exist outside the task 10, but the two tables are made to exist inside the task 10. Is also good. In this case, each task 10 only needs to hold a table of a portion related to the event number that is to be processed by each task 10.
[0042]
Next, the operation of the present embodiment will be described in detail with reference to FIGS. In FIGS. 4 and 5, components corresponding to those shown in FIGS. 1, 2 and 3 are denoted by the same reference numerals or symbols, and description thereof is omitted.
[0043]
FIG. 4 is a diagram illustrating an overview of the operation of the present embodiment.
[0044]
In FIG. 4, it is assumed that “
[0045]
By issuing the event notification 70-1, the task 10-1 is activated at time t2, and event processing for “
[0046]
FIG. 5 is a diagram illustrating the operation of the task according to the present embodiment.
[0047]
In FIG. 5, the task 10 is activated upon receiving an
[0048]
Next, the task 10 refers to the level determination threshold table 20 and determines the level of the deadline from the “event number” and the “delay time” attached to the event notification 70 (S11). Here, the operation of the task 10-1 will be specifically described. In the event notification 70-1 notified to the task 10-1, "
[0049]
Next, the task 10 refers to the event execution processing matrix table 30, and obtains a module name for performing the event processing corresponding to the level obtained in step S11 (S12). Here, the operation of the task 10-1 will be specifically described. Since the “event number” is determined to be “
[0050]
When the module name is obtained, the task 10 transfers control to the module (program) to execute the module, and the module performs event processing (S13). To be more specific, as the operation of the task 10-1, the module name obtained in step S12 is “EVENT1_2”. Therefore, the task 10-1 transfers control to the module “EVENT1_2” to execute the module “EVENT1_2”. Performs event processing of “
[0051]
As described above, the event processing of “
[0052]
It is assumed that “
[0053]
When the “
[0054]
The activated task 10-2 executes “
[0055]
Similarly, when the “
[0056]
【The invention's effect】
As described above, the event notification task control processing method, method, and program of the present invention notify the task side of the delay time from the event occurrence time in the real-time OS to the task side as an event notification, and the task side deadline level of the delay time And the appropriate processing (program module) according to the determination level can be selected and executed, so that the task can recognize the deadline abnormality and the task can respond to the deadline abnormality stage This has the effect that a processing program can be created. Therefore, it is possible to create a processing program capable of avoiding a system failure due to a deadline abnormality in advance.
[0057]
Also, the task side can create a processing program according to the stage of the deadline abnormality. For example, when the delay time is not deadline abnormal, normal processing is performed. If it is determined that the process has exceeded the deadline, the process is interrupted as a part of the
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of an event notification task control processing method according to the present invention.
FIG. 2 is a diagram illustrating an example of a configuration of a level determination threshold table.
FIG. 3 is a diagram illustrating an example of a configuration of an event execution processing matrix table.
FIG. 4 is a diagram illustrating an overview of the operation of the present embodiment.
FIG. 5 is a diagram illustrating the operation of a task according to the present embodiment.
[Explanation of symbols]
10 tasks
20 Threshold table for level judgment
30 Event execution processing matrix table
60 Task control unit
61 Event occurrence detector
62 Delay time measurement unit
63 Event notification section
70 Event notification
80 Real-time OS
90 devices
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002227480A JP3859564B2 (en) | 2002-08-05 | 2002-08-05 | Event notification task control processing method and method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002227480A JP3859564B2 (en) | 2002-08-05 | 2002-08-05 | Event notification task control processing method and method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004070582A true JP2004070582A (en) | 2004-03-04 |
JP3859564B2 JP3859564B2 (en) | 2006-12-20 |
Family
ID=32014507
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002227480A Expired - Fee Related JP3859564B2 (en) | 2002-08-05 | 2002-08-05 | Event notification task control processing method and method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3859564B2 (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005250659A (en) * | 2004-03-02 | 2005-09-15 | Nec Mobiling Ltd | Task processing method and device using real time os and program |
JP2007041890A (en) * | 2005-08-04 | 2007-02-15 | Nec Corp | Task control device |
US8418188B2 (en) | 2010-03-11 | 2013-04-09 | Toyota Jidosha Kabushiki Kaisha | Task execution controller and recording medium on which task execution control program is recorded |
JP2016519371A (en) * | 2013-04-19 | 2016-06-30 | クロノ−セイフ | Task time allocation method enabling deterministic error recovery in real time |
WO2019187041A1 (en) * | 2018-03-30 | 2019-10-03 | 住友電気工業株式会社 | System, server computer thereof, control method, and computer program |
CN110928872A (en) * | 2018-09-19 | 2020-03-27 | 佳能株式会社 | Processing system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05204674A (en) * | 1991-10-15 | 1993-08-13 | Hewlett Packard Co <Hp> | Multitasking data processing system |
JPH09244984A (en) * | 1996-03-08 | 1997-09-19 | Nippon Telegr & Teleph Corp <Ntt> | Event order correction method |
JPH11237995A (en) * | 1998-02-23 | 1999-08-31 | Matsushita Electric Ind Co Ltd | Event controller |
JP2000207174A (en) * | 1999-01-20 | 2000-07-28 | Denso Corp | Electronic control unit |
-
2002
- 2002-08-05 JP JP2002227480A patent/JP3859564B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05204674A (en) * | 1991-10-15 | 1993-08-13 | Hewlett Packard Co <Hp> | Multitasking data processing system |
JPH09244984A (en) * | 1996-03-08 | 1997-09-19 | Nippon Telegr & Teleph Corp <Ntt> | Event order correction method |
JPH11237995A (en) * | 1998-02-23 | 1999-08-31 | Matsushita Electric Ind Co Ltd | Event controller |
JP2000207174A (en) * | 1999-01-20 | 2000-07-28 | Denso Corp | Electronic control unit |
Non-Patent Citations (1)
Title |
---|
岩橋正実: "オブジェクト指向で実現するリアルタイム設計", TECH I リアルタイムシステム実現のための自律オブジェクト指向, vol. 第12巻, CSND200301931005, 1 April 2002 (2002-04-01), pages 61 - 82, ISSN: 0000766849 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005250659A (en) * | 2004-03-02 | 2005-09-15 | Nec Mobiling Ltd | Task processing method and device using real time os and program |
JP2007041890A (en) * | 2005-08-04 | 2007-02-15 | Nec Corp | Task control device |
JP4516898B2 (en) * | 2005-08-04 | 2010-08-04 | 日本電気株式会社 | Task controller |
US8418188B2 (en) | 2010-03-11 | 2013-04-09 | Toyota Jidosha Kabushiki Kaisha | Task execution controller and recording medium on which task execution control program is recorded |
JP2016519371A (en) * | 2013-04-19 | 2016-06-30 | クロノ−セイフ | Task time allocation method enabling deterministic error recovery in real time |
JPWO2019187041A1 (en) * | 2018-03-30 | 2021-04-08 | 住友電気工業株式会社 | System, its server computer, control method and computer program |
CN111919200A (en) * | 2018-03-30 | 2020-11-10 | 住友电气工业株式会社 | System, server computer therefor, control method, and computer program |
US20210096918A1 (en) * | 2018-03-30 | 2021-04-01 | Sumitomo Electric Industries, Ltd. | System, server computer thereof, control method, and computer program |
WO2019187041A1 (en) * | 2018-03-30 | 2019-10-03 | 住友電気工業株式会社 | System, server computer thereof, control method, and computer program |
JP7070664B2 (en) | 2018-03-30 | 2022-05-18 | 住友電気工業株式会社 | System, its server computer, control method and computer program |
US11945382B2 (en) | 2018-03-30 | 2024-04-02 | Sumitomo Electric Industries, Ltd. | System, server computer thereof, control method, and computer program |
CN110928872A (en) * | 2018-09-19 | 2020-03-27 | 佳能株式会社 | Processing system and method |
CN110928872B (en) * | 2018-09-19 | 2023-12-22 | 佳能株式会社 | Processing system and method |
Also Published As
Publication number | Publication date |
---|---|
JP3859564B2 (en) | 2006-12-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6434591B1 (en) | Thread control system and method in a computer system | |
US7627705B2 (en) | Method and apparatus for handling interrupts in embedded systems | |
WO2006076853A1 (en) | A method of processing multi-thread/multi-task/multi-processor | |
US7444450B2 (en) | Method and system for detecting excessive interrupt processing for a processor | |
JP2007018282A (en) | Process control system and its control method | |
US10379931B2 (en) | Computer system | |
JP6955163B2 (en) | Information processing equipment, information processing methods and programs | |
JP5579935B2 (en) | Detection of abnormal operation caused by interrupt processing | |
JP3859564B2 (en) | Event notification task control processing method and method, and program | |
US8095695B2 (en) | Control apparatus for process input-output device | |
JP2965075B2 (en) | Program execution status monitoring method | |
KR100697988B1 (en) | Apparatus and method for protecting system from excessive occurrence of interrupt | |
JP2006227962A (en) | System and method for monitoring application task | |
JPH10269110A (en) | Method for avoiding hang-up of computer system, and computer system using the same method | |
JPH11237995A (en) | Event controller | |
JP4009602B2 (en) | Task processing method, apparatus, and program using real-time OS | |
JP2000089971A (en) | Method and device for controlling interruption order | |
JP4387863B2 (en) | Disturbance occurrence detection program and disturbance occurrence detection method | |
JPH08329022A (en) | Input/output process load decentralization control system for multiprocessor system | |
JP2000259433A (en) | Device and method for detecting deadlock | |
JPS63280345A (en) | Detection of program abnormality | |
JPS59135557A (en) | Information processor | |
JPH0644087A (en) | Scheduling control system of computer system | |
JPS62113260A (en) | Timer monitor control system for multi-cpu system | |
JPH11327959A (en) | Method and device for monitoring abnormality of processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20050304 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050715 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A711 Effective date: 20060410 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060613 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060802 |
|
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: 20060829 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060919 |
|
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: 20090929 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100929 Year of fee payment: 4 |
|
LAPS | Cancellation because of no payment of annual fees |