JP6060584B2 - Program abnormality detection device and program thereof - Google Patents
Program abnormality detection device and program thereof Download PDFInfo
- Publication number
- JP6060584B2 JP6060584B2 JP2012206138A JP2012206138A JP6060584B2 JP 6060584 B2 JP6060584 B2 JP 6060584B2 JP 2012206138 A JP2012206138 A JP 2012206138A JP 2012206138 A JP2012206138 A JP 2012206138A JP 6060584 B2 JP6060584 B2 JP 6060584B2
- Authority
- JP
- Japan
- Prior art keywords
- refresh
- monitoring
- program
- task
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、プログラムの異常を検出する装置等に関する。 The present invention relates to an apparatus for detecting a program abnormality.
プログラムの異常を検出する方法として、WDT(ウォッチドッグタイマ)を使用して異常検出をする方法が一般的に知られている。これは、WDTに対して一定時間内にプログラムからのタイマリセット(クリア)がなされないとプログラムに異常発生したと見做して、CPUリセットまたは停止状態にするものである。 As a method for detecting an abnormality of a program, a method of detecting an abnormality using a WDT (watchdog timer) is generally known. In this case, if the timer reset (clear) is not performed from the program within a certain time with respect to the WDT, it is assumed that an abnormality has occurred in the program, and the CPU is reset or stopped.
この様なプログラムの異常検出方法として、例えば特許文献1,2に記載の従来技術が知られている。
特許文献1には、プログラム処理実行される中央処理装置から送出される監視タイマリセット信号を入力して、この信号に基づいてプログラム異常を検出するプログラム異常検出回路が開示されている。プログラム異常検出回路は、監視タイマやOR回路やフリップフロップ等を有しており、上記監視タイマリセット信号を、監視タイマのカウント時間T1(T1≠0)までに受信した場合、またはカウント時間T1からT2(T1<T2)までの間に受信しなかった場合に、プログラム異常として検出する。
As such a program abnormality detection method, for example, conventional techniques described in Patent Documents 1 and 2 are known.
Patent Document 1 discloses a program abnormality detection circuit that receives a monitoring timer reset signal sent from a central processing unit that executes program processing and detects a program abnormality based on this signal. The program abnormality detection circuit includes a monitoring timer, an OR circuit, a flip-flop, and the like, and when the monitoring timer reset signal is received by the monitoring timer count time T1 (T1 ≠ 0) or from the count time T1 If it is not received before T2 (T1 <T2), it is detected as a program error.
また、特許文献2には、WDTの機能をソフトウェアで拡張して、プログラム異常の検出精度を上げる方式が提案されている。これは、アプリケーションプログラム(AP)がWDTに設定時間を通知し、WDTが通知された設定時間をタイマに設定してリスタートさせるが、上記APから通知される設定時間が毎回異なるようにすることで、プログラムの異常を検出する方法である。この方法によれば、プログラムが暴走して繰り返し実行する部分にタイマリセットのルーチンが含まれている場合でも、当該プログラム暴走を検出できる。 Further, Patent Document 2 proposes a method of extending the WDT function with software to increase the detection accuracy of a program abnormality. This is because the application program (AP) notifies the WDT of the set time, and the set time notified by the WDT is set in the timer and restarted, but the set time notified from the AP is different every time. This is a method for detecting an abnormality in the program. According to this method, even when a timer reset routine is included in a portion where the program runs away and is repeatedly executed, the program runaway can be detected.
しかしながら、前述した従来の方法では以下のような問題が生じる。
すなわち、特許文献1に関しては、下記の問題がある。
・プログラム異常検出回路はハードウェアで実現しており、ソフトウェアが複数の定周期処理(定周期タスク)から構成されている場合には対応困難である。
However, the conventional method described above has the following problems.
That is, Patent Document 1 has the following problems.
The program abnormality detection circuit is realized by hardware, and it is difficult to deal with when the software is composed of a plurality of fixed-cycle processes (fixed-cycle tasks).
例えば、WDTリセット処理を行わないプログラム(定周期タスク)が存在した場合、この定周期タスクに異常が生じても検出できない可能性がある。これに対して、全ての定周期タスクにそれぞれWDTリセット処理を行わせる場合、例えば上記監視タイマリセット信号が各定周期タスク実行に伴って出力されることになるが、プログラム異常検出回路ではどの定周期タスクによるリセット信号であるのか区別することはできないし、当然、定周期タスク毎の正常/異常を判別することはできない。あるいは、WDTリセット処理を行う定周期タスクが暴走して当該リセット処理を含む無限ループになった場合、異常を検出できない可能性がある。 For example, if there is a program (fixed cycle task) that does not perform WDT reset processing, it may not be detected even if an abnormality occurs in the fixed cycle task. On the other hand, when the WDT reset process is performed for all the fixed-cycle tasks, for example, the monitoring timer reset signal is output as each fixed-cycle task is executed. Whether the signal is a reset signal by a periodic task cannot be distinguished, and naturally, normality / abnormality cannot be determined for each fixed-period task. Alternatively, when a fixed-cycle task that performs WDT reset processing runs away and becomes an infinite loop including the reset processing, there is a possibility that an abnormality cannot be detected.
また、特許文献2に関しても、下記の問題がある。
・ソフトウェアが複数の定周期処理(定周期タスク)から構成されている場合の異常検出は、考慮されていない。従って、複数の定周期タスクから構成されるソフトウェアの異常検出に関しても、何等想到されていない。更に、WDTのリセット処理を有するプログラム(定周期タスク)が暴走して、リセット処理を含む無限ループになった場合、異常検出はできない可能性がある。
Also, Patent Document 2 has the following problems.
-Abnormality detection when the software is composed of multiple fixed-cycle processes (fixed-cycle tasks) is not considered. Therefore, nothing is conceived regarding the abnormality detection of software composed of a plurality of periodic tasks. Furthermore, when a program having a WDT reset process (fixed-cycle task) runs out of control and becomes an infinite loop including the reset process, it may not be possible to detect an abnormality.
上述したように、従来では、ソフトウェアが複数の定周期処理(定周期タスク)から構成されている場合において、プログラム異常検出することは、何等想到されていないし実現できないものである。 As described above, conventionally, when software is composed of a plurality of fixed-cycle processes (fixed-cycle tasks), detection of a program abnormality is not conceived and cannot be realized.
ここで、上記複数の定周期タスクとは、例えばリアルタイムOS上のタスクである。よく知られているように、リアルタイムOSは各処理(タスク)のスケジューリング機能、各タスクを一定周期毎に呼び出して実行したりタスク処理を一定時間止めておくなど時間に関係した動作を行うための時間管理機能を備えている。また、割込み管理機能等も備えている。あるいは、制御分野におけるプログラマブルコントローラ(PLC)では、複数の定周期タスクが順次実行されて何らかの制御対象機器が制御される場合が少なくない。 Here, the plurality of fixed-cycle tasks are, for example, tasks on a real-time OS. As is well known, the real-time OS is a scheduling function for each process (task), and is used to perform time-related operations such as calling and executing each task at a certain period or stopping the task process for a certain period of time. Has a time management function. It also has an interrupt management function. Alternatively, in a programmable controller (PLC) in the control field, a plurality of fixed-cycle tasks are sequentially executed to control some device to be controlled.
本発明の課題は、複数の定周期タスクから構成されるソフトウェアであっても異常検出でき、更に、任意のタスクのプログラムが暴走してリフレッシュ処理を含む無限ループになるような場合でも異常検出できるプログラム異常検出装置等を提供することである。 The problem of the present invention is that it is possible to detect anomalies even in software composed of a plurality of fixed-cycle tasks, and furthermore, it is possible to detect anomalies even when a program of an arbitrary task runs away and becomes an infinite loop including a refresh process. It is to provide a program abnormality detection device and the like.
本発明のプログラム異常検出装置は、複数の定周期タスクから構成されるプログラムの異常を検出するプログラム異常検出装置であって、前記定周期タスク毎に対応して所定のリフレッシュ情報が記憶されるリフレッシュ情報記憶手段と、前記定周期タスク毎に対応してその定周期タスクが実行するリフレッシュ処理に関する時間的な条件が登録される条件登録手段とを有し、前記各定周期タスクは、それぞれ、前記リフレッシュ処理としてその定周期タスクに対応する前記リフレッシュ情報の更新を行うリフレッシュ手段を有し、定期的に、前記定周期タスク毎に、対応する前記リフレッシュ情報を参照して前記時間的な条件を満たしているか否かを判定し、該時間的な条件を満たしていない場合、あるいは複数回連続して該時間的な条件を満たしていない場合には、その定周期タスクの異常と判定する監視手段とを有する。 The program abnormality detection device according to the present invention is a program abnormality detection device that detects an abnormality of a program composed of a plurality of periodic tasks, and in which predetermined refresh information is stored corresponding to each of the periodic tasks Information storage means, and condition registration means for registering a temporal condition related to refresh processing executed by the fixed-cycle task corresponding to each fixed-cycle task, each of the fixed-cycle tasks, As refresh processing, it has a refresh means for updating the refresh information corresponding to the fixed-cycle task, and periodically meets the temporal condition with reference to the corresponding refresh information for each fixed-cycle task. If the time condition is not satisfied, or if the time condition is continuously repeated a plurality of times If not satisfied includes a determining monitoring means and abnormality of the periodic task.
前記時間的な条件は、例えば、監視タイムアウト時間、及び、リフレッシュ禁止期間である。そして、例えば、前記監視手段は、前記定周期タスク毎に、任意の前記リフレッシュ処理実行時から前記監視タイムアウト時間経過するまでに次の前記リフレッシュ処理が実行されなかった場合、あるいは、前記リフレッシュ禁止期間内に前記リフレッシュ処理が実行された場合には、前記時間的な条件を満たしていないと判定する。 The temporal condition is, for example, a monitoring timeout period and a refresh prohibition period. And, for example, the monitoring means, for each of the periodic tasks, when the next refresh process is not executed until the monitoring timeout period elapses after the execution of the arbitrary refresh process, or the refresh prohibition period If the refresh process is executed, it is determined that the temporal condition is not satisfied.
本発明のプログラム異常検出装置等によれば、複数の定周期タスクから構成されるソフトウェアであっても異常検出でき、更に、リフレッシュ処理を含む任意のタスクのプログラムが暴走して無限ループになるような場合でも異常検出できる。 According to the program abnormality detection apparatus and the like of the present invention, even software composed of a plurality of periodic tasks can detect an abnormality, and further, a program of an arbitrary task including a refresh process runs out of control and becomes an infinite loop. Anomaly can be detected even if
以下、図面を参照して、本発明の実施の形態について説明する。
図1は、本例のプログラム異常検出装置のハードウェア構成例である。
これは、本例のプログラム異常検出装置の機能を有する何らかのコンピュータ/情報処理装置(パソコン、組み込み機器、プログラマブルコントローラ等)のハードウェア構成例と見做してもよい。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a hardware configuration example of the program abnormality detection device of this example.
This may be regarded as a hardware configuration example of some computer / information processing apparatus (a personal computer, an embedded device, a programmable controller, etc.) having the function of the program abnormality detection apparatus of this example.
本例のプログラム異常検出装置10は、CPU11、RAM12、ROM13、外部I/F(インタフェース)14などから構成され、それぞれバス接続されている。
ROM13は、CPU11が実行するプログラムコード等(後述するアプリケーションプログラム群40等)が格納されているメモリである。更に、ROM13には、後述するプログラム異常検出機能部20の各種処理機能を実現させる為の他のアプリケーションプログラム(不図示)も、予め記憶されている。CPU11が、このアプリケーションプログラムを読出し実行することにより、例えば後述する各種フローチャート図(図7、図8、図10)の処理が実現される。
The program
The
RAM12は、書き換え可能なメモリであり、例えば後述するリフレッシュ処理情報の記憶領域30を割り当てる。後述する各設定テーブル21,22等は、RAM12、ROM13のどちらに記憶させてもよい。
The
外部I/F14は、不図示の何らかの外部機器と接続するためのインタフェースであり、シリアルコントローラやLANコントローラ等の通信デバイスが接続される。また、外部I/F14は、CFカードやUSBメモリといったストレージデバイスが接続されても良い。このインタフェース経由で例えば、各設定テーブル21,22等の変更を可能としても良い。
The external I /
図2は、図1の情報処理装置内のプログラム異常検出機能に係わる構成図である。
まず、上記ROM13には、予め、上述した複数の定周期処理(定周期タスク;以下、省略して単にタスクと記す場合もある)から構成されるソフトウェアであるアプリケーションプログラム群40が記憶されている。
FIG. 2 is a configuration diagram relating to a program abnormality detection function in the information processing apparatus of FIG.
First, the
アプリケーションプログラム群40は、タスク毎に分割された複数のプログラム(タスクAプログラム〜タスクXプログラム)41から構成される。これら各タスク・プログラム41(タスク)は、それぞれ、予め決められた定周期で周期的な動作を行う。各タスク・プログラム41は、例えばリアルタイムOS上のタスク等であるが、この例に限らない。
The
各タスク・プログラム41は、それぞれ何らかの所定の処理を定周期で実行するが、それ以外に、上述した従来のWDTに対する一定時間毎のタイマリセット処理に相当するリフレッシュ処理を実行する、リフレッシュ処理部42が組み込まれている。尚、本手法では、タイマは使用しないで、ソフトウェア処理によって“従来のWDTを用いた異常検出”に相当する機能を実現する。
Each
また、上記記憶領域30には、上記リフレッシュ処理情報の一例であるリフレッシュ記録テーブル31、リフレッシュ順序記録テーブル32等が格納されている。基本的には、各リフレッシュ処理部42によってリフレッシュ処理が行われる毎に少なくともリフレッシュ記録テーブル31の内容が更新される。本例では、更に、リフレッシュ順序記録テーブル32も用いるが、これは必ずしも用いる必要はない(よって後述する図10において、リフレッシュ順序記録テーブル32を用いる処理やこれに関連する処理等も、必須のものではない)。但し、これらを実行することで、後述する効果が更に得られることになる。
The
そして、プログラム異常検出機能部20は、監視条件設定テーブル21、リフレッシュ順序設定テーブル22、設定部23、監視部24等から構成される。
設定部23によって、上記監視条件設定テーブル21、リフレッシュ順序設定テーブル22に対する設定が行われる。設定部23は、例えば不図示の設定画面を不図示のディスプレイ等に表示して、ユーザに任意の情報を設定させて当該設定情報を設定テーブル21,22に格納するものであるが(ユーザは不図示のキーボード、マウス等を操作して設定する)、この例に限らない。例えば、設定部23は、外部でユーザ等によって任意に作成された上記設定テーブル21,22等を何らかの形で取り込んで(ネットワーク経由や可搬記憶媒体経由など)RAM12/ROM13に記憶する処理を行うものであってもよい。何れにしても、これら各設定テーブル21,22の内容は、ユーザ等が任意に設定するものであってよい。
The program abnormality
The setting
上記監視条件設定テーブル21には、例えば、各定周期タスク(各タスク・プログラム41)に対応してその定周期タスクが実行するリフレッシュ処理に関する時間的な条件が設定・登録される。この時間的な条件は、監視タイムアウト時間、及び、リフレッシュ禁止期間であり、監視部24は、例えば、タスク・プログラム41毎に、任意のリフレッシュ処理実行時から監視タイムアウト時間経過するまでに次のリフレッシュ処理が実行されなかった場合、あるいは、リフレッシュ禁止期間内にリフレッシュ処理が実行された場合には、上記時間的な条件を満たしていないと判定する。詳しくは後述する。
In the monitoring condition setting table 21, for example, temporal conditions relating to refresh processing executed by the fixed-cycle task corresponding to each fixed-cycle task (each task / program 41) are set and registered. The temporal conditions are a monitoring timeout period and a refresh prohibition period. For example, the
リフレッシュ記録テーブル31には、例えば、タスク・プログラム41毎に対応して所定のリフレッシュ情報が記憶される。
上記各タスク・プログラム41のリフレッシュ処理部42は、上記定期的なリフレッシュ処理として、上記監視条件設定テーブル21や、リフレッシュ順序設定テーブル22の設定内容を参照しつつ、上記リフレッシュ記録テーブル31や、リフレッシュ順序記録テーブル32の後述する各種格納内容(リフレッシュ情報と呼ぶものとする)を更新する。詳しくは後に図7を参照して説明する。
For example, predetermined refresh information is stored in the refresh recording table 31 corresponding to each
The
監視部24は、定期的に、リフレッシュ記録テーブル31、リフレッシュ順序記録テーブル32に記録されているデータを読み出し、監視条件設定テーブル21、リフレッシュ順序設定テーブル22の設定内容を参照して、上記定周期タスク(タスク・プログラム41)毎の異常の有無の判定を行う。
The
以下、上記各種テーブルについて、具体例を示して説明する。
図3(a)、(b)には、監視条件設定テーブル21の具体例を示す。
図4(a)、(b)には、リフレッシュ順序設定テーブル22の具体例を示す。
Hereinafter, the various tables will be described with specific examples.
3A and 3B show specific examples of the monitoring condition setting table 21. FIG.
4A and 4B show specific examples of the refresh order setting table 22. FIG.
図5(a)、(b)には、リフレッシュ記録テーブル31の具体例を示す。
図6(a)、(b)には、リフレッシュ順序記録テーブル32の具体例を示す。
以下、まず、図3を参照して監視条件設定テーブル21の具体例について説明する。
5A and 5B show specific examples of the refresh recording table 31. FIG.
6A and 6B show specific examples of the refresh order recording table 32. FIG.
Hereinafter, first, a specific example of the monitoring condition setting table 21 will be described with reference to FIG.
図3(a)に示すように、監視条件設定テーブル21は、概略的には、監視条件設定データ数211、各監視条件設定データ((1)〜(n))212から構成される。
監視条件設定データ数211には、監視条件設定データ212の数(レコード数)が格納され、図示の例ではn個が格納される。
As shown in FIG. 3A, the monitoring condition setting table 21 is generally composed of the number of monitoring
The monitoring condition setting
図3(b)には、監視条件設定データ212(レコード)のデータ項目例を示す。
監視条件設定データ212は、リフレッシュ監視時間212a、リフレッシュ遅延最小時間212b、リフレッシュ遅延最大時間212c、監視時間タイムアップ連続発生許容回数212d、監視時間タイムアップ時動作212e、監視時間タイムアップ時呼出関数212f、禁止期間リフレッシュ連続発生許容回数212g、禁止期間リフレッシュ時動作212h、禁止期間リフレッシュ時呼出関数212iから構成される。
FIG. 3B shows an example of data items of the monitoring condition setting data 212 (record).
The monitoring
尚、これら各データ項目の内容は、例えば上記設定部23を介して、開発者等が任意に設定できる。すなわち、特に図示しないが、上記設定部23は、例えば上記各データ項目212a〜212iの内容をユーザが任意に設定・入力できるようにする画面を表示する。そして、任意の定周期タスク(タスク・プログラム41)に関して設定・入力されたデータを、上記監視条件設定テーブル21の監視条件設定データ212として格納する。その際、当該格納する監視条件設定データ212に、対応するタスク・プログラム41の識別子等を付与するようにしてもよい。そして、監視条件設定データ数211を更新(+1インクリメント等)する。
The contents of these data items can be arbitrarily set by a developer or the like via the
“リフレッシュ監視時間”212aは、任意のリフレッシュ実行時から次にリフレッシュが行われるまでの許容待ち時間である。換言すれば、上記従来のWDTに対する一定時間に相当する時間である。任意のタスク・プログラム41に関して、任意のリフレッシュ実行時から次にリフレッシュが行われるまでの時間(リフレッシュ間隔)が、“リフレッシュ監視時間”212aを超えると、そのタスク・プログラム41に異常発生が疑われる。
The “refresh monitoring time” 212a is an allowable waiting time from the execution of any refresh to the next refresh. In other words, it is a time corresponding to a certain time for the conventional WDT. Regarding any
但し、本例では、1回だけで異常と判定するものではなく、リフレッシュ間隔が“リフレッシュ監視時間”212aを越える事態が複数回連続した場合に(後述する“監視時間タイムアップ連続発生回数”312eが、閾値(“監視時間タイムアップ連続発生許容回数”212d)を越えた場合に)、異常と判定する。但し、この例に限らず、1回だけで異常と判定するようにしてもよい。 However, in this example, it is not determined that there is an abnormality only once, but when a situation where the refresh interval exceeds the “refresh monitoring time” 212a continues for a plurality of times (“monitoring time timeout continuous occurrence count” 312e described later). However, it is determined to be abnormal if the threshold value (“monitoring time time up continuous occurrence allowable number” 212d) is exceeded. However, the present invention is not limited to this example, and an abnormality may be determined only once.
“リフレッシュ遅延最小時間”212bと“リフレッシュ遅延最大時間”212cは、リフレッシュ禁止期間を設定するものである。これは、上述した“プログラムが暴走してWDTリセット処理を含む無限ループとなる”異常(簡略化して、無限ループと呼ぶものとする)に相当する異常を検出するためのものである。上記のように、この様な無限ループが発生した場合は、頻繁にリフレッシュ処理が行われる場合がある。これより、例えば、任意のリフレッシュ処理実行時から次のリフレッシュ処理が実行されるまでの時間が、短すぎる場合には(“リフレッシュ遅延最小時間”212b未満の場合)、異常と判定する。 The “refresh delay minimum time” 212b and the “refresh delay maximum time” 212c are for setting a refresh inhibition period. This is for detecting an abnormality corresponding to the above-described abnormality (which is referred to as an infinite loop for simplification) “the program runs away and becomes an infinite loop including WDT reset processing”. As described above, when such an infinite loop occurs, refresh processing may be frequently performed. Thus, for example, when the time from execution of an arbitrary refresh process to the execution of the next refresh process is too short (less than “minimum refresh delay time” 212b), it is determined as abnormal.
従来でも、複数の定周期タスクから構成されるソフトウェアではない場合には、この様な無限ループを検出することができたが、複数の定周期タスクから構成されるソフトウェアの場合には従来では実現できなかった。 In the past, this kind of infinite loop could be detected when the software was not composed of multiple fixed-cycle tasks, but in the past it was realized in the case of software composed of multiple fixed-cycle tasks. could not.
これに対して、本手法では、例えば、少なくとも、監視条件設定テーブル21、リフレッシュ記録テーブル31を用いて、図7、図8の処理(但し、リフレッシュ順序に係わる処理は必須ではない)を行うことで、複数の定周期タスクから構成されるソフトウェアであっても、各タスクそれぞれについて、監視タイムアウト(WDTタイムアウトに相当)に係わる異常だけでなく、上記無限ループも検出することができる。 On the other hand, in this method, for example, at least the monitoring condition setting table 21 and the refresh recording table 31 are used to perform the processing of FIGS. 7 and 8 (however, processing related to the refresh order is not essential). Thus, even software composed of a plurality of fixed-cycle tasks can detect not only the abnormality relating to the monitoring timeout (corresponding to the WDT timeout) but also the infinite loop for each task.
上記無限ループの検出に関しては、例えば、タスク毎に対応して上記禁止期間を設定することで、あるタスク・プログラム41に関して禁止期間中にリフレッシュが行われた場合には、そのタスク・プログラム41の暴走(無限ループ)などの異常発生が疑われるものとした。
Regarding the detection of the infinite loop, for example, by setting the prohibition period corresponding to each task, if a
“リフレッシュ遅延最小時間”212bは、任意のリフレッシュ実行時から次にリフレッシュが行われるまでの時間(リフレッシュ間隔)に関する最小時間である。任意のタスク・プログラム41について“リフレッシュ遅延最小時間”212bより短い時間間隔でリフレッシュが行われると、そのタスク・プログラム41の暴走(無限ループ)などの異常発生が疑われる。
The “minimum refresh delay time” 212b is the minimum time related to the time (refresh interval) from the arbitrary refresh execution time to the next refresh. If any
但し、本例では、1回だけで異常と判定するものではなく、リフレッシュ間隔が“リフレッシュ遅延最小時間”212bより短い場合には、後述する“禁止期間リフレッシュ連続発生回数”312fとしてカウントされる。そして、この連続発生回数312fが所定の閾値(212g)を越えた場合に、異常と判定する。但し、この例に限らず、1回だけで異常と判定するようにしてもよい。
However, in this example, it is not determined that there is an abnormality only once, and when the refresh interval is shorter than the “minimum refresh delay time” 212b, it is counted as “the number of consecutive occurrences of prohibition period refresh” 312f described later. When the number of
一方、“リフレッシュ遅延最大時間”212cは、任意のリフレッシュ実行時から次にリフレッシュが行われるまでの時間(リフレッシュ間隔)に関する最大時間である。任意のタスク・プログラム41についてリフレッシュ間隔が“リフレッシュ遅延最大時間”212cを越える場合には、たとえ“リフレッシュ監視時間”212aを超えなくても、そのタスク・プログラム41に異常発生が疑われる。
On the other hand, the “maximum refresh delay time” 212c is the maximum time related to the time (refresh interval) from the time of arbitrary refresh execution until the next refresh is performed. If the refresh interval for an
但し、本例では、1回だけで異常と判定するものではなく、リフレッシュ間隔が“リフレッシュ遅延最大時間”212cより長い場合には、上記“禁止期間リフレッシュ連続発生回数”312fとしてカウントされる。そして、上記の通り、この連続発生回数312fが所定の閾値(212g)を越えた場合に、異常と判定する。但し、この例に限らず、1回だけで異常と判定するようにしてもよい。
However, in this example, it is not determined that there is an abnormality only once, and when the refresh interval is longer than the “maximum refresh delay time” 212c, it is counted as the “prohibition period refresh occurrence count” 312f. As described above, when the number of
また、上記禁止期間に関しては、“リフレッシュ遅延最大時間”212cは必ずしも用いなくてもよく、“リフレッシュ遅延最小時間”212bのみを用いても構わない。
上記のように本例では、任意のタスク・プログラム41に関して、上記“監視時間タイムアップ連続発生回数”312eや“禁止期間リフレッシュ連続発生回数”312fが、所定の閾値を越えた場合に、そのタスク・プログラム41(タスク)に異常発生と判定する。この閾値が上記監“視時間タイムアップ連続発生許容回数”212dや“禁止期間リフレッシュ連続発生許容回数”212gである。
Further, regarding the prohibition period, the “maximum refresh delay time” 212c is not necessarily used, and only the “minimum refresh delay time” 212b may be used.
As described above, in this example, for any
すなわち、“監視時間タイムアップ連続発生許容回数”212dは、監視時間タイムアップ回数の連続発生を許容する回数であり、任意のタスク・プログラム41に関して、上記“監視時間タイムアップ連続発生回数”312eが“監視時間タイムアップ連続発生許容回数”212dを超えると、そのタスク・プログラム41の暴走(無限ループ)などの異常発生と判定する。そして、プログラム異常と判定した場合には、例えば“監視時間タイムアップ時動作”212eに設定されている動作を実行する。“監視時間タイムアップ時動作”212eに設定されている動作は、例えばCPUリセット、システム停止、タスク停止、タスク再起動、関数呼出等であり、例えば開発者等が設定部23を介して任意に指定したものである。
That is, the “monitoring time time-up continuous occurrence allowable number” 212d is the number of times that the monitoring time time-up continuous occurrence number is allowed. For any
尚、“監視時間タイムアップ時呼出関数”212fは、“監視時間タイムアップ時動作”212eに“関数呼出”が指定されていた場合に呼び出される関数が設定されるものであり、例えば当該関数の格納アドレスが設定されているが、この例に限らない。 The “monitoring time time-up call function” 212f is a function to be called when “function call” is specified in the “monitoring time time-up operation” 212e. Although the storage address is set, the present invention is not limited to this example.
また、上記“禁止期間リフレッシュ連続発生許容回数”212gは、禁止期間にリフレッシュが行われることが連続発生する際の許容回数であり、任意のタスク・プログラム41に関して、上記“禁止期間リフレッシュ連続発生回数”312fが“禁止期間リフレッシュ連続発生許容回数”212gを超えると、そのタスク・プログラム41に無限ループの異常発生と判定する。そして、無限ループと判定した場合には、“禁止期間リフレッシュ時動作”212hに設定されている動作を実行する。“禁止期間リフレッシュ時動作”212hに設定されている動作は、例えばCPUリセット、システム停止、タスク停止、タスク再起動、関数呼出等であり、例えば開発者等が設定部23を介して任意に指定したものである。
The “prohibited period refresh occurrence allowable number of times” 212 g is the allowable number of times that refresh is continuously performed during the prohibited period, and the “prohibited period refresh continuous number of occurrences” for an
尚、“禁止期間リフレッシュ時呼出関数”212iは、“禁止期間リフレッシュ時動作”212hに“関数呼出”が指定されていた場合に呼び出される関数が設定されるものであり、例えば当該関数の格納アドレスが設定されているが、この例に限らない。 The “invocation function during prohibition period refresh” 212i is a function that is called when “function call” is specified in the “operation during refresh during prohibition period” 212h. For example, the storage address of the function is stored. However, the present invention is not limited to this example.
次に、図4を参照してリフレッシュ順序設定テーブル22の具体例について説明する。
本テーブル22は、上記複数のタスク・プログラム41(タスク)のなかに、動作順番が決められている複数のタスク・プログラム41がある場合に、決められた順番通りに処理(リフレッシュ)が行われているか否かを判定するためのテーブルであり、決められた順番通りにリフレッシュが行われていない場合には、各タスク・プログラム41個々については上述した異常(無限ループなど)が無くても、プログラム異常と判断する。
Next, a specific example of the refresh order setting table 22 will be described with reference to FIG.
The table 22 is processed (refreshed) in the determined order when there are a plurality of
例えば、図1に示すタスクAプログラム、タスクBプログラム、・・・、タスクXプログラムのうち(A〜Xまであるものとする)、仮に、タスクB→タスクD→タスクE→タスクB・・・という順番でタスク実行されるものと決められていた場合、これらタスク実行に伴ってリフレッシュ処理も実行されるので、正常であれば、リフレッシュ処理もこの順番通りに行われるはずである。 For example, among task A program, task B program,..., Task X program shown in FIG. 1 (assuming that there are A to X), suppose task B → task D → task E → task B. If the tasks are determined to be executed in this order, the refresh processing is also executed in accordance with the execution of these tasks. Therefore, if normal, the refresh processing should be executed in this order.
リフレッシュ順序設定テーブル22は、複数のグループ設定を可能とし、グループ毎にそれぞれ、“リフレッシュ順序設定グループデータ”222が設定・登録される。リフレッシュ順序設定テーブル22は、図4(a)に示すように概略的には、“リフレッシュ順序設定グループ数”221と“リフレッシュ順序設定グループデータ”((1)〜(m))222から構成される。“リフレッシュ順序設定グループ数”221には、“リフレッシュ順序設定グループデータ”222の数が登録され、図示の例ではm個となる。 The refresh order setting table 22 enables a plurality of group settings, and “refresh order setting group data” 222 is set and registered for each group. As shown in FIG. 4A, the refresh order setting table 22 is roughly composed of “refresh order setting group number” 221 and “refresh order setting group data” ((1) to (m)) 222. The In the “refresh order setting group number” 221, the number of “refresh order setting group data” 222 is registered, which is m in the illustrated example.
図4(b)には、“リフレッシュ順序設定グループデータ”222のデータ項目例を示す。
“リフレッシュ順序設定グループデータ”222は、異常時動作222a、異常時呼出関数222b、順序設定データ数222c、監視条件設定データ識別子((1)〜(r))222d等から構成される。
FIG. 4B shows an example of data items of “refresh order setting group data” 222.
The “refresh order setting group data” 222 includes an
“異常時動作”222aには、設定された順番でリフレッシュが行われなかったことを以ってプログラム異常と判断した場合の動作が指定(設定)される。設定される動作は、例えば、CPUリセット、システム停止、関数呼出等であるが、これらの例に限らない。 In the “abnormal operation” 222a, an operation when it is determined that the program is abnormal because the refresh has not been performed in the set order is designated (set). The set operation is, for example, CPU reset, system stop, function call, etc., but is not limited to these examples.
“異常時呼出関数”222bには、“異常時動作”222aに上記“関数呼出”が指定されていた場合に呼び出される関数が設定され、例えば当該関数の格納アドレスが設定されているものであるが、この例に限らない。 In the “abnormal function call function” 222b, a function to be called when the “function call” is specified in the “abnormal operation” 222a is set, for example, a storage address of the function is set. However, it is not limited to this example.
“順序設定データ数”222cには、“監視条件設定データ識別子”222dの数が登録され、図示の例ではr個が登録される。
“監視条件設定データ識別子”222dは、そのグループに属するタスク(タスク・プログラム41)の識別情報(識別子)である。これら各識別子が、任意に決められた実行順序通りに登録されている。つまり、図示の“監視条件設定データ識別子”(1)→“監視条件設定データ識別子”(2)→・・・→“監視条件設定データ識別子”(r)→“監視条件設定データ識別子”(1)→・・・という順番で、各タスクが実行されるはずであり、もしこの順番通りに実行されていないことが検出されると、プログラム異常と判定されることになる。
In the “order setting data number” 222c, the number of “monitoring condition setting data identifiers” 222d is registered, and in the example illustrated, r pieces are registered.
The “monitoring condition setting data identifier” 222d is identification information (identifier) of a task (task program 41) belonging to the group. These identifiers are registered in an arbitrarily determined execution order. That is, “monitoring condition setting data identifier” (1) → “monitoring condition setting data identifier” (2) →... → “monitoring condition setting data identifier” (r) → “monitoring condition setting data identifier” (1 The tasks should be executed in the order of) →... If it is detected that the tasks are not executed in this order, it is determined that the program is abnormal.
次に、図5を参照してリフレッシュ記録テーブル31の具体例について説明する。
図5(a)に示すように、リフレッシュ記録テーブル31は概略的には、リフレッシュ記録データ数311、リフレッシュ記録データ((1)〜(n))312から構成される。
Next, a specific example of the refresh recording table 31 will be described with reference to FIG.
As shown in FIG. 5A, the refresh recording table 31 is generally composed of a refresh
“リフレッシュ記録データ数”311には、“リフレッシュ記録データ”312の数が格納され、図示の例ではn個となる。これは、監視条件設定テーブル21内の“監視条件設定データ”212と同一(n個)である。このn個は、基本的には、タスク・プログラム41の数と考えてよい。そして、本例では後述する処理の為に、各“リフレッシュ記録データ”312の順番が、上記“監視条件設定データ”212の順番と対応関係にあることが望ましい。つまり、例えば先頭レコードである“監視条件設定データ”(1)が図1のタスクAプログラムに関する設定データであるとするならば、同じく先頭レコードである“リフレッシュ記録データ”(1)がタスクAプログラムに関する記録データとなるように設定しておくことが望ましい。
The “number of refresh recording data” 311 stores the number of “refresh recording data” 312 and is n in the illustrated example. This is the same (n) as the “monitoring condition setting data” 212 in the monitoring condition setting table 21. The n pieces may be considered as the number of
尚、これは、上記“監視条件設定データ識別子”222dとは異なり、実行順番通りにする必要はない。
また、尚、各“リフレッシュ記録データ”312や各“監視条件設定データ”212には、対応するタスク・プログラム41の識別子も登録されていることが望ましい。
Unlike the “monitoring condition setting data identifier” 222d, this need not be in the order of execution.
In addition, it is desirable that the identifier of the
図5(b)には、リフレッシュ記録データ312のデータ項目例を示す。
リフレッシュ記録データ312は、リフレッシュカウンタ今回値312a、タイムスタンプ今回値312b、リフレッシュカウンタ前回値312c、タイムスタンプ前回値312d、監視時間タイムアップ連続発生回数312e、禁止期間リフレッシュ連続発生回数312fから構成される。
FIG. 5B shows an example of data items of the
The
各“リフレッシュ記録データ”312は、タスク・プログラム41(特にそのリフレッシュ処理部42)毎に対応して設けられるものであり、任意のタスク・プログラム41のリフレッシュ処理部42は、そのリフレッシュ処理毎に、自己に対応する“リフレッシュ記録データ”312の内容を更新する。
Each “refresh recording data” 312 is provided corresponding to each task program 41 (particularly, its refresh processing unit 42), and the
すなわち、各リフレッシュ処理部42は、それぞれ、自己に対応する“リフレッシュ記録データ”312の“リフレッシュカウンタ今回値”312a、“タイムスタンプ今回値”312b等のデータを、監視条件設定テーブル21における自己に対応する“監視条件設定データ”212等を参照する等して、更新する。この更新処理は、基本的には例えば、各カウンタ値はそれぞれ+1インクリメントし、タイムスタンプは、現在日時を新たな今回値とする。
That is, each
一方、"リフレッシュカウンタ前回値"312c、"タイムスタンプ前回値"312dは、監視部24が今回値を新たな前回値として更新する。また、“監視時間タイムアップ連続発生回数”312eと“禁止期間リフレッシュ連続発生回数”312fについても、監視部24が更新する。監視部24は、後述する処理で監視時間タイムアップの発生を検出した場合には“監視時間タイムアップ連続発生回数”312eを更新(+1インクリメント)し、禁止期間リフレッシュの発生検出をした場合には禁止期間リフレッシュ連続発生回数”312fを更新(+1インクリメント)する。
On the other hand, regarding the “refresh counter previous value” 312c and the “timestamp previous value” 312d, the
また、監視部24は、後述する処理で監視時間タイムアップの発生を検出しなかった場合には“監視時間タイムアップ連続発生回数”312eを‘0’クリアし、禁止期間リフレッシュの発生を検出しなかった場合には“禁止期間リフレッシュ連続発生回数”312fを‘0’クリアする。これらは文字通り連続して発生する回数をカウントするものであるので、連続発生が途切れたら‘0’に戻す。
In addition, when the
次に、図6を参照してリフレッシュ順序記録テーブル32の具体例について説明する。
まず、図6(a)に示すように、リフレッシュ順序記録テーブル32は概略的には、リフレッシュ順序記録データ数321、リフレッシュ順序記録データ((1)〜(m))322から構成される。
Next, a specific example of the refresh order recording table 32 will be described with reference to FIG.
First, as shown in FIG. 6A, the refresh order recording table 32 is generally composed of a refresh order
“リフレッシュ順序記録データ数”321には、“リフレッシュ順序記録データ”322の数が格納され、図示の例ではm個が格納される。これは、リフレッシュ順序設定テーブル22内の“リフレッシュ設定グループ数”221と同一(m個)である。このm個は、基本的に、グループの数であると考えてよい。グループ分けや各グループ内での実行順序は、例えばプログラマ等が任意に決めて設定してよい。そして、ここでは、各“リフレッシュ順序記録データ”322の順番が、上記“リフレッシュ順序設定グループデータ”222の順番と対応関係にあることが望ましい。つまり、例えば先頭レコードである“リフレッシュ順序設定グループデータ”(1)が、任意のグループαに関する設定データであったならば、同じく先頭レコードであるリフレッシュ順序記録データ”(1)もグループαに関する記録データとなるように設定しておくことが望ましい。 The “refresh order record data number” 321 stores the number of “refresh order record data” 322, and m is stored in the illustrated example. This is the same (m number) as the “number of refresh setting groups” 221 in the refresh order setting table 22. The m pieces may be basically considered as the number of groups. The grouping and the execution order within each group may be arbitrarily determined and set by a programmer, for example. In this case, it is desirable that the order of each “refresh order recording data” 322 corresponds to the order of the “refresh order setting group data” 222. That is, for example, if the “refresh order setting group data” (1) that is the first record is setting data related to an arbitrary group α, the refresh order recording data (1) that is also the first record is also recorded as to the group α. It is desirable to set it to be data.
図6(b)には、リフレッシュ順序記録データ322の項目例を示す。
“リフレッシュ順序記録データ”322は、“リフレッシュ共通カウンタ”322a、“カウンタ”((1)〜(r))322bから構成される。各“カウンタ”322bは、それぞれ、そのグループに属するタスク・プログラム41の何れかに対応するものであり、従って上記“監視条件設定データ識別子”222dと同じくr個となっている。各“カウンタ”322bの順番は、“監視条件設定データ識別子”222dの順番と対応関係にあることが望ましい。つまり、例えば、先頭レコードである“カウンタ”(1)は、同じく先頭レコードである“監視条件設定データ識別子”(1)に対応するカウンタである。この“カウンタ”(1)のカウント値は、識別子(1)に対応するタスク・プログラム41がリフレッシュ処理を実行する毎に更新されるが、更新方法は下記のようにリフレッシュ共通カウンタ322aを用いるものとなる。
FIG. 6B shows an example of items of the refresh
The “refresh order record data” 322 includes a “refresh common counter” 322a and a “counter” ((1) to (r)) 322b. Each “counter” 322b corresponds to one of the task programs 41 belonging to the group, and therefore, the number is “r”, similar to the “monitoring condition setting data identifier” 222d. The order of each “counter” 322b preferably corresponds to the order of “monitoring condition setting data identifier” 222d. That is, for example, the “counter” (1) which is the first record is a counter corresponding to the “monitoring condition setting data identifier” (1) which is also the first record. The count value of the “counter” (1) is updated every time the
“リフレッシュ共通カウンタ”322aは、そのグループ内で共通に使用されるカウンタであり、そのグループに属する何れかのタスク・プログラム41のリフレッシュ処理部42がリフレッシュ処理を実行する毎に、当該リフレッシュ処理部42によって更新(1ずつカウントアップ)される。そして、更新後のカウント値が、当該リフレッシュ処理部42に対応する“カウンタ”322bに格納される。
The “refresh common counter” 322a is a counter that is used in common within the group, and every time the
また、監視部24は後述するように、各“カウンタ”322b等に基づいて、設定された順番通りに“カウンタ”322bが更新されているか否かを判定し、設定された順番通りに“カウンタ”322bが更新されていなかった場合は、プログラム異常と判断する。
Further, as described later, the
次に、上記各種処理機能部(リフレッシュ処理部42、監視部24)の処理について、図7、図8、図10の各フローチャート図を参照して説明する。これは、具体例として上記図3〜図6に示すデータ構成例を用いて説明する。
Next, processing of the various processing function units (refresh
図7は、リフレッシュ処理部42の処理フローチャート図である。
上記アプリケーションプログラム群40を構成する各タスク・プログラム41は、自己のリフレッシュ処理部42を例えば定期的に呼び出す。その際に、パラメータとして自己の識別子を渡す。尚、各タスク・プログラム41には、予めユニークな識別情報(識別子)が割り当てられている。
FIG. 7 is a processing flowchart of the
Each
呼び出されたリフレッシュ処理部42は、図7の処理を実行開始すると、まず、上記識別子を取得する(ステップS11)。上記のように、各設定テーブルおよび各記録テーブルの各格納情報は、識別子を用いて管理されており、取得した識別子を用いることで、自己に対応する格納情報(その格納位置等)を判別することができる。
When the called
リフレッシュ処理部42は、次に、現在のタイムスタンプを取得する(ステップS12)。尚、これは単に、装置内の時計機能等から現在時刻を取得するものであってよい。そして、ステップS11で取得した識別子によってリフレッシュ記録テーブル31内の該当するリフレッシュ記録データ312を判別して、例えばそのレコード位置をセットする(処理対象レコードとする)(ステップS13)。尚、図5(a)で説明したように、各リフレッシュ記録データ312は、例えばそれぞれが任意のタスク・プログラム41に対応するものであり、その識別子が登録されている。
Next, the
そして、上記該当するリフレッシュ記録データ312(該当レコード)のデータ内容を更新する。すなわち、まず、該当レコードのリフレッシュカウンタ今回値312aを更新すると共に、タイムスタンプ今回値312bを更新する(ステップS15)。リフレッシュカウンタ今回値312aの更新は、例えば現在の値(=上記新たな前回値312cの値)に1加算した値を、新たな今回値として設定する。タイムスタンプ今回値312bの更新は、上記ステップS12で取得した現在のタイムスタンプを設定する。
Then, the data content of the corresponding refresh record data 312 (corresponding record) is updated. That is, first, the refresh counter
以上で該当するリフレッシュ記録データ312のデータ内容を更新したら、本例では更にフレッシュ順序記録テーブル32の更新を行う。尚、フレッシュ順序記録テーブル32の利用(更新や、参照して異常判定)は、必須ではないが、これを行うことによる効果も得られる。
When the data content of the corresponding
まず、リフレッシュ順序設定テーブル22を参照・検索して、ステップS11で取得した識別子の設定の有無を判別する(ステップS16,S17)。すなわち、上述したように、リフレッシュ順序設定テーブル22にはグループ毎にそのグループに属するタスク・プログラム41の識別子が上記“監視条件設定データ識別子”222dとして登録されている。これら複数の“監視条件設定データ識別子”222dのなかに上記ステップS11で取得した識別子と同一の識別子があるか否かを判別するのが、上記ステップS16の処理である。
First, the refresh order setting table 22 is referred to and searched to determine whether or not the identifier acquired in step S11 is set (steps S16 and S17). That is, as described above, the identifier of the
尚、上述したことから、ステップS11で取得した識別子と同一の識別子がある場合には、該当する“リフレッシュ順序設定グループデータ”222や該当する“監視条件設定データ識別子”222dが分かるだけでなく、該当する“リフレッシュ順序記録データ”322や該当する“カウンタ”322bも判別できる。 From the above, when there is an identifier identical to the identifier acquired in step S11, not only the relevant “refresh order setting group data” 222 and the relevant “monitoring condition setting data identifier” 222d are known, The corresponding “refresh order recording data” 322 and the corresponding “counter” 322b can also be determined.
これより、該当する識別子の設定がある場合には(ステップS17,YES)、該当する“リフレッシュ順序記録データ”322内の“リフレッシュ共通カウンタ”322aを更新すると共に(例えば+1インクリメントする)(ステップS18)、更に、該当する“カウンタ”322bに、上記更新後のリフレッシュ共通カウンタ322aの値を設定する(ステップS19)。そして、本処理を終了する。
From this, when there is a setting of the corresponding identifier (step S17, YES), the “refresh common counter” 322a in the corresponding “refresh order record data” 322 is updated (for example, incremented by +1) (step S18). Further, the value of the updated refresh
一方、該当する識別子の設定が無い場合には(ステップS17,NO)、そのまま本処理を終了する。
図8は、監視部24の処理フローチャート図である。
On the other hand, if there is no corresponding identifier setting (step S17, NO), this process is terminated.
FIG. 8 is a process flowchart of the
尚、監視部24は、例えば一定周期毎に図8の処理を実行するものであって、各タスク・プログラム41より高い優先順位で動作し、かつ各タスク・プログラム41より短い周期間隔で動作するものとする。
The
監視部24は、図8の処理を実行開始すると、まず、現在のタイムスタンプを取得し、これを変数‘TIMcur’に代入する(ステップS51)。
次に、監視条件設定テーブル21の先頭レコードとリフレッシュ記録テーブル31の先頭レコードを、処理対象レコードとしてセットする(ステップS52,S53)。尚、セットするとは、例えばポインタ指定することであり、現在の処理対象レコードを指し示すものである。
When the
Next, the first record of the monitoring condition setting table 21 and the first record of the refresh recording table 31 are set as processing target records (steps S52 and S53). Note that setting means, for example, designating a pointer, which indicates the current processing target record.
また、尚、上記先頭レコードとは、監視条件設定テーブル21の複数の“監視条件設定データ”212のうちの先頭(図3の例では“監視条件設定データ(1)”)、リフレッシュ記録テーブル31の複数の“リフレッシュ記録データ”312のうちの先頭(図5の例では“リフレッシュ記録データ(1)”を、意味する。また、本例では、最初の処理対象レコードを上記先頭レコードとしているが、勿論、この例に限るものではない。 In addition, the top record is the top (“monitoring condition setting data (1)” in the example of FIG. 3) of the plurality of “monitoring condition setting data” 212 in the monitoring condition setting table 21, and the refresh recording table 31. Of the plurality of “refresh recording data” 312 (in the example of FIG. 5, “refresh recording data (1)” is meant. In this example, the first record to be processed is the above-mentioned first record. Of course, the present invention is not limited to this example.
そして、上記処理対象レコードから下記のデータ読出しと変数への代入を行う。また、下記の発生回数の更新/クリア等も、処理対象レコードの該当データ項目に対して行われるものである。 Then, the following data is read from the processing target record and assigned to a variable. In addition, the update / clearing of the number of occurrences described below is also performed on the corresponding data item of the processing target record.
まず、監視条件設定テーブル21の処理対象レコードの“リフレッシュ監視時間”212a、“リフレッシュ遅延最小時間”212b、“リフレッシュ遅延最大時間”212cを読出し、それぞれ変数‘Tout’,変数‘Tmin’,変数‘Tmax’に代入する(ステップS54)。また、リフレッシュ記録テーブル31の処理対象レコードの“リフレッシュカウンタ今回値”312a、“リフレッシュカウンタ前回値”312c、“タイムスタンプ今回値”312b、“タイムスタンプ前回値”312dを読出し、それぞれ変数‘CNTa’,変数‘CNTb’,変数‘TIMa’,変数‘TIMb’に代入する(ステップS55)。 First, “Refresh monitoring time” 212a, “Refresh delay minimum time” 212b, and “Refresh delay maximum time” 212c of the processing target record in the monitoring condition setting table 21 are read, and the variables “Tout”, “Tmin”, “Variable” are read out. Substitute for Tmax '(step S54). Further, the “refresh counter current value” 312a, “refresh counter previous value” 312c, “time stamp current value” 312b, and “time stamp previous value” 312d of the processing target record of the refresh recording table 31 are read, and the variable “CNTa” is read. , Variable 'CNTb', variable 'TIMa', and variable 'TIMb' are substituted (step S55).
次に、上記リフレッシュカウンタの今回値(CNTa)と前回値(CNTb)との差分(CNTa−CNTb)を計算し、この差分を変数‘CNTdif’に代入する(ステップS56)。また、上記タイムスタンプの今回値(TIMa)と前回値(TIMb)の差分(TIMa−TIMb)を計算し、この差分を変数‘TIMdif’に代入する(ステップS57)。 Next, the difference (CNTa−CNTb) between the current value (CNTa) and the previous value (CNTb) of the refresh counter is calculated, and this difference is substituted into the variable “CNTdif” (step S56). Further, the difference (TIMa−TIMb) between the current value (TIMa) and the previous value (TIMb) of the time stamp is calculated, and this difference is substituted into the variable “TIMdif” (step S57).
そして、概略的には、監視タイムアウトであるか否かを判定し、監視タイムアウトではない場合でも更に禁止期間にリフレッシュ処理が実行されたか否かを確認する。基本的には、監視タイムアウトではなく、且つ、禁止期間におけるリフレッシュ実行でも無い場合に、正常と見做すことになる。 In general, it is determined whether or not a monitoring timeout has occurred, and even if the monitoring timeout has not occurred, it is further confirmed whether or not the refresh process has been executed during the prohibited period. Basically, it is regarded as normal when there is no monitoring timeout and refresh is not executed during the prohibited period.
すなわち、まず、上記リフレッシュカウンタの差分値(CNTdif)に基づいて、カウンタの更新があるか否か(CNTdif>0か否か)の判定を行う(ステップS58)。
カウンタの更新が無い場合(CNTdif≦0)(ステップS58,NO)は、監視タイムアウト判定処理(ステップS63〜S68)に移行する。一方、カウンタの更新がある場合(CNTdif>0)(ステップS58,YES)は、処理対象レコードの"リフレッシュカウンタ前回値"312cに"リフレッシュカウンタ今回値"312aの値を設定する。更に、処理対象レコードの"タイムスタンプ前回値"312dに"タイムスタンプ今回値"312bの値を設定したうえで(ステップS72)、そのままステップS59以降の禁止期間リフレッシュ判定処理へと移行する。
That is, first, based on the difference value (CNTdif) of the refresh counter, it is determined whether there is a counter update (whether CNTdif> 0) (step S58).
When the counter is not updated (CNTdif ≦ 0) (step S58, NO), the process proceeds to the monitoring timeout determination process (steps S63 to S68). On the other hand, if there is a counter update (CNTdif> 0) (step S58, YES), the value of “refresh counter current value” 312a is set in the “refresh counter previous value” 312c of the processing target record. Furthermore, after setting the value of “time stamp current value” 312b in the “time stamp previous value” 312d of the processing target record (step S72), the process proceeds to the prohibition period refresh determination processing after step S59.
上記監視タイムアップ判定処理では、まず、現在のタイムスタンプ(TIMcur)とタイムスタンプ今回値(TIMa)との差分(TIMcur−TIMa)を計算し、この差分を変数‘TIMdif2’に代入する(ステップS63)。次に、この差分値(TIMdif2)と上記リフレッシュ監視時間(Tout)とを比較し、監視タイムアップ(TIMdif2>Tout)であるか否かの判定を行う(ステップS64)。 In the monitoring time-up determination process, first, a difference (TIMcur−TIMa) between the current time stamp (TIMcur) and the current time stamp value (TIMa) is calculated, and this difference is substituted into the variable “TIMdif2” (step S63). ). Next, the difference value (TIMdif2) is compared with the refresh monitoring time (Tout) to determine whether or not the monitoring time is up (TIMdif2> Tout) (step S64).
監視タイムアップでない場合(TIMdif2≦Tout)(ステップS64,NO)は、処理対象レコードの“監視時間タイムアップ連続発生回数”312eをクリアし(ステップS66)、ステップS59以降の処理に移る。 When the monitoring time is not up (TIMdif2 ≦ Tout) (step S64, NO), the “monitoring time up continuous occurrence count” 312e of the processing target record is cleared (step S66), and the process proceeds to step S59 and subsequent steps.
一方、監視タイムアップの場合(TIMdif2>Tout)(ステップS64,YES)は、処理対象レコードの“監視時間タイムアップ連続発生回数”312eを更新する(+1インクリメント等)(ステップS65)。更に、更新後の“監視時間タイムアップ連続発生回数”312eを、処理対象レコードの“監視時間タイムアップ連続発生許容回数”212dと比較して、連続発生回数312eが許容回数212dを超えたか否かを判定する(ステップS67)。
On the other hand, when the monitoring time is up (TIMdif2> Tout) (step S64, YES), the “monitoring time time-up consecutive occurrence count” 312e of the processing target record is updated (+1 increment or the like) (step S65). Further, the updated “monitoring time time-up continuous occurrence count” 312e is compared with the “monitoring time time-up continuous occurrence count” 212d of the processing target record, and whether or not the
連続発生回数312eが許容回数212dを越えていれば(ステップS67,YES)、処理対象レコードに対応するタスク・プログラム41に異常ありと見做し、異常発生時の動作を行う。すなわち、本例では例えば、処理対象レコードの“監視時間タイムアップ時動作”212eに設定されている動作を行う(ステップS68)。その際、仮に“監視時間タイムアップ時動作”212eに上記「関数呼出」が設定されている場合は、“監視時間タイムアップ時呼出関数”212fに登録されている関数を呼出す。
If the number of
そして、ステップS59以降の処理へと移行する。但し、この場合は、“監視時間タイムアップ時動作”212eに上記CPUリセットやシステム停止等が指定されている場合には、これらが実行されるので、ステップS59以降の処理へと移行することなく、初期化処理などが行われることになる。 And it transfers to the process after step S59. However, in this case, if “CPU reset, system stop, etc.” is specified in the “operation when the monitoring time is up” 212e, these are executed, and the process does not proceed to step S59 and subsequent steps. Initialization processing and the like are performed.
一方、連続発生回数312eが許容回数212d以下であれば(ステップS67,NO)、そのままステップS59以降の処理へと移行する。
以下、ステップS59以降の処理について説明する。
On the other hand, if the number of
Hereinafter, the processing after step S59 will be described.
まず、ステップS59においては、上記タイムスタンプの差分値(TIMdif)と上記リフレッシュ遅延最小時間(Tmin)およびリフレッシュ遅延最大時間(Tmax)に基づいて、タイムスタンプの差分値(TIMdif)がリフレッシュ遅延範囲内(Tmin≦TIMdif≦Tmax)であるか否かの判定を行う(ステップS59)。換言すれば、リフレッシュ禁止期間内にリフレッシュが行われていないかを判定する。 First, in step S59, based on the time stamp difference value (TIMdif), the refresh delay minimum time (Tmin), and the refresh delay maximum time (Tmax), the time stamp difference value (TIMdif) is within the refresh delay range. It is determined whether or not (Tmin ≦ TIMdif ≦ Tmax) (step S59). In other words, it is determined whether refresh has not been performed within the refresh prohibition period.
タイムスタンプの差分値(TIMdif)がリフレッシュ遅延範囲内(Tmin≦TIMdif≦Tmax)である場合には(ステップS59,YES)、処理対象レコードに対応するタスク・プログラム41の動作は正常と見做してよく、処理対象レコードの“禁止期間リフレッシュ連続発生回数”312fをクリアする(ステップS60)。そして、ステップS61へ移行する。
When the time stamp difference value (TIMdif) is within the refresh delay range (Tmin ≦ TIMdif ≦ Tmax) (step S59, YES), the operation of the
一方、タイムスタンプの差分値(TIMdif)がリフレッシュ遅延範囲内ではない場合には(Tmin>TIMdif もしくは、TIMdif>Tmax)(ステップS59,NO)、処理対象レコードに対応するタスク・プログラム41の動作に異常(暴走)の可能性ありと見做して、処理対象レコードの“禁止期間リフレッシュ連続発生回数”312fを更新する(+1インクリメント等)(ステップS69)。更に、更新後の“禁止期間リフレッシュ連続発生回数”312fを、処理対象レコードの“禁止期間リフレッシュ連続発生許容回数”212gと比較して、連続発生回数312fが許容回数212gを超えるか否かを判定する(ステップS70)。
On the other hand, when the time stamp difference value (TIMdif) is not within the refresh delay range (Tmin> TIMdif or TIMdif> Tmax) (step S59, NO), the operation of the
連続発生回数312fが許容回数212gを超える場合には(ステップS70,YES)、処理対象レコードに対応するタスク・プログラム41に異常(暴走)ありと見做し、異常発生時の動作を行う。すなわち、本例では例えば処理対象レコードの“禁止期間リフレッシュ時動作”212hで設定されている動作を行う(ステップS71)。尚、“禁止期間リフレッシュ時動作”212hに上記「関数呼出」が設定されている場合には、“禁止期間リフレッシュ時呼出関数”212iに登録されている関数を呼出す。
If the
そして、ステップS71の動作が完了したら、ステップS61へ移行する。但し、この場合は、“禁止期間リフレッシュ時動作”212hに上記CPUリセットやシステム停止等が指定されている場合には、これらが実行されるので、ステップS61へと移行することなく、初期化処理などが行われることになる。 And if operation | movement of step S71 is completed, it will transfer to step S61. However, in this case, if the CPU reset or the system stop is specified in the “prohibition period refresh operation” 212h, these are executed, so that the initialization process does not proceed to step S61. Etc. will be performed.
一方、連続発生回数312fが許容回数212g以下である場合には(ステップS70,NO)、そのままステップS61へ移行する。
ステップS61では、処理対象レコードを更新する。すなわち、監視条件設定テーブル21とリフレッシュ記録テーブル31の処理対象レコードを、それぞれ、現在の処理対象レコードの次のレコード(最初は2番目のレコードとなる)にセットすると共に、変数「処理レコード数」を更新する(+1インクリメントなど)。尚、変数「処理レコード数」は、図8の処理開始時の初期化処理で‘1’となっているものとする。
On the other hand, if the
In step S61, the process target record is updated. That is, the processing target records in the monitoring condition setting table 21 and the refresh recording table 31 are respectively set to the next record of the current processing target record (the first record is the second record) and the variable “number of processing records”. Is updated (such as +1 increment). The variable “number of process records” is assumed to be “1” in the initialization process at the start of the process of FIG.
そして、上記「処理レコード数」が、上記“監視条件設定データ数”211を越えた場合等には、当該監視処理が所定のレコード数分実行終了したものと判定し(ステップS62,YES)、すなわち全てのタスク・プログラム41について動作異常チェック完了したものとして、当該監視処理を終了する。 If the “number of processing records” exceeds the “number of monitoring condition setting data” 211, it is determined that the monitoring processing has been executed for a predetermined number of records (YES in step S62). That is, the monitoring process is terminated assuming that the operation abnormality check has been completed for all the task programs 41.
「処理レコード数」が上記設定数以下である場合には(ステップS62,NO)、未処理のレコードがあることになるので、ステップS54に戻り、新たな処理対象レコードについて上記と同様の監視処理を続行する。 If the “number of processed records” is equal to or smaller than the set number (step S62, NO), there is an unprocessed record, so the process returns to step S54 and the same monitoring process as described above is performed for the new process target record To continue.
ここで、上記ステップS64の監視タイムアップや、ステップS59のリフレッシュ遅延範囲内(逆に、リフレッシュ禁止期間)について、図9を参照して説明する。
図9は、監視タイムアウト、禁止期間について説明する為の図である。
Here, the monitoring time-up in step S64 and the refresh delay range in step S59 (conversely, the refresh inhibition period) will be described with reference to FIG.
FIG. 9 is a diagram for explaining the monitoring timeout and the prohibition period.
図9において、任意のタスク・プログラム41のリフレッシュ処理部42によって、図示の任意のタイミングt1でリフレッシュ処理(図7の処理)が正常に行われたものとする。
In FIG. 9, it is assumed that the refresh process (process of FIG. 7) is normally performed by the
この例の場合、このタイミングt1から上記リフレッシュ監視時間(Tout)経過する前に(図示のタイミングt4になる前に)次のリフレッシュ処理が実行されなければ、上記ステップS64の判定がYES(監視タイムアウト)となるはずである。つまり、例えば図示のタイミングt4以後の任意のタイミングt5において図8の監視処理が行われた場合(更に、その時点で未だ、次のリフレッシュ処理が実行されていなかった場合)、上記ステップS63で計算される上記差分‘TIMdif2’は「t5−t1」となり、当然、「‘TIMdif2’>Tout」となる(ステップS64,YES)。 In this example, if the next refresh process is not executed before the refresh monitoring time (Tout) elapses from this timing t1 (before the timing t4 shown in the figure), the determination in step S64 is YES (monitoring timeout). ) Should be. That is, for example, when the monitoring process of FIG. 8 is performed at an arbitrary timing t5 after the illustrated timing t4 (further, when the next refresh process has not yet been performed at that time), the calculation is performed in step S63. The difference “TIMdif2” is “t5−t1”, and naturally “′ TIMdif2”> Tout ”(YES in step S64).
また、タイミングt1時点から上記Tmin経過した時点(図示のt2)までの期間を、上記リフレッシュ禁止期間としている。また、図示のタイミングt3から上記タイミングt4までの期間も、上記リフレッシュ禁止期間としている。尚、タイミングt3は、タイミングt1時点から上記Tmax経過した時点である。 Further, the period from the time point t1 to the time point (t2 in the figure) after the elapse of Tmin is defined as the refresh prohibition period. Further, the period from the timing t3 to the timing t4 shown in the figure is also the refresh prohibition period. Note that the timing t3 is the time when the above Tmax has elapsed from the timing t1.
この様なリフレッシュ禁止期間を設けるのは、任意のタスク・プログラム41が上記無限ループした場合には図示のように頻繁にリフレッシュ処理が行われることが考えられるので、リフレッシュ禁止期間においてもリフレッシュ処理が行われる可能性が高く、これを以ってタスクの無限ループ発生と判定できる。
The reason why such a refresh prohibition period is provided is that the refresh process is frequently performed as shown in the figure when an
尚、上記ステップS59におけるリフレッシュ遅延範囲は、例えば図9に示す期間となる。つまり、タイミングt1から上記リフレッシュ監視時間(Tout)経過する前までの期間であって上記リフレッシュ禁止期間以外の期間となる。リフレッシュ遅延範囲は、例えばタスク・プログラム41が正常であれば必ずリフレッシュ遅延範囲内に次のリフレッシュ処理を行うと考えられる期間を、開発者等が考えて設定する。これより、設定されたリフレッシュ遅延範囲以外の期間が、上記リフレッシュ禁止期間となる。
The refresh delay range in step S59 is, for example, the period shown in FIG. That is, it is a period from the timing t1 to before the refresh monitoring time (Tout) elapses, and is a period other than the refresh prohibition period. For example, if the
監視部24による上記図8の監視処理は、タスク・プログラム41毎の個別の異常を検出するものであった。これに対して、たとえ図8の処理では異常と判定されない状況であっても、例えば図10の処理によって異常と判定される場合も起こり得る。すなわち、所定の順番通りに処理実行されるものと決められた複数のタスク・プログラム41があった場合、これらをグループ化して、グループ内の複数のタスク・プログラム41が所定の順番通りに処理実行されなかった場合、異常と判定する。
The monitoring process shown in FIG. 8 by the
この様な異常を検出する処理の一例を、図10に示す。
図10は、監視部24の処理順序監視動作を説明するフローチャートである。
ここで、図1に示す情報処理装置が、例えば制御システム用のコンピュータ(PLC;プログラマブルコントローラ)等である場合においては、複数の定周期タスクが動作する場合が多い。更に、これら複数の定周期タスクは、予め決められた順番で順次実行される場合も少なくない。この様な場合、これら各定周期タスクのリフレッシュ処理も、予め決められた順番で順次実行されることになる。更に、この様な実行順序が決められた複数の定周期タスクを1グループとして、複数のグループが存在する場合もある。
An example of processing for detecting such an abnormality is shown in FIG.
FIG. 10 is a flowchart for explaining the processing order monitoring operation of the
Here, when the information processing apparatus shown in FIG. 1 is, for example, a computer (PLC; programmable controller) for a control system, a plurality of periodic tasks often operate. Furthermore, there are many cases where these plural periodic tasks are sequentially executed in a predetermined order. In such a case, the refresh processing for each of the periodic tasks is also sequentially executed in a predetermined order. Furthermore, there may be a plurality of groups in which a plurality of fixed-cycle tasks with such execution order determined as one group.
例えばこの様なグループ毎に、そのグループ内の複数のタスク・プログラム41が予め決められた順番通りに実行されているか否かをチェックして、実行されていない場合には異常と判定する。その為に、上述したリフレッシュ順序設定テーブル22とリフレッシュ順序記録テーブル32とを用いて、図10の処理によって、上記のチェック・異常判定を行う例を示す。
For example, for each such group, it is checked whether or not a plurality of
図10の処理は、図8の処理を実行する毎に行っても良いし、図8の処理とは関係なく定周期で行っても良い。
何れにしても、監視部24は、図10の処理を実行開始すると、まず、リフレッシュ順序設定テーブル22の先頭レコードおよびリフレッシュ順序記録テーブル32の先頭レコードを、処理対象レコードとしてセットする(ステップS81,S82)。
The process of FIG. 10 may be performed every time the process of FIG. 8 is executed, or may be performed at a fixed cycle regardless of the process of FIG.
In any case, when the
また、尚、上記先頭レコードとは、リフレッシュ順序設定テーブル22の複数の“リフレッシュ順序設定グループデータ”222のうちの先頭(図4では“リフレッシュ順序設定グループデータ(1)”、リフレッシュ順序記録テーブル32の複数の“リフレッシュ順序記録データ”322のうちの先頭(図6では“リフレッシュ順序記録データ(1)”)を、意味するものである。尚、本例では、最初の処理対象レコードを上記先頭レコードとしているが、勿論、この例に限るものではない。 Note that the top record is the top of the “refresh order setting group data” 222 in the refresh order setting table 22 (“refresh order setting group data (1)” in FIG. 4), the refresh order recording table 32. Of the plurality of “refresh order record data” 322 (“refresh order record data (1)” in FIG. 6) in this example. Although it is a record, of course, it is not limited to this example.
そして、処理対象レコードを順次変えながら、そのときの処理対象レコードに関して、ステップS83〜S86の処理を行う。
すなわち、まず、リフレッシュ順序記録テーブル32における処理対象レコード(上記の通り最初は“リフレッシュ順序記録データ(1)”)に記録されている各カウンタ322b(カウンタ(1)、カウンタ(2)、・・・、カウンタ(r))同士を比較することで、カウンタ更新順序が予め決められた順序通りとなっているか否を確認する(ステップS83)。
Then, while sequentially changing the processing target records, the processing of steps S83 to S86 is performed on the processing target records at that time.
That is, first, each counter 322b (counter (1), counter (2),..., Which is recorded in the processing target record in the refresh order recording table 32 (initially “refresh order recording data (1)” as described above). -By comparing the counters (r)), it is confirmed whether the counter update order is in a predetermined order (step S83).
ここでは、予め決められた順番は、カウンタ322bの順番通りであるものとする(その様に設定しておく)。よって、図示の例では「カウンタ(1)→カウンタ(2)→・・・→カウンタ(r−1)→カウンタ(r)→カウンタ(1)→・・・」という順番であることになる。まず、このなかで最新の更新が行われたカウンタ322bを識別する。これは、そのカウンタ322bの値が、リフレッシュ共通カウンタ322aの値と同一であるものが、最新の更新が行われたカウンタ322bであることになる。
Here, it is assumed that the predetermined order is the same as the order of the
そして、この最新更新のカウンタ322bから上記順番の逆に見ていき、カウンタ値が1ずつ減少しているか否かをチェックする。例えば、仮に、最新更新のカウンタ322bがカウンタ(3)でありその値が‘100’であったとした場合、正常であれば、カウンタ(2)は‘99’、カウンタ(1)は‘98’、カウンタ(r)は‘97’、カウンタ(r−1)は‘96’であるはずである。各カウンタ値がこの通りになっているか否かをチェックし、この通りになっているならば順序正常(ステップS84,YES)、この通りになっていない場合には順序異常(ステップS84,NO)と判定する。
Then, the
順序異常と判定された場合(設定された順番通りに処理実行されていないと見做せる場合)には(ステップS84,NO)、リフレッシュ順序設定テーブル22の処理対象レコードの上記“異常時動作”222aに従った動作を実行する(ステップS85)。“異常時動作”222aで上記「関数呼出」が設定されている場合は、“異常時呼出関数”222bに登録されている関数を呼出す。 When it is determined that the order is abnormal (when it can be considered that the processing is not executed in the set order) (step S84, NO), the above “operation at the time of abnormality” of the processing target record in the refresh order setting table 22 is performed. The operation according to 222a is executed (step S85). When the “function call” is set in the “abnormal operation” 222a, the function registered in the “abnormal call function” 222b is called.
そして、ステップS85の処理を完了したら、ステップS86へ移行する。但し、“異常時動作”222aに上記CPUリセットやシステム停止等が指定されている場合には、これらが実行されるので、ステップS86へと移行することなく、初期化処理などが行われることになる。 And if the process of step S85 is completed, it will transfer to step S86. However, if the CPU reset or the system stop is specified in the “operation when abnormal” 222a, these are executed, so that the initialization process is performed without proceeding to step S86. Become.
一方、順序正常と判定された場合(設定された順番通りに処理実行されていると見做せる場合)(ステップS84,YES)には、そのままステップS86へと移行する。
ステップS86では、リフレッシュ順序設定テーブル22およびリフレッシュ順序記録テーブル32の両方に関して、次の処理対象レコードを決定する。上記の通り最初は先頭レコードが処理対象レコードであるので、2番目のレコードが次の処理対象レコードとなる。
On the other hand, when it is determined that the order is normal (when it can be considered that the processing is being executed in the set order) (step S84, YES), the process directly proceeds to step S86.
In step S86, the next processing target record is determined for both the refresh order setting table 22 and the refresh order recording table 32. As described above, the first record is the processing target record at the beginning, so the second record is the next processing target record.
但し、次の処理対象レコードが無ければ(ステップS87,YES)、当該順序監視処理は終了する。未処理のレコードがあれば(ステップS87,NO)、ステップS83に戻り、次の処理対象レコードについても上記と同様の処理を行う。 However, if there is no next process target record (step S87, YES), the order monitoring process ends. If there is an unprocessed record (step S87, NO), the process returns to step S83, and the same processing as described above is performed for the next processing target record.
以上、本手法では、複数の定周期処理(定周期タスク)から構成されるプログラムであっても、タスク毎に暴走等の異常発生を検出できる。これは、特にタスク毎の異常検出監視時間とリフレッシュ禁止期間を用いた異常判定を行うことができる。よって、例えば、ある定周期タスクのプログラムが上記「無限ループ」になるような場合においても、プログラム異常を検出することができ、プログラム暴走の検出精度の向上が期待できる。 As described above, according to this method, even in a program composed of a plurality of fixed-cycle processes (fixed-cycle tasks), it is possible to detect the occurrence of abnormality such as runaway for each task. In particular, it is possible to perform abnormality determination using an abnormality detection monitoring time and a refresh prohibition period for each task. Therefore, for example, even when a program of a certain periodic task is in the “infinite loop”, a program abnormality can be detected, and improvement in detection accuracy of program runaway can be expected.
また、図10の処理によって、複数の定周期タスクが所定の順番通りに実行されないという異常も検出可能となる。
さらに異常検出後の動作をアプリケーション側で柔軟に構成することが可能となる。
Further, the process of FIG. 10 can also detect an abnormality in which a plurality of periodic tasks are not executed in a predetermined order.
Furthermore, it is possible to flexibly configure the operation after detecting an abnormality on the application side.
10 プログラム異常検出装置
11 CPU
12 RAM
13 ROM
14 外部I/F(インタフェース)
20 プログラム異常検出機能部
21 監視条件設定テーブル
22 リフレッシュ順序設定テーブル
23 設定部
24 監視部
30 記憶領域
31 リフレッシュ記録テーブル
32 リフレッシュ順序記録テーブル
40 アプリケーションプログラム群
41 プログラム(タスク)
42 リフレッシュ処理部
211 監視条件設定データ数
212 各監視条件設定データ((1)〜(n))
212a リフレッシュ監視時間
212b リフレッシュ遅延最小時間
212c リフレッシュ遅延最大時間
212d 監視時間タイムアップ連続発生許容回数
212e 監視時間タイムアップ時動作
212f 監視時間タイムアップ時呼出関数
212g 禁止期間リフレッシュ連続発生許容回数
212h 禁止期間リフレッシュ時動作
212i 禁止期間リフレッシュ時呼出関数
221 リフレッシュ順序設定グループ数
222 リフレッシュ順序設定グループデータ((1)〜(m))
222a 異常時動作
222b 異常時呼出関数
222c 順序設定データ数
222d 監視条件設定データ識別子((1)〜(r))
311 リフレッシュ記録データ数
312 リフレッシュ記録データ((1)〜(n))
312a リフレッシュカウンタ今回値
312b タイムスタンプ今回値
312c リフレッシュカウンタ前回値
312d タイムスタンプ前回値
312e 監視時間タイムアップ連続発生回数
312f 禁止期間リフレッシュ連続発生回数
321 リフレッシュ記録データ数
322 リフレッシュ順序記録データ((1)〜(m))
322a リフレッシュ共通カウンタ
322b カウンタ((1)〜(r))
10 Program
12 RAM
13 ROM
14 External I / F (interface)
20 Program Abnormality
42
212a Refresh monitoring
222a
311 Number of
312a Refresh counter
322a Refresh
Claims (6)
前記定周期タスク毎に対応して所定のリフレッシュ情報が記憶されるリフレッシュ情報記憶手段と、
前記定周期タスク毎に対応してその定周期タスクが実行するリフレッシュ処理に関する時間的な条件が登録される条件登録手段とを有し、
前記各定周期タスクは、それぞれ、前記リフレッシュ処理としてその定周期タスクに対応する前記リフレッシュ情報の更新を行うリフレッシュ手段を有し、
定期的に、前記定周期タスク毎に、対応する前記リフレッシュ情報を参照して前記時間的な条件を満たしているか否かを判定し、該時間的な条件を満たしていない場合、あるいは複数回連続して該時間的な条件を満たしていない場合には、その定周期タスクの異常と判定する監視手段とを有し、
前記時間的な条件は、監視タイムアウト時間、及び、リフレッシュ禁止期間であり、
前記監視手段は、前記定周期タスク毎に、任意の前記リフレッシュ処理実行時から前記監視タイムアウト時間経過するまでに次の前記リフレッシュ処理が実行されなかった場合、あるいは、前記リフレッシュ禁止期間内に前記リフレッシュ処理が実行された場合には、前記時間的な条件を満たしていないと判定することを特徴とするプログラム異常検出装置。 A program abnormality detection device for detecting an abnormality of a program composed of a plurality of periodic tasks,
Refresh information storage means for storing predetermined refresh information corresponding to each fixed-cycle task;
Condition registration means for registering a temporal condition related to refresh processing executed by the fixed-cycle task corresponding to each fixed-cycle task,
Each of the periodic tasks has refresh means for updating the refresh information corresponding to the periodic tasks as the refresh processing,
Periodically, for each of the periodic tasks, it is determined whether or not the temporal condition is satisfied by referring to the corresponding refresh information, and if the temporal condition is not satisfied, or continuous multiple times When the time condition is not satisfied, the monitoring means determines that the periodic task is abnormal ,
The temporal conditions are a monitoring timeout period and a refresh prohibition period,
The monitoring means, for each of the periodic tasks, when the next refresh process is not executed from when any refresh process is executed until the monitor timeout period elapses, or within the refresh prohibition period A program abnormality detection apparatus , wherein when the process is executed, it is determined that the time condition is not satisfied .
前記監視手段は、任意の定周期タスクに関して異常と判定した場合、その定周期タスクに対応する前記登録されている動作を実行することを特徴とする請求項1〜3の何れかに記載のプログラム異常検出装置。 In the condition registration means, an operation corresponding to a case where the periodic task is determined to be abnormal is registered for each of the periodic tasks.
Said monitoring means, if it is decided that an abnormality for any periodic task, the program according to any one of claims 1 to 3, characterized in that performing an operation that is the registration corresponding to the periodic task Anomaly detection device.
前記実行順序監視対象となる複数の定周期タスクに共通のカウンタである共通カウンタとを有し、
前記実行順序監視対象となる各定周期タスクのリフレッシュ手段は、その前記リフレッシュ処理の際に、前記共通カウンタを更新すると共に、そのカウンタ値を自己に対応する前記カウンタ値記憶手段に記憶し、
前記監視手段は、該各カウンタ値記憶手段を参照することで、前記実行順序監視対象となる複数の定周期タスクが前記実行順序通りに実行されているか否かを判別する処理を更に実行することを特徴とする請求項1〜4の何れかに記載のプログラム異常検出装置。 A counter value provided in accordance with the execution order corresponding to each fixed-cycle task that is the execution order monitoring target, with a plurality of fixed-period tasks having an execution order determined among the plurality of fixed-cycle tasks as execution order monitoring targets Storage means;
A common counter that is a counter common to a plurality of periodic tasks to be monitored for execution order;
The refresh means for each periodic task to be monitored for execution order updates the common counter during the refresh process, and stores the counter value in the counter value storage means corresponding to itself,
The monitoring means further executes a process of determining whether or not a plurality of periodic tasks to be monitored for execution order are being executed in the execution order by referring to the counter value storage means. The program abnormality detection device according to any one of claims 1 to 4 .
前記定周期タスク毎に対応して所定のリフレッシュ情報が記憶されるリフレッシュ情報記憶手段と、
前記定周期タスク毎に対応してその定周期タスクが実行するリフレッシュ処理に関する時間的な条件として、監視タイムアウト時間、及び、リフレッシュ禁止期間が登録される条件登録手段とを有し、
前記各定周期タスクは、それぞれ、前記リフレッシュ処理としてその定周期タスクに対応する前記リフレッシュ情報の更新を行うリフレッシュ手段を有し、
定期的に、前記定周期タスク毎に、対応する前記リフレッシュ情報を参照して前記時間的な条件を満たしているか否かを判定し、該時間的な条件を満たしていない場合、あるいは複数回連続して該時間的な条件を満たしていない場合には、その定周期タスクの異常と判定する手段であって、前記定周期タスク毎に、任意の前記リフレッシュ処理実行時から前記監視タイムアウト時間経過するまでに次の前記リフレッシュ処理が実行されなかった場合、あるいは、前記リフレッシュ禁止期間内に前記リフレッシュ処理が実行された場合には、前記時間的な条件を満たしていないと判定する監視手段、
として機能させるためのプログラム。
A computer of a program abnormality detection device that detects a program abnormality composed of a plurality of periodic tasks,
Refresh information storage means for storing predetermined refresh information corresponding to each fixed-cycle task;
As a time condition regarding the refresh process executed by the fixed-cycle task corresponding to each fixed-cycle task, it has a condition registration means for registering a monitoring timeout period and a refresh prohibition period ,
Each of the periodic tasks has refresh means for updating the refresh information corresponding to the periodic tasks as the refresh processing,
Periodically, for each of the periodic tasks, it is determined whether or not the temporal condition is satisfied by referring to the corresponding refresh information, and if the temporal condition is not satisfied, or continuous multiple times If the time condition is not satisfied, it is means for determining that the periodic task is abnormal, and the monitoring timeout period elapses from the execution of any of the refresh processes for each of the periodic tasks. Monitoring means for determining that the temporal condition is not satisfied if the next refresh process has not been executed before or if the refresh process is executed within the refresh inhibition period ,
Program to function as.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012206138A JP6060584B2 (en) | 2012-09-19 | 2012-09-19 | Program abnormality detection device and program thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012206138A JP6060584B2 (en) | 2012-09-19 | 2012-09-19 | Program abnormality detection device and program thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014059846A JP2014059846A (en) | 2014-04-03 |
JP6060584B2 true JP6060584B2 (en) | 2017-01-18 |
Family
ID=50616237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012206138A Expired - Fee Related JP6060584B2 (en) | 2012-09-19 | 2012-09-19 | Program abnormality detection device and program thereof |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6060584B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6787658B2 (en) * | 2015-10-16 | 2020-11-18 | コイト電工株式会社 | Processing equipment, traffic signal equipment and information display equipment |
JP7379875B2 (en) * | 2019-06-14 | 2023-11-15 | 富士電機株式会社 | Control device and its maintenance support device |
JP6788145B2 (en) * | 2020-06-24 | 2020-11-18 | コイト電工株式会社 | Processing equipment, traffic signal equipment and information display equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS58191045A (en) * | 1982-04-30 | 1983-11-08 | Fujitsu Ltd | Execution time management device |
JP2793993B2 (en) * | 1990-04-05 | 1998-09-03 | 株式会社ゼクセル | Program runaway detection method in microcomputer |
JPH09212389A (en) * | 1996-01-31 | 1997-08-15 | Sumitomo Electric Ind Ltd | Method and apparatus for detecting abnormal state of computer system |
JP2005063295A (en) * | 2003-08-19 | 2005-03-10 | Matsushita Electric Ind Co Ltd | Control unit |
JP5590667B2 (en) * | 2010-07-01 | 2014-09-17 | 株式会社日立製作所 | Subroutine execution monitoring apparatus and subroutine execution monitoring method |
-
2012
- 2012-09-19 JP JP2012206138A patent/JP6060584B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014059846A (en) | 2014-04-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI686696B (en) | Compute node, failure detection method thereof and cloud data processing system | |
US8930757B2 (en) | Operations management apparatus, operations management method and program | |
CN109445927B (en) | Task management method and device for storage cluster | |
US10671440B2 (en) | Resource usage prediction for cluster provisioning | |
CN112035326A (en) | Abnormal node task processing method and device based on cluster node mutual detection | |
JP6060584B2 (en) | Program abnormality detection device and program thereof | |
JP6001480B2 (en) | Migration processing method and processing apparatus | |
CN101894083A (en) | Interrupt processing device and method | |
EP3526674B1 (en) | Time-parallelized integrity testing of software code | |
CN109542599A (en) | A kind of embedded OS thread monitoring method | |
KR101212496B1 (en) | Method of representing usage of monitoring resource, computing apparatus for performing the same and record medium recording program for implementing the method | |
JP6252309B2 (en) | Monitoring omission identification processing program, monitoring omission identification processing method, and monitoring omission identification processing device | |
CN112035839A (en) | Detection method and device for race condition vulnerability exploitation | |
CN106294364B (en) | Method and device for realizing web crawler to capture webpage | |
TWI712911B (en) | Device, method and program for detecting attack | |
CN103823711A (en) | Method and device for providing relative timing in Java virtual machine | |
JP7068819B2 (en) | Facility monitoring device and facility monitoring method | |
US20170060666A1 (en) | Controller capable of detecting factor at time of abnormality of pc function | |
JP2005293164A (en) | Task monitoring method | |
JP7248100B2 (en) | MONITORING METHOD, MONITORING DEVICE, AND PROGRAM | |
JP4387863B2 (en) | Disturbance occurrence detection program and disturbance occurrence detection method | |
WO2017056159A1 (en) | Management system, management method, and management program | |
JP2006227962A (en) | Application task monitoring system and method | |
JP6812831B2 (en) | Monitoring equipment, monitoring systems, monitoring methods, and programs | |
JP2003256243A (en) | Process stall monitoring method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150812 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160422 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160524 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160701 |
|
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: 20161115 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20161128 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6060584 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |