JP2005018341A - Event-driven program execution device, security system and program - Google Patents
Event-driven program execution device, security system and program Download PDFInfo
- Publication number
- JP2005018341A JP2005018341A JP2003181170A JP2003181170A JP2005018341A JP 2005018341 A JP2005018341 A JP 2005018341A JP 2003181170 A JP2003181170 A JP 2003181170A JP 2003181170 A JP2003181170 A JP 2003181170A JP 2005018341 A JP2005018341 A JP 2005018341A
- Authority
- JP
- Japan
- Prior art keywords
- event
- pattern
- events
- executed
- occurrence
- 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.)
- Pending
Links
Images
Landscapes
- Alarm Systems (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、イベント駆動型プログラムを実行する技術に関する。さらに詳しくは、1個以上のイベント系列をトリガとして、そのイベント系列に関連付けられたプログラムを実行するイベント駆動型プログラムを実行する技術に関する。
【0002】
【従来の技術】
従来、イベント駆動型プログラムの実行方法には、次に説明するような方法がある。第一に、イベントテーブルにトリガとなるイベントと、そのイベント発生時に実行する処理をイベントテーブルに記述し、イベントテーブルの記述に従ってプログラムを実行する方法がある。ここでいうイベントテーブルの一例を図7に示す。図7では、例えば、イベントE1が発生した場合に処理P1を実行するように記述されている。第二に、システムの状態毎にトリガとなるイベントと、そのイベント発生時に実行する処理と処理完了後に遷移する状態との組み合わせを状態遷移表に記述し、状態遷移表の記述に従ってプログラムを実行する方法がある。ここでいう状態遷移表の一例を図8に示す。図8では、例えば、状態1でイベントE1が発生した場合に処理P1を実行して状態2に遷移するように記述されている。
【0003】
以上のような、従来のプログラム実行方法では、イベントテーブルまたは状態遷移表などに単一のイベントをトリガとする簡易的な記述をしておき、記述されている単一のイベントをトリガとしてプログラムを実行させていた。
【0004】
その他、イベント処理に係る技術として、特許文献1及び特許文献2に開示された技術がある。
【0005】
【特許文献1】
特開平8−272727号公報
【特許文献2】
特開平8−115107号公報
【0006】
【発明が解決しようとする課題】
しかしながら、上述のような従来のプログラム実行方法では、単一のイベントしかトリガとして記述できないため、複雑な処理を記述することが困難であるという問題があった。このため、イベント駆動型のプログラムにおいて、複数のイベントに跨る複雑な処理を実行することが困難であった。
【0007】
本発明は、以上のような問題を解決し、イベント駆動型のプログラムにおいて、従来のイベントテーブルの記述における簡易さを維持したまま、より複雑な処理の記述を可能にするための技術を提供することを目的とする。
【0008】
【課題を解決するための手段】
上記問題を解決するため、本発明は以下のような構成をとる。即ち、本発明は、イベント駆動型プログラム実行装置であって、所定の状態変化に係るイベントの発生を監視する手段と、発生したイベントをイベント系列として順次蓄積する手段と、1以上のイベントからなるイベントパターンとそのイベントパターンに合致するイベント系列が発生したときに実行させる処理とを対応付けたイベントテーブルに基づいて、上記蓄積されたイベント系列が上記いずれかのイベントパターンに合致するか否かを比較する手段と、上記イベントパターンに合致するイベント系列があった場合に、当該イベントパターンに対応する処理を実行する手段とを備える。
【0009】
好ましくは、上記イベント駆動型プログラム実行装置は、上記イベントの発生時刻を上記イベントに関連付けて記録する手段と、上記イベントパターンに合致するイベント系列の発生時刻に基づく経過時間と上記イベントパターンに対する制限時間とを比較する手段と、上記イベント系列による経過時間が上記制限時間を超える場合に、当該イベントパターンに対応する処理を実行対象から排除する手段とを備えるように構成してもよい。
【0010】
好ましくは、上記イベント駆動型プログラム実行装置は、上記イベントの発生時刻を上記イベントに関連付けて記録する手段と、発生から所定時間経過したイベントを上記蓄積したイベント系列から削除する手段とを備えるように構成してもよい。
【0011】
好ましくは、上記イベントパターンは、複数イベントの組み合わせ、複数イベントが逐次連続した順列、複数イベントの順列に他の不特定イベントが挿入された非連続な順列、または特定イベントの未発生を示す情報の少なくとも1つを含んでいてもよい。
【0012】
本発明によれば、所定の状態変化に係るイベントの発生を監視し、発生したイベントをイベント系列として順次蓄積し、1以上のイベントからなるイベントパターンとそのイベントパターンに合致するイベント系列が発生したときに実行させる処理とを対応付けたイベントテーブルに基づいて、上記蓄積されたイベント系列が上記いずれかのイベントパターンに合致するか否かを比較し、上記イベントパターンに合致するイベント系列があった場合に、そのイベントパターンに対応する処理を実行している。そのため、本発明によれば、複数のイベントの組み合わせに応じて、適切な処理を実行することができる。
【0013】
また、本発明は、上記のイベント駆動型プログラム実行装置を備えるセキュリティシステムであって、人の動作をイベントとして監視することを特徴とする。これにより、人の動作に基づくイベントパターンをトリガとして、セキュリティシステムに係る処理を実行させることが可能となる。従って、例えば、本発明をホームセキュリティシステムに適用した場合には、住人しか知りえない動作によるイベントパターンをトリガとして警戒を解除するというような処理を実行させることが可能となる。
【0014】
以上のように、本発明によれば、イベントテーブルの記述における簡易さを維持したまま、より複雑な処理を記述することができる。従って、イベント駆動型のプログラムにおいて、複数の動作を伴うイベントパターンをトリガとする複雑な処理を実行させることが可能となる。
【0015】
また、本発明は、コンピュータその他の装置、機械等が上記いずれかの処理を実行する方法であってもよい。また、本発明は、コンピュータその他の装置、機械等が上記いずれかの機能を実現させるプログラムであってもよい。また、本発明は、そのようなプログラムをコンピュータ等が読み取り可能な記録媒体に記録したものでもよい。
【0016】
【発明の実施の形態】
以下、図面を用いて本発明の実施形態について説明する。なお、本実施形態の説明は例示であり、本発明の構成は以下の説明に限定されない。
【0017】
《実施形態》
本実施形態では、イベント駆動型プログラムをホームセキュリティシステムに適用した場合を想定する。
【0018】
〈ハードウエア構成〉
図1は、本実施形態のシステムにおけるハードウエア構成を示す図である。コントローラ1は、CPU2、メモリ3、二次記憶4、通信部5、及びI/O(Input/Output)6を有する。
【0019】
CPU2は、メモリ3、二次記憶4、通信部5、及びI/O6にそれぞれ接続されており、メモリ3に格納されたプログラムを実行して装置全体を制御する。メモリ3は、プログラムや一時的なデータを記憶する。このメモリ3は、例えば、ROMまたはRAM等で構成される。二次記憶4は、プログラムが使用するファイル等を記憶する。この二次記憶4は、例えば、ハードディスク、フラッシュROM等で構成される。通信部5は、インターネットと接続されており、インターネットを介してメール等を送受信する。I/O6は、コントローラ1に接続される各種センサやスイッチ等との入出力を行う。
【0020】
I/O6に接続される各種センサやスイッチは、例えば、マグネットセンサ7、赤外線センサ8、照度センサ9、電気錠10、インターホン11、リモコン受信部12、及び警戒解除ボタン13等である。マグネットセンサ7は、窓や扉の開閉を検知するセンサである。このマグネットセンサ7は、窓や扉の開閉部に磁石を設置しておくことで、窓や扉の開閉動作により磁石に電流が流れるか否かを検知する。赤外線センサ8は、人の在/不在を検知するセンサである。照度センサ9は、照明機器のオン・オフを検知するセンサである。この照度センサ9は、照明機器が備わる部屋に設置しておき、部屋の明るさまたは暗さを検知する。電気錠10は、電気的に開錠/施錠が行え、また、開錠/施錠が検知可能な錠である。インターホン11は、来訪者を住人に知らせる機器である。リモコン受信部12は、赤外線リモコンの受信部である。警戒解除ボタン13は、ホームセキュリティの警戒解除を行うボタンである。
【0021】
〈ソフトウエア構成〉
図2は、本実施形態におけるソフトウエア構成を示す図である。本実施形態におけるソフトウエアは、イベント生成部20、イベントキュー21、イベント削除部22、イベントマネージャ23、イベントハンドラ24、及びイベントテーブル25により機能する。このうち、イベント生成部20は、例えば、センサ等からの入力信号を監視する制御プログラムである。
【0022】
イベント生成部20は、センサ入力等のイベントを監視し、イベントに係る情報を生成し、イベントキュー21に記録(登録)する。即ち、イベント生成部20は、図1に示したI/O6に入力される各種センサ入力、例えば、マグネットセンサ7による窓の開閉、赤外線センサ8による人の検知、照度センサ9からの報知、電気錠10の開閉、インターホン11の動作、リモコン入力等を受信し、対応するイベントに係る情報を記録する。各イベントは、イベントIDによりその種類が識別される。以下、イベントに係る情報を単にイベントともいう。
【0023】
イベントキュー21は、イベント生成部20が生成したイベントに係る情報を蓄積する。例えば、イベントキュー21には、イベントID、イベント発生時刻、及びイベント詳細情報をイベント毎に蓄積する。このうち、イベント詳細情報とは、イベントに関連する情報であり、例えば、イベント発生箇所や固有情報(例えば、照度)である。
【0024】
イベント削除部22は、イベントキュー21に蓄積されてから一定時間(イベント生存時間)経過したイベントをイベントキュー21から削除する。
【0025】
イベントマネージャ23は、イベントキュー21に蓄積されているイベントの列とイベントテーブル25に登録されているイベントパターンを比較し、一致した場合にはそのイベントテーブル25のエントリに登録されているイベントハンドラ24を実行する。
【0026】
イベントハンドラ24は、イベント発生をトリガとして、そのイベントに対応した処理を行うプログラムである。
【0027】
図2において、まず、イベント生成部20は、生成したイベントをイベントキュー21に登録する(1)。そして、イベントマネージャ23は、イベントキュー21内のイベント列とイベントテーブル25のイベントパターンを比較する(2)。比較した結果パターンが一致している場合には、イベントマネージャ23は、イベントテーブル25のエントリに登録されているイベントハンドラを実行する(3)。
【0028】
〈イベントテーブル〉
図3は、イベントテーブル25のデータ構造を示す図である。このイベントテーブル25には、イベントマネージャ23で監視する複数のイベントパターンと、そのイベントパターンをトリガとして実行する処理(イベントハンドラ24)を記述する。以下、図3に示されるイベントテーブル25の各項目について、詳細に説明する。
【0029】
イベントパターンには、イベントマネージャ23で監視するイベントのパターンを記述する。ここで、イベントマネージャ23に監視させるイベントパターンは、次の規則に従って記述する。第一に、単一のイベントの発生を監視させるには、イベントのイベントIDを記述する。第二に、複数イベントのうち何れかのイベントの発生を監視させるには、“[]”内に“|”で区切ってイベントIDを記述する。第三に、連続する複数イベントの発生順を監視させるには、“−”で区切ってイベントIDを記述する。第四に、連続していない複数イベントの発生順を監視させるには、“−−”で区切ってイベントIDを記述する。第五に、連続する複数イベントの発生(順不同)を監視させるには、“&”で区切ってイベントIDを記述する。第六に、連続していない複数イベントの発生(順不同)を監視させるには、“&&”で区切ってイベントIDを記述する。第七に、イベントの未発生を監視させるには、イベントIDの前に“!”を記述する。
【0030】
スコープには、イベントパターンの先頭イベントが発生してから終端イベントが発生するまでの時間制限を記述する。本実施形態では、イベントパターンと一致し、且つ先頭イベントから終端イベントまでの実際の経過時間がイベントテーブル25のスコープに指定された時間以下の場合にイベントハンドラ24が実行される。
【0031】
処理には、イベントパターン欄、及びスコープ欄に記述された条件を満たすイベントが発生した時に実行するイベントハンドラ24を記述する。本システムでは、1つの処理の欄にイベントハンドラ24を複数記述してもよい。即ち、1つのイベントパターンに対応して複数のイベントハンドラ24を起動できる。
【0032】
比較開始位置には、イベントマネージャ23がイベントキュー21に蓄積されている何番目のイベントから、イベントパターンとの比較を行うかということを示す数値を記述する。イベントキュー21において、比較開始位置より前のイベントは検査済みであることが示される。
【0033】
以上のように、イベントハンドラ24(処理)は、図3に示されるイベントテーブル25の記述に従って実行される。例えば、T1秒以内にE1→E2の順でイベントが連続して発生した場合には、処理P1が実行される(図3の※1)。また、T2秒以内にE3、E4、E5のいずれかのイベントが発生した後にイベントE6が発生した場合には、処理P2、P3等が実行される(図3の※2)。また、T3秒以内にE7、E8、E9の順でイベントが発生(連続していなくても可)した場合には、処理P4、P5、及びP6等が実行される(図3の※3)。また、T4秒以内にイベントE10、E11が連続して発生(順不同)した場合には、処理P7、P8等が実行される(図3の※4)。また、T5秒以内にイベントE12、E13が発生(連続していなくても可、順不同)した場合には、処理P9、P10等が実行される(図3の※5)。また、イベントE14が発生した後に、T6秒以内にイベントE15が発生しない場合には、処理P11、P12等が実行される(図3の※6)。
【0034】
以上から、本実施形態によれば、イベントテーブルに、複数のイベントからなるイベントパターンとそのイベントパターンの発生に時間制限を設けて処理を実行させるというような複雑な記述をすることができる。
【0035】
〈イベントテーブルの具体例〉
次に、図3に示されるイベントテーブル25をホームセキュリティコントローラに適用した場合におけるデータ構造の一例を説明する。図4は、ホームセキュリティコントローラにおけるイベントテーブル25のデータ構造例を示す。このうち、図4の1〜4行目に示されているイベントパターンは、住人の帰宅時に行う自然な動作をトリガとして、ホームセキュリティの警戒を解除/開始するための記述である。一方、図4の5〜7行目に示されているイベントパターンは、住人であれば行わない不自然な動作をトリガとして、住人や警備会社に警報メールを送信するための記述である。
【0036】
図4に示される例では、例えば、玄関が開錠されテレビまたはエアコンのスイッチをオンするというイベントパターンが発生した場合には、住人が帰宅したものと判断して、警戒を解除するという処理が実行される(図4の1行目)。また、玄関が開錠され洗面所の照明をオンして、その後リビングへ入室するというイベントパターンが発生した場合には、住人が帰宅して手を洗い、リビングに移動したものと判断して、警戒を解除するという処理が実行される(図4の2行目)。また、玄関が開錠され台所の照明をオンして、その後冷蔵庫の扉を開けるというイベントパターンが発生した場合には、住人が買い物から帰宅したものと判断して、警戒を解除するという処理が実行される(図4の3行目)。また、テレビとエアコンのスイッチがオフされ、リビングが無人になるというイベントパターンが発生した場合には、住人が外出したものと判断して、警戒を開始する処理が実行される(図4の4行目)。また、インターホンが鳴らされてから玄関が開錠するというイベントパターンが発生した場合には、泥棒がインターホンで留守を確認してから侵入したと判断して、警報メールを送信する処理が実行される(図4の5行目)。また、窓が開いた後、リビングで赤外線センサオン(人が検知される)というイベントパターンが発生した場合には、泥棒の侵入と判断して警報メールを送信する処理が実行される(図4の6行目)。また、リビングに人がいるが室内が暗いまま(照明オンのイベントが発生しない)というイベントパターンが発生した場合には、泥棒が物色中であると判断して警報メールを送信する処理が実行される(図4の7行目)。
【0037】
以上のように、本実施形態によれば、複数のイベントからなるイベントパターンをトリガとして実行される処理を簡単にイベントテーブルに記述することができる。従って、このようなイベントテーブルをホームセキュリティコントローラに適用した場合には、例えば、本人しか知らないような複数の動作を伴うイベントパターンをトリガとして警戒を解除させるというような複雑な記述に基づいた処理を実行させることが可能となる。
【0038】
〈処理フロー〉
《イベント生成処理》
次に、イベント生成時における処理について説明する。図5は、イベント生成処理を示すフローチャートである。この処理は、イベント生成部20がセンサ入力の監視に基づいてイベントに係る情報を生成した場合にイベントマネージャ23により実行される。
【0039】
まず、イベント生成部20は、イベントキュー21の末尾に生成したイベントを追加する(S1)。ここで、イベントテーブル25が空であるか否かが判断される(S2)。イベントテーブル25が空である場合には、そのまま処理を終了する。即ち、イベントテーブル25に何も設定されていない場合には、何も処理が行われない。一方、イベントテーブル25が空でない場合には、検査対象エントリをイベントテーブル25の先頭エントリに設定する(S3)。
【0040】
続いて、イベントマネージャ23は、イベントテーブル25に設定された検査対象エントリのイベントパターンとイベントキュー21に蓄積されているイベント列とを比較する(S4)。ここで、比較はイベントテーブル25に設定されている比較開始位置から行われる。
【0041】
続いて、イベントマネージャ23は、イベントパターンと一致するパターンがイベントキュー21に存在するか否かを判断する(S5)。即ち、イベントテーブル25に設定された検査対象エントリのイベントパターンがイベントキュー21に存在するか否かが判断される。ここで、一致するイベントパターンが存在する場合には、イベントマネージャ23は、パターンが一致する部分の先頭イベント発生から終端イベント発生までの経過時間とスコープに登録されている時間(以下、スコープ時間と表記する)とを比較する(S6)。
【0042】
続いて、イベントマネージャ23は、パターンが一致する部分の先頭イベント発生から終端イベント発生までの経過時間がスコープ時間と同じ、あるいはそれ以下であるか否かを判断する(S7)。ここで、経過時間がスコープ時間と同じ、あるいはそれ以下である場合には、イベントマネージャ23は、イベントハンドラ24を実行する(S8)。即ち、経過時間がイベントテーブル25に設定されているスコープ時間に達していない場合にイベントハンドラ24が実行される。
【0043】
イベントハンドラ24を実行した後、イベントマネージャ23は、比較開始位置をイベントキュー21の未検査部分の先頭に更新する(S9)。このようにして、イベントキュー21中の未検査部分がなくなるまで、イベントパターンとイベントキュー21との比較が繰り返し行われる。
【0044】
また、S7において、パターンが一致する部分の先頭イベント発生から終端イベント発生までの経過時間がスコープ時間より大きいと判断された場合には、そのままS9が実行される。即ち、イベントテーブル25に記述されているスコープ欄の条件が満たされていないとして、イベントハンドラ24は実行されずに、検査対象がイベントキュー21の未検査部分に移される。
【0045】
また、S5において、一致するイベントパターンが存在しないと判断された場合には、イベントマネージャ23は、イベントテーブル25に未検査のエントリがあるか否かを判断する(S10)。ここで、未検査のエントリがある場合には、イベントマネージャ23は、検査対象エントリをイベントテーブル25の次のエントリに設定する(S11)。一方、未検査のエントリがない場合には、イベントマネージャ23は、そのまま処理を終了する。
【0046】
以上のようにして、イベントテーブル25に登録されている条件(イベントパターンとスコープ時間)を満たしている場合に、イベントハンドラ24が実行され、イベントテーブル25内に未検査のエントリがなくなるまで繰り返しイベントキュー21との比較が行われる。
【0047】
本実施形態によれば、イベントパターンとそのイベントパターンをトリガとして実行する処理とを対にしてイベントテーブル25に記述しておき、イベントキュー21に蓄積されているイベント列とイベントテーブル25に記述されているイベントパターンとを比較して、パターンが一致した場合に必要な処理を実行することができる。このため、本システムをホームセキュリティシステムに適用した場合には、例えば、本人しか知らないような複数の動作を伴うイベントパターンをトリガとして警戒を解除するような処理を実行することができる。
【0048】
《イベント削除処理》
次に、イベントキュー21からイベントを削除する処理について説明する。図6は、イベントキュー21からイベントを削除する処理を示すフローチャートである。この処理は、イベント削除部22により周期的に実行され、イベント発生から現在までに規定されているイベント生存時間以上の時間が経過したイベントをイベントキュー21から削除する。ここでは、イベント削除部22が1秒毎に処理を実行し、イベント生存時間を10分と規定した場合を想定する。
【0049】
まず、イベント削除部22は、イベントキュー21が空であるか否かを判断する(S21)。即ち、イベント削除部22は、生成されたイベントがイベントキュー21に蓄積されているか否かを判断する。ここで、イベントキュー21が空である場合には、そのまま処理を終了する。一方、イベントキュー21が空でない場合には、検査対象イベントをイベントキュー21の先頭イベントに設定する(S22)。
【0050】
続いて、イベント削除部22は、検査対象イベントが発生してからの経過時間がイベント生存時間と同じ、あるいはそれ以上であるか否かを判断する(S23)。経過時間がイベント生存時間と同じ、あるいはそれ以上でない場合には、イベント削除部22は、そのまま処理を終了する。一方、検査対象イベントが発生してからの経過時間がイベント生存時間と同じ、あるいはそれ以上である場合には、イベント削除部22は、検査対象イベントをイベントキュー21から削除する(S24)。イベント削除後、イベント削除部22は、イベントテーブル25の比較開始位置欄の値を1減算する(S25)。
【0051】
続いて、イベント削除部22は、イベントキュー21に未検査のイベントがあるか否かを判断する(S26)。イベントキュー21に未検査のイベントがあると判断された場合には、イベント削除部22は、検査対象イベントをイベントキュー21の次のイベントに設定する(S27)。以降も同様にして、検査対象イベントが発生してからの経過時間とイベント生存時間との比較が行われ、イベントキュー21のイベントを削除する処理が実行される。一方、イベントキュー21に未検査のイベントがないと判断された場合には、そのまま処理を終了する。
【0052】
このようにして、本実施形態によれば、イベントキュー21に蓄積されたイベントを周期的に検査して、予め規定したイベント生存時間を基準として古くなったイベントを判断し削除することができる。
【0053】
以上述べたように、本システムによれば、複数のイベントからなるイベントパターンをトリガとして実行される処理を簡単にイベントテーブルに記述することができる。このため、複数のイベントの組み合わせに応じて、適切な処理を実行することができる。
【0054】
また、例えば、本システムをホームセキュリティシステムに適用した場合には、従来のイベント駆動型プログラム実行方法によると「警戒解除ボタンが押された場合は、警戒解除処理を行う」といった単純な記述しかできなかったところが、「玄関ドアの電気錠が開錠され、テレビまたはエアコンがオンされた場合は、警戒解除を行う」または「インターホンがオンされ、玄関ドアの電気錠が開錠された場合は、警報メールを送信する」というような複雑な動作を伴う記述を簡単に行うことができる。このように、本システムをホームセキュリティシステムに適用することにより、単純かつ安価なセンサを組み合わせて、住人の日々の自然な動作(住人ごとに異なる)を検知して警戒解除をするような処理、または、逆に住人であれば行わない不自然な動作(住人ごと、犯罪手口の変遷によって異なる)を異常として検知して利用者に警報を発するような処理を容易に行うことが可能となる。さらに、住人しか知りえない動作よる警戒解除は、いわばパスワードの働きをするので、侵入者には容易に解除できないという効果を有する。以上のように、本システムをホームセキュリティシステムに適用することで、上述のような特有の効果を発揮することができる。
【0055】
【発明の効果】
本発明によれば、複数のイベントからなるイベントパターンをトリガとして実行される処理を簡単にイベントテーブルに記述することができる。従って、本発明のイベントテーブルを用いることにより、複数のイベントに跨る複雑な処理を実行させることも可能となる。
【図面の簡単な説明】
【図1】本実施形態のシステムにおけるハードウエア構成を示す図である。
【図2】本実施形態におけるソフトウエア構成を示す図である。
【図3】イベントテーブル25のデータ構造を示す図である。
【図4】ホームセキュリティコントローラにおけるイベントテーブル25のデータ構造例を示す。
【図5】イベント生成処理を示すフローチャートである。
【図6】イベントキュー21からイベントを削除する処理を示すフローチャートである。
【図7】従来のイベントテーブルの一例を示す。
【図8】従来の状態遷移表の一例を示す。
【符号の説明】
1 コントローラ
2 CPU
3 メモリ
4 二次記憶
5 通信部
6 I/O
7 マグネットセンサ
8 赤外線センサ
9 照度センサ
10 電気錠
11 インターホン
12 リモコン受信部
13 警戒解除ボタン
20 イベント生成部
21 イベントキュー
22 イベント削除部
23 イベントマネージャ
24 イベントハンドラ
25 イベントテーブル[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a technique for executing an event-driven program. More particularly, the present invention relates to a technique for executing an event-driven program that executes one or more event sequences as a trigger and executes a program associated with the event sequence.
[0002]
[Prior art]
Conventionally, an event-driven program execution method includes the following method. First, there is a method in which an event that is a trigger in the event table and a process that is executed when the event occurs are described in the event table, and the program is executed according to the description of the event table. An example of the event table here is shown in FIG. In FIG. 7, for example, it is described that the process P1 is executed when the event E1 occurs. Second, describe in the state transition table the combination of the event that triggers for each system state, the process to be executed when that event occurs, and the state that transitions after the process is completed, and execute the program according to the description in the state transition table There is a way. An example of the state transition table here is shown in FIG. In FIG. 8, for example, when the event E1 occurs in the
[0003]
In the conventional program execution method as described above, a simple description using a single event as a trigger is written in the event table or state transition table, and the program is executed using the described single event as a trigger. I was running.
[0004]
In addition, there are techniques disclosed in
[0005]
[Patent Document 1]
JP-A-8-272727
[Patent Document 2]
JP-A-8-115107
[0006]
[Problems to be solved by the invention]
However, the conventional program execution method as described above has a problem that it is difficult to describe a complicated process because only a single event can be described as a trigger. For this reason, in an event-driven program, it has been difficult to execute complicated processing across a plurality of events.
[0007]
The present invention solves the above problems and provides a technique for enabling description of more complicated processing while maintaining the simplicity of description of a conventional event table in an event-driven program. For the purpose.
[0008]
[Means for Solving the Problems]
In order to solve the above problems, the present invention has the following configuration. That is, the present invention is an event-driven program execution device, comprising means for monitoring the occurrence of an event relating to a predetermined state change, means for sequentially accumulating generated events as an event series, and one or more events Whether or not the accumulated event series matches any of the above event patterns based on an event table that associates an event pattern with processing to be executed when an event series that matches the event pattern occurs. Means for comparing, and means for executing processing corresponding to the event pattern when there is an event series that matches the event pattern.
[0009]
Preferably, the event-driven program execution device includes means for recording the occurrence time of the event in association with the event, an elapsed time based on an occurrence time of an event sequence that matches the event pattern, and a time limit for the event pattern And means for excluding the processing corresponding to the event pattern from the execution target when the elapsed time due to the event sequence exceeds the time limit.
[0010]
Preferably, the event-driven program execution device includes means for recording the occurrence time of the event in association with the event, and means for deleting an event that has passed a predetermined time from the occurrence from the accumulated event series. It may be configured.
[0011]
Preferably, the event pattern is a combination of a plurality of events, a permutation in which a plurality of events are sequentially consecutive, a discontinuous permutation in which another unspecified event is inserted in a permutation of the plurality of events, or information indicating that a specific event has not occurred. At least one may be included.
[0012]
According to the present invention, the occurrence of an event related to a predetermined state change is monitored, the generated events are sequentially accumulated as an event series, and an event pattern composed of one or more events and an event series that matches the event pattern are generated. Based on the event table that associates the process to be executed sometimes, it is compared whether or not the accumulated event sequence matches any of the above event patterns, and there is an event sequence that matches the event pattern. In this case, processing corresponding to the event pattern is executed. Therefore, according to the present invention, an appropriate process can be executed according to a combination of a plurality of events.
[0013]
According to another aspect of the present invention, there is provided a security system including the event-driven program execution device described above, which monitors human actions as events. As a result, it is possible to execute a process related to the security system using an event pattern based on a human action as a trigger. Therefore, for example, when the present invention is applied to a home security system, it is possible to execute processing such as releasing alert using an event pattern based on an operation that only a resident knows as a trigger.
[0014]
As described above, according to the present invention, more complicated processing can be described while maintaining the simplicity of description of the event table. Therefore, in an event-driven program, it is possible to execute a complicated process triggered by an event pattern with a plurality of operations.
[0015]
Further, the present invention may be a method in which a computer, other devices, machines, etc. execute any one of the processes described above. Further, the present invention may be a program that causes a computer, other devices, machines, or the like to realize any of the functions described above. Further, the present invention may be a program in which such a program is recorded on a computer-readable recording medium.
[0016]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. The description of the present embodiment is an exemplification, and the configuration of the present invention is not limited to the following description.
[0017]
<Embodiment>
In this embodiment, it is assumed that an event-driven program is applied to a home security system.
[0018]
<Hardware configuration>
FIG. 1 is a diagram showing a hardware configuration in the system of the present embodiment. The
[0019]
The
[0020]
Various sensors and switches connected to the I /
[0021]
<Software configuration>
FIG. 2 is a diagram showing a software configuration in the present embodiment. The software in the present embodiment functions by an
[0022]
The
[0023]
The
[0024]
The
[0025]
The
[0026]
The
[0027]
In FIG. 2, first, the
[0028]
<Event table>
FIG. 3 is a diagram illustrating a data structure of the event table 25. The event table 25 describes a plurality of event patterns monitored by the
[0029]
In the event pattern, an event pattern monitored by the
[0030]
The scope describes a time limit from when the first event of the event pattern occurs until the end event occurs. In the present embodiment, the
[0031]
In the process, an
[0032]
In the comparison start position, a numerical value indicating from what number of events stored in the
[0033]
As described above, the event handler 24 (process) is executed according to the description of the event table 25 shown in FIG. For example, if events occur continuously in the order of E1 → E2 within T1 seconds, the process P1 is executed (* 1 in FIG. 3). Further, when the event E6 occurs after any of the events E3, E4, E5 within T2 seconds, the processes P2, P3, etc. are executed (* 2 in FIG. 3). If events occur in the order of E7, E8, E9 within T3 seconds (it is possible even if they are not continuous), processing P4, P5, P6, etc. are executed (* 3 in FIG. 3). . If events E10 and E11 occur continuously (in no particular order) within T4 seconds, processes P7 and P8 are executed (* 4 in FIG. 3). Further, when events E12 and E13 occur within T5 seconds (it is possible even if they are not continuous, in any order), processes P9 and P10 are executed (* 5 in FIG. 3). If event E15 does not occur within T6 seconds after event E14 occurs, processes P11 and P12 are executed (* 6 in FIG. 3).
[0034]
As described above, according to the present embodiment, it is possible to make a complicated description in the event table such that an event pattern composed of a plurality of events and a process is executed with a time restriction on the occurrence of the event pattern.
[0035]
<Specific example of event table>
Next, an example of a data structure when the event table 25 shown in FIG. 3 is applied to the home security controller will be described. FIG. 4 shows an example of the data structure of the event table 25 in the home security controller. Among these, the event pattern shown in the 1st to 4th lines in FIG. 4 is a description for releasing / starting home security alerts triggered by a natural operation performed when the resident returns home. On the other hand, the event pattern shown in the 5th to 7th lines in FIG. 4 is a description for sending an alarm mail to a resident or a security company, triggered by an unnatural operation that is not performed by a resident.
[0036]
In the example shown in FIG. 4, for example, when an event pattern occurs in which the entrance is unlocked and the TV or air conditioner is turned on, it is determined that the resident has come home and the process of releasing the alert is performed. It is executed (first line in FIG. 4). Also, if an event pattern occurs where the entrance is unlocked and the bathroom is turned on and then enters the living room, it is determined that the resident has come home, washed his hands, moved to the living room, A process of releasing the alert is executed (second line in FIG. 4). In addition, when an event pattern occurs in which the entrance is unlocked, the kitchen lighting is turned on, and the refrigerator door is opened afterwards, it is determined that the resident has returned from shopping and the warning is released. It is executed (third line in FIG. 4). Further, when an event pattern occurs in which the TV and air conditioner are turned off and the living room is unattended, it is determined that the resident has gone out and a process of starting alert is executed (4 in FIG. 4). Line). Also, if an event pattern occurs in which the door is unlocked after the intercom is sounded, it is determined that the thief has entered after confirming absence from the intercom, and processing to send an alarm mail is executed (5th line of FIG. 4). In addition, when an event pattern in which an infrared sensor is turned on (a person is detected) occurs in the living room after the window is opened, a process of transmitting an alarm mail based on a thief intrusion is executed (FIG. 4). 6th line). Also, if an event pattern occurs where there is a person in the living room but the room is dark (no lighting on event occurs), a process is performed in which it is determined that the thief is in color and an alarm email is sent. (7th line in FIG. 4).
[0037]
As described above, according to the present embodiment, it is possible to easily describe in the event table the process executed using an event pattern composed of a plurality of events as a trigger. Therefore, when such an event table is applied to the home security controller, for example, processing based on a complicated description such as releasing alerts triggered by an event pattern with a plurality of operations that only the person knows is a trigger. Can be executed.
[0038]
<Processing flow>
<Event generation processing>
Next, processing at the time of event generation will be described. FIG. 5 is a flowchart showing the event generation process. This process is executed by the
[0039]
First, the
[0040]
Subsequently, the
[0041]
Subsequently, the
[0042]
Subsequently, the
[0043]
After executing the
[0044]
If it is determined in S7 that the elapsed time from the start event occurrence to the end event occurrence of the portion with the matching pattern is greater than the scope time, S9 is executed as it is. That is, assuming that the conditions in the scope column described in the event table 25 are not satisfied, the
[0045]
If it is determined in S5 that no matching event pattern exists, the
[0046]
As described above, when the condition (event pattern and scope time) registered in the event table 25 is satisfied, the
[0047]
According to this embodiment, an event pattern and a process executed using the event pattern as a trigger are described in the event table 25 as a pair, and the event sequence stored in the
[0048]
<Event deletion processing>
Next, processing for deleting an event from the
[0049]
First, the
[0050]
Subsequently, the
[0051]
Subsequently, the
[0052]
In this way, according to the present embodiment, the events accumulated in the
[0053]
As described above, according to the present system, it is possible to easily describe in the event table a process executed using an event pattern composed of a plurality of events as a trigger. For this reason, appropriate processing can be executed in accordance with a combination of a plurality of events.
[0054]
In addition, for example, when this system is applied to a home security system, according to the conventional event-driven program execution method, only a simple description such as “when the warning release button is pressed, the warning release processing is performed” can be performed. However, if the door lock is unlocked and the TV or air conditioner is turned on, the alarm will be released or if the intercom is turned on and the door lock is unlocked, It is possible to easily describe a complicated operation such as “send alarm mail”. In this way, by applying this system to a home security system, a simple and inexpensive sensor is combined to detect daily natural actions of the resident (which differs from resident to resident) and release the alert. Or, conversely, it is possible to easily perform a process of detecting an unnatural operation (which varies depending on the resident and depending on the transition of the criminal technique) as an abnormality and issuing a warning to the user, which is not performed by a resident. Furthermore, the warning cancellation by an operation that only the resident knows has the effect that it can not be easily released by an intruder because it works as a password. As described above, by applying this system to a home security system, the above-described specific effects can be exhibited.
[0055]
【The invention's effect】
According to the present invention, it is possible to easily describe in the event table a process executed using an event pattern composed of a plurality of events as a trigger. Therefore, by using the event table of the present invention, it is possible to execute complicated processing across a plurality of events.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a hardware configuration in a system according to an embodiment.
FIG. 2 is a diagram showing a software configuration in the present embodiment.
3 is a diagram showing a data structure of an event table 25. FIG.
FIG. 4 shows an example of the data structure of an event table 25 in the home security controller.
FIG. 5 is a flowchart showing an event generation process.
FIG. 6 is a flowchart showing processing for deleting an event from the
FIG. 7 shows an example of a conventional event table.
FIG. 8 shows an example of a conventional state transition table.
[Explanation of symbols]
1 Controller
2 CPU
3 memory
4 Secondary memory
5 Communication Department
6 I / O
7 Magnet sensor
8 Infrared sensor
9 Illuminance sensor
10 Electric lock
11 Intercom
12 Remote control receiver
13 Alert release button
20 Event generator
21 Event queue
22 Event deletion part
23 Event Manager
24 Event Handler
25 Event table
Claims (10)
発生したイベントをイベント系列として順次蓄積する手段と、
1以上のイベントからなるイベントパターンとそのイベントパターンに合致するイベント系列が発生したときに実行させる処理とを対応付けたイベントテーブルに基づいて、前記蓄積されたイベント系列が前記いずれかのイベントパターンに合致するか否かを比較する手段と、
前記イベントパターンに合致するイベント系列があった場合に、当該イベントパターンに対応する処理を実行する手段と、
を備えるイベント駆動型プログラム実行装置。Means for monitoring the occurrence of an event relating to a predetermined state change;
Means for sequentially accumulating generated events as an event sequence;
Based on an event table in which an event pattern composed of one or more events and a process to be executed when an event sequence that matches the event pattern is generated, the accumulated event sequence becomes one of the event patterns. Means for comparing whether or not they match,
Means for executing processing corresponding to the event pattern when there is an event series that matches the event pattern;
An event-driven program execution device comprising:
前記イベントパターンに合致するイベント系列の発生時刻に基づく経過時間と前記イベントパターンに対する制限時間とを比較する手段と、
前記イベント系列による経過時間が前記制限時間を超える場合に、当該イベントパターンに対応する処理を実行対象から排除する手段と、
を備える請求項1に記載のイベント駆動型プログラム実行装置。Means for recording the event occurrence time in association with the event;
Means for comparing an elapsed time based on an occurrence time of an event sequence that matches the event pattern and a time limit for the event pattern;
Means for excluding the processing corresponding to the event pattern from the execution target when the elapsed time by the event series exceeds the time limit;
An event-driven program execution device according to claim 1.
発生から所定時間経過したイベントを前記蓄積したイベント系列から削除する手段と、
を備える請求項1に記載のイベント駆動型プログラム実行装置。Means for recording the event occurrence time in association with the event;
Means for deleting an event that has passed a predetermined time from occurrence from the accumulated event series;
An event-driven program execution device according to claim 1.
所定の状態変化に係るイベントの発生を監視するステップと、
発生したイベントをイベント系列として順次蓄積するステップと、
1以上のイベントからなるイベントパターンとそのイベントパターンに合致するイベント系列が発生したときに実行させる処理とを対応付けたイベントテーブルに基づいて、前記蓄積されたイベント系列が前記いずれかのイベントパターンに合致するか否かを比較するステップと、
前記イベントパターンに合致するイベント系列があった場合に、当該イベントパターンに対応する処理を実行するステップと、
を実行させるコンピュータ実行可能なイベント駆動型プログラム。On the computer,
Monitoring the occurrence of an event relating to a predetermined state change;
Sequentially accumulating the events that occurred as an event sequence;
Based on an event table in which an event pattern composed of one or more events and a process to be executed when an event sequence that matches the event pattern is generated, the accumulated event sequence becomes one of the event patterns. Comparing whether or not they match,
If there is an event series that matches the event pattern, executing a process corresponding to the event pattern;
An event-driven program that can be executed by a computer.
前記イベントの発生時刻を前記イベントに関連付けて記録するステップと、
前記イベントパターンに合致するイベント系列の発生時刻に基づく経過時間と前記イベントパターンに対する制限時間とを比較するステップと、
前記イベント系列による経過時間が前記制限時間を超える場合に、当該イベントパターンに対応する処理を実行対象から排除するステップと、
を実行させる請求項6に記載のコンピュータ実行可能なイベント駆動型プログラム。On the computer,
Recording the event occurrence time in association with the event;
Comparing an elapsed time based on an occurrence time of an event sequence that matches the event pattern and a time limit for the event pattern;
When the elapsed time due to the event series exceeds the time limit, removing the process corresponding to the event pattern from the execution target;
7. The computer-executable event-driven program according to claim 6, wherein the program is executed.
前記イベントの発生時刻を前記イベントに関連付けて記録するステップと、
発生から所定時間経過したイベントを前記蓄積したイベント系列から削除するステップと、
を実行させる請求項6に記載のコンピュータ実行可能なイベント駆動型プログラム。On the computer,
Recording the event occurrence time in association with the event;
Deleting an event that has passed a predetermined time from occurrence from the accumulated event series;
7. The computer-executable event-driven program according to claim 6, wherein the program is executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003181170A JP2005018341A (en) | 2003-06-25 | 2003-06-25 | Event-driven program execution device, security system and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003181170A JP2005018341A (en) | 2003-06-25 | 2003-06-25 | Event-driven program execution device, security system and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005018341A true JP2005018341A (en) | 2005-01-20 |
Family
ID=34181941
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003181170A Pending JP2005018341A (en) | 2003-06-25 | 2003-06-25 | Event-driven program execution device, security system and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005018341A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008059311A (en) * | 2006-08-31 | 2008-03-13 | Secom Co Ltd | Intruder detection system |
JP2009231855A (en) * | 2008-03-19 | 2009-10-08 | Mitsubishi Electric Corp | Monitoring device and monitoring system |
WO2020262526A1 (en) * | 2019-06-28 | 2020-12-30 | ノバルス株式会社 | Watching system, server device and storage medium |
-
2003
- 2003-06-25 JP JP2003181170A patent/JP2005018341A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008059311A (en) * | 2006-08-31 | 2008-03-13 | Secom Co Ltd | Intruder detection system |
JP2009231855A (en) * | 2008-03-19 | 2009-10-08 | Mitsubishi Electric Corp | Monitoring device and monitoring system |
WO2020262526A1 (en) * | 2019-06-28 | 2020-12-30 | ノバルス株式会社 | Watching system, server device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10896595B2 (en) | Temporary security bypass method and apparatus | |
EP3139359B1 (en) | System and method providing early prediction and forecasting of false alarms by applying statistical inference models | |
EP2353153B1 (en) | A system for tracking a presence of persons in a building, a method and a computer program product | |
EP2533220A1 (en) | Building security system | |
US10217350B2 (en) | Adaptive exception handling in security system | |
CN104063969B (en) | The gate inhibition's early warning system detected based on motion and pre-warning and control method | |
US10497241B1 (en) | Outdoor furniture monitoring | |
US10062249B1 (en) | Systems and methods of tamper detection | |
JP2006244039A (en) | Monitoring system | |
JP2009070118A (en) | Security device and monitoring mode switching control method | |
JP6422229B2 (en) | Notification system | |
CN107123218A (en) | A kind of anti-theft alarm system | |
JP2018084927A (en) | Alarm unit, alarm method, and program | |
JP2010205092A (en) | Entry/exit management system | |
JP2005018341A (en) | Event-driven program execution device, security system and program | |
JP2009086947A (en) | Security device and security system | |
JP2008165682A (en) | Host device and security setting method for security system | |
JP5248694B2 (en) | Security device and security system | |
JP2002190070A (en) | Life guard system | |
JP2000132765A (en) | Burglar prevention installation and interphone device | |
JP2006039798A (en) | Security device and program therefor | |
JP2015191603A (en) | monitoring system | |
JP2009087029A (en) | Security device | |
JP7489641B2 (en) | Control system and control method | |
US20240060948A1 (en) | System and method for monitoring and classifying smoking events in monitored spaces |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060202 |
|
A131 | Notification of reasons for refusal |
Effective date: 20080408 Free format text: JAPANESE INTERMEDIATE CODE: A131 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080605 |
|
A02 | Decision of refusal |
Effective date: 20081216 Free format text: JAPANESE INTERMEDIATE CODE: A02 |