JP6102409B2 - Event processing method, event processing system, and event processing program - Google Patents
Event processing method, event processing system, and event processing program Download PDFInfo
- Publication number
- JP6102409B2 JP6102409B2 JP2013067308A JP2013067308A JP6102409B2 JP 6102409 B2 JP6102409 B2 JP 6102409B2 JP 2013067308 A JP2013067308 A JP 2013067308A JP 2013067308 A JP2013067308 A JP 2013067308A JP 6102409 B2 JP6102409 B2 JP 6102409B2
- Authority
- JP
- Japan
- Prior art keywords
- event
- terminal
- time
- stream
- event processing
- 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
Landscapes
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
Description
本明細書で議論される実施態様は、ストリームコンピューティングを用いるイベント処理に関する。 The embodiments discussed herein relate to event processing using stream computing.
ビジネス上の意思決定の迅速化に対する要求の増加に伴い、ストリームコンピューティングが注目されている。ストリームコンピューティングは、様々なセンサやシステムから、次々と収集される大量のイベント(センシングによりデータが収集、あるいはシステムによりデータが生成されたこと、およびデータそのもの)をリアルタイムに処理する技術である。従来のデータ処理は、収集したイベントを一旦データベースに格納し、クエリを発行し、条件にあるデータの抽出・分析を行う。これに対し、ストリームコンピューティングは、あらかじめイベントを検出するロジックをクエリとして、ストリームエンジンに与えておき、イベントの到着時にクエリを実行し、イベントの抽出・分析を行う。そのため、アルゴリズム取引、工場設備の稼働状況監視、システム操作の不正行為検出などに利用されている。 With increasing demand for faster business decisions, stream computing has attracted attention. Stream computing is a technology for processing in real time a large number of events collected from various sensors and systems (data collected by sensing or data generated by the system, and data itself). In conventional data processing, collected events are temporarily stored in a database, a query is issued, and data in a condition is extracted and analyzed. On the other hand, in stream computing, logic for detecting an event is given as a query to the stream engine in advance, and the query is executed when the event arrives to extract and analyze the event. For this reason, it is used for algorithmic trading, factory facility operation status monitoring, and fraud detection of system operation.
一方、様々なセンサを搭載した携帯端末の普及と無線技術の発達により、移動体(移動を伴う人やモノ)の状態を把握できるようになり、移動体の状態変化に応じたサービスが注目されている。例えば、人の携帯端末から位置情報を収集し、人の居場所に応じて最適なコンテンツを配信したり、外来者にセンサを携行させ、許可されていないエリアへ立ち入っていないかを監視したりするサービス等が考えられる。それには、無線配信によりイベントを収集し、リアルタイムに処理する必要があり、ストリームコンピューティングのモバイル環境への適用が進みつつある。 On the other hand, with the widespread use of mobile terminals equipped with various sensors and the development of wireless technology, the status of mobile objects (people and things that accompany movement) can be grasped, and services that respond to changes in the status of mobile objects are attracting attention. ing. For example, collect location information from a person's mobile terminal and distribute optimal content according to the person's whereabouts, or carry a sensor to an outpatient to monitor whether they have entered an unauthorized area. Service is considered. For this purpose, it is necessary to collect events by wireless distribution and process them in real time, and stream computing is being applied to mobile environments.
通常、無線環境は不安定で、さまざまな環境要因により通信できなくなり、携帯端末は収集したイベントをストリームエンジンが稼働するサーバに送信できない場合がある。ストリームエンジンは連続的にイベントを処理するので、イベントが欠落すると、正しくイベントを処理できない可能性がある。例えば、人の移動軌跡が不完全なために、次の移動先の予測精度が低下することで、前もって適切なコンテンツを送信できなかったり、一定時間立ち入り禁止区域に入ったイベントを検出できず、不正立ち入り判定に失敗したりすることが考えられる。 Usually, the wireless environment is unstable, and communication is impossible due to various environmental factors, and the mobile terminal may not be able to transmit collected events to a server on which the stream engine operates. Since the stream engine processes events continuously, if an event is missing, there is a possibility that the event cannot be processed correctly. For example, because the human movement trajectory is incomplete, the prediction accuracy of the next destination will decrease, so it will not be possible to send appropriate content in advance, or it will not be possible to detect an event that has entered the restricted area for a certain period of time, It is conceivable that the unauthorized entry determination may fail.
このような問題を解決するために、端末がオフライン中は、端末側で収集したイベントを保持し、オンラインになった時点で、保持していたイベントをストリームエンジンに送信するという方法が考えられる(図2参照)。そうすることで、携帯端末が収集したすべてのイベントを、ストリームエンジンに順次処理させることが可能となる。 In order to solve such a problem, there is a method of holding events collected on the terminal side when the terminal is offline, and transmitting the held event to the stream engine when the terminal is online ( (See FIG. 2). By doing so, it is possible to cause the stream engine to sequentially process all events collected by the mobile terminal.
しかし、ストリームエンジンは、イベントの発生時刻と到着時刻の差が少ないことを前提としており、ストリームエンジンにイベントが到着する時間が、発生時刻から大幅に遅れると、正しい処理ができないという問題がある。例えば、ストリームエンジンの典型的な処理として、タイマ処理とタイムウィンドウ処理がある。タイマ処理は、あるイベントが到着後、一定時間内に所定のイベントが到着しない、あるいは到着したことを検出する処理である。タイムウィンドウ処理は、ある一定期間内に到着したイベントをバッファリングして、共通の処理(例えば、平均値や最大値を求める)を行う処理である。これらの処理は、イベントのストリームエンジンへの到着時刻を基準に処理を行うため、イベントの発生時刻と到着時刻の差が大きいと、所定の時刻にタイマイベントを生成できなかったり、タイムウィンドウ処理の対象イベントが正しく認識されなかったりする場合がある。 However, the stream engine is based on the premise that the difference between the event occurrence time and the arrival time is small, and there is a problem that correct processing cannot be performed if the time for the event arrival at the stream engine is greatly delayed from the occurrence time. For example, typical processing of the stream engine includes timer processing and time window processing. The timer process is a process for detecting that a predetermined event has not arrived or has arrived within a certain time after a certain event has arrived. The time window process is a process for buffering events that arrive within a certain period and performing a common process (for example, obtaining an average value or a maximum value). Since these processes are performed based on the arrival time of the event to the stream engine, if the difference between the event occurrence time and the arrival time is large, a timer event cannot be generated at a predetermined time, or time window processing The target event may not be recognized correctly.
したがって、生成時刻とシステムへの到着時刻の差が大きいイベントに対して、正しくストリーム処理を行うことが課題である。 Therefore, it is a problem to correctly perform stream processing for an event having a large difference between the generation time and the arrival time to the system.
本明細書で後述するイベント処理方法は、以下の処理をコンピュータによって実行される。まず、センサが収集したデータをイベントデータとしてイベント処理システムに送信する端末の接続状態を監視する。次に、端末の通信不可能な時間の累積値を計算する。そして、ストリーム処理を行う際、システムクロックの時刻からその累積値を差し引いた補正時刻を計算する。最後に、端末が送信したイベントデータを補正時刻に基づいてストリーム処理して出力する。 In the event processing method described later in this specification, the following processing is executed by a computer. First, the connection state of a terminal that transmits data collected by the sensor as event data to the event processing system is monitored. Next, the cumulative value of the time during which the terminal cannot communicate is calculated. When stream processing is performed, a correction time is calculated by subtracting the accumulated value from the system clock time. Finally, the event data transmitted by the terminal is stream-processed based on the correction time and output.
本明細書で後述するイベント処理システムによれば、生成時刻とシステムへの到着時刻の差が大きいイベントに対して、正しくストリーム処理を行うことができる。 According to the event processing system described later in this specification, it is possible to correctly perform stream processing on an event having a large difference between the generation time and the arrival time at the system.
<イベント処理システムの構成>
図1は、本発明の原理を説明するためのイベント処理システムの構成図である。図1に示すように、イベント処理システム10は、端末接続状態監視部11と、クロック補正部12と、イベントストリーム再生部13と、ストリームエンジン14と、システムクロック15とを備える。
<Configuration of event processing system>
FIG. 1 is a configuration diagram of an event processing system for explaining the principle of the present invention. As shown in FIG. 1, the event processing system 10 includes a terminal connection state monitoring unit 11, a clock correction unit 12, an event stream reproduction unit 13, a stream engine 14, and a system clock 15.
端末50は、センサ51を備える。センサ51が収集したセンサデータを、端末50はイベント処理システム10にイベントデータとして送信する。 The terminal 50 includes a sensor 51. The terminal 50 transmits the sensor data collected by the sensor 51 to the event processing system 10 as event data.
端末接続状態監視部11は、各端末50が通信可能(オンライン)か否(オフライン)かの接続状態を監視する。 The terminal connection status monitoring unit 11 monitors the connection status of whether each terminal 50 can communicate (online) or not (offline).
クロック補正部12は、端末50毎にオフラインになった時刻と、オフライン時間の累積値を計算して管理し、イベントストリーム再生部13やストリームエンジン14に、端末50がオンライン状態であり続けた場合の時刻(見かけ上の時刻)を提供する。 The clock correction unit 12 calculates and manages the time of going offline for each terminal 50 and the accumulated value of the offline time, and the event stream playback unit 13 and the stream engine 14 keep the terminal 50 online. Provide the time of day (apparent time).
イベントストリーム再生部13は、端末50から送信されたイベントデータを、本来到着すべき時刻に、ストリームエンジン14に入力する。 The event stream reproduction unit 13 inputs the event data transmitted from the terminal 50 to the stream engine 14 at the time when it should originally arrive.
ストリームエンジン14は、イベントをストリーム処理し、イベント利用サービス60にイベントを出力する。 The stream engine 14 processes the event and outputs the event to the event use service 60.
システムクロック15は、イベント処理システム10が動作する機器あるいはOSが提供する、常に一定の速度で動作するクロックで、実際の時刻を提供する。 The system clock 15 is a clock that always operates at a constant speed provided by a device or OS that operates the event processing system 10 and provides an actual time.
このような構成により、イベント処理システム10は、ストリームエンジン14が参照するクロック補正部12を制御し、イベントを送信する端末50がオフラインの間はクロックが停止しているように、オンラインになって遅延して到着したイベントを、あたかも今到着したように、ストリームエンジン14に認識させることができる。 With such a configuration, the event processing system 10 controls the clock correction unit 12 referred to by the stream engine 14 and goes online so that the clock is stopped while the terminal 50 that transmits the event is offline. An event that arrives late can be recognized by the stream engine 14 as if it had arrived now.
また、オフライン中に送信されているイベントの間隔を実際よりも短く処理、すなわち見かけ上の時刻の進み方を速くすることにより、効率的にイベント処理を行ってもよい。 Further, the event processing may be performed efficiently by processing the interval between events transmitted offline while making the interval shorter than the actual time, that is, by making the apparent time advance faster.
<イベント処理システムの動作>
続いて、イベント処理システム10におけるイベント処理方法について説明する。イベント処理方法は、コンピュータによって実行される。
<Operation of event processing system>
Next, an event processing method in the event processing system 10 will be described. The event processing method is executed by a computer.
図2は,端末がオフラインになることを想定した場合の、ストリームエンジンへのイベントの送信の仕方を説明するための図である。通常の動作は、プログラムによって、以下の2種類の処理をコンピュータに実行させる。
(1)端末接続状態監視処理
(2)イベントストリーム再生処理
FIG. 2 is a diagram for explaining a method of transmitting an event to the stream engine when the terminal is assumed to be offline. The normal operation causes the computer to execute the following two types of processing by a program.
(1) Terminal connection status monitoring process (2) Event stream playback process
端末接続状態監視処理の動作は、以下の通りである。端末接続状態監視部11が、端末50の接続状態(オンラインまたはオフライン)を監視しており、接続状態が変化した場合に、端末の識別子と状態変化の内容を、クロック補正部12に通知する。クロック補正部12は、端末50毎にオフラインになった時刻と、オフライン時間の累積値(以下、累積オフライン時間と呼ぶ場合がある)を計算して管理しており、端末50がオンラインからオフラインに変化した場合は、オフラインに変化した時刻とシステムクロック15との差分を算出し、それまでの累積オフライン時間に加算して、新しい累積オフライン時間とする。そうすることで、各端末が初期状態から現在までの、オフラインになっていた累積時間を把握できる。 The operation of the terminal connection state monitoring process is as follows. The terminal connection state monitoring unit 11 monitors the connection state (online or offline) of the terminal 50, and notifies the clock correction unit 12 of the terminal identifier and the contents of the state change when the connection state changes. The clock correction unit 12 calculates and manages the time when the terminal 50 goes offline for each terminal 50 and the accumulated value of the offline time (hereinafter sometimes referred to as accumulated offline time), and the terminal 50 goes from online to offline. In the case of a change, the difference between the time when the change was made offline and the system clock 15 is calculated and added to the accumulated offline time so far to obtain a new accumulated offline time. By doing so, it is possible to grasp the accumulated time that each terminal has been offline from the initial state to the present.
イベントストリーム再生処理の動作は、以下の通りである。端末50がイベント処理システム10にイベントを送信する。この時点で、端末50はオンライン状態であり、センサ51によって収集したセンサデータが、リアルタイムで送信される場合もあれば、オフライン中に収集したイベントが送信される場合もある。各イベントは、センサデータの他に、センサデータを収集した時刻と端末50の識別子を属性として持つ(端末50のクロックは、イベント処理システム10のシステムクロック15と同期が取れたものとする)。端末50がオフライン中に収集したイベントは、1個ずつ順番に送信される場合も、まとめて1回で送信される場合もあり得る。端末50から送信されたイベントは、イベントストリーム再生部13に渡される。イベントストリーム再生部13は、各々のイベントに含まれるデータ収集時刻と端末50の識別子を参照し、端末識別子をキーにして、クロック補正部12から端末50の見かけ上の時刻を取得する。クロック補正部12は、システムクロック15を参照し、端末識別子をキーにして、クロック補正部12から端末50の時刻を取得する。クロック補正部12は、システムクロック15を参照し、端末接続状態監視処理によって随時更新されている累積オフライン時間を差し引いた補正時刻を返却する。これは、イベントが本来到着するべき時刻を示している。イベントストリーム再生部12は、各イベントを、その本来到着すべき時刻になった時点で、ストリームエンジン14に入力する。ストリームエンジン14がイベントを処理する間もクロックを参照するが、その際もクロック補正部12経由で、端末50毎のオフライン時間を考慮した補正値を利用する。また、端末50がオフラインの場合は、本来返信されてくるはずのイベントも滞っているので、ストリームエンジン14が参照する見かけ上の時刻は、常にオフラインになった時刻を返す。また、このとき、オフライン中に送信されているイベントの間隔を実際よりも短く処理することにより、効率的にイベント処理を行ってもよい。 The operation of the event stream playback process is as follows. The terminal 50 transmits an event to the event processing system 10. At this point, the terminal 50 is online, and sensor data collected by the sensor 51 may be transmitted in real time, or an event collected while offline may be transmitted. Each event has, in addition to the sensor data, the time when the sensor data is collected and the identifier of the terminal 50 as attributes (the clock of the terminal 50 is assumed to be synchronized with the system clock 15 of the event processing system 10). Events collected while the terminal 50 is offline may be transmitted one by one in sequence or may be transmitted all at once. The event transmitted from the terminal 50 is passed to the event stream playback unit 13. The event stream reproduction unit 13 refers to the data collection time included in each event and the identifier of the terminal 50, and acquires the apparent time of the terminal 50 from the clock correction unit 12 using the terminal identifier as a key. The clock correction unit 12 refers to the system clock 15 and acquires the time of the terminal 50 from the clock correction unit 12 using the terminal identifier as a key. The clock correction unit 12 refers to the system clock 15 and returns a correction time obtained by subtracting the accumulated offline time updated as needed by the terminal connection state monitoring process. This indicates the time at which the event should originally arrive. The event stream reproduction unit 12 inputs each event to the stream engine 14 at the time when the event should arrive originally. While the stream engine 14 processes the event, the clock is referred to. The correction value considering the offline time for each terminal 50 is also used via the clock correction unit 12 at that time. In addition, when the terminal 50 is offline, the events that are supposed to be replied are stagnant, and the apparent time referred to by the stream engine 14 always returns the time when the terminal 50 is offline. At this time, the event processing may be performed efficiently by processing the interval of the event transmitted while offline, shorter than the actual interval.
図3は、この動作をタイムラインで示した図である。端末50がオンラインの間に収集・送信されたイベント(時刻t0およびt1に収集されたイベント)は、イベントストリーム再生部13により、即座にストリームエンジン14に渡され、処理される。時刻Toffに、端末50がオフラインになると、端末50はイベントを収集するが(時刻t2およびt3にイベントを収集)、イベント処理システム10には送信できなくなる。すると、ストリームエンジン14が参照するクロックはオフラインになった時刻を常に参照するようになり、タイマ処理やタイムウィンドウ処理も停止される。端末50が時刻Tonにオンラインに復帰すると、オフラインの間に収集した時刻t2およびt3のイベントをイベント処理システム10に送信する。しかし、イベントストリーム再生部13は、すぐにストリームエンジン14に渡さず、実際の時刻がt2+(Ton−Toff)およびt3+(Ton−Toff)になるまで待つ。Ton−Toffは、端末50がオフラインになっていた時間であり、実際の時刻からその時間を差し引いた補正時刻を、ストリームエンジン(4)が参照しながら、処理を行うことで、そのイベントが本来のt2およびt3の時刻に発生したものとして処理できるようになる。端末50がオンラインに復帰した後に収集される、時刻t4のイベントも同様に処理される。 FIG. 3 is a timeline showing this operation. Events collected and transmitted while the terminal 50 is online (events collected at times t0 and t1) are immediately passed to the stream engine 14 and processed by the event stream playback unit 13. When the terminal 50 goes offline at time Toff, the terminal 50 collects events (collects events at times t2 and t3), but cannot transmit to the event processing system 10. Then, the clock referred to by the stream engine 14 always refers to the time when it goes offline, and timer processing and time window processing are also stopped. When the terminal 50 returns online at the time Ton, the events at the times t2 and t3 collected while offline are transmitted to the event processing system 10. However, the event stream playback unit 13 does not immediately pass to the stream engine 14, but waits until the actual time becomes t2 + (Ton-Toff) and t3 + (Ton-Toff). Ton-Toff is the time when the terminal 50 has been offline. The stream engine (4) performs processing while referring to the correction time obtained by subtracting the time from the actual time, so that the event is originally It can be processed as occurring at times t2 and t3. The event at time t4 collected after the terminal 50 returns online is processed in the same manner.
イベント処理システム10は、端末接続状態監視部11が、端末50の接続状況を監視しており、それをクロック補正部12に通知する。クロック補正部12は、端末50がオフラインなのか、オンラインなのか、およびオフラインになっていた時間の累積値を計算して管理する。そして、他のモジュールが時刻を参照する際に、実際の時刻すなわちシステムクロックの時刻から累積オフライン時間を差し引いた補正時刻を返すことで、端末50が常にオンライン状態で、イベントを送り続けたと仮定した場合の時刻を提供できるようにする。端末50がオフラインの場合は、本来到着すべきイベントが滞っているので、時間が進まないように、オフラインになった時の見かけ上の時刻を返す。 In the event processing system 10, the terminal connection state monitoring unit 11 monitors the connection status of the terminal 50 and notifies the clock correction unit 12 of the monitoring. The clock correction unit 12 calculates and manages the cumulative value of whether the terminal 50 is offline or online, and the time that has been offline. Then, when other modules refer to the time, it is assumed that the terminal 50 has always sent an event in an online state by returning a correction time obtained by subtracting the accumulated offline time from the actual time, that is, the time of the system clock. Be able to provide the time of the case. When the terminal 50 is offline, the events that should have arrived are stagnant, so that the apparent time when the terminal 50 is offline is returned so that the time does not advance.
このように動作することで、イベントを処理する際、イベントストリーム再生部13が、クロック補正部12を利用して、あたかも今イベントが到着したようにイベントをストリームエンジン14に入力することができ、ストリームエンジン14は現在のイベントを処理しているかのように動作することが可能となる。従って、イベントの発生時刻と到着時刻が大きく異なっていても、ストリームエンジン14は正常に処理することが可能である。 By operating in this way, when processing an event, the event stream playback unit 13 can use the clock correction unit 12 to input the event to the stream engine 14 as if the event has just arrived. The stream engine 14 can operate as if it is processing the current event. Therefore, even if the event occurrence time and arrival time are significantly different, the stream engine 14 can process normally.
<第1の実施形態>
図4は、第1の実施形態に係るイベント処理システムの構成図である。イベント処理システム20は、無線通信により端末50からイベントを収集する。図4において、図1で示した要素には類似の番号を付与してある。
<First Embodiment>
FIG. 4 is a configuration diagram of the event processing system according to the first embodiment. The event processing system 20 collects events from the terminal 50 by wireless communication. In FIG. 4, similar numbers are assigned to the elements shown in FIG.
図4に示すように、イベント処理システム20は、イベント処理システム10と同様に、端末接続状態監視部21と、クロック補正部22と、イベントストリーム再生部23と、ストリームエンジン24と、システムクロック25とを備え、更に、セッション管理部26と、イベント受信部27とを備える。 As shown in FIG. 4, the event processing system 20 is similar to the event processing system 10 in that the terminal connection state monitoring unit 21, the clock correction unit 22, the event stream playback unit 23, the stream engine 24, and the system clock 25 are displayed. And a session management unit 26 and an event reception unit 27.
端末接続状態監視部21と、クロック補正部22と、イベントストリーム再生部23と、ストリームエンジン24と、システムクロック25は、イベント処理システム10と同様に動作する。 The terminal connection state monitoring unit 21, the clock correction unit 22, the event stream reproduction unit 23, the stream engine 24, and the system clock 25 operate in the same manner as the event processing system 10.
セッション管理部26は、セッション開始を要求した端末50に対して、必要に応じて認証を行い、セッションを開始し、システムクロック25から時刻を取得し、端末50に返却する。更に、セッション管理部26は、セッションを開始したことを、端末50のIDとともに、端末接続状態監視部21に通知する。 The session management unit 26 authenticates the terminal 50 that requested the session start as necessary, starts the session, acquires the time from the system clock 25, and returns it to the terminal 50. Furthermore, the session management unit 26 notifies the terminal connection state monitoring unit 21 of the start of the session together with the ID of the terminal 50.
イベント受信部27は、端末50から送信されたイベントを解析し、内部形式に変換し、イベントストリーム再生部23に渡す。 The event receiver 27 analyzes the event transmitted from the terminal 50, converts it into an internal format, and passes it to the event stream playback unit 23.
ここで、上記実施の形態によるイベント処理システムの動作、及びイベント処理をコンピュータに行わせるために共通に適用されるコンピュータの例について説明する。 Here, the operation of the event processing system according to the above embodiment and an example of a computer that is commonly applied to cause a computer to perform event processing will be described.
図5は、標準的なコンピュータのハードウエア構成の一例を示すブロック図である。図5に示すように、コンピュータ70は、Central Processing Unit(CPU)71、メモリ72、入力装置73、出力装置74、外部記憶装置76、媒体駆動装置77、ネットワーク接続装置79等がバス75を介して互いに接続されている。 FIG. 5 is a block diagram illustrating an example of a hardware configuration of a standard computer. As shown in FIG. 5, a computer 70 includes a central processing unit (CPU) 71, a memory 72, an input device 73, an output device 74, an external storage device 76, a medium drive device 77, a network connection device 79, and the like via a bus 75. Are connected to each other.
CPU71は、コンピュータ70全体の動作を制御する演算処理装置である。CPU71は、メモリ72を利用してイベント処理プログラムを実行することにより、図4の端末接続状態監視部21、クロック補正部22、イベントストリーム再生部23、ストリームエンジン24、セッション管理部26、イベント受信部27として動作する。 The CPU 71 is an arithmetic processing unit that controls the operation of the entire computer 70. The CPU 71 uses the memory 72 to execute the event processing program, whereby the terminal connection state monitoring unit 21, the clock correction unit 22, the event stream reproduction unit 23, the stream engine 24, the session management unit 26, and the event reception shown in FIG. The unit 27 operates.
メモリ72は、例えばRandom Access Memory(RAM)、Read Only Memory(ROM)等を含み、イベント処理プログラムとイベント処理に用いられるデータを格納する。メモリ72は、イベント処理プログラムを予め記憶したり、イベント処理プログラムを実行する際に必要に応じて作業領域として使用したりするための記憶部である。メモリ72は、例えば、端末50毎にオフラインになった時刻と各々の累積オフライン時間を格納する記憶部としても用いることができる。 The memory 72 includes, for example, a random access memory (RAM) and a read only memory (ROM), and stores an event processing program and data used for event processing. The memory 72 is a storage unit for storing an event processing program in advance or using it as a work area as necessary when the event processing program is executed. For example, the memory 72 can also be used as a storage unit that stores the time when each terminal 50 is offline and the accumulated offline time.
入力装置73は、コンピュータの使用者により操作されると、その操作内容に対応付けられている使用者からの各種情報の入力を取得し、取得した入力情報をCPU71に送信する装置であり、例えばキーボード装置、マウス装置などである。入力装置73は、イベント処理プログラムを実行する際に、外部入力からの編集操作入力を受け付ける。 The input device 73 is a device that, when operated by a computer user, acquires various information inputs from the user associated with the operation content and transmits the acquired input information to the CPU 71. Keyboard device, mouse device, etc. The input device 73 receives an editing operation input from an external input when executing the event processing program.
出力装置74は、コンピュータ70による処理結果を出力する装置であり、表示装置などが含まれる。表示装置とは、例えば、ディスプレイやプリンタ等であり、コンピュータのユーザへの問い合わせ、処理結果等の出力に用いられる。例えば表示装置は、CPU71により送付される表示データに応じてテキストや画像を表示する。出力装置74は、イベント処理プログラムを実行する際にイベントを出力する。 The output device 74 is a device that outputs a processing result by the computer 70, and includes a display device and the like. The display device is, for example, a display, a printer, or the like, and is used for outputting an inquiry to a computer user, a processing result, and the like. For example, the display device displays text and images according to display data sent by the CPU 71. The output device 74 outputs an event when executing the event processing program.
外部記憶装置76は、例えば、ハードディスクなどの記憶装置であり、CPU71により実行される各種制御プログラムや、取得したデータ等を記憶しておく装置である。記憶装置とは、例えば、磁気ディスク装置、光ディスク装置、光磁気ディスク装置等である。外部記憶装置76は、端末50毎にオフラインになった時刻と各々の累積オフライン時間を格納することもできる。この場合、端末50毎にオフラインになった時刻と各々の累積オフライン時間は、外部記憶装置76からメモリ72に読み出されて、イベント処理に用いられる。さらに、イベント処理プログラムをコンピュータ70の外部記憶装置76に保存しておき、必要に応じて、それらをメモリ72にロードして使用することもできる。 The external storage device 76 is a storage device such as a hard disk, for example, and stores various control programs executed by the CPU 71, acquired data, and the like. Examples of the storage device include a magnetic disk device, an optical disk device, and a magneto-optical disk device. The external storage device 76 can also store the time when each terminal 50 has gone offline and the respective accumulated offline time. In this case, the time of going offline for each terminal 50 and each accumulated offline time are read from the external storage device 76 to the memory 72 and used for event processing. Furthermore, the event processing program can be stored in the external storage device 76 of the computer 70 and loaded into the memory 72 for use as required.
媒体駆動装置77は、可搬記録媒体78に書き込みおよび読み出しを行うための装置である。媒体駆動装置77は、可搬記録媒体78を駆動し、その記録内容にアクセスする。 The medium driving device 77 is a device for writing to and reading from the portable recording medium 78. The medium driving device 77 drives the portable recording medium 78 and accesses the recorded contents.
CPU71は、可搬型記録媒体78に記録されているイベント処理プログラムを、媒体駆動装置77を介して読み出して実行することによって、イベント処理を行うようにすることもできる。可搬記録媒体78は、例えばCompact Disc(CD)−ROM、Digital Versatile Disc(DVD)、Universal Serial Bus(USB)メモリ等である。 The CPU 71 can also perform event processing by reading and executing the event processing program recorded on the portable recording medium 78 via the medium driving device 77. The portable recording medium 78 is, for example, a Compact Disc (CD) -ROM, a Digital Versatile Disc (DVD), a Universal Serial Bus (USB) memory, or the like.
ネットワーク接続装置79は、有線または無線により外部との間で行われる各種データの授受の管理を行うインタフェース装置である。ネットワーク接続装置79は、Local Area Network(LAN)、Wide Area Network(WAN)等の任意のネットワーク(回線)を介して外部の装置を通信し、通信に伴うデータ変換を行う。また、必要に応じて、イベント処理プログラムを外部の装置から受け取り、それをコンピュータ70のメモリ72にロードして使用することもできる。 The network connection device 79 is an interface device that manages transmission / reception of various data performed between the outside by wired or wireless. The network connection device 79 communicates with an external device via an arbitrary network (line) such as a local area network (LAN) or a wide area network (WAN), and performs data conversion accompanying the communication. If necessary, the event processing program can be received from an external device and loaded into the memory 72 of the computer 70 for use.
バス75は、上記各装置等を互いに接続し、データのやり取りを行う通信経路である。この可搬記録媒体78に上述のプログラムを格納しておき、必要に応じて、それをコンピュータ70のメモリ72にロードして使用することもできる。 The bus 75 is a communication path for connecting the above devices and the like to exchange data. The above-mentioned program can be stored in the portable recording medium 78 and loaded into the memory 72 of the computer 70 for use as necessary.
上記それぞれの実施の形態によるイベント処理をコンピュータに実行させるイベント処理プログラムは、例えば外部記憶装置76に記憶される。CPU71は、外部記憶装置76からイベント処理プログラムを読み出し、イベント処理を行う。このとき、イベント処理をCPU71に行わせるためのイベント処理プログラムは、予め外部記憶装置76に記憶されている。そして、入力装置73から所定の指示をCPU71に与えて、このイベント処理プログラムを外部記憶装置76から読み出させて実行させるようにする。また、このイベント処理プログラムは、可搬記録媒体78に記憶するようにしてもよい。 An event processing program that causes a computer to execute the event processing according to each of the above embodiments is stored in, for example, the external storage device 76. The CPU 71 reads an event processing program from the external storage device 76 and performs event processing. At this time, an event processing program for causing the CPU 71 to perform event processing is stored in the external storage device 76 in advance. Then, a predetermined instruction is given to the CPU 71 from the input device 73, and this event processing program is read from the external storage device 76 and executed. The event processing program may be stored in the portable recording medium 78.
次に、図5に図示したコンピュータ70へのイベント処理プログラム及びデータのローディング例を説明する。
上述の実施形態において説明したイベント処理システム20に相当する機能をコンピュータ70に行わせるためには、イベント処理プログラムを、コンピュータ70で読み取り可能な可搬記録媒体78に予め記憶させておく。そして、その可搬記録媒体78からイベント処理プログラムをコンピュータ70に読み出させて、そのコンピュータ70のメモリ72や外部記憶装置76に一旦格納させ、この格納されたイベント処理プログラムをそのコンピュータ70の有するCPU71に読み出させて実行させるように構成すればよい。
Next, an example of loading an event processing program and data to the computer 70 shown in FIG. 5 will be described.
In order for the computer 70 to perform the function corresponding to the event processing system 20 described in the above embodiment, the event processing program is stored in advance in the portable recording medium 78 that can be read by the computer 70. Then, the event processing program is read from the portable recording medium 78 to the computer 70 and temporarily stored in the memory 72 or the external storage device 76 of the computer 70, and the stored event processing program is included in the computer 70. The CPU 71 may be configured to read and execute.
また、サーバが有するデータベースから、ネットワークを介して、イベント処理プログラムをコンピュータ70にダウンロードすることとしてもよい。 Further, the event processing program may be downloaded from the database of the server to the computer 70 via the network.
<システム全体の動作フェーズ>
続いて、本実施形態におけるイベント処理方法について説明する。端末50を含むシステム全体の典型的な動作フェーズは、以下の通りである。これらの処理をコンピュータに実行させる。
(1)端末50がイベント送信のためにセッションを開始し、センシングを開始する。
(2)端末50がオンラインになり、収集したセンサデータをイベントとして、イベント処理システム20に送信する。
(3)端末50がオフラインになり、端末50内でイベントを蓄積する。
(4)端末50がオンラインになり、オフライン中に蓄積したイベントをイベント処理システムに送信する。
((3)から(4)を繰り返す。)
(5)端末がセンシングを終了し、イベント送信のためのセッションを終了する。
<Operation phase of the entire system>
Next, the event processing method in this embodiment will be described. A typical operation phase of the entire system including the terminal 50 is as follows. The computer executes these processes.
(1) The terminal 50 starts a session for event transmission and starts sensing.
(2) The terminal 50 comes online and transmits the collected sensor data to the event processing system 20 as an event.
(3) The terminal 50 goes offline and accumulates events in the terminal 50.
(4) The terminal 50 goes online and transmits the events accumulated while offline to the event processing system.
(Repeat (3) to (4).)
(5) The terminal ends sensing and ends the session for event transmission.
イベント処理システムの動作は、以下の4種類である。
セッション開始処理(動作フェーズ(1)に対応):図6は、端末状態管理テーブルの例を示す。図7は、セッション開始処理の処理内容を図解したフローチャートである。
S100において、端末50は、イベント処理システム20にイベントを送信する前に、セッション管理部26に対してセッション開始を要求する。セッションは、イベントを送り続ける間、常に維持されるものであればよく、Virtual Private Network(VPN)やHypertext Transfer Protocol(HTTP)等のセッションで構わない。
The event processing system has the following four types of operations.
Session start processing (corresponding to operation phase (1)): FIG. 6 shows an example of a terminal state management table. FIG. 7 is a flowchart illustrating the processing contents of the session start processing.
In S <b> 100, the terminal 50 requests the session management unit 26 to start a session before transmitting an event to the event processing system 20. The session may be any session as long as it is constantly maintained while the event is continuously sent, and may be a session such as Virtual Private Network (VPN) or Hypertext Transfer Protocol (HTTP).
S102において、セッション管理部26は、必要に応じて認証を行い、セッションを開始する。次に、S104において、セッション管理部26は、システムクロック25から時刻を取得し、端末50に返却する。 In S102, the session management unit 26 performs authentication as necessary and starts a session. Next, in S <b> 104, the session management unit 26 acquires the time from the system clock 25 and returns it to the terminal 50.
S106において、端末50は、端末50のクロックを、取得した時刻に合わせる。更に、S108において、端末50は、イベントの収集・送信を開始し、セッション終了まで継続する。 In S106, the terminal 50 sets the clock of the terminal 50 to the acquired time. Further, in S108, the terminal 50 starts collecting and transmitting events and continues until the session ends.
S110において、セッション管理部26は、セッションを開始したことを、端末50のIDとともに、端末接続状態監視部21に通知する。これは逆に端末接続状態監視部21が、セッション管理部26に定期的に問い合わせるようにしても構わない。次に、S112において、端末接続状態監視部21は、セッションの開始をクロック補正部22に通知する。 In S110, the session management unit 26 notifies the terminal connection state monitoring unit 21 of the start of the session together with the ID of the terminal 50. Conversely, the terminal connection state monitoring unit 21 may periodically inquire the session management unit 26. Next, in S112, the terminal connection state monitoring unit 21 notifies the clock correction unit 22 of the start of the session.
クロック補正部22は、端末50毎にオフラインになった時のシステムクロック25の時刻と、端末50毎にオフラインになっていた時間の累積値を計算して管理しており、S114において、通知された端末50のエントリを初期化する。続いて、S116において、端末接続状態監視部21は、端末接続状態の監視を開始する。なお、セッション開始時は、オフライン時刻が空で、累積オフライン時間を0とする。 The clock correction unit 22 calculates and manages the time of the system clock 25 when it goes offline for each terminal 50 and the accumulated value of the time when it goes offline for each terminal 50, and is notified in S114. Initialize the entry of the terminal 50. Subsequently, in S116, the terminal connection state monitoring unit 21 starts monitoring the terminal connection state. At the start of the session, the offline time is empty and the accumulated offline time is set to zero.
端末接続状態監視処理(動作フェーズ(3)および(4)に対応):図8は、端末接続状態監視処理の処理内容を図解したフローチャートである。
S200において、セッション管理部26は、端末50の接続状態を定期的に確認する。それはセッション管理部26自身が管理するセッション情報を確認しても、端末50からのパケットの有無や、pingによる応答を確認しても構わない。セッション管理部26は、その結果を端末IDとともに端末接続状態監視部21に通知し、S202に進む。
Terminal connection state monitoring process (corresponding to operation phases (3) and (4)): FIG. 8 is a flowchart illustrating the processing contents of the terminal connection state monitoring process.
In S200, the session management unit 26 periodically checks the connection state of the terminal 50. That is, the session information managed by the session management unit 26 itself may be confirmed, the presence / absence of a packet from the terminal 50, or a response by ping may be confirmed. The session management unit 26 notifies the terminal connection state monitoring unit 21 of the result together with the terminal ID, and proceeds to S202.
S202において、端末接続状態監視部21は、端末50の以前の接続状態から変化したか否かを確認する。すなわちオンラインだったのがオフラインに、あるいはオフラインだったのがオンラインに変化したかを判定する。そして、変化があった場合は、S204に進み、端末接続状態監視部21は、その変化をクロック補正部22に通知する。変化が無かった場合は、S200に戻る。 In S202, the terminal connection state monitoring unit 21 confirms whether or not the terminal 50 has changed from the previous connection state. That is, it is determined whether online has changed to offline or offline has changed to online. If there is a change, the process proceeds to S204, and the terminal connection state monitoring unit 21 notifies the clock correction unit 22 of the change. If there is no change, the process returns to S200.
S204に続いて、S206において、端末接続状態監視部21は、端末50の接続状態の変化が、オンラインからオフラインへの変化であるか否かを判定する。 Subsequent to S204, in S206, the terminal connection state monitoring unit 21 determines whether or not the change in the connection state of the terminal 50 is a change from online to offline.
S206の判定結果がYESの場合、すなわちオンラインからオフラインへの変化である場合、S208に進み、端末接続状態監視部21は、端末状態管理テーブルのオフライン時刻に、システムクロックの時刻を記録し、S200に戻る。 If the determination result in S206 is YES, that is, if the change is from online to offline, the process proceeds to S208, and the terminal connection state monitoring unit 21 records the time of the system clock in the offline time of the terminal state management table, and S200. Return to.
S206の判定結果がNOの場合、すなわち接続状態がオフラインからオンラインに変化した場合は、S210に進み、端末接続状態監視部21は、システムクロック25から現在時刻を取得する。次に、S212に進み、端末接続状態監視部21は、システムクロック25の現在時刻と、端末状態管理テーブルのオフライン時刻との差分を累積オフライン時間に加算する。そして、S214に進み、端末接続状態監視部21は、オフライン時刻を空にする。その後、S200に戻る。 When the determination result in S206 is NO, that is, when the connection state changes from offline to online, the process proceeds to S210, and the terminal connection state monitoring unit 21 acquires the current time from the system clock 25. In step S212, the terminal connection state monitoring unit 21 adds the difference between the current time of the system clock 25 and the offline time of the terminal state management table to the accumulated offline time. In step S214, the terminal connection state monitoring unit 21 empties the offline time. Thereafter, the process returns to S200.
イベントストリーム再生処理(動作フェーズ(2)および(4)に対応):図9は、イベントストリーム再生処理の処理内容を図解したフローチャートである。まず、端末50がセンサからデータを収集し、それをイベントとしてイベント受信部27に送信する。端末50は、イベントを1個ずつ送信する場合もあれば、複数をまとめて送信する場合もあり得る。端末がオンライン状態であればイベントを収集した時点で1個ずつ送信可能であるが、オフラインからオンラインに移行した直後であれば、オフライン中に収集したイベントをまとめて送信する方がイベントの遅延を小さくできるからである。 Event stream playback process (corresponding to operation phases (2) and (4)): FIG. 9 is a flowchart illustrating the process contents of the event stream playback process. First, the terminal 50 collects data from the sensor and transmits it to the event receiving unit 27 as an event. The terminal 50 may transmit events one by one, or may transmit a plurality of events collectively. If the terminal is online, it can be sent one at a time when the events are collected. However, if the terminal is immediately after moving from offline to online, it is better to send the collected events while offline to delay the event. This is because it can be made smaller.
S300において、イベント受信部27は、端末50から送信されたイベントを解析し、内部形式に変換し、イベントストリーム再生部23に渡す。そして、S302において、イベントストリーム再生部23は、渡されたイベントを、必要に応じて1個ずつに分解し、各イベントに対して、本来イベントが到着する時刻になった時点で、ストリームエンジン24に入力する。ストリームエンジン24は、クロック補正部22に、端末50の見かけ上の時刻を要求する。 In S300, the event reception unit 27 analyzes the event transmitted from the terminal 50, converts it into an internal format, and passes it to the event stream reproduction unit 23. Then, in S302, the event stream playback unit 23 decomposes the passed events one by one as necessary, and the stream engine 24 at the time when the event arrives for each event. To enter. The stream engine 24 requests the clock correction unit 22 for the apparent time of the terminal 50.
次に、S304に進み、クロック補正部22は、端末IDをキーにして、累積オフライン時間を取得する。続いて、S306において、クロック補正部22は、端末接続状態管理テーブルから、端末50のオフライン時刻を取得する。そして、S308に進み、クロック補正部22は、端末50のオフライン時刻が存在するか否かを判定する。 In step S304, the clock correction unit 22 acquires the accumulated offline time using the terminal ID as a key. Subsequently, in S306, the clock correction unit 22 acquires the offline time of the terminal 50 from the terminal connection state management table. In step S308, the clock correction unit 22 determines whether the offline time of the terminal 50 exists.
S308の判定結果がYESの場合、すなわちその時刻が存在する場合、S312に進み、端末50は現在オフライン状態なので、クロック補正部22は、オフライン時刻から累積オフライン時間を差し引いた補正時刻をストリームエンジン24に返却する。その後、S314に進む。 If the determination result in S308 is YES, that is, if the time exists, the process proceeds to S312 and the terminal 50 is currently in an offline state, so the clock correction unit 22 sets the correction time obtained by subtracting the accumulated offline time from the offline time to the stream engine 24. Return to Thereafter, the process proceeds to S314.
S308の判定結果がNOの場合、すなわちオフライン時刻が存在しない場合は、S310に進み、クロック補正部22は、システムクロック25から、現在時刻を取得し、累積オフライン時間を差し引いた補正時刻をストリームエンジン24に返却する。その後、S314に進む。 When the determination result in S308 is NO, that is, when the offline time does not exist, the process proceeds to S310, where the clock correction unit 22 acquires the current time from the system clock 25 and uses the correction time obtained by subtracting the accumulated offline time as the stream engine. Return to 24. Thereafter, the process proceeds to S314.
S314において、クロック補正部22は、上記のようにして取得した端末50の見かけ上の時刻が、イベントの生成時刻より新しいか否かを判定する。S314の判定結果がNOの場合、S316に進み、クロック補正部22は、イベントが本来処理されるべき時刻になっていないので、一定時間待機し、S304に戻り、同じ処理を繰り返す。なお、定常的にイベント到着の遅延時間を計測しておき、その時間を加味してもよい。それ以降の処理は、ストリームエンジン24に与えられているクエリに依存するが、タイマ処理やタイムウィンドウ処理等のようにイベントの到着時刻に依存した処理は、時刻を参照する。その際の処理は、前述の時刻参照処理と同じである。 In S314, the clock correction unit 22 determines whether the apparent time of the terminal 50 acquired as described above is newer than the event generation time. If the determination result in S314 is NO, the process proceeds to S316, and the clock correction unit 22 waits for a certain period of time because the time at which the event should be processed is not reached, returns to S304, and repeats the same process. In addition, the delay time of event arrival may be measured regularly, and the time may be taken into account. Subsequent processing depends on the query given to the stream engine 24, but processing dependent on the arrival time of the event such as timer processing or time window processing refers to the time. The process at that time is the same as the time reference process described above.
S314の判定結果がYESの場合、S318に進み、クロック補正部22は、そのイベントをストリームエンジン24に渡した後、S320に進み、繰返し処理を終了する。 If the determination result in S314 is YES, the process proceeds to S318, and the clock correction unit 22 passes the event to the stream engine 24, and then proceeds to S320 to end the repetition process.
その後、ストリームエンジン24が実行するクエリに依存する処理を行う。S322において、ストリームエンジン24がクエリを処理する。その処理の最中で、S324において、ストリームエンジン24は、必要に応じて、時刻を取得する(上記の時刻取得処理を実行する)。その後、S326において、ストリームエンジン24がイベントを出力する。
なお、上記において、繰返し処理は同期的に行う必要はなく、順次行うことができる。
Thereafter, processing that depends on the query executed by the stream engine 24 is performed. In S322, the stream engine 24 processes the query. In the middle of the process, in S324, the stream engine 24 acquires time as necessary (executes the time acquisition process described above). Thereafter, in S326, the stream engine 24 outputs an event.
In the above, iterative processing need not be performed synchronously, but can be performed sequentially.
セッション終了(動作フェーズ(5)に対応):セッション管理部26がセッションの終了処理を行う。この時点で、端末はオンライン状態なので、クロック補正部22の端末接続状態管理テーブルのエントリを変更する必要がないので、端末接続状態監視部21に対しては何もしない。端末接続状態管理テーブルのエントリを削除しないのは、ストリームエンジン24が処理しているクエリにタイマ処理やタイムウィンドウ処理を含む場合、セッションが終了しても、クロック参照があり得るからである。 Session termination (corresponding to the operation phase (5)): The session management unit 26 performs session termination processing. At this point, since the terminal is online, there is no need to change the entry in the terminal connection state management table of the clock correction unit 22, so nothing is done to the terminal connection state monitoring unit 21. The reason why the entry in the terminal connection state management table is not deleted is that when the query processed by the stream engine 24 includes timer processing or time window processing, clock reference can be made even if the session ends.
前述の動作では、端末が一旦オフラインになると、見かけ上の時刻を、実際の時刻より、端末がオフラインになっていた時間だけ遅らせるようにしている。そうすると、端末50がオフライン・オンラインを繰り返すたびに、ストリームエンジン24がイベントを処理する時刻が遅延し、リアルタイム性が低下する。それを防ぐために、見かけ上の時刻の進み方を早くし、通常よりも高速にイベントの処理を行うようにしてもよい。その場合、過去のイベント処理が終わり、現在時刻に追いついた時点で、見かけ上の時刻の進み方を元に戻す。 In the above operation, once the terminal goes offline, the apparent time is delayed from the actual time by the time when the terminal has been offline. Then, every time the terminal 50 repeats offline / online, the time when the stream engine 24 processes the event is delayed, and the real-time property is deteriorated. In order to prevent this, it is possible to make the apparent time advance faster and process the event faster than usual. In that case, when the past event processing ends and catches up with the current time, the way the apparent time advances is restored.
<第2の実施形態>
図10は、第2の実施形態に係るイベント処理システムの構成図である。図10に示すように、イベント処理システム30は、端末接続状態監視部31と、クロック補正部32と、イベントストリーム再生部33と、ストリームエンジン34と、システムクロック35と、セッション管理部36と、イベント受信部37とを備え、更に、VM管理部38と、クロック取得部39とを備える。
<Second Embodiment>
FIG. 10 is a configuration diagram of an event processing system according to the second embodiment. As shown in FIG. 10, the event processing system 30 includes a terminal connection state monitoring unit 31, a clock correction unit 32, an event stream reproduction unit 33, a stream engine 34, a system clock 35, a session management unit 36, An event receiving unit 37, and a VM management unit 38 and a clock acquisition unit 39.
第1の実施形態においては、イベントストリーム再生部23およびストリームエンジン24が、端末50の見かけ上の時刻を利用するためには、端末50のIDが必要であり、専用のApplication Programming Interface(API)を利用することを想定している。そのため、本実施形態においては、一般的なストリームエンジンに適用できるようにするために、クロックとして見かけ上の時刻を参照する機能を持つVirtual Machine(VM、仮想マシン)を端末50毎に用意し(すなわち、n個のVM1、VM2、…、VMnを用意し)、イベントストリーム再生部33とストリームエンジン34をその専用のVMで実行するようにしてもよい。 In the first embodiment, in order for the event stream playback unit 23 and the stream engine 24 to use the apparent time of the terminal 50, the ID of the terminal 50 is necessary, and a dedicated Application Programming Interface (API) is used. Is assumed to be used. Therefore, in the present embodiment, in order to be applicable to a general stream engine, a virtual machine (VM, virtual machine) having a function of referring to an apparent time as a clock is prepared for each terminal 50 ( In other words, n VM1, VM2,..., VMn are prepared), and the event stream playback unit 33 and the stream engine 34 may be executed by the dedicated VM.
本実施形態において、第1の実施形態の構成と異なるのはVM管理部38とクロック取得部39とを備えることである。
VM管理部36は、端末50毎にイベントを処理するVMを管理する。
The present embodiment is different from the configuration of the first embodiment in that a VM management unit 38 and a clock acquisition unit 39 are provided.
The VM management unit 36 manages a VM that processes an event for each terminal 50.
クロック取得部39は、VMが処理する端末50のIDを覚えておき、それを利用してクロック補正部32から見かけ上の時刻を取得する。 The clock acquisition unit 39 remembers the ID of the terminal 50 processed by the VM, and acquires the apparent time from the clock correction unit 32 by using the ID.
セッション開始動作は、上述の動作に、セッション管理部36がVM管理部38に対して、所定の端末50のセッションが開始されることを通知する処理が加わる。VM管理部38は、指定された端末IDのVMが存在しているかを確認し、存在していなければ、イベントストリーム再生部33、ストリームエンジン34、およびクロック取得部39を含むVMを作成し、端末IDを設定したり、ストリームエンジンにクエリを登録したりする等の初期化を行う。 In the session start operation, a process in which the session management unit 36 notifies the VM management unit 38 that the session of the predetermined terminal 50 is started is added to the above-described operation. The VM management unit 38 checks whether a VM with the designated terminal ID exists, and if not, creates a VM including the event stream playback unit 33, the stream engine 34, and the clock acquisition unit 39, Initialization such as setting a terminal ID or registering a query in the stream engine is performed.
イベントストリーム再生処理の動作は、イベント受信部37がイベントを受信すると、VM管理部38に対して、イベントを処理するVMを問い合わせ、そのVMのイベントストリーム再生部33にイベントを振り分ける。以降の処理は、前述の通りであるが、イベントストリーム再生部33およびストリームエンジン34にクエリを登録したりするなどの初期化を行う。 When the event receiving unit 37 receives an event, the event stream playback processing operation inquires the VM management unit 38 about the VM for processing the event, and distributes the event to the event stream playback unit 33 of the VM. The subsequent processing is as described above, and initialization such as registering a query in the event stream reproduction unit 33 and the stream engine 34 is performed.
イベントストリーム再生処理の動作は、イベント受信部37がイベントを受信すると、VM管理部38に対して、イベントを処理するVMを問い合わせ、そのVMのイベントストリーム再生部33およびストリームエンジン34が見かけ上の時刻を取得する。そうすることで、既存のストリームエンジン製品を変更することなく、オフライン時のイベントを処理することが可能となる。 When the event reception unit 37 receives an event, the event stream playback process is inquired of the VM management unit 38 about the VM for processing the event, and the event stream playback unit 33 and the stream engine 34 of the VM apparently appear. Get the time. By doing so, it is possible to process an off-line event without changing the existing stream engine product.
本実施形態によるイベント処理システムの動作、及びイベント処理をコンピュータに行わせるために共通に適用されるコンピュータの例は、図5に示したものと同様である。 The operation of the event processing system according to the present embodiment and the example of the computer commonly applied to cause the computer to perform the event processing are the same as those shown in FIG.
CPU71は、メモリ72を利用してイベント処理プログラムを実行することにより、図10の端末接続状態監視部31、クロック補正部32、イベントストリーム再生部33、ストリームエンジン34、システムクロック35、セッション管理部36、イベント受信部37、VM管理部38、クロック取得部39として動作する。 The CPU 71 uses the memory 72 to execute the event processing program, whereby the terminal connection state monitoring unit 31, the clock correction unit 32, the event stream reproduction unit 33, the stream engine 34, the system clock 35, and the session management unit in FIG. 36, the event receiving unit 37, the VM managing unit 38, and the clock acquiring unit 39.
以上、説明したように、本実施形態によれば、無線端末からイベントを収集し、ストリーム処理する際に、ストリームエンジンが参照するクロックを制御することで、イベントがあたかも今到着したように認識させることができ、イベントの到着が大きく遅延する場合でも、正しく処理することが可能である。 As described above, according to the present embodiment, when an event is collected from a wireless terminal and stream processing is performed, the clock referred to by the stream engine is controlled so that the event is recognized as if it has just arrived. Even if the arrival of an event is greatly delayed, it can be handled correctly.
なお、上記のように本発明の実施形態について説明したが、本発明は上述した実施形態に限定されるものではなく、他の様々な変更が可能である。 Although the embodiment of the present invention has been described as described above, the present invention is not limited to the above-described embodiment, and various other modifications are possible.
なお、以上までに説明した実施形態に関し、更に以下の付記を開示する。
(付記1)
コンピュータによって実行されるイベント処理方法であって、
センサが収集したデータをイベントデータとしてイベント処理システムに送信する端末の接続状態を監視し、
前記端末の通信不可能な時間の累積値を計算し、
ストリーム処理を行う際、システムクロックの時刻から前記累積値を差し引いた補正時刻を計算し、
前記端末から送信されたイベントデータを前記補正時刻に基づいてストリーム処理して出力する、
ことを特徴とするイベント処理方法。
(付記2)
前記端末は複数であり、端末毎に異なる仮想マシンによって前記ストリーム処理を行うことを特徴とする付記1に記載のイベント処理方法。
(付記3)
前記イベント処理は、通信不可能な時間中に送信されているイベントの間隔を実際より短くして処理することを特徴とする付記1に記載のイベント処理方法。
(付記4)
センサが収集したデータをイベントデータとしてイベント処理システムに送信する端末の接続状態を監視する端末接続状態監視部と、
前記端末の通信不可能な時間の累積値を計算し、ストリーム処理を行う際にシステムクロックの時刻から前記累積値を差し引いた補正時刻を計算するクロック補正部と、
前記端末から送信されたイベントデータをストリームエンジンに入力するイベントストリーム再生部と、
前記イベントデータを前記補正時刻に基づいてストリーム処理して出力するストリームエンジンと、
実際の時刻を提供するシステムクロックと、
を備えることを特徴とするイベント処理システム。
(付記5)
前記端末は複数であり、端末毎に異なる仮想マシンによって前記ストリーム処理を行うことを特徴とする付記4に記載のイベント処理システム。
(付記6)
前記イベント処理は、通信不可能な時間中に送信されているイベントの間隔を実際より短くして処理することを特徴とする付記4に記載のイベント処理システム。
(付記7)
センサが収集したデータをイベントデータとしてイベント処理システムに送信する端末の接続状態を監視し、
前記端末の通信不可能な時間の累積値を計算し、
ストリーム処理を行う際、システムクロックの時刻から前記累積値を差し引いた補正時刻を計算し、
前記端末から送信されたイベントデータを前記補正時刻に基づいてストリーム処理して出力する、
処理をコンピュータに実行させるイベント処理プログラム。
(付記8)
前記端末は複数であり、端末毎に異なる仮想マシンによって前記ストリーム処理を行うことを特徴とする付記7に記載のイベント処理プログラム。
(付記9)
前記イベント処理は、通信不可能な時間中に送信されているイベントの間隔を実際より短くして処理することを特徴とする付記8に記載のイベント処理プログラム。
In addition, the following additional remarks are disclosed regarding the embodiment described above.
(Appendix 1)
An event processing method executed by a computer,
Monitor the connection status of the terminal that sends the data collected by the sensor to the event processing system as event data,
Calculate the cumulative value of the time when the terminal cannot communicate,
When performing stream processing, calculate the correction time by subtracting the cumulative value from the time of the system clock,
Streaming and outputting event data transmitted from the terminal based on the correction time,
An event processing method characterized by the above.
(Appendix 2)
The event processing method according to appendix 1, wherein the stream processing is performed by a different virtual machine for each terminal.
(Appendix 3)
The event processing method according to appendix 1, wherein the event processing is performed by setting an interval of events transmitted during a time during which communication is impossible to be shorter than actual.
(Appendix 4)
A terminal connection state monitoring unit for monitoring a connection state of a terminal that transmits data collected by the sensor to the event processing system as event data;
A clock correction unit that calculates a cumulative value of the communication impossible time of the terminal, and calculates a correction time obtained by subtracting the cumulative value from a system clock time when performing stream processing;
An event stream playback unit for inputting event data transmitted from the terminal to a stream engine;
A stream engine that processes and outputs the event data based on the correction time;
A system clock that provides the actual time, and
An event processing system comprising:
(Appendix 5)
The event processing system according to appendix 4, wherein the stream processing is performed by a different virtual machine for each terminal.
(Appendix 6)
The event processing system according to appendix 4, wherein the event processing is performed by setting an interval of events transmitted during a time during which communication is impossible to be shorter than actual.
(Appendix 7)
Monitor the connection status of the terminal that sends the data collected by the sensor to the event processing system as event data,
Calculate the cumulative value of the time when the terminal cannot communicate,
When performing stream processing, calculate the correction time by subtracting the cumulative value from the time of the system clock,
Streaming and outputting event data transmitted from the terminal based on the correction time,
An event processing program that causes a computer to execute processing.
(Appendix 8)
The event processing program according to appendix 7, wherein a plurality of the terminals are provided, and the stream processing is performed by a different virtual machine for each terminal.
(Appendix 9)
9. The event processing program according to appendix 8, wherein the event processing is performed by setting an interval of events transmitted during a time during which communication is impossible to be shorter than actual.
10 イベント処理システム
11 端末接続状態監視部
12 クロック補正部
13 イベントストリーム再生部
14 ストリームエンジン
15 システムクロック
16 セッション管理部
17 イベント受信部
18 VM管理部
19 クロック取得部
DESCRIPTION OF SYMBOLS 10 Event processing system 11 Terminal connection state monitoring part 12 Clock correction part 13 Event stream reproduction | regeneration part 14 Stream engine 15 System clock 16 Session management part 17 Event reception part 18 VM management part 19 Clock acquisition part
Claims (5)
センサが収集したデータをイベントデータとしてイベント処理システムに送信する端末の接続状態を監視し、
前記端末の通信不可能な時間の累積値を計算し、
ストリーム処理を行う際、システムクロックの時刻から前記累積値を差し引いた補正時刻を計算し、
前記端末から送信されたイベントデータを前記補正時刻に基づいてストリーム処理して出力する、
ことを特徴とするイベント処理方法。 An event processing method executed by a computer,
Monitor the connection status of the terminal that sends the data collected by the sensor to the event processing system as event data,
Calculate the cumulative value of the time when the terminal cannot communicate,
When performing stream processing, calculate the correction time by subtracting the cumulative value from the time of the system clock,
Streaming and outputting event data transmitted from the terminal based on the correction time,
An event processing method characterized by the above.
前記端末の通信不可能な時間の累積値を計算し、ストリーム処理を行う際、システムクロックの時刻から前記累積オフライン時間を差し引いた補正時刻を計算するクロック補正部と、
前記端末から送信されたイベントデータをストリームエンジンに入力するイベントストリーム再生部と、
前記イベントデータを前記補正時刻に基づいてストリーム処理して出力するストリームエンジンと、
実際の時刻を提供するシステムクロックと、
を備えることを特徴とするイベント処理システム。 A terminal connection state monitoring unit for monitoring a connection state of a terminal that transmits data collected by the sensor to the event processing system as event data;
A clock correction unit that calculates a correction value obtained by subtracting the cumulative offline time from a system clock time when calculating a cumulative value of the terminal incapable communication and performing stream processing;
An event stream playback unit for inputting event data transmitted from the terminal to a stream engine;
A stream engine that processes and outputs the event data based on the correction time;
A system clock that provides the actual time, and
An event processing system comprising:
前記端末の通信不可能な時間の累積値を計算し、
ストリーム処理を行う際、システムクロックの時刻から前記累積値を差し引いた補正時刻を計算し、
前記端末から送信されたイベントデータを前記補正時刻に基づいてストリーム処理して出力する、
処理をコンピュータに実行させるイベント処理プログラム。 Monitor the connection status of the terminal that sends the data collected by the sensor to the event processing system as event data,
Calculate the cumulative value of the time when the terminal cannot communicate,
When performing stream processing, calculate the correction time by subtracting the cumulative value from the time of the system clock,
Streaming and outputting event data transmitted from the terminal based on the correction time,
An event processing program that causes a computer to execute processing.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013067308A JP6102409B2 (en) | 2013-03-27 | 2013-03-27 | Event processing method, event processing system, and event processing program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013067308A JP6102409B2 (en) | 2013-03-27 | 2013-03-27 | Event processing method, event processing system, and event processing program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014191637A JP2014191637A (en) | 2014-10-06 |
| JP6102409B2 true JP6102409B2 (en) | 2017-03-29 |
Family
ID=51837817
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2013067308A Expired - Fee Related JP6102409B2 (en) | 2013-03-27 | 2013-03-27 | Event processing method, event processing system, and event processing program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6102409B2 (en) |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006228047A (en) * | 2005-02-18 | 2006-08-31 | Daikin Ind Ltd | Remote monitoring device, remote monitoring system |
| JP5058209B2 (en) * | 2009-05-22 | 2012-10-24 | 株式会社日立製作所 | Data processing system for reverse reproduction in stream data processing |
-
2013
- 2013-03-27 JP JP2013067308A patent/JP6102409B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014191637A (en) | 2014-10-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10819773B2 (en) | Efficient and reliable host distribution of totally ordered global state | |
| CN101142566B (en) | Method and system for detecting concurrent logins | |
| JP6365519B2 (en) | Data flow control device and data flow control method | |
| JP6458755B2 (en) | Data flow control device and data flow control method | |
| US9356986B2 (en) | Distributed stream processing | |
| US9015731B2 (en) | Event handling system and method | |
| US20060031262A1 (en) | Synchronizing client data and server data | |
| CN109447701A (en) | The anti-cheat method of application program, device and server-side | |
| JP2018201154A (en) | Transmission control program, transmission control method, and information processing device | |
| US10360266B2 (en) | Data-flow control device and data-flow control method | |
| JP6102409B2 (en) | Event processing method, event processing system, and event processing program | |
| JP6925889B2 (en) | Relay device, transmission processing program | |
| JP6832025B1 (en) | Communication system for IoT device management | |
| US9300573B2 (en) | Recording medium having stored therein a transfer program, transfer apparatus, and transfer method | |
| JP5577140B2 (en) | Information processing system and information processing method | |
| WO2017141339A1 (en) | Process control program, process control method, information processing device, and communication device | |
| EP3432593B1 (en) | Data-flow control device and data-flow control method | |
| US8825850B2 (en) | Information processing apparatus and control method | |
| JP6866092B2 (en) | Relay device, relay system, relay program, and relay method | |
| JP4381879B2 (en) | Transmission / reception data volume management / limitation device and its program | |
| JP7102952B2 (en) | Data relay device and program | |
| de Amorim Vaz | Smart Objects para a Indústria 4.0 | |
| JP2018163582A (en) | Repeater, repeating method, and program | |
| CN121462590A (en) | OpenHarmony distributed architecture-based multi-screen cooperative control method and integrated machine system | |
| CN120469890A (en) | Real-time data monitoring and processing method, system, terminal and medium for multi-business system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20151204 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20161111 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20161122 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20161219 |
|
| 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: 20170131 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170213 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6102409 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |