JP3775135B2 - Multitask processing system - Google Patents
Multitask processing system Download PDFInfo
- Publication number
- JP3775135B2 JP3775135B2 JP29444399A JP29444399A JP3775135B2 JP 3775135 B2 JP3775135 B2 JP 3775135B2 JP 29444399 A JP29444399 A JP 29444399A JP 29444399 A JP29444399 A JP 29444399A JP 3775135 B2 JP3775135 B2 JP 3775135B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- identifier
- task
- storage unit
- interrupt
- 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
Landscapes
- Computer And Data Communications (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、ネットワーク上からデータを受信してマルチタスク方式でデータ処理を行うマルチタスク処理システムに関し、特にネットワーク上に送信されたデータの受信を最優先で実行するために、割り込み受信部を備えたマルチタスク処理システムに関する。
【0002】
【従来の技術】
従来複数の外部装置とデータを交換する際に、個々の装置に応じた識別子であるIDを付与したデータをネットワークを介して送受信する情報処理システムが開発されている。
従来のシステムとしては、例えば図10に示すように、外部装置U1〜U15と、割り込みレジスタIR’、汎用レジスタR16、制御部6、リングバッファ2およびデータテーブル3からなるマルチタスク処理装置が、ネットワークNを介して接続されている。
ネットワークN上に、外部装置U1〜U15からデータが送信されると、割り込みレジスタIR’は、データを受信し、直ちに割り込み信号ISを制御部6へ出力する。
【0003】
制御部6における制御動作は、割り込みレジスタIR’に保存されたデータをリングバッファ2に転送する通信ドライバタスクと、リングバッファ2に格納されたデータをデータテーブル3に転送するデータ管理タスク、そしてデータテーブル3に格納されたデータに基づいて、演算処理または送信を行う演算処理タスクからなり、各タスクは予め設定された優先順位に従って順次実行される。
【0004】
具体的には、通信ドライバタスクが最も高い優先順位にあり、割り込み信号ISが入力された場合には、直ちに実行される。他のタスクが実行されていた場合には、そのタスクの動作は、一時的に停止状態に切り換えられ、通信ドライバタスクの処理が終了した後再開される。
次の優先順位は、演算処理タスクにあり、予め定められた所定の制御で起動され、通信ドライバタスクが実行されていなければ、実行される。通信ドライバタスクが実行されている場合には、通信ドライバタスクの動作が終了するまで、待機状態となる。
【0005】
データ管理タスクは最も低い優先順位のタスクである。このタスクはポーリング式で起動し、通信ドライバタスクまたは演算処理タスクが実行されていなければ、実行される。
通信ドライバタスクまたは演算処理タスクが起動された場合には、一時停止状態となり、通信ドライバタスクまたは演算処理タスクの処理が終了後再開される。
【0006】
正常に動作が行われるためには、これらのタスクが実行される実行時間や実行回数のバランスが所定範囲に保たれる必要がある。
このため、不図示の監視装置により、各タスクの実行状態を監視し、タスクの実行状態にアンバランスが生じた場合には、エラーリカバリー処置を実行する。
【0007】
例えば、ウオッチドッグタイマにより各タスクの実行状態を監視し、いずれかのタスクが所定時間を経過しても一回も実行されない場合には、処理装置内に何らかのトラブルが発生しているとみなし、一旦処理装置の動作を停止し、再起動させている。
あるいは、特開平8−202409号公報に記載されているマルチプロセッサシステム等では、一つのCPUでタスク実行状態にアンバランスが検出された場合には、そのCPUのランタイムが不足しているとみなし、他のCPUに負荷の一部を移すことにより、タスク実行状態のアンバランスを解消している。
【0008】
【発明が解決しようとする課題】
しかしながら、マルチタスク処理装置において、タスクのバランスが崩れる原因のひとつとして、マルチタスク処理装置自身には異常はないが、データを送信している外部装置に異常が生じている場合がある。
特に、外部装置の異常により、通常の送信レートより高いオーバーレートでデータが送信された場合には、そのオーバーレートデータを割り込みレジスタで受信すると、割り込みレジスタによる受信、割り込み信号ISの出力および通信ドライバタスクによるデータの転送が頻繁に繰り返され、他のタスクを実行する時間が不足し、タスク実行状態にアンバランスが生じることがある。
【0009】
この場合には、処理装置を再起動しても、タスクの実行状態のアンバランスは解消されず、また他のCPUにオーバーレートデータの受信を移しても、オーバーレートデータを受信するCPUにおいて、再びタスク実行状態のアンバランスが生じてしまう。
このため、本来受信側のマルチタスク処理装置には、異常が生じていないにも係わらず、受信側おけるエラーリカバリー動作が頻繁に繰り返され、動作に支障が生じてしまうという問題があった。
【0010】
本発明は、このような従来の問題点に鑑み、外部装置の異常により、所定送信レートより高いオーバーレートでデータが送信された場合でも、受信側の動作に支障が生じることがない、信頼性の向上したマルチタスク処理システムを提供することを目的とする。
【0011】
【課題を解決するための手段】
上記課題を解決するために、請求項1記載の発明では各装置に対応した識別子を付けたデータをネットワークに送信する外部装置と、ネットワークからデータを受信し、割り込み信号を出力する割り込み受信部と、ネットワークに送信されたデータの中から、設定された識別子と識別子が一致したデータを受信する識別子付受信部と、割り込み信号が出力されたときに割り込み受信部に取り込まれたデータを割り込み受信部から一時記憶部に転送する通信ドライバタスクと、一時記憶部に記憶されたデータを所定の転送レートで、記憶部に転送するデータ管理タスクと、記憶部に記憶されたデータに基づいて演算処理または送信を行う演算処理タスクを予め設定された優先順位に基づいて順次実行する制御部を備え、制御部は、一時記憶部がオーバーライト状態となったことを検知するオーバーライト検知手段と、オーバーライト状態となった一時記憶部に記憶されたデータ内容を解析し、正常な送信レートより高いレートで送信されているデータの識別子リストを作成するオーバーレート識別子リスト作成手段と、オーバーレート識別子リストの識別子を識別子付受信部の識別子として設定する識別子設定手段と、所定レートで、識別子付受信部で受信されたデータを前記記憶部へ転送するオーバーレート識別子データ転送手段を有し、割り込み受信部は、識別子付受信部に識別子が設定されていない識別子が付与されたデータをネットワーク上から取り込むものとする。
【0012】
請求項2記載の発明では、上記一時記憶部がリングバッファであるものとした。
【0013】
【発明の効果】
請求項1記載の発明では、外部装置が正常な状態でデータを送信している場合には、データはすべて割り込み受信部で受信され、制御部の通信ドライバタスクにより、データが受信される毎に、割り込み受信部から一時記憶部に転送され、データ管理タスクにより、一時記憶部から記憶部に転送される。演算処理タスクは、記憶部に記憶されたデータに基づいて、演算処理を行う。
【0014】
外部装置に異常が生じ、通常の送信レートより高いオーバーレートでデータが送信されると、割り込み受信部から一時記憶部へのデータの転送が頻繁に行われ、一時記憶部がオーバーライト状態となる。
制御部では、オーバーライト検知手段により、一時記憶部のオーバーライト状態が検知されると、オーバーレート識別子リスト作成手段は、一時記憶部に記憶されたデータの中から、オーバーレートで送信されているデータのリストであるオーバーレート識別子リストを作成し、オーバーレート識別子設定手段により、オーバーレート識別子リストの識別子を識別子付受信部の識別子として設定する。
【0015】
識別子付受信部に識別子が設定されると、ネットワークに送信されたデータのうち、識別子が識別子付受信部に設定されているデータは、該当する識別子付受信部で受信され、識別子が識別子付受信部に設定されていないデータのみが、割り込み受信部で受信される。
【0016】
このため、割り込み受信部では、正常な送信レートで送信されたデータのみを受信するため、通信ドライバタスクによる割り込み受信部から一時記憶部へのデータ転送が、他のタスクの実行を妨げるほど頻繁に行われることはない。
したがって、外部装置の異常により、正常な送信レートより高いレートでデータが送信された場合でも、受信側の処理装置の動作に支障が生じることを防止でき、マルチタスク処理システムの信頼性を向上させることができる。
【0017】
請求項2記載の発明では、一時記憶部としてリングバッファを用いることにより、容易にオーバーライト状態を検出できる。
【0018】
【発明の実施の形態】
本発明の実施の形態を実施例により説明する。
図1は本発明の実施例の構成を示すブロック図である。
制御部1には、割り込みレジスタIR、ID付レジスタR1〜R7、汎用レジスタR8〜R15、リングバッファ2およびデータテーブル3が接続されている。
割り込みレジスタIRおよびID付レジスタR1〜R7は、IDマスク部4を介して、ネットワークNに接続されている。汎用レジスタR8〜R15は、ネットワークNに直接接続されている。
【0019】
ネットワークNには、外部装置U1〜U15が接続され、外部装置U1はID=1が付与されたデータを送信し、外部装置U2はID=2を、同様に外部装置U3〜U15はID=3〜ID=15が付与されたデータを送信する。
制御部1には、ID=0が設定されている。
【0020】
ID付レジスタR1〜R7は、オーバーレートデータ受信用のレジスタであり、通常は使用されない。
後述するオーバーライトエラー処理により、IDが設定されると、予め設定されたIDと一致したIDが付加されたデータを受信する。
ID付レジスタR1〜R7で受信されたデータは、一定周期で制御部1により読み出され、転送される。ID付レジスタR1〜R7は、一旦データを受信して保管すると、制御部1により保管したデータが読み出されて、転送されるまでの間は、データを受信しない。
【0021】
割り込みレジスタIRは、ID付レジスタに設定されたIDと一致しないIDが付加されたデータを受信する。ID付レジスタのIDが設定されていない場合には、全てのデータを受信する。
データを受信すると、直ちに割り込み信号ISを制御部1に出力する。
汎用レジスタR8〜R15は、必要に応じて、種々の記憶部として用いられる。
【0022】
リングバッファ2は、図2に示すような複数個のポジションから構成されるリング状のバッファである。格納されたデータの最初のポジションをHeadポジション、最後のポジションをTailポジションとする。
データテーブル3は、受信されたデータを記憶できる十分な記憶容量を備えた記憶部である。
割り込みレジスタIRおよびIDマスク部4は、発明の割り込み受信部を構成する。また、ID付レジスタR1〜R7は、発明の識別子付受信部を構成し、リングバッファ2は発明の一時記憶部を、データテーブル3は記憶部を構成する。
【0023】
次に、制御部1の動作を中心に、本発明のマルチタスク処理システムの動作を説明する。
制御部1における制御動作は、次の3つのタスクから構成されている。
まず、通信ドライバタスクは、割り込みレジスタIRに保存されたデータをリングバッファ2に転送する。またリングバッファ2がオーバーライト状態となった場合に、後述するオーバーライトエラー処理を行い、通常の送信レートより高いレートで送信されているオーバーレートデータのIDをID付レジスタR1〜R7のIDとして設定する。
【0024】
データ管理タスクは、リングバッファ2に格納されたデータをデータテーブル3に転送する。またオーバーライトエラー処理が行われた場合には、ID付レジスタR1〜R7で受信したデータを一定周期で、データテーブル3に転送する。演算処理タスクは、データテーブル3に格納されたデータに基づいて、演算処理または送信を行う。また、オーバーライトエラー処理が実行されている間、制御部1をフェイルセーフ状態に保つ。
【0025】
各タスクは予め設定された優先順位に従って、複数の動作状態間で遷移しながら、順次実行される。
通信ドライバタスクは、起動されていないスリーピング状態、処理を行っているオペレーション状態、起動され待機しているレディ状態の3つの状態を遷移し、演算処理タスクはスリーピング状態、オペレーション状態、レディ状態、処理が中断されているブロックド状態の4つの状態を遷移し、データ管理タスクはオペレーション状態とブロックド状態の2つの状態を遷移する。
【0026】
まず、図3を用いて、通信ドライバタスクにおける動作状態の遷移条件を説明する。
通信ドライバタスクは、最も高い優先順位にあり、割り込みレジスタIRから割り込み信号ISが入力されると、レディ状態になり、直ちにオペレーション状態となり、処理を実行する。他のタスクが実行されていた場合には、そのタスクの動作は、中断されてブロックド状態に切り換えられ、通信ドライバタスクの処理が優先的に実行される。
通信ドライバタスクは、処理が終了すると、オペレーション状態からスリーピング状態となり、次に割り込み信号ISが入力されるまで、スリーピング状態を保つ。
最も優先順位の高いタスクであるため、ブロックド状態になることはない。
【0027】
次に、図4を用いて第2の優先順位を有する、演算処理タスクにおける動作状態の遷移条件を説明する。
予め定められた一定周期で起動され、通信ドライバタスクが起動されていない、すなわちスリーピング状態であれば、レディ状態から直ちにオペレーション状態に移り、実行される。
通信ドライバタスクが起動されている場合には、通信ドライバタスクの処理動作が終了するまで、レディ状態で待機する。
オペレーション状態で処理を実行中に、通信ドライバタスクが起動された場合には、処理は中断されブロックド状態に切り換えられる。通信ドライバタスクの処理が終了し、通信ドライバタスクがスリーピング状態に移行すると、演算処理タスクは、ブロックド状態からオペレーション状態に移行し、処理を再開する。
【0028】
最も優先順位が低いデータ管理タスクにおける動作状態の遷移条件を図5に示す。
データ管理タスクは、ポーリング式で起動され、通信ドライバタスクおよび演算処理タスクが起動されていなければ、常時実行される。
通信ドライバタスクまたは演算処理タスクが起動された場合には、すぐにブロックド状態となり、起動された通信ドライバタスクまたは演算処理タスクの処理が終了後再開される。
なお、システムにエラーが発生した場合には、上記遷移条件よりエラー処理における処理が優先される。
【0029】
次に、図6、図8および図9に示すフローチャートを用いて、制御部1における動作を詳細に説明する。
図6は、通信ドライバタスクの流れを示すフローチャートである。
ステップ101では、割り込みレジスタIRから割り込み信号ISが入力されるとスリーピング状態からレディ状態、オペレーション状態に遷移し、ステップ102へ進む。
【0030】
割り込み信号ISが入力されない場合には、スリーピング状態で割り込み信号ISの入力の監視を継続する。
ステップ102では、リングバッファ2にデータを書き込む空きポジションが残っていないオーバーライト状態であるか否かを判定する。
具体的には、格納されたデータの最後のポジションであるTailポジションに1を加えた値と格納されたデータの先頭のポジションであるHeadポジションの値を比較し、等しい場合には、オーバーライト状態であると判定し、ステップ105へ進み、ステップ105〜ステップ118において、オーバーライトエラー処理を行う。
【0031】
Tailポジションに1を加えた値とHeadポジションの値が等しくなければ、リングバッファ2には、データを書き込む余裕が残っている状態であり、すなわち外部装置から異常に高いレートで送信されたデータを受信してはいないので、通常の動作として、ステップ103へ進み、データを割り込みレジスタIRからリングバッファ2へ転送する。
ステップ104では、Tailポジションの値に1を加え、ステップ102へ戻る。
【0032】
ステップ105では、リングバッファ2には、データを書き込む余裕が残っていないオーバーライト状態であり、オーバーライトエラーフラグを設定する。
ステップ106では、システムエラーを示すシステムエラーフラグも設定する。
ステップ107では、一旦通信ドライバタスクをスリーピング状態に遷移させ、演算処理タスクから返答信号Aが入力されるまで、スリーピング状態で待機する。
返答信号Aが入力されると、ステップ108へ進み、ステップ108〜ステップ111において、通常の送信レートより高い送信レートで送信されているオーバーレートデータのIDをリストアップする。
【0033】
ステップ108では、まず、リングバッファ2の全ポジションにデータが蓄積されるまでに経過したデータ蓄積時間を算出する。
具体的には、データ管理タスクに記憶されている、リングバッファ2のデータをデータテーブル3に転送し、リングバッファ2の全ポジションを空き状態にしたデータ転送時刻から、リングバッファ2のオーバーライト状態が検出された時刻までの経過時間を算出し、データ蓄積時間とする。
【0034】
次にステップ109で、リングバッファ2に格納されている全データのID毎の格納数を示すID格納数表を作成する。
具体的には、リングバッファ2に格納されたデータを順次読み出して、読み出されたデータのIDを検出し、ID毎の個数を算出する。
リングバッファ2に格納された全てのデータのID毎の個数を算出し、ID格納数表とする。
【0035】
ステップ110では、ID格納数表の値をステップ108で算出したデータ蓄積時間で除算することにより、ID毎の受信レートを示す、ID受信レート表を作成する。
ステップ111では、各ID毎に、受信レートが通常の送信レートに対応した正常な受信レートより高いレートであるか、すなわちデータがオーバーレートデータであるか否かをしらべ、オーバーレートデータのIDの一覧表であるオーバーレートIDリストを作成する。
この際には、各外部装置の送信レートが異なる場合には、ID毎に対応する外部装置の正常な送信レートと比較すればよい。
【0036】
ステップ112では、オーバーレートIDリストを受信レートの高いものから低いものへ順次並ぶように、並べ替えるソーティングを行う。
ステップ113では、ID付レジスタR1〜R7に、オーバーレートIDリストの受信レートの高い順からID番号を割り当てる。
例えば、オーバーレートIDリストとして、図7の(a)に示すようなリストが作成された場合には、ID付レジスタR1にはID=4を設定し、ID付レジスタR2にはID=6を、ID付レジスタR3にはID=10を設定する。
【0037】
また、図7の(a)に示すようなオーバーレートIDリストが作成された場合には、さらに、ID付レジスタR4にはID=15を設定し、ID付レジスタR5にはID=1を、ID付レジスタR6にはID=2を設定し、ID付レジスタR7にはID=9を設定する。この際には、ID=13のデータは、ID付レジスタR1〜R7では受信できないため、割り込みレジスタIRで受信されてしまうが、受信レートは、比較的低いので、マルチタスク制御装置の動作に支障をきたす確率は低くなる。
【0038】
ステップ114では、オーバーライトエラーフラグを消去する。
ステップ115では、オーバーレートデータモードフラグを設定する。このフラグは、データ管理タスクにおいて、通常の転送のみを行うか、オーバーレートデータ用のID付レジスタ内のデータの転送を行うかの判定に用いる。
【0039】
ステップ116は、システムエラーフラグも消去する。
ステップ117は、エラー処理終了信号ESを出力する。
ステップ118は、一旦通信ドライバタスクをスリーピング状態に遷移させ、演算処理タスクから返答信号Aが入力されるまで、スリーピング状態で待機する。
返答信号Aが入力されると、ステップ101へ戻る。
【0040】
次に、データ管理タスクにおける動作を図8に示すフローチャートを用いて説明する。
ステップ201では、ポーリング式で起動され、通信ドライバタスクおよび演算処理タスクがスリーピングであるか否かを判定する。両方のタスクがスリーピング状態であれば、ステップ202へ進む。どちらかのタスクがスリーピング状態でなければ、ブロックド状態で、両方のタスクがスリーピング状態になるまで待機する。
【0041】
ステップ202では、リングバッファ2にデータが格納されているか否かを判定する。
データが格納されていなければ、ステップ205へ進む。
データが格納されていれば、ステップ203へ進み、リングバッファ2に格納されたデータをデータテーブル3へ転送し、ステップ204で、転送した時刻データ転送時刻として記憶する。
【0042】
ステップ205では、オーバーレートデータモードフラグが設定されているか否かを判定する。
オーバーレートデータモードフラグが設定されていなければ、ステップ201に戻る。
オーバーレートデータモードフラグが設定されていれば、ステップ206へ進む。
【0043】
ステップ206では、ID付レジスタに格納されたオーバーレートデータの転送時間であるか否かを判定する。
具体的には、オーバーレートデータを転送後の経過時間をオーバーレートクロックにより計測し、所定時間経過している場合には、オーバーレートデータの転送時間であるとみなし、ステップ207へ進む。
オーバーレートデータの転送時間でなければ、ステップ201へ戻る。
ステップ207では、IDレジスタR1〜R7に、データが格納されているか否かを調べ、データが格納されている場合には、そのデータをID付レジスタからデータテーブル3に転送する。
【0044】
さらに、図9に示すフローチャートを用いて、演算処理タスクにおける動作を説明する。
ステップ301では、所定周期のクロックからクロック信号CSが入力されると、起動され、レディ状態となる。
ステップ302では、通信ドライバタスクがスリーピング状態であるか否かを判定する。
スリーピング状態であれば、ステップ303へ進む。
スリーピング状態でなければ、通信ドライバタスクがスリーピング状態になるまで、レディ状態で待機する。
【0045】
ステップ303では、システムエラーフラグが設定されているか否かを判定する。
システムエラーフラグが設定されていなければ、ステップ304へ進み、制御演算に必要なデータをデータテーブルから読み出し、通常の演算処理を行い、ステップ301へ戻る。
システムエラーフラグが設定されていれば、ステップ305へ進む。
【0046】
ステップ305では、オーバーライトエラーフラグが設定されているか否かを判定する。
オーバーライトエラーフラグが設定されていなければ、ステップ306へ進み、エラー内容に適した処理を行い、ステップ301へ戻る。
オーバーライトエラーフラグが設定されている場合にはステップ307へ進む。
ステップ307では、オーバーライト状態に応じたフェイルセーフ処理を制御部1に施す。
【0047】
ステップ308では、データ管理タスクの動作停止を要求する。
ステップ309では、返答信号Aを通信ドライバタスクへ出力し、通信ドライバタスクがオーバーライトエラー処理を開始するように促す。
ステップ310では、エラー処理終了信号ESが、通信ドライバタスクから入力されるまで、待機する。
【0048】
ステップ311では、オーバーレートデータモードフラグが設定されているか否かを判定する。
オーバーレートデータモードフラグが設定されている場合には、正常なエラー処理が終了したとみなし、ステップ313へ進む。
エラー処理終了信号ESが入力されたにも係らず、オーバーレートデータモードフラグが設定されていない場合には、制御部1に何らかの異常が生じている恐れがあるため、ステップ312へ進み、フェイルセーフ状態を解除せず、適切な対応を警報等により促す。
ステップ313では、データ管理タスクの動作開始を要求する。
ステップ314では、フェイルセーフ状態を解除し、通常動作状態に戻り、その後ステップ301へ戻る。
【0049】
なお、図6に示すフローチャートのステップ102は、発明のオーバーライト検知手段を構成し、ステップ108〜ステップ111はオーバーレート識別子リスト作成手段を、ステップ113は識別子設定手段を構成する。
また、図8に示すフローチャートのステップ207は、発明のオーバーレート識別子データ転送手段を構成し、図9に示すフローチャートのステップ307は、フェイルセーフ手段を構成する。
【0050】
上記の動作により、外部装置U1〜U15が正常な状態でデータを送信している場合には、データはすべて割り込みレジスタIRで受信され、制御部1の通信ドライバタスクにより、データが受信される毎に、割り込みレジスタIRからリングバッファ2に転送され、データ管理タスクにより、リングバッファ2からデータテーブル3に転送される。演算処理タスクは、データテーブル3に記憶されたデータに基づいて、演算処理を行う。
【0051】
外部装置に異常が生じ、通常の送信レートより高いオーバーレートでデータが送信されると、オーバーライト状態が検知され、オーバーレートで送信されているデータのリストであるオーバーレートIDリストを作成し、ID付レジスタR1〜R7に、オーバーレートデータのIDを設定する。
ID付レジスタにIDが設定されると、IDマスク部4により、ネットワークNに送信されたデータのうち、IDがID付レジスタに設定されているデータは、該当するIDレジスタで受信され、IDがID付レジスタに設定されていないデータのみが、割り込みレジスタIRで受信される。
【0052】
このため、割り込みレジスタIRでは、正常な送信レートで送信されたデータのみを受信するため、通信ドライバタスクによる割り込みレジスタIRからリングバッファ2へのデータ転送が、他のタスクの実行を妨げるほど頻繁に行われることはない。
【0053】
したがって、外部装置U1〜U15の異常により、正常な送信レートより高いレートでデータが送信された場合でも、受信側の処理装置の動作に支障が生じることを防止でき、マルチタスク処理システムの信頼性を向上させることができる。
また、オーバーレートデータを送信する外部装置の数が、予めオーバーレートデータ受信用に設置されたID付レジスタの個数より多い場合には、レートの高いデータのIDから順にIDを設定し、割り込みレジスタIRでは、オーバーレートデータの中でもなるべく低いレートで送信されているデータを受信するので、ID付レジスタを最も有効に利用することができる。
【0054】
さらに、リングバッファ2のオーバーライト状態が検出されると、制御部1はフェイルセーフ状態に保たれるため、その後の動作に支障が生じることがなく、マルチタスク処理システムの信頼性を一層向上させることができる。
割り込みレジスタIRからのデータの転送先としてリングバッファ2を用いることにより、容易にオーバーライト状態を検出できる。
【図面の簡単な説明】
【図1】本発明の実施例の構成を示すブロック図である。
【図2】リングバッファを示す図である。
【図3】通信ドライバタスクにおける状態遷移条件を示す図である。
【図4】演算処理バタスクにおける状態遷移条件を示す図である。
【図5】データ管理タスクにおける状態遷移条件を示す図である。
【図6】通信ドライバタスクにおける動作の流れを説明するフローチャートである。
【図7】オーバーレートIDリストを説明する図である。
【図8】データ管理タスクにおける動作の流れを説明するフローチャートである。
【図9】演算処理タスクにおける動作の流れを説明するフローチャートである。
【図10】従来例の構成を示すブロック図である。
【符号の説明】
1、6 制御部
2 リングバッファ
3 データテーブル
4 IDマスク部
IR、IR’ 割り込みレジスタ
R1〜R7 ID付レジスタ
R8〜R16 汎用レジスタ
U1〜U15 外部装置[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a multitask processing system that receives data from a network and performs data processing by a multitask method, and more particularly, includes an interrupt receiving unit to execute reception of data transmitted over the network with the highest priority. Relates to a multitasking processing system.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, an information processing system has been developed that exchanges data with an ID, which is an identifier corresponding to each device, via a network when exchanging data with a plurality of external devices.
As a conventional system, for example, as shown in FIG. 10, a multitask processing device comprising external devices U1 to U15, an interrupt register IR ′, a general-purpose register R16, a
When data is transmitted from the external devices U1 to U15 to the network N, the interrupt register IR ′ receives the data and immediately outputs the interrupt signal IS to the
[0003]
The control operation in the
[0004]
Specifically, when the communication driver task has the highest priority and the interrupt signal IS is input, it is immediately executed. If another task has been executed, the operation of the task is temporarily switched to a stopped state and resumed after the processing of the communication driver task is completed.
The next priority is in the arithmetic processing task, which is activated if the communication driver task is not executed by being started by predetermined control. When the communication driver task is being executed, the communication driver task is in a standby state until the operation of the communication driver task is completed.
[0005]
The data management task is the lowest priority task. This task is started in a polling manner, and is executed if the communication driver task or the arithmetic processing task is not executed.
When the communication driver task or the arithmetic processing task is activated, the communication driver task or the arithmetic processing task is temporarily stopped and resumed after the processing of the communication driver task or the arithmetic processing task is completed.
[0006]
In order for normal operation to be performed, it is necessary to keep the balance between the execution time and the number of execution times during which these tasks are executed within a predetermined range.
For this reason, the execution state of each task is monitored by a monitoring device (not shown), and if an imbalance occurs in the execution state of the task, error recovery measures are executed.
[0007]
For example, the execution state of each task is monitored by a watchdog timer, and if any task is not executed even once after a predetermined time, it is considered that some trouble has occurred in the processing device, The operation of the processing device is once stopped and restarted.
Alternatively, in the multiprocessor system described in JP-A-8-202409, etc., when an imbalance is detected in the task execution state by one CPU, it is considered that the runtime of the CPU is insufficient. The task execution state imbalance is eliminated by transferring a part of the load to another CPU.
[0008]
[Problems to be solved by the invention]
However, in the multitask processing apparatus, one of the causes of the imbalance of tasks is that there is no abnormality in the multitask processing apparatus itself, but there is a case where an abnormality occurs in the external apparatus that transmits data.
In particular, when data is transmitted at an overrate higher than the normal transmission rate due to an abnormality in the external device, when the overrate data is received by the interrupt register, reception by the interrupt register, output of the interrupt signal IS, and communication driver Data transfer by a task is frequently repeated, and there is a case where the task execution state is unbalanced due to insufficient time for executing another task.
[0009]
In this case, even if the processing device is restarted, the imbalance in the task execution state is not resolved, and even if the reception of the overrate data is transferred to another CPU, the CPU that receives the overrate data, The task execution state is unbalanced again.
For this reason, the multitask processing apparatus on the receiving side originally has a problem that the error recovery operation on the receiving side is frequently repeated even though no abnormality has occurred, and the operation is hindered.
[0010]
In view of such a conventional problem, the present invention does not hinder the operation on the receiving side even when data is transmitted at an over rate higher than a predetermined transmission rate due to an abnormality of an external device. An object of the present invention is to provide an improved multitask processing system.
[0011]
[Means for Solving the Problems]
In order to solve the above-described problem, in the first aspect of the present invention, an external device that transmits data with an identifier corresponding to each device to the network, an interrupt receiving unit that receives data from the network and outputs an interrupt signal, A receiver with an identifier for receiving data whose identifier matches the set identifier from data transmitted to the network, and an interrupt receiver for receiving data captured by the interrupt receiver when an interrupt signal is output A communication driver task for transferring data from the temporary storage unit to the temporary storage unit, a data management task for transferring the data stored in the temporary storage unit to the storage unit at a predetermined transfer rate, and arithmetic processing based on the data stored in the storage unit or A control unit that sequentially executes arithmetic processing tasks to be transmitted based on a preset priority order; -Overwrite detection means for detecting that it is in the bar light state and the identifier list of data transmitted at a higher rate than the normal transmission rate by analyzing the data content stored in the temporary storage unit in the over write state Overrate identifier list creating means for creating the identifier, identifier setting means for setting the identifier of the overrate identifier list as an identifier of the receiver with identifier, and data received by the receiver with identifier at a predetermined rate to the storage section It is assumed that there is an over-rate identifier data transfer means for transferring, and the interrupt receiving unit takes in data with an identifier to which no identifier is set in the receiving unit with identifier from the network.
[0012]
In invention of
[0013]
【The invention's effect】
In the first aspect of the invention, when the external device is transmitting data in a normal state, all the data is received by the interrupt receiving unit, and every time data is received by the communication driver task of the control unit. The data is transferred from the interrupt receiving unit to the temporary storage unit, and transferred from the temporary storage unit to the storage unit by the data management task. The arithmetic processing task performs arithmetic processing based on the data stored in the storage unit.
[0014]
When an error occurs in the external device and data is transmitted at an overrate higher than the normal transmission rate, data is frequently transferred from the interrupt receiving unit to the temporary storage unit, and the temporary storage unit is overwritten. .
In the control unit, when the overwrite state of the temporary storage unit is detected by the overwrite detection unit, the overrate identifier list creation unit is transmitted at an overrate rate from the data stored in the temporary storage unit. An overrate identifier list which is a list of data is created, and an identifier of the overrate identifier list is set as an identifier of the receiver with identifier by an overrate identifier setting unit.
[0015]
When an identifier is set in the receiver with identifier, among the data transmitted to the network, the data with the identifier set in the receiver with identifier is received by the corresponding receiver with identifier, and the identifier is received with the identifier. Only data that is not set in the receiver is received by the interrupt receiver.
[0016]
For this reason, since the interrupt receiving unit receives only data transmitted at a normal transmission rate, data transfer from the interrupt receiving unit to the temporary storage unit by the communication driver task is frequently performed so as to prevent execution of other tasks. Never done.
Therefore, even when data is transmitted at a higher rate than the normal transmission rate due to an abnormality in the external device, it is possible to prevent the operation of the processing device on the receiving side from being hindered, and improve the reliability of the multitask processing system. be able to.
[0017]
In the invention according to
[0018]
DETAILED DESCRIPTION OF THE INVENTION
The embodiment of the present invention will be described with reference to examples.
FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.
The
The interrupt register IR and the ID registers R1 to R7 are connected to the network N via the
[0019]
External devices U1 to U15 are connected to the network N, the external device U1 transmits data assigned ID = 1, the external device U2 assigns ID = 2, and the external devices U3 to U15 similarly ID = 3. Data with ID = 15 is transmitted.
ID = 0 is set in the
[0020]
The registers with IDs R1 to R7 are registers for receiving overrate data and are not normally used.
When an ID is set by an overwrite error process, which will be described later, data with an ID that matches a preset ID is received.
Data received by the registers with IDs R1 to R7 is read and transferred by the
[0021]
The interrupt register IR receives data with an ID that does not match the ID set in the register with ID. If the ID of the register with ID is not set, all data is received.
When data is received, an interrupt signal IS is immediately output to the
The general purpose registers R8 to R15 are used as various storage units as necessary.
[0022]
The
The data table 3 is a storage unit having a sufficient storage capacity for storing received data.
The interrupt register IR and the
[0023]
Next, the operation of the multitask processing system of the present invention will be described focusing on the operation of the
The control operation in the
First, the communication driver task transfers the data stored in the interrupt register IR to the
[0024]
The data management task transfers the data stored in the
[0025]
Each task is sequentially executed while transitioning between a plurality of operation states according to a preset priority order.
The communication driver task transitions between three states: a sleeping state that is not activated, an operation state that is performing processing, and a ready state that is activated and waiting, and an arithmetic processing task is the sleeping state, operation state, ready state, and processing The data management task transits between the operation state and the blocked state.
[0026]
First, the transition condition of the operation state in the communication driver task will be described with reference to FIG.
The communication driver task has the highest priority. When the interrupt signal IS is input from the interrupt register IR, the communication driver task enters a ready state, immediately enters an operation state, and executes processing. If another task has been executed, the operation of the task is interrupted and switched to the blocked state, and the processing of the communication driver task is preferentially executed.
When the processing is completed, the communication driver task changes from the operation state to the sleeping state, and keeps the sleeping state until the interrupt signal IS is input next time.
Since it is the highest priority task, it will not be blocked.
[0027]
Next, the operation state transition condition in the arithmetic processing task having the second priority will be described with reference to FIG.
If the communication driver task is not started, that is, in a sleeping state, it is started at a predetermined fixed period and is immediately moved from the ready state to the operation state and executed.
When the communication driver task is activated, the communication driver task waits in a ready state until the processing operation of the communication driver task is completed.
If the communication driver task is activated while the process is being executed in the operation state, the process is interrupted and switched to the blocked state. When the processing of the communication driver task is completed and the communication driver task shifts to the sleeping state, the arithmetic processing task shifts from the blocked state to the operation state and restarts the processing.
[0028]
FIG. 5 shows the transition conditions of the operation state in the data management task with the lowest priority.
The data management task is activated in a polling manner, and is always executed unless the communication driver task and the arithmetic processing task are activated.
When the communication driver task or the arithmetic processing task is activated, the communication driver task or the arithmetic processing task is immediately blocked and resumed after the processing of the activated communication driver task or arithmetic processing task is completed.
If an error occurs in the system, the error processing is prioritized over the transition condition.
[0029]
Next, the operation in the
FIG. 6 is a flowchart showing the flow of the communication driver task.
In
[0030]
When the interrupt signal IS is not input, monitoring of the input of the interrupt signal IS is continued in the sleeping state.
In
Specifically, the value obtained by adding 1 to the tail position, which is the last position of the stored data, is compared with the value of the head position, which is the first position of the stored data. In
[0031]
If the value obtained by adding 1 to the tail position is not equal to the value of the head position, the
In
[0032]
In
In
In
When the reply signal A is input, the process proceeds to step 108, and in
[0033]
In
Specifically, the data stored in the data management task is transferred from the data in the
[0034]
Next, in
Specifically, the data stored in the
The number of all data stored in the
[0035]
In
In
In this case, if the transmission rates of the external devices are different, the comparison may be made with the normal transmission rate of the external device corresponding to each ID.
[0036]
In
In
For example, when a list as shown in FIG. 7A is created as the overrate ID list, ID = 4 is set in the ID-added register R1, and ID = 6 is set in the ID-added register R2. ID = 10 is set in the register with ID R3.
[0037]
When the overrate ID list as shown in FIG. 7A is created, ID = 15 is set in the register with ID R4, ID = 1 is set in the register with ID R5, and ID = 2 is set in the register with ID R6, and ID = 9 is set in the register with ID R7. In this case, since the data with ID = 13 cannot be received by the registers with IDs R1 to R7, the data is received by the interrupt register IR. However, since the reception rate is relatively low, the operation of the multitask control device is hindered. The probability of causing is low.
[0038]
In step 114, the overwrite error flag is erased.
In step 115, an overrate data mode flag is set. This flag is used in the data management task to determine whether to perform only normal transfer or to transfer data in the ID-added register for overrate data.
[0039]
Step 116 also clears the system error flag.
Step 117 outputs an error processing end signal ES.
Step 118 temporarily changes the communication driver task to the sleeping state, and waits in the sleeping state until a response signal A is input from the arithmetic processing task.
When the response signal A is input, the process returns to step 101.
[0040]
Next, the operation in the data management task will be described using the flowchart shown in FIG.
In step 201, it is activated by a polling method, and it is determined whether or not the communication driver task and the arithmetic processing task are sleeping. If both tasks are in the sleeping state, go to step 202. If either task is not in the sleeping state, it is blocked and waits until both tasks are in the sleeping state.
[0041]
In step 202, it is determined whether or not data is stored in the
If no data is stored, the process proceeds to step 205.
If data is stored, the process proceeds to step 203, where the data stored in the
[0042]
In step 205, it is determined whether or not the over-rate data mode flag is set.
If the over rate data mode flag is not set, the process returns to step 201.
If the over rate data mode flag is set, the process proceeds to step 206.
[0043]
In step 206, it is determined whether it is the transfer time of the overrate data stored in the register with ID.
Specifically, the elapsed time after transferring the overrate data is measured by the overrate clock, and if the predetermined time has elapsed, it is considered that the transfer time of the overrate data is reached, and the process proceeds to step 207.
If it is not the transfer time of the overrate data, the process returns to step 201.
In step 207, it is checked whether data is stored in the ID registers R1 to R7. If data is stored, the data is transferred from the register with ID to the data table 3.
[0044]
Furthermore, the operation | movement in a calculation processing task is demonstrated using the flowchart shown in FIG.
In
In
If it is in the sleeping state, the process proceeds to step 303.
If it is not in the sleeping state, it waits in the ready state until the communication driver task enters the sleeping state.
[0045]
In
If the system error flag is not set, the process proceeds to step 304, data necessary for the control calculation is read from the data table, a normal calculation process is performed, and the process returns to step 301.
If the system error flag is set, the process proceeds to step 305.
[0046]
In
If the overwrite error flag is not set, the process proceeds to step 306, performs processing suitable for the error content, and returns to step 301.
If the overwrite error flag is set, the process proceeds to step 307.
In
[0047]
In
In
In
[0048]
In
If the overrate data mode flag is set, it is considered that normal error processing has ended, and the process proceeds to step 313.
If the over rate data mode flag is not set despite the input of the error processing end signal ES, there is a possibility that some abnormality has occurred in the
In
In
[0049]
Note that
Further, step 207 in the flowchart shown in FIG. 8 constitutes the over-rate identifier data transfer means of the invention, and step 307 in the flowchart shown in FIG. 9 constitutes a fail-safe means.
[0050]
When the external devices U1 to U15 transmit data in a normal state by the above operation, all data is received by the interrupt register IR, and every time data is received by the communication driver task of the
[0051]
When an abnormality occurs in the external device and data is transmitted at an overrate higher than the normal transmission rate, an overwrite state is detected and an overrate ID list that is a list of data transmitted at the overrate is created, The ID of the overrate data is set in the registers with IDs R1 to R7.
When the ID is set in the register with ID, the data in which the ID is set in the register with ID among the data transmitted to the network N by the
[0052]
For this reason, since the interrupt register IR receives only data transmitted at a normal transmission rate, the data transfer from the interrupt register IR to the
[0053]
Therefore, even when data is transmitted at a rate higher than the normal transmission rate due to an abnormality in the external devices U1 to U15, it is possible to prevent the operation of the processing device on the receiving side from being hindered, and the reliability of the multitask processing system Can be improved.
If the number of external devices that transmit overrate data is greater than the number of registers with IDs that are installed in advance for receiving overrate data, IDs are set in order from the ID of the data with the highest rate, and the interrupt register In the IR, data transmitted at a rate as low as possible among over-rate data is received, so that the register with ID can be used most effectively.
[0054]
Further, when the overwriting state of the
By using the
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.
FIG. 2 is a diagram illustrating a ring buffer.
FIG. 3 is a diagram illustrating a state transition condition in a communication driver task.
FIG. 4 is a diagram illustrating a state transition condition in an arithmetic processing task.
FIG. 5 is a diagram showing a state transition condition in a data management task.
FIG. 6 is a flowchart illustrating an operation flow in a communication driver task.
FIG. 7 is a diagram illustrating an overrate ID list.
FIG. 8 is a flowchart illustrating an operation flow in a data management task.
FIG. 9 is a flowchart for explaining an operation flow in an arithmetic processing task;
FIG. 10 is a block diagram showing a configuration of a conventional example.
[Explanation of symbols]
1, 6 Control unit
2 Ring buffer
3 Data table
4 ID mask section
IR, IR 'interrupt register
R1-R7 Register with ID
R8 to R16 general purpose registers
U1-U15 External device
Claims (2)
ネットワークからデータを受信し、割り込み信号を出力する割り込み受信部と、
ネットワークに送信されたデータの中から、設定された識別子と識別子が一致したデータを受信する識別子付受信部と、
前記割り込み信号が出力されたときに前記割り込み受信部に取り込まれた前記データを前記割り込み受信部から一時記憶部に転送する通信ドライバタスクと、前記一時記憶部に記憶された前記データを所定の転送レートで、記憶部に転送するデータ管理タスクと、前記記憶部に記憶されたデータに基づいて演算処理または送信を行う演算処理タスクを予め設定された優先順位に基づいて順次実行する制御部を備え、
該制御部は、前記一時記憶部がオーバーライト状態となったことを検知するオーバーライト検知手段と、
オーバーライト状態となった一時記憶部に記憶されたデータ内容を解析し、正常な送信レートより高いレートで送信されているデータの識別子リストを作成するオーバーレート識別子リスト作成手段と、
前記オーバーレート識別子リストの識別子を前記識別子付受信部の識別子として設定する識別子設定手段と、
所定レートで、前記識別子付受信部で受信されたデータを前記記憶部へ転送するオーバーレート識別子データ転送手段を有し、
前記割り込み受信部は、前記識別子付受信部に識別子が設定されていない識別子が付与されたデータをネットワーク上から取り込むことを特徴とするマルチタスク処理システム。An external device that transmits data with an identifier corresponding to each device to the network;
An interrupt receiver that receives data from the network and outputs an interrupt signal;
An identifier-equipped receiving unit that receives data whose identifier matches the set identifier from the data transmitted to the network;
A communication driver task for transferring the data captured by the interrupt receiving unit when the interrupt signal is output from the interrupt receiving unit to a temporary storage unit, and a predetermined transfer of the data stored in the temporary storage unit A data management task to be transferred to a storage unit at a rate, and a control unit that sequentially executes a calculation processing task for performing calculation processing or transmission based on data stored in the storage unit based on a preset priority order ,
The control unit includes an overwrite detection unit that detects that the temporary storage unit is in an overwrite state;
Overrate identifier list creating means for analyzing the data content stored in the temporary storage unit in the overwritten state and creating an identifier list of data transmitted at a higher rate than the normal transmission rate;
Identifier setting means for setting an identifier of the overrate identifier list as an identifier of the identifier-attached receiving unit;
Over rate identifier data transfer means for transferring the data received by the identifier-attached receiving unit to the storage unit at a predetermined rate;
The multi-task processing system, wherein the interrupt receiving unit takes in data having an identifier to which no identifier is set in the receiving unit with identifier from a network.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP29444399A JP3775135B2 (en) | 1999-10-15 | 1999-10-15 | Multitask processing system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP29444399A JP3775135B2 (en) | 1999-10-15 | 1999-10-15 | Multitask processing system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2001117785A JP2001117785A (en) | 2001-04-27 |
| JP3775135B2 true JP3775135B2 (en) | 2006-05-17 |
Family
ID=17807852
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP29444399A Expired - Fee Related JP3775135B2 (en) | 1999-10-15 | 1999-10-15 | Multitask processing system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3775135B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1774696B (en) * | 2003-02-11 | 2010-04-28 | 汤姆森特许公司 | Method and system for implementing asynchronous serial communication between devices through main processor |
| JP6201921B2 (en) * | 2014-07-14 | 2017-09-27 | 株式会社デンソー | Microcomputer |
-
1999
- 1999-10-15 JP JP29444399A patent/JP3775135B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2001117785A (en) | 2001-04-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4888691A (en) | Method for disk I/O transfer | |
| US5961622A (en) | System and method for recovering a microprocessor from a locked bus state | |
| JP3481737B2 (en) | Dump collection device and dump collection method | |
| WO2008101386A1 (en) | Method of recovering single core exception in multi-core system | |
| US6922741B2 (en) | Method and system for monitoring DMA status | |
| US7707343B2 (en) | Interrupt control circuit and method | |
| US7627807B2 (en) | Monitoring a data processor to detect abnormal operation | |
| US7472214B2 (en) | Real-time embedded simple monitor method and computer product | |
| US7600051B2 (en) | Autonomic hardware-level storage device data integrity checking | |
| JP4992740B2 (en) | Multiprocessor system, failure detection method, and failure detection program | |
| JP3775135B2 (en) | Multitask processing system | |
| JP4487756B2 (en) | Computer system and system monitoring program | |
| JPH02294739A (en) | Fault detecting system | |
| JPH0245838A (en) | Program execution condition monitoring method | |
| JP5262418B2 (en) | Task scheduling apparatus and task scheduling method | |
| CN110018921B (en) | Event logging controller and electronics | |
| CN101311909A (en) | Method for diagnosing system abnormality | |
| JPWO2007097040A1 (en) | Information processing apparatus control method, information processing apparatus | |
| JP7600691B2 (en) | Image forming apparatus, method and control device for image forming apparatus | |
| US7685470B2 (en) | Method and device for debugging a program executed by a multitask processor | |
| JP2009169515A (en) | Computer system and system recovery device | |
| CN120429122A (en) | Thread debugging method, device, control system and electronic equipment | |
| JP2002251299A (en) | Program trace device | |
| JPH0667909A (en) | Fault restoration system | |
| JP2024136260A (en) | Information processing system and information processing program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20051108 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20051227 |
|
| 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: 20060131 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060213 |
|
| 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: 20100303 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |